From patchwork Tue Jun 12 22:19:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 27768 Received: (qmail 92933 invoked by alias); 12 Jun 2018 22:19:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 92583 invoked by uid 89); 12 Jun 2018 22:19:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy= X-HELO: mga01.intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False X-ExtLoop1: 1 From: "H.J. Lu" To: libc-alpha@sourceware.org Subject: [PATCH 11/20] libcpu-rt-c/x86-64: Add strchr Date: Tue, 12 Jun 2018 15:19:30 -0700 Message-Id: <20180612221939.19545-12-hjl.tools@gmail.com> In-Reply-To: <20180612221939.19545-1-hjl.tools@gmail.com> References: <20180612221939.19545-1-hjl.tools@gmail.com> * sysdeps/x86_64/Makefile (cpu-rt-c-routines): Add strchr. * sysdeps/x86_64/multiarch/Makefile (libcpu-rt-c-sysdep_routines): Add strchr-sse2-no-bsf, strchr-sse2 and strchr-avx2. * sysdeps/x86_64/multiarch/strchr-avx2.S: Support libcpu-rt-c. * sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S: Likewise. * sysdeps/x86_64/multiarch/strchr-sse2.S: Likewise. * sysdeps/x86_64/multiarch/strchr.c: Likewise. --- sysdeps/x86_64/Makefile | 2 +- sysdeps/x86_64/multiarch/Makefile | 4 +++- sysdeps/x86_64/multiarch/strchr-avx2.S | 2 +- sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S | 2 +- sysdeps/x86_64/multiarch/strchr-sse2.S | 2 +- sysdeps/x86_64/multiarch/strchr.c | 4 ++-- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile index d5e4912074..6c8adb898a 100644 --- a/sysdeps/x86_64/Makefile +++ b/sysdeps/x86_64/Makefile @@ -148,7 +148,7 @@ endif ifeq ($(subdir),cpu-rt-c) cpu-rt-c-routines += memchr memcmp memcpy memmove mempcpy memrchr \ - memset \ + memset strchr \ wmemset # For the CPU run-time tests. diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile index 9262251b2c..b06c1555df 100644 --- a/sysdeps/x86_64/multiarch/Makefile +++ b/sysdeps/x86_64/multiarch/Makefile @@ -80,5 +80,7 @@ libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2 \ memset-sse2-unaligned-erms \ memset-avx2-unaligned-erms \ memset-avx512-unaligned-erms \ - memset-avx512-no-vzeroupper + memset-avx512-no-vzeroupper \ + strchr-sse2-no-bsf strchr-sse2 \ + strchr-avx2 endif diff --git a/sysdeps/x86_64/multiarch/strchr-avx2.S b/sysdeps/x86_64/multiarch/strchr-avx2.S index 47bc3c9949..fd5bd1a64a 100644 --- a/sysdeps/x86_64/multiarch/strchr-avx2.S +++ b/sysdeps/x86_64/multiarch/strchr-avx2.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ -#if IS_IN (libc) +#if IS_IN (libc) || IS_IN (libcpu_rt_c) # include diff --git a/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S b/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S index 93fb661da2..42be1a6c79 100644 --- a/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S +++ b/sysdeps/x86_64/multiarch/strchr-sse2-no-bsf.S @@ -17,7 +17,7 @@ License along with the GNU C Library; if not, see . */ -#if IS_IN (libc) +#if IS_IN (libc) || IS_IN (libcpu_rt_c) # include # include "asm-syntax.h" diff --git a/sysdeps/x86_64/multiarch/strchr-sse2.S b/sysdeps/x86_64/multiarch/strchr-sse2.S index 8a6e77195c..ac1f7fc494 100644 --- a/sysdeps/x86_64/multiarch/strchr-sse2.S +++ b/sysdeps/x86_64/multiarch/strchr-sse2.S @@ -16,7 +16,7 @@ License along with the GNU C Library; if not, see . */ -#if IS_IN (libc) +#if IS_IN (libc) || IS_IN (libcpu_rt_c) # define strchr __strchr_sse2 # undef weak_alias diff --git a/sysdeps/x86_64/multiarch/strchr.c b/sysdeps/x86_64/multiarch/strchr.c index 76d64fb378..ac748dc749 100644 --- a/sysdeps/x86_64/multiarch/strchr.c +++ b/sysdeps/x86_64/multiarch/strchr.c @@ -18,7 +18,7 @@ . */ /* Define multiple versions only for the definition in libc. */ -#if IS_IN (libc) +#if IS_IN (libc) || IS_IN (libcpu_rt_c) # define strchr __redirect_strchr # include # undef strchr @@ -48,7 +48,7 @@ IFUNC_SELECTOR (void) libc_ifunc_redirected (__redirect_strchr, strchr, IFUNC_SELECTOR ()); weak_alias (strchr, index) -# ifdef SHARED +# if defined SHARED && !IS_IN (libcpu_rt_c) __hidden_ver1 (strchr, __GI_strchr, __redirect_strchr) __attribute__((visibility ("hidden"))); # endif