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

S390: Refactor strncat ifunc handling.

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

View File

@@ -33,6 +33,7 @@
#include <ifunc-strncpy.h>
#include <ifunc-stpncpy.h>
#include <ifunc-strcat.h>
#include <ifunc-strncat.h>
/* Maximum number of IFUNC implementations. */
#define MAX_IFUNC 3
@@ -255,6 +256,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
)
#endif /* HAVE_STRCAT_IFUNC */
#if HAVE_STRNCAT_IFUNC
IFUNC_IMPL (i, name, strncat,
# if HAVE_STRNCAT_Z13
IFUNC_IMPL_ADD (array, i, strncat,
dl_hwcap & HWCAP_S390_VX, STRNCAT_Z13)
# endif
# if HAVE_STRNCAT_C
IFUNC_IMPL_ADD (array, i, strncat, 1, STRNCAT_C)
# endif
)
#endif /* HAVE_STRNCAT_IFUNC */
#ifdef HAVE_S390_VX_ASM_SUPPORT
# define IFUNC_VX_IMPL(FUNC) \
@@ -277,7 +290,6 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
IFUNC_VX_IMPL (wcscat);
IFUNC_VX_IMPL (strncat);
IFUNC_VX_IMPL (wcsncat);
IFUNC_VX_IMPL (strcmp);