aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86/include/cpu-features.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-06-05 06:42:20 -0700
committerH.J. Lu <hjl.tools@gmail.com>2021-07-23 05:12:51 -0700
commit7c124e3714c38157230ed1a5d743b37defe64dc2 (patch)
treef1e13e18239c4421675234b56d880ae081d4bdcd /sysdeps/x86/include/cpu-features.h
parent5b8d271571434a74b2464c278eafe2ff81f31029 (diff)
downloadglibc-7c124e3714c38157230ed1a5d743b37defe64dc2.zip
glibc-7c124e3714c38157230ed1a5d743b37defe64dc2.tar.gz
glibc-7c124e3714c38157230ed1a5d743b37defe64dc2.tar.bz2
x86: Install <bits/platform/x86.h> [BZ #27958]
1. Install <bits/platform/x86.h> for <sys/platform/x86.h> which includes <bits/platform/x86.h>. 2. Rename HAS_CPU_FEATURE to CPU_FEATURE_PRESENT which checks if the processor has the feature. 3. Rename CPU_FEATURE_USABLE to CPU_FEATURE_ACTIVE which checks if the feature is active. There may be other preconditions, like sufficient stack space or further setup for AMX, which must be satisfied before the feature can be used. This fixes BZ #27958. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps/x86/include/cpu-features.h')
-rw-r--r--sysdeps/x86/include/cpu-features.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/sysdeps/x86/include/cpu-features.h b/sysdeps/x86/include/cpu-features.h
index a3f11ba..28be3e0 100644
--- a/sysdeps/x86/include/cpu-features.h
+++ b/sysdeps/x86/include/cpu-features.h
@@ -43,11 +43,11 @@ enum
/* Only used directly in cpu-features.c. */
#define CPU_FEATURE_SET(ptr, name) \
- ptr->features[index_cpu_##name].usable.reg_##name |= bit_cpu_##name;
+ ptr->features[index_cpu_##name].active.reg_##name |= bit_cpu_##name;
#define CPU_FEATURE_UNSET(ptr, name) \
- ptr->features[index_cpu_##name].usable.reg_##name &= ~bit_cpu_##name;
-#define CPU_FEATURE_SET_USABLE(ptr, name) \
- ptr->features[index_cpu_##name].usable.reg_##name \
+ ptr->features[index_cpu_##name].active.reg_##name &= ~bit_cpu_##name;
+#define CPU_FEATURE_SET_ACTIVE(ptr, name) \
+ ptr->features[index_cpu_##name].active.reg_##name \
|= ptr->features[index_cpu_##name].cpuid.reg_##name & bit_cpu_##name;
#define CPU_FEATURE_PREFERRED_P(ptr, name) \
((ptr->preferred[index_arch_##name] & bit_arch_##name) != 0)
@@ -55,10 +55,14 @@ enum
#define CPU_FEATURE_CHECK_P(ptr, name, check) \
((ptr->features[index_cpu_##name].check.reg_##name \
& bit_cpu_##name) != 0)
-#define CPU_FEATURE_CPU_P(ptr, name) \
+#define CPU_FEATURE_PRESENT_P(ptr, name) \
CPU_FEATURE_CHECK_P (ptr, name, cpuid)
+#define CPU_FEATURE_ACTIVE_P(ptr, name) \
+ CPU_FEATURE_CHECK_P (ptr, name, active)
+#define CPU_FEATURE_CPU_P(ptr, name) \
+ CPU_FEATURE_PRESENT_P (ptr, name)
#define CPU_FEATURE_USABLE_P(ptr, name) \
- CPU_FEATURE_CHECK_P (ptr, name, usable)
+ CPU_FEATURE_ACTIVE_P (ptr, name)
/* HAS_CPU_FEATURE evaluates to true if CPU supports the feature. */
#define HAS_CPU_FEATURE(name) \
@@ -849,8 +853,8 @@ struct cpuid_feature_internal
};
union
{
- unsigned int usable_array[4];
- struct cpuid_registers usable;
+ unsigned int active_array[4];
+ struct cpuid_registers active;
};
};