aboutsummaryrefslogtreecommitdiff
path: root/lib/Target/X86/X86Subtarget.cpp
diff options
context:
space:
mode:
authorJeff Cohen <jeffc@jolt-lang.org>2006-01-28 19:48:34 +0000
committerJeff Cohen <jeffc@jolt-lang.org>2006-01-28 19:48:34 +0000
commit216d281d0a2b005585f449a512025e5062152f58 (patch)
tree80897714940b1d7186ec6cf53f6793bf6d8e3b25 /lib/Target/X86/X86Subtarget.cpp
parent24200d63fda0a82438c9fe2852375c47c44d1a20 (diff)
Correctly determine CPU vendor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 63927fa633..6e36343bb0 100644
--- a/lib/Target/X86/X86Subtarget.cpp
+++ b/lib/Target/X86/X86Subtarget.cpp
@@ -68,18 +68,12 @@ static const char *GetCurrentX86CPU() {
bool Em64T = EDX & (1 << 29);
union {
- unsigned u[12];
- char c[48];
+ unsigned u[3];
+ char c[12];
} text;
- GetCpuIDAndInfo(0x80000002, text.u+0, text.u+1, text.u+2, text.u+3);
- GetCpuIDAndInfo(0x80000003, text.u+4, text.u+5, text.u+6, text.u+7);
- GetCpuIDAndInfo(0x80000004, text.u+8, text.u+9, text.u+10, text.u+11);
- char *t = text.c;
- while (*t == ' ')
- t++;
-
- if (memcmp(t, "Intel", 5) == 0) {
+ GetCpuIDAndInfo(0, &EAX, text.u+0, text.u+2, text.u+1);
+ if (memcmp(text.c, "GenuineIntel", 12) == 0) {
switch (Family) {
case 3:
return "i386";
@@ -118,7 +112,7 @@ static const char *GetCurrentX86CPU() {
default:
return "generic";
}
- } else if (memcmp(t, "AMD", 3) == 0) {
+ } else if (memcmp(text.c, "AuthenticAMD", 12) == 0) {
// FIXME: fill in remaining family/model combinations
switch (Family) {
case 15: