glibc/sysdeps
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
..
aarch64 aarch64: redefine RETURN_ADDRESS to strip PAC 2020-07-08 15:02:38 +01:00
alpha alpha: Use builtin sqrt{f} 2020-06-22 11:09:49 -03:00
arc ARC: Build Infrastructure 2020-07-10 16:08:45 -07:00
arm Rewrite abi-note.S in C. 2020-07-08 15:02:37 +01:00
csky semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
generic rtld: Avoid using up static TLS surplus for optimizations [BZ #25051] 2020-07-08 17:32:56 +01:00
gnu signal: Move sys_errlist to a compat symbol 2020-07-07 14:10:58 -03:00
hppa dl-runtime: reloc_{offset,index} now functions arch overide'able 2020-06-05 13:45:46 -07:00
htl htl: Move cleanup handling to non-private libc-lock 2020-06-28 00:13:57 +00:00
hurd hurd: Evaluate fd before entering the critical section 2020-07-07 22:10:24 +02:00
i386 x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
ia64 ia64: Use generic exp10f 2020-06-19 12:08:52 -03:00
ieee754 Use C2x return value from getpayload of non-NaN (bug 26073). 2020-07-06 16:18:02 +00:00
m68k m68k: Use sqrt{f} builtin for coldfire 2020-06-22 11:09:50 -03:00
mach Remove --enable-obsolete-nsl configure flag 2020-07-08 17:25:57 +02:00
microblaze semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
mips mips: Use sqrt{f} builtin 2020-06-22 11:09:49 -03:00
nios2 semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
nptl nptl: Add pthread_attr_setsigmask_np, pthread_attr_getsigmask_np 2020-06-02 11:59:18 +02:00
posix hurd: Fix __writev_nocancel_nostatus 2020-06-14 17:45:04 +00:00
powerpc powerpc64: Fix calls when r2 is not used [BZ #26173] 2020-07-10 19:41:06 -03:00
pthread htl: Enable cancel*16 an cancel*20 tests 2020-06-29 00:16:33 +00:00
riscv riscv: Use sqrt{f} builtin 2020-06-22 11:09:50 -03:00
s390 S390: Optimize __memset_z196. 2020-06-26 09:45:11 +02:00
sh semaphore: consolidate arch headers into a generic one 2020-05-06 13:07:12 -07:00
sparc sparc: Use sqrt{f} builtin 2020-06-22 11:09:49 -03:00
unix x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
wordsize-32 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
wordsize-64 Update copyright dates with scripts/update-copyrights. 2020-01-01 00:14:33 +00:00
x86 x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00
x86_64 x86: Support usable check for all CPU features 2020-07-13 06:05:16 -07:00