From patchwork Wed Jun 29 22:05:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 55559 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DAE6386C5BA for ; Wed, 29 Jun 2022 22:06:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DAE6386C5BA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1656540377; bh=gNvB5q0kBLjqHvlRWkXlCx7J7FMxpFs4eat2OAIa4ZA=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=mp46vUjy58TJZbMVMVjhAvmuEnJudn4s4bNvMtvmzs/C72W8mb4CAkyVaxO9aiQ3g OlcLiE/F77s5AITLngJT22IeRjE4mE47lMX56+1HWVio6fcxfUzhAgO7Cz8nCe/9nL Cx9aEW+wV539hQfmJCjKlpNggLdfZqDIYIwPzLj4= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by sourceware.org (Postfix) with ESMTPS id 5B73138485AA for ; Wed, 29 Jun 2022 22:05:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5B73138485AA Received: by mail-pj1-x1033.google.com with SMTP id w1-20020a17090a6b8100b001ef26ab992bso870479pjj.0 for ; Wed, 29 Jun 2022 15:05:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=gNvB5q0kBLjqHvlRWkXlCx7J7FMxpFs4eat2OAIa4ZA=; b=4QG0SDLlsfIfUUwdQLwoP+Be+aP0+wpsQFhMDqpSVSwIwRmY/3KIFIv8Lr08c3fc8Q IjT0p5L+YlACaPqifhUPhp8lCw2Q4ELVFp34gufwVh9IVnaGqI6dn67bKJuf9+qEqkLx /ClYO6wMc/BSE+ENuRpUnQsLkHd+M5p3smdZyg/OTfy3EF90njEQ312GYpmWds62NIRb O3qh65HZpTOdYkM+4mg45ghu+e072nT1vwWZq8YiKTeE+RHSq2rufF+A/FBOWNRDZ8hP WSe6JzAFUM4Gsro2L/KSJQhSC3YaBv0lrzFqn/c/WlV1LvZYzGD67rFhAABoudJDnfzF QrEQ== X-Gm-Message-State: AJIora+heuf/oBOO7K/M+79Awq8sZBhC+MqqSepHuOMRMJ7qi1I6g8/q pyJANCVzIx5sPgHASJE+DPoVi2J7j3A= X-Google-Smtp-Source: AGRyM1vpvSQmxYKkds1DgIW7mgp0HDCIPxGqMxl5KESoFJqoue56GDurBnM0mTd9Ubtu4UHuREtHXA== X-Received: by 2002:a17:90b:3ec6:b0:1ec:ac25:ce6f with SMTP id rm6-20020a17090b3ec600b001ecac25ce6fmr7930851pjb.203.1656540355164; Wed, 29 Jun 2022 15:05:55 -0700 (PDT) Received: from noah-tgl.. ([192.55.60.43]) by smtp.gmail.com with ESMTPSA id a15-20020a17090a688f00b001eef3f30c74sm158195pjd.48.2022.06.29.15.05.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 15:05:54 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 1/2] x86: Add comment explaining no Slow_SSE4_2 check in ifunc-sse4_2 Date: Wed, 29 Jun 2022 15:05:51 -0700 Message-Id: <20220629220552.1241553-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220628152717.17838-1-goldstein.w.n@gmail.com> References: <20220628152717.17838-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Noah Goldstein via Libc-alpha From: Noah Goldstein Reply-To: Noah Goldstein Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" Just for clarities sake and so that if a future implementation is added we remember to add the check. --- sysdeps/x86_64/multiarch/ifunc-sse4_2.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h index ee36525bcf..973041d23b 100644 --- a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h +++ b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h @@ -27,7 +27,11 @@ IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); - if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2)) + /* This function uses slow sse4.2 instructions (pcmpstri) but since + there is no other optimized implementation keep using. If an + optimized fallback is added add a X86_ISA_CPU_FEATURE_ARCH_P + (cpu_features, Slow_SSE4_2) check. */ + if (ISA_CPU_FEATURE_USABLE_P (cpu_features, SSE4_2)) return OPTIMIZE (sse42); return OPTIMIZE (generic);