mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Clean up and improve Zen CPU detection
This commit is contained in:
parent
bc7b2ed172
commit
9b52b6c39a
@ -1025,17 +1025,14 @@ getAMDProcessorTypeAndSubtype(unsigned Family, unsigned Model,
|
|||||||
*Type = X86::AMD_BTVER2;
|
*Type = X86::AMD_BTVER2;
|
||||||
break;
|
break;
|
||||||
case 23:
|
case 23:
|
||||||
CPU = "znver1";
|
|
||||||
*Type = X86::AMDFAM17H;
|
*Type = X86::AMDFAM17H;
|
||||||
if ((Model >= 0x30 && Model <= 0x3f) || Model == 0x71) {
|
if (Model >= 0x30) {
|
||||||
CPU = "znver2";
|
CPU = "znver2";
|
||||||
*Subtype = X86::AMDFAM17H_ZNVER2;
|
*Subtype = X86::AMDFAM17H_ZNVER2;
|
||||||
break; // 30h-3fh, 71h: Zen2
|
break; // >30h: Zen2
|
||||||
}
|
|
||||||
if (Model <= 0x0f) {
|
|
||||||
*Subtype = X86::AMDFAM17H_ZNVER1;
|
|
||||||
break; // 00h-0Fh: Zen1
|
|
||||||
}
|
}
|
||||||
|
CPU = "znver1";
|
||||||
|
*Subtype = X86::AMDFAM17H_ZNVER1;
|
||||||
break;
|
break;
|
||||||
case 25:
|
case 25:
|
||||||
if (testFeature(X86::FEATURE_AVX512VBMI2)) {
|
if (testFeature(X86::FEATURE_AVX512VBMI2)) {
|
||||||
@ -1046,10 +1043,7 @@ getAMDProcessorTypeAndSubtype(unsigned Family, unsigned Model,
|
|||||||
}
|
}
|
||||||
CPU = "znver3";
|
CPU = "znver3";
|
||||||
*Type = X86::AMDFAM19H;
|
*Type = X86::AMDFAM19H;
|
||||||
if (Model <= 0x0f || Model == 0x21) {
|
*Subtype = X86::AMDFAM19H_ZNVER3;
|
||||||
*Subtype = X86::AMDFAM19H_ZNVER3;
|
|
||||||
break; // 00h-0Fh: Zen3
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break; // Unknown AMD CPU.
|
break; // Unknown AMD CPU.
|
||||||
|
Loading…
Reference in New Issue
Block a user