-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
detect Meteor Lake CPU model #247
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,12 @@ | |
|
||
#include <cpuinfo.h> | ||
#include <x86/api.h> | ||
#include <x86/cpuid.h> | ||
|
||
CPUINFO_INTERNAL bool cpuinfo_x86_detect_pcores(){ | ||
if (((cpuid(0x1A).eax >> 24) & 0xFFF) == 0x40) return true; | ||
return false; | ||
} | ||
|
||
enum cpuinfo_uarch cpuinfo_x86_decode_uarch( | ||
enum cpuinfo_vendor vendor, | ||
|
@@ -167,6 +173,26 @@ enum cpuinfo_uarch cpuinfo_x86_decode_uarch( | |
case 0x7D: // Ice Lake-Y | ||
case 0x7E: // Ice Lake-U | ||
return cpuinfo_uarch_sunny_cove; | ||
case 0xA7: // Rocket Lake | ||
return cpuinfo_uarch_cypress_cove; | ||
case 0x9A: // Alder Lake | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Alder Lake pcore can also have a model 0x97: The CPUID instruction gives information about the core, on which it is executed. It is different for P cores and E cores. The CPUID on Alder Lake is family 6 model 0x9A for both cores when enabled. The CPUID is changed to family 6 model 0x97 when E cores are disabled and AVX512 is enabled. CPUID leaf 7 EDX bit 15 indicates a hybrid design. CPUID leaf 1A EAX bit 24-31 indicates the type of core, according to "Game Dev Guide for Alder Lake Performance Hybrid Architecture", https://www.intel.com/content/www/us/en/developer/articles/guide/alder-lake-developer-guide.html See my discussion at https://www.agner.org/forum/viewtopic.php?f=1&t=79 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New model IDs have been added for Rocket, Alder, and Meteor Lake. |
||
if (cpuinfo_x86_detect_pcores()){ | ||
return cpuinfo_uarch_golden_cove; | ||
} else { // E Core | ||
return cpuinfo_uarch_gracemont; | ||
} | ||
case 0xB7: // Raptor Lake | ||
if (cpuinfo_x86_detect_pcores()){ | ||
return cpuinfo_uarch_raptor_cove; | ||
} else { // E Core | ||
return cpuinfo_uarch_gracemont; | ||
} | ||
case 0xAA: // Meteor Lake | ||
if (cpuinfo_x86_detect_pcores()){ | ||
return cpuinfo_uarch_redwood_cove; | ||
} else { // E/LP-E Core | ||
return cpuinfo_uarch_crestmont; | ||
} | ||
|
||
/* Low-power cores */ | ||
case 0x1C: // Diamondville, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this work on pcore-only CPUs? I'm thinking the reverse logic should be used?
cpuinfo_x86_detect_hybrid_ecore(){
If the hybrid is not present, pcore should be assumed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, we have modified it to check whether it is a hybrid architecture.