about summary refs log tree commit diff
path: root/sysdeps/s390/multiarch/ifunc-impl-list.c
diff options
context:
space:
mode:
authorStefan Liebler <stli@linux.ibm.com>2018-12-18 13:57:13 +0100
committerStefan Liebler <stli@linux.ibm.com>2018-12-18 13:57:13 +0100
commit316b88421993d540513a6b25b59ec16df267e9b4 (patch)
treec6b8bb8db33ae9bf674d24fd03bab69a8b656501 /sysdeps/s390/multiarch/ifunc-impl-list.c
parentcdab85fe33b0443a645509cbb5b929a0d3307f18 (diff)
downloadglibc-316b88421993d540513a6b25b59ec16df267e9b4.tar.gz
glibc-316b88421993d540513a6b25b59ec16df267e9b4.tar.xz
glibc-316b88421993d540513a6b25b59ec16df267e9b4.zip
S390: Refactor strncmp ifunc handling.
The ifunc handling for strncmp is adjusted in order to omit ifunc
variants if those will never be used as the minimum architecture level
already supports newer CPUs by default.
Glibc internal calls will then also use the "newer" ifunc variant.

ChangeLog:

	* sysdeps/s390/multiarch/Makefile
	(sysdep_routines): Remove strncmp variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strncmp variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strncmp.
	* sysdeps/s390/multiarch/strncmp-c.c: Move to ...
	* sysdeps/s390/strncmp-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strncmp-vx.S: Move to ...
	* sysdeps/s390/strncmp-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strncmp.c: Move to ...
	* sysdeps/s390/strncmp.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strncmp.h: New file.
Diffstat (limited to 'sysdeps/s390/multiarch/ifunc-impl-list.c')
-rw-r--r--sysdeps/s390/multiarch/ifunc-impl-list.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/s390/multiarch/ifunc-impl-list.c b/sysdeps/s390/multiarch/ifunc-impl-list.c
index 44637c431b..d982de5788 100644
--- a/sysdeps/s390/multiarch/ifunc-impl-list.c
+++ b/sysdeps/s390/multiarch/ifunc-impl-list.c
@@ -35,6 +35,7 @@
 #include <ifunc-strcat.h>
 #include <ifunc-strncat.h>
 #include <ifunc-strcmp.h>
+#include <ifunc-strncmp.h>
 
 /* Maximum number of IFUNC implementations.  */
 #define MAX_IFUNC	3
@@ -281,6 +282,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 		)
 #endif /* HAVE_STRCMP_IFUNC  */
 
+#if HAVE_STRNCMP_IFUNC
+    IFUNC_IMPL (i, name, strncmp,
+# if HAVE_STRNCMP_Z13
+		IFUNC_IMPL_ADD (array, i, strncmp,
+				dl_hwcap & HWCAP_S390_VX, STRNCMP_Z13)
+# endif
+# if HAVE_STRNCMP_C
+		IFUNC_IMPL_ADD (array, i, strncmp, 1, STRNCMP_C)
+# endif
+		)
+#endif /* HAVE_STRNCMP_IFUNC  */
+
 #ifdef HAVE_S390_VX_ASM_SUPPORT
 
 # define IFUNC_VX_IMPL(FUNC)						\
@@ -307,7 +320,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 
   IFUNC_VX_IMPL (wcscmp);
 
-  IFUNC_VX_IMPL (strncmp);
   IFUNC_VX_IMPL (wcsncmp);
 
   IFUNC_VX_IMPL (strchr);