diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2021-03-29 13:13:32 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2022-01-27 12:47:19 -0800 |
commit | e8078d2ac516560ce54b8383f34372853402629c (patch) | |
tree | d14b1e6032bc42c800ba608fd1e540baccc75c5f | |
parent | b2e59f87ae10e5874bb150bd87f3b92b47b1090e (diff) | |
download | glibc-e8078d2ac516560ce54b8383f34372853402629c.tar.gz glibc-e8078d2ac516560ce54b8383f34372853402629c.tar.xz glibc-e8078d2ac516560ce54b8383f34372853402629c.zip |
x86: Add AVX512VL_Usable and AVX512BW_Usable
Add AVX512VL_Usable and AVX512BW_Usable for backporting string/memory functions optimized with 256-bit EVEX.
-rw-r--r-- | sysdeps/x86/cpu-features.c | 8 | ||||
-rw-r--r-- | sysdeps/x86/cpu-features.h | 4 |
2 files changed, 12 insertions, 0 deletions
diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index 5ddc8eebf4..4be4be7051 100644 --- a/sysdeps/x86/cpu-features.c +++ b/sysdeps/x86/cpu-features.c @@ -130,6 +130,14 @@ get_common_indeces (struct cpu_features *cpu_features, { cpu_features->feature[index_arch_AVX512F_Usable] |= bit_arch_AVX512F_Usable; + /* Determine if AVX512VL is usable. */ + if (CPU_FEATURES_CPU_P (cpu_features, AVX512VL)) + cpu_features->feature[index_arch_AVX512VL_Usable] + |= bit_arch_AVX512VL_Usable; + /* Determine if AVX512BW is usable. */ + if (CPU_FEATURES_CPU_P (cpu_features, AVX512BW)) + cpu_features->feature[index_arch_AVX512BW_Usable] + |= bit_arch_AVX512BW_Usable; /* Determine if AVX512DQ is usable. */ if (CPU_FEATURES_CPU_P (cpu_features, AVX512DQ)) cpu_features->feature[index_arch_AVX512DQ_Usable] diff --git a/sysdeps/x86/cpu-features.h b/sysdeps/x86/cpu-features.h index 1f60296e7b..177aa0ebc8 100644 --- a/sysdeps/x86/cpu-features.h +++ b/sysdeps/x86/cpu-features.h @@ -42,6 +42,8 @@ #define bit_arch_XSAVEC_Usable (1 << 22) #define bit_arch_Prefer_FSRM (1 << 23) #define bit_arch_Prefer_AVX2_STRCMP (1 << 24) +#define bit_arch_AVX512VL_Usable (1 << 25) +#define bit_arch_AVX512BW_Usable (1 << 26) /* CPUID Feature flags. */ @@ -268,6 +270,8 @@ extern const struct cpu_features *__get_cpu_features (void) # define index_arch_XSAVEC_Usable FEATURE_INDEX_1 # define index_arch_Prefer_FSRM FEATURE_INDEX_1 # define index_arch_Prefer_AVX2_STRCMP FEATURE_INDEX_1 +# define index_arch_AVX512VL_Usable FEATURE_INDEX_1 +# define index_arch_AVX512BW_Usable FEATURE_INDEX_1 #endif /* !__ASSEMBLER__ */ |