[14/20] libcpu-rt-c/x86-64: Add strlen
Commit Message
* 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(-)
@@ -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.
@@ -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
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
+#if IS_IN (libc) || IS_IN (libcpu_rt_c)
# include <sysdep.h>
@@ -16,7 +16,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#if IS_IN (libc)
+#if IS_IN (libc) || IS_IN (libcpu_rt_c)
# define strlen __strlen_sse2
#endif
@@ -18,7 +18,7 @@
<http://www.gnu.org/licenses/>. */
/* 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 <string.h>
# 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