glibc/sysdeps/x86_64
H.J. Lu 1432d38ea0 x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391]
dl_platform and dl_hwcap are set from AT_PLATFORM and AT_HWCAP very
early during startup.  They are used by dynamic linker to determine
platform and build an array of hardware capability names, which are
added to search path when loading shared object.  dl_platform and
dl_hwcap are unused on x86-64.  On i386, i386, i486, i586 and i686
platforms were supported and only SSE2 capability was used.

On x86, usage of AT_PLATFORM and AT_HWCAP to determine platform and
processor capabilities is obsolete since all information is available
in dl_x86_cpu_features.  This patch sets dl_platform and dl_hwcap from
dl_x86_cpu_features in dynamic linker.  On i386, the available plaforms
are changed to i586 and i686 since i386 has been deprecated.  On x86-64,
the available plaforms are haswell, which is for Haswell class processors
with BMI1, BMI2, LZCNT, MOVBE, POPCNT, AVX2 and FMA, and xeon_phi, which
is for Xeon Phi class processors with AVX512F, AVX512CD, AVX512ER and
AVX512PF.  A capability, avx512_1, is also added to x86-64 for AVX512
ISAs: AVX512F, AVX512CD, AVX512BW, AVX512DQ and AVX512VL.

	[BZ #21391]
	* sysdeps/i386/dl-machine.h (dl_platform_init) [IS_IN (rtld)]:
	Only call init_cpu_features.
	[!IS_IN (rtld)]: Only set GLRO(dl_platform) to NULL if needed.
	* sysdeps/x86_64/dl-machine.h (dl_platform_init): Likewise.
	* sysdeps/i386/dl-procinfo.h: Removed.
	* sysdeps/unix/sysv/linux/i386/dl-procinfo.h: Don't include
	<sysdeps/i386/dl-procinfo.h> nor <ldsodefs.h>.  Include
	<sysdeps/x86/dl-procinfo.h>.
	(_dl_procinfo): Replace _DL_HWCAP_COUNT with 32.
	* sysdeps/unix/sysv/linux/x86_64/dl-procinfo.h [!IS_IN (ldconfig)]:
	Include <sysdeps/x86/dl-procinfo.h> instead of
	 <sysdeps/generic/dl-procinfo.h>.
	* sysdeps/x86/cpu-features.c: Include <dl-hwcap.h>.
	(init_cpu_features): Set dl_platform, dl_hwcap and dl_hwcap_mask.
	* sysdeps/x86/cpu-features.h (bit_cpu_LZCNT): New.
	(bit_cpu_MOVBE): Likewise.
	(bit_cpu_BMI1): Likewise.
	(bit_cpu_BMI2): Likewise.
	(index_cpu_BMI1): Likewise.
	(index_cpu_BMI2): Likewise.
	(index_cpu_LZCNT): Likewise.
	(index_cpu_MOVBE): Likewise.
	(index_cpu_POPCNT): Likewise.
	(reg_BMI1): Likewise.
	(reg_BMI2): Likewise.
	(reg_LZCNT): Likewise.
	(reg_MOVBE): Likewise.
	(reg_POPCNT): Likewise.
	* sysdeps/x86/dl-hwcap.h: New file.
	* sysdeps/x86/dl-procinfo.h: Likewise.
	* sysdeps/x86/dl-procinfo.c (_dl_x86_hwcap_flags): New.
	(_dl_x86_platforms): Likewise.
2017-05-03 13:44:35 -07:00
..
64
fpu Allow direct use of math_ldbl.h in testsuite. 2017-02-25 10:40:48 -05:00
multiarch x86: Use AVX2 memcpy/memset on Skylake server [BZ #21396] 2017-04-18 14:01:45 -07:00
nptl Remove CALL_THREAD_FCT macro 2017-04-04 18:03:35 -03:00
x32 Remove CALL_THREAD_FCT macro 2017-04-04 18:03:35 -03:00
____longjmp_chk.S
__longjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
_mcount.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
abort-instr.h
add_n.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
addmul_1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
atomic-machine.h Narrowing the visibility of libc-internal.h even further. 2017-03-01 20:33:46 -05:00
backtrace.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bsd-_setjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bsd-setjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bzero.S
configure
configure.ac
crti.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
crtn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-irel.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-machine.h x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391] 2017-05-03 13:44:35 -07:00
dl-procinfo.c Add sysdeps/x86/dl-procinfo.c 2017-04-10 12:01:45 -07:00
dl-runtime.c
dl-tls.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-tlsdesc.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-tlsdesc.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-trampoline.h x86-64: Improve branch predication in _dl_runtime_resolve_avx512_opt [BZ #21258] 2017-03-21 11:00:12 -07:00
dl-trampoline.S x86-64: Improve branch predication in _dl_runtime_resolve_avx512_opt [BZ #21258] 2017-03-21 11:00:12 -07:00
ffs.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ffsll.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
hp-timing.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
htonl.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ifuncmain8.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ifuncmod8.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Implies
jmpbuf-offsets.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
l10nflist.c
ldbl2mpn.c
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
link-defines.sym
locale-defines.sym
localplt.data Document and fix --enable-bind-now [BZ #21015] 2017-03-02 14:44:28 +01:00
lshift.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
machine-gmon.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Makefile x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
memchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcopy.h
memcpy_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy.S
memmove_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memmove.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mempcpy_chk.S x86_64: fix static build of __mempcpy_chk for compilers defaulting to PIC/PIE 2017-03-15 16:10:05 -07:00
mempcpy.S
memrchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mp_clz_tab.c
mul_1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
preconfigure
preconfigure.ac
rawmemchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
rshift.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sched_cpucount.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stack-aliasing.h
stackguard-macros.h
stackinfo.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
start.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stpcpy.S
strcasecmp_l-nonascii.c
strcasecmp_l.S
strcasecmp.S
strcat.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strchrnul.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcspn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strlen.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strncase_l-nonascii.c
strncase_l.S
strncase.S
strncmp.S
strnlen.S
strpbrk.S
strrchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strspn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sub_n.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
submul_1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tls-macros.h
tlsdesc.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tlsdesc.sym
tst-audit3.c
tst-audit4-aux.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-audit4.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-audit5.c
tst-audit6.c
tst-audit7.c
tst-audit10-aux.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-audit10.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-audit.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-auditmod3a.c
tst-auditmod3b.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-auditmod4a.c
tst-auditmod4b.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-auditmod5a.c
tst-auditmod5b.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-auditmod6a.c
tst-auditmod6b.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-auditmod6c.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-auditmod7a.c
tst-auditmod7b.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-auditmod10a.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-auditmod10b.c Add missing header files throughout the testsuite. 2017-02-16 17:33:18 -05:00
tst-avx512-aux.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-avx512.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-avx512mod.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-avx-aux.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-avx.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-avxmod.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-mallocalign1.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-quad1.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-quad1pie.c
tst-quad2.c
tst-quad2pie.c
tst-quadmod1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-quadmod1pie.S
tst-quadmod2.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-quadmod2pie.S
tst-split-dynreloc.c
tst-split-dynreloc.lds
tst-sse.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-ssemod.c x86-64: Verify that _dl_runtime_resolve preserves vector registers 2017-02-09 12:19:58 -08:00
tst-stack-align.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
Versions
wcschr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcscmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcslen.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wcsrchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
wordcopy.c