From patchwork Tue Jun 12 22:19:33 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: 27773 Received: (qmail 94082 invoked by alias); 12 Jun 2018 22:20:04 -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 93006 invoked by uid 89); 12 Jun 2018 22:19:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 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 14/20] libcpu-rt-c/x86-64: Add strlen Date: Tue, 12 Jun 2018 15:19:33 -0700 Message-Id: <20180612221939.19545-15-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 strlen. * sysdeps/x86_64/multiarch/Makefile (libcpu-rt-c-sysdep_routines): Add strlen-sse2 and strlen-avx2. * sysdeps/x86_64/multiarch/strlen-avx2.S: Support libcpu-rt-c. * sysdeps/x86_64/multiarch/strlen-sse2.S: Likewise. * sysdeps/x86_64/multiarch/strlen.c: Likewise. --- sysdeps/x86_64/Makefile | 2 +- sysdeps/x86_64/multiarch/Makefile | 3 ++- sysdeps/x86_64/multiarch/strlen-avx2.S | 2 +- sysdeps/x86_64/multiarch/strlen-sse2.S | 2 +- sysdeps/x86_64/multiarch/strlen.c | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile index b793d067f2..947cb48086 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 strchr strcmp strcpy \ + memset strchr strcmp strcpy strlen \ wmemset # For the CPU run-time tests. diff --git a/sysdeps/x86_64/multiarch/Makefile b/sysdeps/x86_64/multiarch/Makefile index c6040a0170..b2f0e9f8da 100644 --- a/sysdeps/x86_64/multiarch/Makefile +++ b/sysdeps/x86_64/multiarch/Makefile @@ -85,5 +85,6 @@ libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2 \ strchr-avx2 strcmp-sse2 \ strcmp-sse2-unaligned strcmp-ssse3 \ strcmp-sse4_2 strcmp-avx2 strcpy-sse2 \ - strcpy-sse2-unaligned strcpy-ssse3 + strcpy-sse2-unaligned strcpy-ssse3 \ + strlen-sse2 strlen-avx2 endif diff --git a/sysdeps/x86_64/multiarch/strlen-avx2.S b/sysdeps/x86_64/multiarch/strlen-avx2.S index fb2418cddc..6e390e1ddf 100644 --- a/sysdeps/x86_64/multiarch/strlen-avx2.S +++ b/sysdeps/x86_64/multiarch/strlen-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/strlen-sse2.S b/sysdeps/x86_64/multiarch/strlen-sse2.S index 7bc57b8d0f..c0d80a3779 100644 --- a/sysdeps/x86_64/multiarch/strlen-sse2.S +++ b/sysdeps/x86_64/multiarch/strlen-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 strlen __strlen_sse2 #endif diff --git a/sysdeps/x86_64/multiarch/strlen.c b/sysdeps/x86_64/multiarch/strlen.c index 1758d22b8f..04d4c04b15 100644 --- a/sysdeps/x86_64/multiarch/strlen.c +++ b/sysdeps/x86_64/multiarch/strlen.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 strlen __redirect_strlen # include # undef strlen @@ -27,7 +27,7 @@ # include "ifunc-avx2.h" libc_ifunc_redirected (__redirect_strlen, strlen, IFUNC_SELECTOR ()); -# ifdef SHARED +# if defined SHARED && !IS_IN (libcpu_rt_c) __hidden_ver1 (strlen, __GI_strlen, __redirect_strlen) __attribute__((visibility ("hidden"))); # endif