diff --git a/libcpuid/cpuid_main.c b/libcpuid/cpuid_main.c index cb8c573..5f95e89 100644 --- a/libcpuid/cpuid_main.c +++ b/libcpuid/cpuid_main.c @@ -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) { diff --git a/libcpuid/libcpuid.h b/libcpuid/libcpuid.h index d5c8a9b..2b8c6bb 100644 --- a/libcpuid/libcpuid.h +++ b/libcpuid/libcpuid.h @@ -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; diff --git a/libcpuid/recog_intel.c b/libcpuid/recog_intel.c index 9880f01..026c2ff 100644 --- a/libcpuid/recog_intel.c +++ b/libcpuid/recog_intel.c @@ -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); } }