Skip to content

Commit

Permalink
Add Intel Alder Lake N detection (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
toor1245 authored Sep 5, 2023
1 parent 248aa1b commit aeaa84e
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 @@ -647,6 +647,7 @@ X86Microarchitecture GetX86Microarchitecture(const X86Info* info) {
}
case CPUID(0x06, 0x97):
case CPUID(0x06, 0x9A):
case CPUID(0x06, 0xBE):
// https://en.wikichip.org/wiki/intel/microarchitectures/alder_lake
return INTEL_ADL;
case CPUID(0x06, 0xA5):
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 @@ -1722,6 +1722,20 @@ TEST_F(CpuidX86Test, INTEL_RAPTOR_LAKE_S) {
EXPECT_EQ(GetX86Microarchitecture(&info), X86Microarchitecture::INTEL_RPL);
}

// http://users.atw.hu/instlatx64/GenuineIntel/GenuineIntel00B06E0_AlderLakeN_03_CPUID.txt
TEST_F(CpuidX86Test, INTEL_ALDER_LAKE_N) {
cpu().SetLeaves({
{{0x00000000, 0}, Leaf{0x00000020, 0x756E6547, 0x6C65746E, 0x49656E69}},
{{0x00000001, 0}, Leaf{0x000B06E0, 0x00800800, 0x7FFAFBBF, 0xBFEBFBFF}},
});
const auto info = GetX86Info();

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

// 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 aeaa84e

Please sign in to comment.