From patchwork Thu Jun 30 01:56:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Noah Goldstein X-Patchwork-Id: 1650433 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=LhHpOZgu; 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 4LYLzf4HMzz9s07 for ; Thu, 30 Jun 2022 11:56:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 04D0D38418A9 for ; Thu, 30 Jun 2022 01:56:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04D0D38418A9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1656554202; bh=qVE2kGa/5PCQS5L5N0CLRlMGOTTWQ86+YKJQyU00K/M=; 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=LhHpOZguM6lKMBTsSC7D5MMjr1cLgUEBakBovPRYSe8ZPVsj/+4xXDZ9k8tXwAKd4 zgyajsRtA0zePM3MEhOmRK96/62wZ8zcP6cg3Zra/MW5JN0zK+7OvVhbpkwpgj8dFe 4rNZsyxBDwhBWl/qiU3VKCQJ696iof6k4VvVbmq8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by sourceware.org (Postfix) with ESMTPS id EE4603846473 for ; Thu, 30 Jun 2022 01:56:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EE4603846473 Received: by mail-pj1-x102c.google.com with SMTP id 73-20020a17090a0fcf00b001eaee69f600so1283440pjz.1 for ; Wed, 29 Jun 2022 18:56:25 -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=qVE2kGa/5PCQS5L5N0CLRlMGOTTWQ86+YKJQyU00K/M=; b=ZO5A9qPJVgn1TE6dRGuBtQjYfrfzj+H1slYjC49OVo/MFhXiKV4T3T+7s0B2e28fgd s89rw8RowXb0aVn0C6QigE6Fvv8sRGOYTxaKD4BUWXhFjmZOD4vJiWBdhp3iOgBWWWPt B4dsNpIx4dCAtUDzDzgbNwi5Q2ekHKvpEkMIvFoDIkrOdTvyTKRpxxAB40XWKT4cy7uI I7B80UXKNgPdRy8/gP4RnNbvLP3bpo5FP3oHVvYEI3ruUcw1qswT95O03t7GIPSpXlc8 7nJgoVlNYlnpK08YS75FSrhmQ7gZ/wRjpar/7P191xlg8B/XlJt6UUlqsmv1dX/eosvK r0Yw== X-Gm-Message-State: AJIora9UGcpE4CmhCi0wD7+9JUNdUtOydUWCH4nQrpnlmVjo5rmrCQY7 1wpvo6MB8NXEuOux7LaVP5xE1HnLwto= X-Google-Smtp-Source: AGRyM1sGEHMco8DdGkoDYPp1gvLYN5/dOtnOv0EIE67hLI19BkqzjnzrM2OUJXOXtCDuu4hAhDcl0A== X-Received: by 2002:a17:90a:4944:b0:1ec:7585:3167 with SMTP id c62-20020a17090a494400b001ec75853167mr7108708pjh.35.1656554184838; Wed, 29 Jun 2022 18:56:24 -0700 (PDT) Received: from noah-tgl.. ([2600:1010:b00a:11cb:54c6:67b8:c3a4:f835]) by smtp.gmail.com with ESMTPSA id h15-20020a170902680f00b00161e50e2245sm11991259plk.178.2022.06.29.18.56.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Jun 2022 18:56:23 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v1] x86: Add missing IS_IN (libc) check to strcspn-sse4.c Date: Wed, 29 Jun 2022 18:56:17 -0700 Message-Id: <20220630015618.3586787-2-goldstein.w.n@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220630015618.3586787-1-goldstein.w.n@gmail.com> References: <20220630015618.3586787-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-strcspn-sse4.os was being built and exporting symbols: build/glibc/string/rtld-strcspn-sse4.os: U ___m128i_shift_right U __strcspn_generic 0000000000000000 T __strcspn_sse42 U strlen build/glibc/string/rtld-varshift.os: 0000000000000000 R ___m128i_shift_right Introduced in: commit 06e51c8f3de38761f8855700841bc49cf495c8c0 Author: H.J. Lu Date: Fri Jul 3 02:48:56 2009 -0700 Add SSE4.2 support for strcspn, strpbrk, and strspn on x86-64. --- sysdeps/x86_64/multiarch/strcspn-sse4.c | 39 +++++++++++++------------ sysdeps/x86_64/multiarch/varshift.c | 5 +++- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/sysdeps/x86_64/multiarch/strcspn-sse4.c b/sysdeps/x86_64/multiarch/strcspn-sse4.c index 59f64f9fe8..d11e87ab6c 100644 --- a/sysdeps/x86_64/multiarch/strcspn-sse4.c +++ b/sysdeps/x86_64/multiarch/strcspn-sse4.c @@ -16,9 +16,11 @@ License along with the GNU C Library; if not, see . */ -#include -#include -#include "varshift.h" +#if IS_IN (libc) + +# include +# include +# include "varshift.h" /* We use 0x2: _SIDD_SBYTE_OPS @@ -52,31 +54,31 @@ when either CFlag or ZFlag is 1. If CFlag == 1, ECX has the offset X for case 1. */ -#ifndef STRCSPN_GENERIC -# define STRCSPN_GENERIC __strcspn_generic -# define STRCSPN_SSE42 __strcspn_sse42 -#endif +# ifndef STRCSPN_GENERIC +# define STRCSPN_GENERIC __strcspn_generic +# define STRCSPN_SSE42 __strcspn_sse42 +# endif -#ifdef USE_AS_STRPBRK -# define RETURN(val1, val2) return val1 -#else -# define RETURN(val1, val2) return val2 -#endif +# ifdef USE_AS_STRPBRK +# define RETURN(val1, val2) return val1 +# else +# define RETURN(val1, val2) return val2 +# endif extern -#ifdef USE_AS_STRPBRK +# ifdef USE_AS_STRPBRK char * -#else +# else size_t -#endif +# endif STRCSPN_GENERIC (const char *, const char *) attribute_hidden; -#ifdef USE_AS_STRPBRK +# ifdef USE_AS_STRPBRK char * -#else +# else size_t -#endif +# endif __attribute__ ((section (".text.sse4.2"))) STRCSPN_SSE42 (const char *s, const char *a) { @@ -161,3 +163,4 @@ start_loop: aligned += 16; } } +#endif diff --git a/sysdeps/x86_64/multiarch/varshift.c b/sysdeps/x86_64/multiarch/varshift.c index d27767520a..5e2f2bdf51 100644 --- a/sysdeps/x86_64/multiarch/varshift.c +++ b/sysdeps/x86_64/multiarch/varshift.c @@ -16,7 +16,8 @@ License along with the GNU C Library; if not, see . */ -#include +#if IS_IN (libc) +# include const int8_t ___m128i_shift_right[31] attribute_hidden __attribute__((aligned(32))) = @@ -24,3 +25,5 @@ const int8_t ___m128i_shift_right[31] attribute_hidden 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; + +#endif