-
Notifications
You must be signed in to change notification settings - Fork 18k
[X86] AMD Zen 6 Initial enablement #179150
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
Changes from all 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 |
|---|---|---|
|
|
@@ -105,6 +105,7 @@ enum ProcessorSubtypes { | |
| INTEL_COREI7_ARROWLAKE_S, | ||
| INTEL_COREI7_PANTHERLAKE, | ||
| AMDFAM1AH_ZNVER5, | ||
| AMDFAM1AH_ZNVER6, | ||
| INTEL_COREI7_DIAMONDRAPIDS, | ||
| INTEL_COREI7_NOVALAKE, | ||
| CPU_SUBTYPE_MAX | ||
|
|
@@ -837,20 +838,27 @@ getAMDProcessorTypeAndSubtype(unsigned Family, unsigned Model, | |
| case 26: | ||
| CPU = "znver5"; | ||
| Type = AMDFAM1AH; | ||
| if (Model <= 0x77) { | ||
| if (Model <= 0x4f || (Model >= 0x60 && Model <= 0x77) || | ||
| (Model >= 0xd0 && Model <= 0xd7)) { | ||
|
Contributor
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. Why are we removing the model comments here?
Contributor
Author
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. Weisshorn is excluded and we have few models included as well. The model numbers are broader now.
Contributor
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. So update the comments to match Host.cpp? |
||
| // Models 00h-0Fh (Breithorn). | ||
| // Models 10h-1Fh (Breithorn-Dense). | ||
| // Models 20h-2Fh (Strix 1). | ||
| // Models 30h-37h (Strix 2). | ||
| // Models 38h-3Fh (Strix 3). | ||
| // Models 40h-4Fh (Granite Ridge). | ||
| // Models 50h-5Fh (Weisshorn). | ||
| // Models 60h-6Fh (Krackan1). | ||
| // Models 70h-77h (Sarlak). | ||
| // Models D0h-D7h (Annapurna). | ||
| CPU = "znver5"; | ||
| Subtype = AMDFAM1AH_ZNVER5; | ||
| break; // "znver5" | ||
| } | ||
| if ((Model >= 0x50 && Model <= 0x5f) || (Model >= 0x80 && Model <= 0xcf) || | ||
| (Model >= 0xd8 && Model <= 0xe7)) { | ||
| CPU = "znver6"; | ||
| Subtype = AMDFAM1AH_ZNVER6; | ||
| break; // "znver6" | ||
| } | ||
| break; | ||
| default: | ||
| break; // Unknown AMD CPU. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -146,6 +146,7 @@ enum CPUKind { | |
| CK_ZNVER3, | ||
| CK_ZNVER4, | ||
| CK_ZNVER5, | ||
| CK_ZNVER6, | ||
| CK_x86_64, | ||
| CK_x86_64_v2, | ||
| CK_x86_64_v3, | ||
|
|
||
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.
Values in this enum have to be synced with analogous enum in libgcc. In GCC (gcc/common/config/i386/i386-cpuinfo.h) in enum processor_subtypes AMDFAM1AH_ZNVER6 has different value than here (it's after novalake). Entry in X86TargetParser.def would need to be adjusted to match the one here
The table is out-of-sync between gcc and llvm anyway, I have a PR #171172 to sync it and make it more robust, I hope to get around to having it merged soon