From patchwork Fri Jun 24 20:12:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1648165 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JZinJQTB; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LV7bH70QDz9s2R for ; Sat, 25 Jun 2022 06:12:59 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C988F383DBA3 for ; Fri, 24 Jun 2022 20:12:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C988F383DBA3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1656101577; bh=8E+N/qrWC+Z39QL7lovhoXm28bohSnruyPo8zfmF2BQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JZinJQTBWY06ZrgIrGOgHZBtdGDDJH1TZ6wfXMSlqk6TUTyr6rtNi0GSOLt/aFT/a xfjPi6BRaccRAqZTaIhBnsKPH2BCiwp82KQLLPdQm4+jQZdOkCPaTwWQks4G+nrxre k6rUvOBt/Y7Xde6RoebvAZjLMw2mHibiqot/QHn0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by sourceware.org (Postfix) with ESMTPS id E7891383D815 for ; Fri, 24 Jun 2022 20:12:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7891383D815 Received: by mail-pg1-x534.google.com with SMTP id s185so3381523pgs.3 for ; Fri, 24 Jun 2022 13:12:22 -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:mime-version :content-transfer-encoding; bh=8E+N/qrWC+Z39QL7lovhoXm28bohSnruyPo8zfmF2BQ=; b=k4v4JYuVUsBVuZKirSPUGAMEW1+KTR2AVxUH9SIpLJ5u7XWfoWiZkmlp3dM5bntoxo qA+kzVZ3gbSduIvt8xwH0k0Kopv/alKnhWkxX19OTsIJaZsm5cZO9f5oShq86VLSfsGs mCHSfr0jMDEs8g3+M8pGMCMloUKDQ6BtwUmeXgTDRGYgktH9FcgFxSSWRAKM1tn8FUGY dDmcLvuP6e/LxVk4bzGAiA+IJwSaN1tiLrchl1GMcgyEbQii13SchlE+FDyg6BoFYaKs 9D0o7buYCfquLu8r+a+5px+pQmIli1csGXaX0h/3UCgB6tVlD+wdXvXycr+C+a7MJSDo kX2Q== X-Gm-Message-State: AJIora8x/R9DgRi+kRlHYvQhSQAfA327FV0hT4onbQqMNFbyMtTFBfYb XIjR5r/jQrKGmIw34BQKJK/lhvC+Xfw= X-Google-Smtp-Source: AGRyM1vzsqa8SKC8VIFtkVZeP2DPIu4PAdNh9iNqTbQvFcwy1GiRwakg/QUV0B7C+sqdOA1/pAWhDw== X-Received: by 2002:a63:b54d:0:b0:40c:5917:964b with SMTP id u13-20020a63b54d000000b0040c5917964bmr492419pgo.241.1656101541869; Fri, 24 Jun 2022 13:12:21 -0700 (PDT) Received: from noah-tgl.. ([192.55.60.37]) by smtp.gmail.com with ESMTPSA id w91-20020a17090a6be400b001e667f932cdsm4377403pjj.53.2022.06.24.13.12.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 13:12:20 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2] x86: Add missing Slow_SSE4_2 to ifunc-sse4_2.h Date: Fri, 24 Jun 2022 13:12:16 -0700 Message-Id: <20220624201216.3783855-1-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" The functions that use this ifunc are strspn, strcspn, and strpbrk. All of these functions use pcmpstri which can be slow on some processors (checked by Slow_SSE4_2). --- sysdeps/x86_64/multiarch/ifunc-sse4_2.h | 3 ++- 1 file changed, 2 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..1830597862 100644 --- a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h +++ b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h @@ -27,7 +27,8 @@ IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); - if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2)) + if (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2) + && !CPU_FEATURES_ARCH_P (cpu_features, Slow_SSE4_2)) return OPTIMIZE (sse42); return OPTIMIZE (generic);