Flesh out AMD family/models.
authorJeff Cohen <jeffc@jolt-lang.org>
Sat, 28 Jan 2006 20:30:18 +0000 (20:30 +0000)
committerJeff Cohen <jeffc@jolt-lang.org>
Sat, 28 Jan 2006 20:30:18 +0000 (20:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25755 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86Subtarget.cpp

index 6e36343bb041adc5540554489e4fd255adce3ed6..2a65013c2313b53efc259f696089a102c433b2ac 100644 (file)
@@ -113,10 +113,35 @@ static const char *GetCurrentX86CPU() {
       return "generic";
     }
   } else if (memcmp(text.c, "AuthenticAMD", 12) == 0) {
-    // FIXME: fill in remaining family/model combinations
+    // FIXME: this poorly matches the generated SubtargetFeatureKV table.  There
+    // appears to be no way to generate the wide variety of AMD-specific targets
+    // from the information returned from CPUID.
     switch (Family) {
+      case 4:
+        return "i486";
+      case 5:
+        switch (Model) {
+        case 6:
+        case 7:  return "k6";
+        case 8:  return "k6-2";
+        case 9:
+        case 13: return "k6-3";
+        default: return "pentium";
+        }
+      case 6:
+        switch (Model) {
+        case 4:  return "athlon-tbird";
+        case 6:
+        case 7:
+        case 8:  return "athlon-mp";
+        case 10: return "athlon-xp";
+        default: return "athlon";
+        }
       case 15:
-        return (Em64T) ? "athlon64" : "athlon";
+        switch (Model) {
+        case 5:  return "athlon-fx"; // also opteron
+        default: return "athlon64";
+        }
 
     default:
       return "generic";