[05/20] libcpu-rt-c/x86-64: Add memcmp
Commit Message
* sysdeps/x86_64/Makefile (cpu-rt-c-routines): Add memcmp.
* sysdeps/x86_64/multiarch/Makefile
(libcpu-rt-c-sysdep_routines): Add memcmp-sse2, memcmp-ssse3,
memcmp-sse4 and memcmp-avx2-movbe.
* sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S: Support
libcpu-rt-c.
* sysdeps/x86_64/multiarch/memcmp-sse2.S: Likewise.
* sysdeps/x86_64/multiarch/memcmp-sse4.S: Likewise.
* sysdeps/x86_64/multiarch/memcmp-ssse3.S: Likewise.
* sysdeps/x86_64/multiarch/memcmp.c: Likewise.
---
sysdeps/x86_64/Makefile | 2 +-
sysdeps/x86_64/multiarch/Makefile | 4 +++-
sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S | 2 +-
sysdeps/x86_64/multiarch/memcmp-sse2.S | 2 +-
sysdeps/x86_64/multiarch/memcmp-sse4.S | 2 +-
sysdeps/x86_64/multiarch/memcmp-ssse3.S | 2 +-
sysdeps/x86_64/multiarch/memcmp.c | 4 ++--
7 files changed, 10 insertions(+), 8 deletions(-)
@@ -147,7 +147,7 @@ endif
endif
ifeq ($(subdir),cpu-rt-c)
-cpu-rt-c-routines += memchr
+cpu-rt-c-routines += memchr memcmp
# For the CPU run-time tests.
vpath %.c $(..)string
@@ -67,5 +67,7 @@ sysdep_routines += memcpy_chk-nonshared mempcpy_chk-nonshared \
endif
ifeq ($(subdir),cpu-rt-c)
-libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2
+libcpu-rt-c-sysdep_routines += memchr-sse2 memchr-avx2 \
+ memcmp-sse2 memcmp-ssse3 memcmp-sse4 \
+ memcmp-avx2-movbe
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)
/* memcmp/wmemcmp is implemented as:
1. For size from 2 to 7 bytes, load as big endian with movbe and bswap
@@ -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 memcmp __memcmp_sse2
# ifdef SHARED
@@ -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>
@@ -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>
@@ -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 memcmp __redirect_memcmp
# include <string.h>
# undef memcmp
@@ -30,7 +30,7 @@ libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
# undef bcmp
weak_alias (memcmp, bcmp)
-# ifdef SHARED
+# if defined SHARED && !IS_IN (libcpu_rt_c)
__hidden_ver1 (memcmp, __GI_memcmp, __redirect_memcmp)
__attribute__ ((visibility ("hidden")));
# endif