[11/20] libcpu-rt-c/x86-64: Add strchr
Commit Message
* 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(-)
@@ -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.
@@ -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
@@ -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>
@@ -17,7 +17,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>
# include "asm-syntax.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 strchr __strchr_sse2
# undef weak_alias
@@ -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 strchr __redirect_strchr
# include <string.h>
# 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