x86: Add AVX512VL_Usable and AVX512BW_Usable

Add AVX512VL_Usable and AVX512BW_Usable for backporting string/memory
functions optimized with 256-bit EVEX.
This commit is contained in:
H.J. Lu 2021-03-29 13:13:32 -07:00
parent b2e59f87ae
commit e8078d2ac5
2 changed files with 12 additions and 0 deletions

View File

@ -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]

View File

@ -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__ */