From e8078d2ac516560ce54b8383f34372853402629c Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 29 Mar 2021 13:13:32 -0700 Subject: [PATCH] x86: Add AVX512VL_Usable and AVX512BW_Usable Add AVX512VL_Usable and AVX512BW_Usable for backporting string/memory functions optimized with 256-bit EVEX. --- sysdeps/x86/cpu-features.c | 8 ++++++++ sysdeps/x86/cpu-features.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/sysdeps/x86/cpu-features.c b/sysdeps/x86/cpu-features.c index 5ddc8eebf44..4be4be7051b 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 1f60296e7b6..177aa0ebc80 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__ */ -- 2.47.2