diff --git a/libcpuid/recog_amd.c b/libcpuid/recog_amd.c index 87ddc85..4fa83cc 100644 --- a/libcpuid/recog_amd.c +++ b/libcpuid/recog_amd.c @@ -344,9 +344,18 @@ static void load_amd_features(struct cpu_raw_data_t* raw, struct cpu_id_t* data) if (raw->ext_cpuid[0][0] >= 0x80000007) match_features(matchtable_edx87, COUNT_OF(matchtable_edx87), raw->ext_cpuid[7][3], data); if (raw->ext_cpuid[0][0] >= 0x8000001a) { - /* We have the extended info about SSE unit size */ + /* We have the extended info about SSE unit size + Extracted from BKDG, about CPUID_Fn8000001A_EAX [Performance Optimization Identifiers] (Core::X86::Cpuid::PerfOptId): + - bit 2: FP256 + - bit 1: MOVU + - bit 0: FP128 */ data->detection_hints[CPU_HINT_SSE_SIZE_AUTH] = 1; - data->sse_size = (raw->ext_cpuid[0x1a][0] & 1) ? 128 : 64; + if ((raw->ext_cpuid[0x1a][0] >> 2) & 1) + data->sse_size = 256; + else if ((raw->ext_cpuid[0x1a][0]) & 1) + data->sse_size = 128; + else + data->sse_size = 64; } } diff --git a/tests/amd/zen2/ryzen5-matisse.test b/tests/amd/zen2/ryzen5-matisse.test index 23ed254..7932c57 100644 --- a/tests/amd/zen2/ryzen5-matisse.test +++ b/tests/amd/zen2/ryzen5-matisse.test @@ -73,6 +73,6 @@ ext_cpuid[31]=0001000f 0000016f 000001fd 00000001 64 64 -1 -64 (authoritative) +256 (authoritative) Ryzen 5 (Matisse) fpu vme de pse tsc msr pae mce cx8 apic mtrr sep pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht pni pclmul monitor ssse3 cx16 sse4_1 sse4_2 syscall movbe popcnt aes xsave osxsave avx mmxext nx fxsr_opt rdtscp lm lahf_lm cmp_legacy svm abm misalignsse sse4a 3dnowprefetch osvw ibs skinit wdt ts ttp tm_amd hwpstate constant_tsc fma3 f16c rdrand cpb aperfmperf avx2 bmi1 bmi2