Skip to content

Commit

Permalink
Add AMD ZEN4 Genoa detection (#329)
Browse files Browse the repository at this point in the history
  • Loading branch information
toor1245 authored Sep 5, 2023
1 parent 199d299 commit 248aa1b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/impl_x86__base_implementation.inl
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info) {
// https://en.wikichip.org/wiki/amd/microarchitectures/zen_3
return AMD_ZEN3;
case CPUID(0x19, 0x10):
case CPUID(0x19, 0x11):
case CPUID(0x19, 0x61):
case CPUID(0x19, 0x74):
// https://en.wikichip.org/wiki/amd/microarchitectures/zen_4
Expand Down
14 changes: 14 additions & 0 deletions test/cpuinfo_x86_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,20 @@ TEST_F(CpuidX86Test, AMD_ZEN2_MENDOCINO) {
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_ZEN2);
}

// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0A10F11_K19_Genoa_02_CPUID.txt
TEST_F(CpuidX86Test, AMD_K19_ZEN4_GENOA) {
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000010, 0x68747541, 0x444D4163, 0x69746E65}},
{{0x00000001, 0}, Leaf{0x00A10F11, 0x00200800, 0x7EFA320B, 0x178BFBFF}},
});
const auto info = GetX86Info();

EXPECT_EQ(info.model, 0x11);
EXPECT_EQ(info.family, 0x19);
EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_ZEN4);
}

// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00906A4_AlderLakeP_00_CPUID.txt
TEST_F(CpuidX86Test, INTEL_ALDER_LAKE_AVX_VNNI) {
cpu().SetOsBackupsExtendedRegisters(true);
Expand Down

0 comments on commit 248aa1b

Please sign in to comment.