glibc/sysdeps/x86_64/multiarch
H.J. Lu 107e6a3c22 x86: Support usable check for all CPU features
Support usable check for all CPU features with the following changes:

1. Change struct cpu_features to

struct cpuid_features
{
  struct cpuid_registers cpuid;
  struct cpuid_registers usable;
};

struct cpu_features
{
  struct cpu_features_basic basic;
  struct cpuid_features features[COMMON_CPUID_INDEX_MAX];
  unsigned int preferred[PREFERRED_FEATURE_INDEX_MAX];
...
};

so that there is a usable bit for each cpuid bit.
2. After the cpuid bits have been initialized, copy the known bits to the
usable bits.  EAX/EBX from INDEX_1 and EAX from INDEX_7 aren't used for
CPU feature detection.
3. Clear the usable bits which require OS support.
4. If the feature is supported by OS, copy its cpuid bit to its usable
bit.
5. Replace HAS_CPU_FEATURE and CPU_FEATURES_CPU_P with CPU_FEATURE_USABLE
and CPU_FEATURE_USABLE_P to check if a feature is usable.
6. Add DEPR_FPU_CS_DS for INDEX_7_EBX_13.
7. Unset MPX feature since it has been deprecated.

The results are

1. If the feature is known and doesn't requre OS support, its usable bit
is copied from the cpuid bit.
2. Otherwise, its usable bit is copied from the cpuid bit only if the
feature is known to supported by OS.
3. CPU_FEATURE_USABLE/CPU_FEATURE_USABLE_P are used to check if the
feature can be used.
4. HAS_CPU_FEATURE/CPU_FEATURE_CPU_P are used to check if CPU supports
the feature.
2020-07-13 06:05:16 -07:00
..
bcopy.S Use IFUNC memmove/memset in x86-64 bcopy/bzero 2012-10-11 13:58:16 -07:00
ifunc-avx2.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-impl-list.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-memcmp.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-memmove.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-memset.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-sse4_2.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-strcasecmp.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-strcpy.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ifunc-wmemset.h x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
Makefile x86-64: Optimize strcat/strncat, strcpy/strncpy and stpcpy/stpncpy with AVX2 2019-01-14 09:43:38 -06:00
memchr-avx2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memchr-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memchr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcmp-avx2-movbe.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcmp-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcmp-sse4.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcmp-ssse3.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcmp.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcpy_chk-nonshared.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcpy_chk.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcpy-ssse3-back.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcpy-ssse3.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memcpy.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memmove_chk-nonshared.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memmove_chk.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memmove-avx512-no-vzeroupper.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memmove-avx512-unaligned-erms.S Require binutils 2.24 to build x86-64 glibc [BZ #20139] 2016-07-01 06:03:05 -07:00
memmove-avx-unaligned-erms.S X86-64: Use non-temporal store in memcpy on large data 2016-04-12 08:10:47 -07:00
memmove-sse2-unaligned-erms.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memmove-ssse3-back.S Improve 64bit memcpy/memmove for Atom, Core 2 and Core i7 2010-06-30 08:26:11 -07:00
memmove-ssse3.S Improve 64bit memcpy/memmove for Atom, Core 2 and Core i7 2010-06-30 08:26:11 -07:00
memmove-vec-unaligned-erms.S x86: Add thresholds for "rep movsb/stosb" to tunables 2020-07-06 11:48:42 -07:00
memmove.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mempcpy_chk-nonshared.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mempcpy_chk.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
mempcpy.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memrchr-avx2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memrchr-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memrchr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memset_chk-nonshared.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memset_chk.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memset-avx2-unaligned-erms.S x86-64: Optimize wmemset with SSE2/AVX2/AVX512 2017-06-05 11:09:59 -07:00
memset-avx512-no-vzeroupper.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memset-avx512-unaligned-erms.S x86-64: Optimize wmemset with SSE2/AVX2/AVX512 2017-06-05 11:09:59 -07:00
memset-sse2-unaligned-erms.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
memset-vec-unaligned-erms.S x86: Add thresholds for "rep movsb/stosb" to tunables 2020-07-06 11:48:42 -07:00
memset.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
rawmemchr-avx2.S x86-64: Optimize memchr/rawmemchr/wmemchr with SSE2/AVX2 2017-06-09 05:13:31 -07:00
rawmemchr-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
rawmemchr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
sched_cpucount.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
stpcpy-avx2.S x86-64: Optimize strcat/strncat, strcpy/strncpy and stpcpy/stpncpy with AVX2 2019-01-14 09:43:38 -06:00
stpcpy-sse2-unaligned.S Improved st{r,p}{,n}cpy for SSE2 and SSSE3 on x86-64 2011-06-24 15:14:22 -04:00
stpcpy-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stpcpy-ssse3.S Improved st{r,p}{,n}cpy for SSE2 and SSSE3 on x86-64 2011-06-24 15:14:22 -04:00
stpcpy.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
stpncpy-avx2.S x86-64: Optimize strcat/strncat, strcpy/strncpy and stpcpy/stpncpy with AVX2 2019-01-14 09:43:38 -06:00
stpncpy-c.c x86-64: Implement strcpy family IFUNC selectors in C 2017-06-12 09:06:09 -07:00
stpncpy-sse2-unaligned.S Improved st{r,p}{,n}cpy for SSE2 and SSSE3 on x86-64 2011-06-24 15:14:22 -04:00
stpncpy-ssse3.S Improved st{r,p}{,n}cpy for SSE2 and SSSE3 on x86-64 2011-06-24 15:14:22 -04:00
stpncpy.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcasecmp_l-avx.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcasecmp_l-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcasecmp_l-sse4_2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcasecmp_l-ssse3.S Fix x86-64 build without multiarch. 2010-08-14 14:56:32 -07:00
strcasecmp_l.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcasecmp.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcat-avx2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcat-sse2-unaligned.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcat-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcat-ssse3.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcat.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strchr-avx2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strchr-sse2-no-bsf.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strchr-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strchr.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
strchrnul-avx2.S x86-64: Optimize strchr/strchrnul/wcschr with AVX2 2017-06-09 05:42:29 -07:00
strchrnul-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strchrnul.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcmp-avx2.S Fix avx2 strncmp offset compare condition check [BZ #25933] 2020-06-17 07:07:38 -07:00
strcmp-sse2-unaligned.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcmp-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcmp-sse4_2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcmp-sse42.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcmp-ssse3.S Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
strcmp.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
strcpy-avx2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcpy-sse2-unaligned.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcpy-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcpy-ssse3.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcpy.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcspn-c.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcspn-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strcspn.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strlen-avx2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strlen-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strlen.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncase_l-avx.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncase_l-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncase_l-sse4_2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncase_l-ssse3.S Add optimized strncasecmp versions for x86-64. 2010-08-14 22:04:01 -07:00
strncase_l.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncase.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncat-avx2.S x86-64: Optimize strcat/strncat, strcpy/strncpy and stpcpy/stpncpy with AVX2 2019-01-14 09:43:38 -06:00
strncat-c.c x86-64: Use IFUNC strncat inside libc.so 2018-05-16 09:04:35 -07:00
strncat-sse2-unaligned.S Improve 64 bit strcat functions with SSE2/SSSE3 2011-07-19 17:11:54 -04:00
strncat-ssse3.S Improve 64 bit strcat functions with SSE2/SSSE3 2011-07-19 17:11:54 -04:00
strncat.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncmp-avx2.S x86-64: Optimize strcmp/wcscmp and strncmp/wcsncmp with AVX2 2018-06-01 16:32:43 -05:00
strncmp-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncmp-sse4_2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncmp-ssse3.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strncmp.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
strncpy-avx2.S x86-64: Optimize strcat/strncat, strcpy/strncpy and stpcpy/stpncpy with AVX2 2019-01-14 09:43:38 -06:00
strncpy-c.c x86-64: Implement strcpy family IFUNC selectors in C 2017-06-12 09:06:09 -07:00
strncpy-sse2-unaligned.S Improved st{r,p}{,n}cpy for SSE2 and SSSE3 on x86-64 2011-06-24 15:14:22 -04:00
strncpy-ssse3.S Improved st{r,p}{,n}cpy for SSE2 and SSSE3 on x86-64 2011-06-24 15:14:22 -04:00
strncpy.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strnlen-avx2.S x86-64: Optimize strlen/strnlen/wcslen/wcsnlen with AVX2 2017-06-09 05:18:18 -07:00
strnlen-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strnlen.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strpbrk-c.c x86-64: Implement strcspn/strpbrk/strspn IFUNC selectors in C 2017-06-15 08:59:05 -07:00
strpbrk-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strpbrk.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strrchr-avx2.S x86_64: Use %xmmN with vpxor to clear a vector register 2020-06-17 05:44:02 -07:00
strrchr-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strrchr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strspn-c.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strspn-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strspn.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strstr-sse2-unaligned.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
strstr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
test-multiarch.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
varshift.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
varshift.h Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcschr-avx2.S x86-64: Optimize strchr/strchrnul/wcschr with AVX2 2017-06-09 05:42:29 -07:00
wcschr-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcschr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcscmp-avx2.S x86-64: Optimize strcmp/wcscmp and strncmp/wcsncmp with AVX2 2018-06-01 16:32:43 -05:00
wcscmp-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcscmp.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcscpy-c.c wcsmbs: optimize wcscat 2019-02-27 10:00:37 -03:00
wcscpy-ssse3.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcscpy.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
wcslen-avx2.S x86-64: Optimize strlen/strnlen/wcslen/wcsnlen with AVX2 2017-06-09 05:18:18 -07:00
wcslen-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcslen.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcsncmp-avx2.S x86-64: Optimize strcmp/wcscmp and strncmp/wcsncmp with AVX2 2018-06-01 16:32:43 -05:00
wcsncmp-sse2.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcsncmp.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcsnlen-avx2.S x86-64: Optimize strlen/strnlen/wcslen/wcsnlen with AVX2 2017-06-09 05:18:18 -07:00
wcsnlen-c.c x86-64: Move wcsnlen.S to multiarch/wcsnlen-sse4_1.S 2017-06-06 06:12:32 -07:00
wcsnlen-sse4_1.S x86-64: Move wcsnlen.S to multiarch/wcsnlen-sse4_1.S 2017-06-06 06:12:32 -07:00
wcsnlen.c x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
wcsrchr-avx2.S x86-64: Optimize strrchr/wcsrchr with AVX2 2017-06-09 05:45:52 -07:00
wcsrchr-sse2.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wcsrchr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wmemchr-avx2.S x86-64: Optimize memchr/rawmemchr/wmemchr with SSE2/AVX2 2017-06-09 05:13:31 -07:00
wmemchr-sse2.S x86-64: Optimize memchr/rawmemchr/wmemchr with SSE2/AVX2 2017-06-09 05:13:31 -07:00
wmemchr.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wmemcmp-avx2-movbe.S x86-64: Optimize memcmp/wmemcmp with AVX2 and MOVBE 2017-06-05 12:52:55 -07:00
wmemcmp-c.c Remove NOT_IN_libc 2014-11-24 15:03:45 +05:30
wmemcmp-sse4.S Optimized memcmp and wmemcmp for x86-64 and x86-32 2011-10-15 11:10:08 -04:00
wmemcmp-ssse3.S Optimized memcmp and wmemcmp for x86-64 and x86-32 2011-10-15 11:10:08 -04:00
wmemcmp.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wmemset_chk-nonshared.S Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wmemset_chk.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wmemset.c Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00