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

S390: Refactor wcscmp ifunc handling.

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

View File

@@ -54,6 +54,7 @@
#include <ifunc-wcpncpy.h>
#include <ifunc-wcscat.h>
#include <ifunc-wcsncat.h>
#include <ifunc-wcscmp.h>
/* Maximum number of IFUNC implementations. */
#define MAX_IFUNC 3
@@ -528,6 +529,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
)
#endif /* HAVE_WCSNCAT_IFUNC */
#if HAVE_WCSCMP_IFUNC
IFUNC_IMPL (i, name, wcscmp,
# if HAVE_WCSCMP_Z13
IFUNC_IMPL_ADD (array, i, wcscmp,
dl_hwcap & HWCAP_S390_VX, WCSCMP_Z13)
# endif
# if HAVE_WCSCMP_C
IFUNC_IMPL_ADD (array, i, wcscmp, 1, WCSCMP_C)
# endif
)
#endif /* HAVE_WCSCMP_IFUNC */
#ifdef HAVE_S390_VX_ASM_SUPPORT
# define IFUNC_VX_IMPL(FUNC) \
@@ -536,8 +549,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 (wcscmp);
IFUNC_VX_IMPL (wcsncmp);
IFUNC_VX_IMPL (wcschr);