1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-11-10 22:59:13 +00:00

add support to feature intel avx512_vnni

This commit is contained in:
Leslie-Fang 2019-08-08 22:06:23 +08:00
parent 88d98cedd3
commit 8f91df526d
3 changed files with 6 additions and 0 deletions

View file

@ -649,6 +649,7 @@ const char* cpu_feature_str(cpu_feature_t feature)
{ CPU_FEATURE_SGX, "sgx" },
{ CPU_FEATURE_RDSEED, "rdseed" },
{ CPU_FEATURE_ADX, "adx" },
{ CPU_FEATURE_AVX512VNNI, "avx512_vnni" },
};
unsigned i, n = COUNT_OF(matchtable);
if (n != NUM_CPU_FEATURES) {

View file

@ -489,6 +489,7 @@ typedef enum {
CPU_FEATURE_SGX, /*!< SGX extensions. Non-autoritative, check cpu_id_t::sgx::present to verify presence */
CPU_FEATURE_RDSEED, /*!< RDSEED instruction */
CPU_FEATURE_ADX, /*!< ADX extensions (arbitrary precision) */
CPU_FEATURE_AVX512VNNI, /*!< AVX-512 Vector Neural Network Instructions */
/* termination: */
NUM_CPU_FEATURES,
} cpu_feature_t;

View file

@ -406,6 +406,9 @@ static void load_intel_features(struct cpu_raw_data_t* raw, struct cpu_id_t* dat
{ 30, CPU_FEATURE_AVX512BW },
{ 31, CPU_FEATURE_AVX512VL },
};
const struct feature_map_t matchtable_ecx7[] = {
{ 11, CPU_FEATURE_AVX512VNNI },
};
if (raw->basic_cpuid[0][0] >= 1) {
match_features(matchtable_edx1, COUNT_OF(matchtable_edx1), raw->basic_cpuid[1][3], data);
match_features(matchtable_ecx1, COUNT_OF(matchtable_ecx1), raw->basic_cpuid[1][2], data);
@ -416,6 +419,7 @@ static void load_intel_features(struct cpu_raw_data_t* raw, struct cpu_id_t* dat
// detect TSX/AVX512:
if (raw->basic_cpuid[0][0] >= 7) {
match_features(matchtable_ebx7, COUNT_OF(matchtable_ebx7), raw->basic_cpuid[7][1], data);
match_features(matchtable_ecx7, COUNT_OF(matchtable_ecx7), raw->basic_cpuid[7][2], data);
}
}