1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-08 17:42:12 +03:00

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>
This commit is contained in:
H.J. Lu
2021-06-05 06:42:20 -07:00
parent 5b8d271571
commit 7c124e3714
14 changed files with 567 additions and 561 deletions

View File

@@ -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;
};
};