Make 91378 more conservative.
[oota-llvm.git] / lib / System / Host.cpp
index b5d2a911dc89b0adaf6c4b2a15c36ade7c8d1d56..79897e48bdaab5c11c4a4f531d9f1c42ff41cba4 100644 (file)
@@ -22,6 +22,9 @@
 #ifdef LLVM_ON_WIN32
 #include "Win32/Host.inc"
 #endif
+#ifdef _MSC_VER
+#include <intrin.h>
+#endif
 
 //===----------------------------------------------------------------------===//
 //
@@ -100,11 +103,8 @@ static void DetectX86FamilyModel(unsigned EAX, unsigned &Family, unsigned &Model
     Model += ((EAX >> 16) & 0xf) << 4; // Bits 16 - 19
   }
 }
-#endif
-
 
 std::string sys::getHostCPUName() {
-#if defined(__x86_64__) || defined(__i386__)
   unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
   if (GetX86CpuIDAndInfo(0x1, &EAX, &EBX, &ECX, &EDX))
     return "generic";
@@ -243,17 +243,13 @@ std::string sys::getHostCPUName() {
                // and manufactured using the 65 nm process.
         return (Em64T) ? "nocona" : "prescott";
 
-        // FIXME: Are these bogus?
-      case 26: return "corei7";
-      case 28: return "atom";
-
       default:
         return (Em64T) ? "x86-64" : "pentium4";
       }
     }
 
     default:
-      return "";
+      return "generic";
     }
   } else if (memcmp(text.c, "AuthenticAMD", 12) == 0) {
     // FIXME: this poorly matches the generated SubtargetFeatureKV table.  There
@@ -293,10 +289,13 @@ std::string sys::getHostCPUName() {
       case 16:
         return "amdfam10";
     default:
-      return "";
+      return "generic";
     }
   }
-#endif
-
-  return "";
+  return "generic";
+}
+#else
+std::string sys::getHostCPUName() {
+  return "generic";
 }
+#endif