From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 D8F09386C59F for ; Thu, 30 Jun 2022 02:03:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D8F09386C59F Received: by mail-pj1-x102c.google.com with SMTP id w1-20020a17090a6b8100b001ef26ab992bso1326882pjj.0 for ; Wed, 29 Jun 2022 19:03:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7lnYNELxf9eumGMYbpsgbsnvtd4wb0FWyyHWvBa4UGg=; b=j3QygvhQJMslAJnvI8YALb4oUepjGj7fFHBuF/SQ6ii4V3Ae7iGMDFNAaEactRYS93 jY7Y2mDmj2bPe+i4ezMOmQ2ngomlQmRvVbaQHOUoGY86AmzOhkO+ovJ7SoJDEuQkJH+H owyYoUgpk8S+ZyxTRqp6pbRGvx4TBZCUtmLzJvkuFJCYCIAPKiHLh0G/dZ2paNtYxF0c lA2dabWyUfFsWtOH6NFT53NLrLR1h0PJMpA6uDpN91wgtRQq6udCN/nJEGik+0kaPuLz aqGqfa4O6BqvdRrM2Wj1kP19I/UKC9ZIIXoRkGHFmurUvgwpbJq4pDvonTBDkJ8YS6vL SMgg== X-Gm-Message-State: AJIora/PRzv3ASZkSqxflhVK6gbDKD0UV3uZYKbe/lB3iHKkZ4c6cIyh Sb8EMSL272XosCyxCiQ58jdVTV+q+NbY74MwyRa5xJ76 X-Google-Smtp-Source: AGRyM1tkHvbuGp+wZ3ccnFP6hNZnrjugNZR7yeUmO8y4n9bL563BOIEUWvDGdbYG2teA50OVvdBp/wd1wpkqZpxxe0U= X-Received: by 2002:a17:90b:2316:b0:1ec:7b32:55bd with SMTP id mt22-20020a17090b231600b001ec7b3255bdmr9158297pjb.217.1656554630033; Wed, 29 Jun 2022 19:03:50 -0700 (PDT) MIME-Version: 1.0 References: <20220630015618.3586787-1-goldstein.w.n@gmail.com> <20220630015618.3586787-2-goldstein.w.n@gmail.com> In-Reply-To: <20220630015618.3586787-2-goldstein.w.n@gmail.com> From: "H.J. Lu" Date: Wed, 29 Jun 2022 19:03:14 -0700 Message-ID: Subject: Re: [PATCH v1] x86: Add missing IS_IN (libc) check to strcspn-sse4.c To: Noah Goldstein Cc: GNU C Library , "Carlos O'Donell" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3024.6 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-List-Received-Date: Thu, 30 Jun 2022 02:03:54 -0000 On Wed, Jun 29, 2022 at 6:56 PM Noah Goldstein wrote: > > 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 > -- > 2.34.1 > LGTM. Thanks. -- H.J.