Skip to content

Commit

Permalink
Add Raptor Lake-P and Raptor Lake-HX/S detection (#300)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykola Hohsadze authored Mar 6, 2023
1 parent 79c0d7d commit 5607a68
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/impl_x86__base_implementation.inl
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,8 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info) {
// https://en.wikichip.org/wiki/intel/microarchitectures/rocket_lake
return INTEL_RCL;
case CPUID(0x06, 0xB7):
case CPUID(0x06, 0xBA):
case CPUID(0x06, 0xBF):
// https://en.wikichip.org/wiki/intel/microarchitectures/raptor_lake
return INTEL_RPL;
case CPUID(0x06, 0x85):
Expand Down
32 changes: 32 additions & 0 deletions test/cpuinfo_x86_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,38 @@ TEST_F(CpuidX86Test, INTEL_HASWELL_LZCNT) {
EXPECT_TRUE(info.features.lzcnt);
}

// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00B06A2_RaptorLakeP_03_CPUID.txt
TEST_F(CpuidX86Test, INTEL_RAPTOR_LAKE_P) {
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000020, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000B06A3, 0x00400800, 0x7FFAFBFF, 0xBFEBFBFF}},
{{0x80000000, 0}, Leaf{0x80000008, 0x00000000, 0x00000000, 0x00000000}},
{{0x80000001, 0}, Leaf{0x00000000, 0x00000000, 0x00000121, 0x2C100000}},
});
const auto info = GetX86Info();

EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0xBA);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_RPL);
}

// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00B06F2_RaptorLakeS_02_CPUID.txt
TEST_F(CpuidX86Test, INTEL_RAPTOR_LAKE_S) {
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000020, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000B06F2, 0x00800800, 0x7FFAFBFF, 0xBFEBFBFF}},
{{0x80000000, 0}, Leaf{0x80000008, 0x00000000, 0x00000000, 0x00000000}},
{{0x80000001, 0}, Leaf{0x00000000, 0x00000000, 0x00000121, 0x2C100000}},
});
const auto info = GetX86Info();

EXPECT_STREQ(info.vendor, CPU_FEATURES_VENDOR_GENUINE_INTEL);
EXPECT_EQ(info.family, 0x06);
EXPECT_EQ(info.model, 0xBF);
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_RPL);
}

// https://github.com/google/cpu_features/issues/200
// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00206F2_Eagleton_CPUID.txt
#if defined(CPU_FEATURES_OS_WINDOWS)
Expand Down

0 comments on commit 5607a68

Please sign in to comment.