1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

S390: Refactor strlen ifunc handling.

The ifunc handling for strlen 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 strlen variants.
	* sysdeps/s390/Makefile (sysdep_routines): Add strlen variants.
	* sysdeps/s390/multiarch/ifunc-impl-list.c
	(__libc_ifunc_impl_list): Refactor ifunc handling for strlen.
	* sysdeps/s390/multiarch/strlen-c.c: Move to ...
	* sysdeps/s390/strlen-c.c: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strlen-vx.S: Move to ...
	* sysdeps/s390/strlen-vx.S: ... here and adjust ifunc handling.
	* sysdeps/s390/multiarch/strlen.c: Move to ...
	* sysdeps/s390/strlen.c: ... here and adjust ifunc handling.
	* sysdeps/s390/ifunc-strlen.h: New file.
This commit is contained in:
Stefan Liebler
2018-12-18 13:57:10 +01:00
parent d2c4c403fe
commit ff3ca3743a
8 changed files with 123 additions and 20 deletions

View File

@@ -26,6 +26,7 @@
#include <ifunc-memcpy.h>
#include <ifunc-strstr.h>
#include <ifunc-memmem.h>
#include <ifunc-strlen.h>
/* Maximum number of IFUNC implementations. */
#define MAX_IFUNC 3
@@ -164,6 +165,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
)
#endif /* HAVE_MEMMEM_IFUNC */
#if HAVE_STRLEN_IFUNC
IFUNC_IMPL (i, name, strlen,
# if HAVE_STRLEN_Z13
IFUNC_IMPL_ADD (array, i, strlen,
dl_hwcap & HWCAP_S390_VX, STRLEN_Z13)
# endif
# if HAVE_STRLEN_C
IFUNC_IMPL_ADD (array, i, strlen, 1, STRLEN_C)
# endif
)
#endif /* HAVE_STRLEN_IFUNC */
#ifdef HAVE_S390_VX_ASM_SUPPORT
# define IFUNC_VX_IMPL(FUNC) \
@@ -172,7 +185,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
__##FUNC##_vx) \
IFUNC_IMPL_ADD (array, i, FUNC, 1, __##FUNC##_c))
IFUNC_VX_IMPL (strlen);
IFUNC_VX_IMPL (wcslen);
IFUNC_VX_IMPL (strnlen);