From patchwork Tue Jun 12 22:19:34 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: 27771 Received: (qmail 93958 invoked by alias); 12 Jun 2018 22:20:03 -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 92943 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 15/20] libcpu-rt-c/x86-64: Add strcat Date: Tue, 12 Jun 2018 15:19:34 -0700 Message-Id: <20180612221939.19545-16-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 strcat. * sysdeps/x86_64/multiarch/Makefile (libcpu-rt-c-sysdep_routines): Add strcat-sse2, strcat-sse2-unaligned and strcat-ssse3. * sysdeps/x86_64/strcat.S: Support libcpu-rt-c. * sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S: Likewise. * sysdeps/x86_64/multiarch/strcat-sse2.S: Likewise. * sysdeps/x86_64/multiarch/strcat-ssse3.S: Likewise. * sysdeps/x86_64/multiarch/strcat.c: Likewise. --- sysdeps/x86_64/Makefile | 2 +- sysdeps/x86_64/multiarch/Makefile | 2 ++ sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S | 2 +- sysdeps/x86_64/multiarch/strcat-sse2.S | 2 +- sysdeps/x86_64/multiarch/strcat-ssse3.S | 2 +- sysdeps/x86_64/multiarch/strcat.c | 4 ++-- sysdeps/x86_64/strcat.S | 2 ++ 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/sysdeps/x86_64/Makefile b/sysdeps/x86_64/Makefile index 947cb48086..ea0d7a31dc 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 strlen \ + memset strcat 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 b2f0e9f8da..10de1f3af3 100644 --- a/sysdeps/x86_64/multiarch/Makefile +++ b/sysdeps/x86_64/multiarch/Makefile @@ -81,6 +81,8 @@ libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2 \ memset-avx2-unaligned-erms \ memset-avx512-unaligned-erms \ memset-avx512-no-vzeroupper \ + strcat-sse2 strcat-sse2-unaligned \ + strcat-ssse3 \ strchr-sse2-no-bsf strchr-sse2 \ strchr-avx2 strcmp-sse2 \ strcmp-sse2-unaligned strcmp-ssse3 \ diff --git a/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S b/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S index 852f179bf4..d144651b33 100644 --- a/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.S +++ b/sysdeps/x86_64/multiarch/strcat-sse2-unaligned.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 diff --git a/sysdeps/x86_64/multiarch/strcat-sse2.S b/sysdeps/x86_64/multiarch/strcat-sse2.S index 8eb64e104c..f4939ac409 100644 --- a/sysdeps/x86_64/multiarch/strcat-sse2.S +++ b/sysdeps/x86_64/multiarch/strcat-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) # include # define strcat __strcat_sse2 diff --git a/sysdeps/x86_64/multiarch/strcat-ssse3.S b/sysdeps/x86_64/multiarch/strcat-ssse3.S index 2d4fd78f99..65e8b8e6a4 100644 --- a/sysdeps/x86_64/multiarch/strcat-ssse3.S +++ b/sysdeps/x86_64/multiarch/strcat-ssse3.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 diff --git a/sysdeps/x86_64/multiarch/strcat.c b/sysdeps/x86_64/multiarch/strcat.c index 1f7f6263f3..8637e249ec 100644 --- a/sysdeps/x86_64/multiarch/strcat.c +++ b/sysdeps/x86_64/multiarch/strcat.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 strcat __redirect_strcat # include # undef strcat @@ -28,7 +28,7 @@ libc_ifunc_redirected (__redirect_strcat, strcat, IFUNC_SELECTOR ()); -# ifdef SHARED +# if defined SHARED && !IS_IN (libcpu_rt_c) __hidden_ver1 (strcat, __GI_strcat, __redirect_strcat) __attribute__ ((visibility ("hidden"))); # endif diff --git a/sysdeps/x86_64/strcat.S b/sysdeps/x86_64/strcat.S index 9a4a4e6feb..db2a6e881a 100644 --- a/sysdeps/x86_64/strcat.S +++ b/sysdeps/x86_64/strcat.S @@ -255,4 +255,6 @@ ENTRY (strcat) movq %rdi, %rax /* Source is return value. */ retq END (strcat) +#if !IS_IN (libcpu_rt_c) libc_hidden_builtin_def (strcat) +#endif