glibc/sysdeps
H.J. Lu 11ffcacb64 x86-64: Implement strcmp family IFUNC selectors in C
Implement strcmp family IFUNC selectors in C.

All internal calls within libc.so can use IFUNC on x86-64 since unlike
x86, x86-64 supports PC-relative addressing to access the GOT entry so
that it can call via PLT without using an extra register.  For libc.a,
we can't use IFUNC for functions which are called before IFUNC has been
initialized.  Use IFUNC internally reduces the icache footprint since
libc.so and other codes in the process use the same implementations.
This patch uses IFUNC for strcmp family functions within libc.

	* sysdeps/x86_64/multiarch/Makefile (sysdep_routines): Add
	strcmp-sse2, strcmp-sse4_2, strncmp-sse2, strncmp-sse4_2,
	strcasecmp_l-sse2, strcasecmp_l-sse4_2, strcasecmp_l-avx,
	strncase_l-sse2, strncase_l-sse4_2 and strncase_l-avx.
	* sysdeps/x86_64/multiarch/ifunc-strcasecmp.h: New file.
	* sysdeps/x86_64/multiarch/strcasecmp.c: Likewise.
	* sysdeps/x86_64/multiarch/strcasecmp_l-avx.S: Likewise.
	* sysdeps/x86_64/multiarch/strcasecmp_l-sse2.S: Likewise.
	* sysdeps/x86_64/multiarch/strcasecmp_l-sse4_2.S: Likewise.
	* sysdeps/x86_64/multiarch/strcasecmp_l.c: Likewise.
	* sysdeps/x86_64/multiarch/strcmp-sse2.S: Likewise.
	* sysdeps/x86_64/multiarch/strcmp-sse4_2.S: Likewise.
	* sysdeps/x86_64/multiarch/strcmp.c: Likewise.
	* sysdeps/x86_64/multiarch/strncase.c: Likewise.
	* sysdeps/x86_64/multiarch/strncase_l-avx.S : Likewise.
	* sysdeps/x86_64/multiarch/strncase_l-sse2.S: Likewise.
	* sysdeps/x86_64/multiarch/strncase_l-sse4_2.S: Likewise.
	* sysdeps/x86_64/multiarch/strncase_l.c: Likewise.
	* sysdeps/x86_64/multiarch/strncmp-sse2.S: Likewise.
	* sysdeps/x86_64/multiarch/strncmp-sse4_2.S: Likewise.
	* sysdeps/x86_64/multiarch/strncmp.c: Likewise.
	* sysdeps/x86_64/multiarch/strcasecmp_l.S: Removed.
	* sysdeps/x86_64/multiarch/strcmp.S: Likewise.
	* sysdeps/x86_64/multiarch/strncase_l.S: Likewise.
	* sysdeps/x86_64/multiarch/strncmp.S: Likewise.
	* sysdeps/x86_64/multiarch/strcmp-sse42.S: Include <sysdep.h>.
	(STRCMP_SSE42): New.  Defined to __strcmp_sse42 if not defined.
	[USE_AS_STRCASECMP_L || USE_AS_STRNCASECMP_L]: Include
	"locale-defines.h".
	(UPDATE_STRNCMP_COUNTER): New.
	(SECTION): Likewise.
	(GLABEL): Likewise.
	(LABEL): Likewise.
	* sysdeps/x86_64/multiarch/strncmp-ssse3.S: Rewrite and enable
	for libc.a.
2017-06-21 12:11:06 -07:00
..
aarch64 [AArch64] Add more cfi annotations to tlsdesc entry points 2017-06-21 15:04:37 +01:00
alpha PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
arm PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
generic Factor out shared definitions from bits/signum.h. 2017-06-20 20:32:50 -04:00
gnu Regenerate sysdeps/gnu/errlist.c. 2017-06-04 15:27:14 -04:00
hppa PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
i386 Remove bits/string.h. 2017-06-20 08:21:24 -04:00
ia64 PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
ieee754 Use locale_t, not __locale_t, throughout glibc 2017-06-20 20:30:06 -04:00
init_array Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
m68k Remove bits/string.h. 2017-06-20 08:21:24 -04:00
mach Remove __need macros from errno.h (__need_Emath, __need_error_t). 2017-06-14 08:14:34 -04:00
microblaze PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
mips Remove pre-GCC-4.9 MIPS code. 2017-06-19 23:24:36 +00:00
nios2 PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
nptl fork: Remove bogus parent PID assertions [BZ #21386] 2017-05-12 16:04:16 +02:00
posix getaddrinfo: Avoid stack copy of IPv6 address 2017-06-21 13:35:37 +02:00
powerpc powerpc: Optimize memchr for power8 2017-06-21 10:55:12 +05:30
pthread Remove __need macros from signal.h. 2017-05-20 19:04:43 -04:00
s390 Remove bits/string.h. 2017-06-20 08:21:24 -04:00
sh PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
sparc Remove bits/string.h. 2017-06-20 08:21:24 -04:00
tile PowerPC64 ELFv2 PPC64_OPT_LOCALENTRY 2017-06-14 10:47:25 +09:30
unix Fix tile SA_* conditions for POSIX.1:2008 (bug 21622). 2017-06-21 17:35:24 +00:00
wordsize-32 Build divdi3 only for architecture that required it 2017-04-06 15:14:34 -03:00
wordsize-64 Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
x86 x86: Rename glibc.tune.ifunc to glibc.tune.hwcaps 2017-06-21 10:21:37 -07:00
x86_64 x86-64: Implement strcmp family IFUNC selectors in C 2017-06-21 12:11:06 -07:00