[llvm-commits] CVS: llvm/lib/Target/X86/X86Subtarget.cpp
Anton Korobeynikov
asl at math.spbu.ru
Fri Mar 23 16:47:20 PDT 2007
Changes in directory llvm/lib/Target/X86:
X86Subtarget.cpp updated: 1.52 -> 1.53
---
Log message:
Autodetect MMX & SSE stuff for AMD processors
---
Diffs of the changes: (+11 -10)
X86Subtarget.cpp | 21 +++++++++++----------
1 files changed, 11 insertions(+), 10 deletions(-)
Index: llvm/lib/Target/X86/X86Subtarget.cpp
diff -u llvm/lib/Target/X86/X86Subtarget.cpp:1.52 llvm/lib/Target/X86/X86Subtarget.cpp:1.53
--- llvm/lib/Target/X86/X86Subtarget.cpp:1.52 Tue Jan 30 14:08:38 2007
+++ llvm/lib/Target/X86/X86Subtarget.cpp Fri Mar 23 18:46:48 2007
@@ -106,19 +106,20 @@
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;
- if ((EDX >> 25) & 0x1) X86SSELevel = SSE1;
- if ((EDX >> 26) & 0x1) X86SSELevel = SSE2;
- if (ECX & 0x1) X86SSELevel = SSE3;
+ X86::GetCpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX);
+
+ if ((EDX >> 23) & 0x1) X86SSELevel = MMX;
+ if ((EDX >> 25) & 0x1) X86SSELevel = SSE1;
+ 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
+ }
}
static const char *GetCurrentX86CPU() {
@@ -203,10 +204,10 @@
}
case 15:
switch (Model) {
+ case 1: return "opteron";
case 5: return "athlon-fx"; // also opteron
default: return "athlon64";
}
-
default:
return "generic";
}
More information about the llvm-commits
mailing list