mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
Autodetect MMX & SSE stuff for AMD processors
llvm-svn: 35292
This commit is contained in:
parent
ad01036d5c
commit
63bff8af0c
@ -107,8 +107,6 @@ void X86Subtarget::AutoDetectSubtargetFeatures() {
|
||||
if (X86::GetCpuIDAndInfo(0, &EAX, text.u+0, text.u+2, text.u+1))
|
||||
return;
|
||||
|
||||
// FIXME: support for AMD family of processors.
|
||||
if (memcmp(text.c, "GenuineIntel", 12) == 0) {
|
||||
X86::GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX);
|
||||
|
||||
if ((EDX >> 23) & 0x1) X86SSELevel = MMX;
|
||||
@ -116,8 +114,11 @@ void X86Subtarget::AutoDetectSubtargetFeatures() {
|
||||
if ((EDX >> 26) & 0x1) X86SSELevel = SSE2;
|
||||
if (ECX & 0x1) X86SSELevel = SSE3;
|
||||
|
||||
if (memcmp(text.c, "GenuineIntel", 12) == 0) {
|
||||
X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
|
||||
HasX86_64 = (EDX >> 29) & 0x1;
|
||||
} else if (memcmp(text.c, "AuthenticAMD", 12) == 0) {
|
||||
// FIXME: Correctly check for 64-bit stuff
|
||||
}
|
||||
}
|
||||
|
||||
@ -203,10 +204,10 @@ static const char *GetCurrentX86CPU() {
|
||||
}
|
||||
case 15:
|
||||
switch (Model) {
|
||||
case 1: return "opteron";
|
||||
case 5: return "athlon-fx"; // also opteron
|
||||
default: return "athlon64";
|
||||
}
|
||||
|
||||
default:
|
||||
return "generic";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user