From patchwork Thu Jun 30 03:08:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1650443 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=w7zsYRCl; 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 4LYNb15yHyz9s0r for ; Thu, 30 Jun 2022 13:09:01 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6E14B386DC75 for ; Thu, 30 Jun 2022 03:08:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E14B386DC75 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1656558539; bh=9FKiM4dEEUli6egim7GTIVJjnyQ0eo1ZyWLtH+pSTXI=; 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=w7zsYRCl5zGvwjiP1hGVFkDflRojfInEL6ZP1RI4+dxR90sfgxRz4fmeXGui5vaUJ KCO39jQdm9Y7TX9gOQaoFRyodBCEZlCeZ7aD6Xlk05ZzJeYdmQMZLxnNritZm4cYQT dc59DavVm3ZMsqLZSYbcZqeUSnORdBCz6eZqTZDQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by sourceware.org (Postfix) with ESMTPS id ABEF338582AD for ; Thu, 30 Jun 2022 03:08:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ABEF338582AD Received: by mail-pj1-x102e.google.com with SMTP id dw10-20020a17090b094a00b001ed00a16eb4so1414735pjb.2 for ; Wed, 29 Jun 2022 20:08:43 -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=9FKiM4dEEUli6egim7GTIVJjnyQ0eo1ZyWLtH+pSTXI=; b=Mi2oFs/d/EVg7u7rht2PZ8KJBZPX/erMo3pCTAfRzOEvH1/YQ11dtWKw+5Fw5uHIyg E2DF9j/Csn9VUrLJSFKkGDO7Wyatrhlby0OuNkxNPurxSnOxplHG88bTCWuw5okmFb9H TSJzTdrvYnGzOsSQA30fxck2Urx4uGKYLJ9sBcAl083jpejiH4lsZF3O4buOmsRcnHyL YhojeydOG8OAE8HTyY0xGCQA8HQzOpF3DG85JJDgEG04qMPJSZ3AsJimFRyZat4z7Ywb vt9ta3eoXPZmdChxAr0cNGM5+gpPjbco+J0D1wMu4eLecs/oRGKWjO8UkqpIJGBci61r QXXQ== X-Gm-Message-State: AJIora/Ku1iZrQoF+qF3eNlW3QFHmWMDHH6E79KJ3eMYaniPJynpk+0c fS8uLaabqzMI9hdJ4+aWnflKDq7Cp7w= X-Google-Smtp-Source: AGRyM1sVx1Taw5etJtJ+RMGOA79TXpQPZvFN58KtF51ZFNt8XfAvWYlW2yhyGpPk1twFdrN/0CtNfw== X-Received: by 2002:a17:90b:3c0c:b0:1ec:c5b1:ce56 with SMTP id pb12-20020a17090b3c0c00b001ecc5b1ce56mr9352524pjb.102.1656558522574; Wed, 29 Jun 2022 20:08:42 -0700 (PDT) Received: from noah-tgl.. ([2600:1010:b00a:11cb:54c6:67b8:c3a4:f835]) by smtp.gmail.com with ESMTPSA id bo7-20020a056a000e8700b0052515a79b78sm12096376pfb.189.2022.06.29.20.08.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 20:08:42 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v4 1/2] x86: Add missing IS_IN (libc) check to strncmp-sse4_2.S Date: Wed, 29 Jun 2022 20:08:37 -0700 Message-Id: <20220630030838.3693807-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=-12.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, 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" Was missing to for the multiarch build rtld-strncmp-sse4_2.os was being built and exporting symbols: build/glibc/string/rtld-strncmp-sse4_2.os: 0000000000000000 T __strncmp_sse42 Introduced in: commit 11ffcacb64a939c10cfc713746b8ec88837f5c4a Author: H.J. Lu Date: Wed Jun 21 12:10:50 2017 -0700 x86-64: Implement strcmp family IFUNC selectors in C --- sysdeps/x86_64/multiarch/strncmp-sse4_2.S | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sysdeps/x86_64/multiarch/strncmp-sse4_2.S b/sysdeps/x86_64/multiarch/strncmp-sse4_2.S index 9773e5fc09..310a6dbe77 100644 --- a/sysdeps/x86_64/multiarch/strncmp-sse4_2.S +++ b/sysdeps/x86_64/multiarch/strncmp-sse4_2.S @@ -16,6 +16,8 @@ License along with the GNU C Library; if not, see . */ -#define STRCMP_SSE42 __strncmp_sse42 -#define USE_AS_STRNCMP -#include "strcmp-sse42.S" +#if IS_IN (libc) +# define STRCMP_SSE42 __strncmp_sse42 +# define USE_AS_STRNCMP +# include "strcmp-sse42.S" +#endif From patchwork Thu Jun 30 03:08:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1650444 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=H+IJ52Gh; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4LYNb260sFz9s0r for ; Thu, 30 Jun 2022 13:09:02 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id AF5BC386EC02 for ; Thu, 30 Jun 2022 03:08:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AF5BC386EC02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1656558539; bh=Q4fk77oyZWIjqm5nEjoWrrIuWbIh6DKLCepp2WSZ3N0=; 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=H+IJ52GhkaoCrasZ1gX1ERT71basRLkGu/Lv7NmYowbbudGqat0QK+7g6O1zmQWZV rEBOptDtuVmWTTQ16QcATzUgqWdUlcpL1UpSq92v8uiYqfl+hokj7Nxnvfq9XCJVds Kcw8bnYdLVTm/NwDqAPlqQjxxU3danbe2H8x+It0= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id BDBD538582A1 for ; Thu, 30 Jun 2022 03:08:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BDBD538582A1 Received: by mail-pf1-x42d.google.com with SMTP id 136so11749936pfy.10 for ; Wed, 29 Jun 2022 20:08:44 -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=Q4fk77oyZWIjqm5nEjoWrrIuWbIh6DKLCepp2WSZ3N0=; b=XR326bLROMDIDAQ93opEzZBO1n79g/24s1FpidcWmkJXvQU7huiFma8yrgyPehU7T9 GkI0+40CAd7WqU8JAKPhiDUxsklk8mPGRrQzzx9z1KL7RM9H1Mjis2HUMH3oFpIPuoAH StCeNyTjztDBrZMATQCwd2hdTkY1qhHHX0jrafdYGKwKyHZctK81jx7SllGFggZtTe7i tPDjqYJLPcDEzvPQACfhHUeIKbM7MpJVrUc5JRHPV2Xh9d/I3e+2av62911DxpFcBmY/ hNTxZmskx7TmizSZm/c0wwbjLndadj6P/j3tjCAsra5uSKYF3fQrZ1lkB5dxkgqskgrR cu/w== X-Gm-Message-State: AJIora+9Wo68u+DX+a86kGngoebuugjOkras6pvQIjU78Bjax5mtFdX9 GBlMelcgK4L76jzsikaK3VsAMQpK1lc= X-Google-Smtp-Source: AGRyM1ufRMb8cz+G3UiI2ArUdMXdg1jGdg+Sd68an+UxQWMrVzz8L0Yz33fCYyLn3wPYD1wFDI1zAQ== X-Received: by 2002:a63:4d57:0:b0:405:1ff6:382a with SMTP id n23-20020a634d57000000b004051ff6382amr5829791pgl.250.1656558523542; Wed, 29 Jun 2022 20:08:43 -0700 (PDT) Received: from noah-tgl.. ([2600:1010:b00a:11cb:54c6:67b8:c3a4:f835]) by smtp.gmail.com with ESMTPSA id bo7-20020a056a000e8700b0052515a79b78sm12096376pfb.189.2022.06.29.20.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 20:08:43 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v4 2/2] x86: Add comment explaining no Slow_SSE4_2 check in ifunc-sse4_2 Date: Wed, 29 Jun 2022 20:08:38 -0700 Message-Id: <20220630030838.3693807-2-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630030838.3693807-1-goldstein.w.n@gmail.com> References: <20220628152717.17838-1-goldstein.w.n@gmail.com> <20220630030838.3693807-1-goldstein.w.n@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 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+incoming=patchwork.ozlabs.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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h index ee36525bcf..4eb9cca7f0 100644 --- a/sysdeps/x86_64/multiarch/ifunc-sse4_2.h +++ b/sysdeps/x86_64/multiarch/ifunc-sse4_2.h @@ -27,6 +27,10 @@ IFUNC_SELECTOR (void) { const struct cpu_features* cpu_features = __get_cpu_features (); + /* 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 (CPU_FEATURE_USABLE_P (cpu_features, SSE4_2)) return OPTIMIZE (sse42);