Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/google/cpu_features.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMykola Hohsadze <Mykola_Hohsadze@epam.com>2022-10-19 12:36:27 +0300
committerGitHub <noreply@github.com>2022-10-19 12:36:27 +0300
commit627959faee8a51ae46b79d8cedb5525e8803ee66 (patch)
tree7432f488eaa1c5f19dd36214569cdc81596138e7
parent4760834428a2efbae712382f3de1cca289ca6e45 (diff)
Add AMD ZEN4 Raphael detection (#277)
-rw-r--r--src/impl_x86__base_implementation.inl1
-rw-r--r--test/cpuinfo_x86_test.cc21
2 files changed, 22 insertions, 0 deletions
diff --git a/src/impl_x86__base_implementation.inl b/src/impl_x86__base_implementation.inl
index a1e8722..433e93b 100644
--- a/src/impl_x86__base_implementation.inl
+++ b/src/impl_x86__base_implementation.inl
@@ -744,6 +744,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, 0x61):
// https://en.wikichip.org/wiki/amd/microarchitectures/zen_4
return AMD_ZEN4;
default:
diff --git a/test/cpuinfo_x86_test.cc b/test/cpuinfo_x86_test.cc
index 5db3f4b..747b9af 100644
--- a/test/cpuinfo_x86_test.cc
+++ b/test/cpuinfo_x86_test.cc
@@ -884,6 +884,27 @@ TEST_F(CpuidX86Test, AMD_K19_ZEN3) {
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_ZEN3);
}
+// http://users.atw.hu/instlatx64/AuthenticAMD/AuthenticAMD0A60F12_K19_Raphael_01_CPUID.txt
+TEST_F(CpuidX86Test, AMD_K19_ZEN4_RAPHAEL) {
+ cpu().SetLeaves({
+ {{0x00000000, 0}, Leaf{0x00000010, 0x68747541, 0x444D4163, 0x69746E65}},
+ {{0x00000001, 0}, Leaf{0x00A60F12, 0x000C0800, 0x7EF8320B, 0x178BFBFF}},
+ {{0x80000000, 0}, Leaf{0x80000028, 0x68747541, 0x444D4163, 0x69746E65}},
+ {{0x80000001, 0}, Leaf{0x00A60F12, 0x00000000, 0x75C237FF, 0x2FD3FBFF}},
+ {{0x80000002, 0}, Leaf{0x20444D41, 0x657A7952, 0x2035206E, 0x30303637}},
+ {{0x80000003, 0}, Leaf{0x2D362058, 0x65726F43, 0x6F725020, 0x73736563}},
+ {{0x80000004, 0}, Leaf{0x2020726F, 0x20202020, 0x20202020, 0x00202020}},
+ });
+ const auto info = GetX86Info();
+
+ EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_AUTHENTIC_AMD);
+ EXPECT_EQ(info.family, 0x19);
+ EXPECT_EQ(info.model, 0x61);
+ EXPECT_STREQ(info.brand_string,
+ "AMD Ryzen 5 7600X 6-Core Processor ");
+ EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::AMD_ZEN4);
+}
+
// http://users.atw.hu/instlatx64/HygonGenuine/HygonGenuine0900F11_Hygon_01_CPUID.txt
TEST_F(CpuidX86Test, AMD_K18_ZEN_DHYANA_OCTAL_CORE_C86_3250) {
cpu().SetLeaves({