mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +03:00
S390: Refactor wcschr ifunc handling.
The ifunc handling for wcschr is adjusted in order to omit ifunc if the minimum architecture level already supports newer CPUs by default. Unfortunately the c ifunc variant can't be omitted at all as it is used by the z13 ifunc variant as fallback if the pointers are not 4-byte aligned. Glibc internal calls will use the "newer" ifunc variant. ChangeLog: * sysdeps/s390/multiarch/Makefile (sysdep_routines): Remove wcschr variants. * sysdeps/s390/Makefile (sysdep_routines): Add wcschr variants. * sysdeps/s390/multiarch/ifunc-impl-list.c (__libc_ifunc_impl_list): Refactor ifunc handling for wcschr. * sysdeps/s390/multiarch/wcschr-c.c: Move to ... * sysdeps/s390/wcschr-c.c: ... here and adjust ifunc handling. * sysdeps/s390/multiarch/wcschr-vx.S: Move to ... * sysdeps/s390/wcschr-vx.S: ... here and adjust ifunc handling. * sysdeps/s390/multiarch/wcschr.c: Move to ... * sysdeps/s390/wcschr.c: ... here and adjust ifunc handling. * sysdeps/s390/ifunc-wcschr.h: New file.
This commit is contained in:
@@ -56,6 +56,7 @@
|
||||
#include <ifunc-wcsncat.h>
|
||||
#include <ifunc-wcscmp.h>
|
||||
#include <ifunc-wcsncmp.h>
|
||||
#include <ifunc-wcschr.h>
|
||||
|
||||
/* Maximum number of IFUNC implementations. */
|
||||
#define MAX_IFUNC 3
|
||||
@@ -554,6 +555,18 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
||||
)
|
||||
#endif /* HAVE_WCSNCMP_IFUNC */
|
||||
|
||||
#if HAVE_WCSCHR_IFUNC
|
||||
IFUNC_IMPL (i, name, wcschr,
|
||||
# if HAVE_WCSCHR_Z13
|
||||
IFUNC_IMPL_ADD (array, i, wcschr,
|
||||
dl_hwcap & HWCAP_S390_VX, WCSCHR_Z13)
|
||||
# endif
|
||||
# if HAVE_WCSCHR_C
|
||||
IFUNC_IMPL_ADD (array, i, wcschr, 1, WCSCHR_C)
|
||||
# endif
|
||||
)
|
||||
#endif /* HAVE_WCSCHR_IFUNC */
|
||||
|
||||
#ifdef HAVE_S390_VX_ASM_SUPPORT
|
||||
|
||||
# define IFUNC_VX_IMPL(FUNC) \
|
||||
@@ -562,8 +575,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 (wcschr);
|
||||
|
||||
IFUNC_VX_IMPL (wcschrnul);
|
||||
|
||||
IFUNC_VX_IMPL (wcsrchr);
|
||||
|
Reference in New Issue
Block a user