mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[X86] Simplify the getHostCPUName for AMD family 6 and 15.
As far as I can tell we can simply distinguish based on features rather than model number. Many of the strings we were previously using are treated the same by the backend. llvm-svn: 307884
This commit is contained in:
parent
842285000a
commit
27a05640e7
@ -336,13 +336,10 @@ enum ProcessorSubtypes {
|
|||||||
AMDPENTIUM_K62,
|
AMDPENTIUM_K62,
|
||||||
AMDPENTIUM_K63,
|
AMDPENTIUM_K63,
|
||||||
AMDPENTIUM_GEODE,
|
AMDPENTIUM_GEODE,
|
||||||
AMDATHLON_TBIRD,
|
AMDATHLON_CLASSIC,
|
||||||
AMDATHLON_MP,
|
|
||||||
AMDATHLON_XP,
|
AMDATHLON_XP,
|
||||||
|
AMDATHLON_K8,
|
||||||
AMDATHLON_K8SSE3,
|
AMDATHLON_K8SSE3,
|
||||||
AMDATHLON_OPTERON,
|
|
||||||
AMDATHLON_FX,
|
|
||||||
AMDATHLON_64,
|
|
||||||
CPU_SUBTYPE_MAX
|
CPU_SUBTYPE_MAX
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -868,38 +865,20 @@ static void getAMDProcessorTypeAndSubtype(unsigned Family, unsigned Model,
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
*Type = AMDATHLON;
|
*Type = AMDATHLON;
|
||||||
switch (Model) {
|
if (Features & (1 << FEATURE_SSE)) {
|
||||||
case 4:
|
|
||||||
*Subtype = AMDATHLON_TBIRD;
|
|
||||||
break; // "athlon-tbird"
|
|
||||||
case 6:
|
|
||||||
case 7:
|
|
||||||
case 8:
|
|
||||||
*Subtype = AMDATHLON_MP;
|
|
||||||
break; // "athlon-mp"
|
|
||||||
case 10:
|
|
||||||
*Subtype = AMDATHLON_XP;
|
*Subtype = AMDATHLON_XP;
|
||||||
break; // "athlon-xp"
|
break; // "athlon-xp"
|
||||||
}
|
}
|
||||||
break;
|
*Subtype = AMDATHLON_CLASSIC;
|
||||||
|
break; // "athlon"
|
||||||
case 15:
|
case 15:
|
||||||
*Type = AMDATHLON;
|
*Type = AMDATHLON;
|
||||||
if (Features & (1 << FEATURE_SSE3)) {
|
if (Features & (1 << FEATURE_SSE3)) {
|
||||||
*Subtype = AMDATHLON_K8SSE3;
|
*Subtype = AMDATHLON_K8SSE3;
|
||||||
break; // "k8-sse3"
|
break; // "k8-sse3"
|
||||||
}
|
}
|
||||||
switch (Model) {
|
*Subtype = AMDATHLON_K8;
|
||||||
case 1:
|
break; // "k8"
|
||||||
*Subtype = AMDATHLON_OPTERON;
|
|
||||||
break; // "opteron"
|
|
||||||
case 5:
|
|
||||||
*Subtype = AMDATHLON_FX;
|
|
||||||
break; // "athlon-fx"; also opteron
|
|
||||||
default:
|
|
||||||
*Subtype = AMDATHLON_64;
|
|
||||||
break; // "athlon64"
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 16:
|
case 16:
|
||||||
*Type = AMDFAM10H; // "amdfam10"
|
*Type = AMDFAM10H; // "amdfam10"
|
||||||
switch (Model) {
|
switch (Model) {
|
||||||
@ -1168,20 +1147,14 @@ StringRef sys::getHostCPUName() {
|
|||||||
}
|
}
|
||||||
case AMDATHLON:
|
case AMDATHLON:
|
||||||
switch (Subtype) {
|
switch (Subtype) {
|
||||||
case AMDATHLON_TBIRD:
|
case AMDATHLON_CLASSIC:
|
||||||
return "athlon-tbird";
|
return "athlon";
|
||||||
case AMDATHLON_MP:
|
|
||||||
return "athlon-mp";
|
|
||||||
case AMDATHLON_XP:
|
case AMDATHLON_XP:
|
||||||
return "athlon-xp";
|
return "athlon-xp";
|
||||||
|
case AMDATHLON_K8:
|
||||||
|
return "k8";
|
||||||
case AMDATHLON_K8SSE3:
|
case AMDATHLON_K8SSE3:
|
||||||
return "k8-sse3";
|
return "k8-sse3";
|
||||||
case AMDATHLON_OPTERON:
|
|
||||||
return "opteron";
|
|
||||||
case AMDATHLON_FX:
|
|
||||||
return "athlon-fx";
|
|
||||||
case AMDATHLON_64:
|
|
||||||
return "athlon64";
|
|
||||||
default:
|
default:
|
||||||
llvm_unreachable("Unexpected subtype!");
|
llvm_unreachable("Unexpected subtype!");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user