From 1e253a772819a5cdb09907a302ce2cb491120a34 Mon Sep 17 00:00:00 2001 From: Andrei Kurushin Date: Thu, 18 Aug 2022 11:40:24 +0300 Subject: [PATCH] add amd cato (#267) * add AMD RX-8125, RX-8120, and A9-9820 detection --- src/impl_x86__base_implementation.inl | 1 + test/cpuinfo_x86_test.cc | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/impl_x86__base_implementation.inl b/src/impl_x86__base_implementation.inl index 64ea068..7d4c34f 100644 --- a/src/impl_x86__base_implementation.inl +++ b/src/impl_x86__base_implementation.inl @@ -705,6 +705,7 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info) { // https://en.wikichip.org/wiki/amd/microarchitectures/excavator return AMD_EXCAVATOR; case CPUID(0x16, 0x00): + case CPUID(0x16, 0x26): return AMD_JAGUAR; case CPUID(0x16, 0x30): return AMD_PUMA; diff --git a/test/cpuinfo_x86_test.cc b/test/cpuinfo_x86_test.cc index 69551e6..5a19f26 100644 --- a/test/cpuinfo_x86_test.cc +++ b/test/cpuinfo_x86_test.cc @@ -652,6 +652,28 @@ TEST_F(CpuidX86Test, AMD_K16_PUMA_BEEMA) { EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_PUMA); } +// https://github.com/InstLatx64/InstLatx64/blob/master/AuthenticAMD/AuthenticAMD0720F61_K16_Cato_CPUID.txt +TEST_F(CpuidX86Test, AMD_K16_CATO) { + cpu().SetLeaves({ + {{0x00000000, 0}, Leaf{0x0000000D, 0x68747541, 0x444D4163, 0x69746E65}}, + {{0x00000001, 0}, Leaf{0x00720F61, 0x00080800, 0x3ED8220B, 0x178BFBFF}}, + {{0x00000007, 0}, Leaf{0x00000000, 0x00000008, 0x00000000, 0x00000000}}, + {{0x80000000, 0}, Leaf{0x8000001E, 0x68747541, 0x444D4163, 0x69746E65}}, + {{0x80000001, 0}, Leaf{0x00720F61, 0x00000000, 0x154837FF, 0x2FD3FBFF}}, + {{0x80000002, 0}, Leaf{0x20444D41, 0x392D3941, 0x20303238, 0x636F7250}}, + {{0x80000003, 0}, Leaf{0x6F737365, 0x00000072, 0x00000000, 0x00000000}}, + {{0x80000004, 0}, Leaf{0x00000000, 0x00000000, 0x00000000, 0x00000000}}, + }); + const auto info = GetX86Info(); + + EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD); + EXPECT_EQ(info.family, 0x16); + EXPECT_EQ(info.model, 0x26); + EXPECT_STREQ(info.brand_string, + "AMD A9-9820 Processor"); + EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_JAGUAR); +} + // http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0820F01_K17_Dali_CPUID.txt TEST_F(CpuidX86Test, AMD_K17_ZEN_DALI) { cpu().SetLeaves({