Add Intel processors core i7 and atom.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 3 Jan 2009 04:24:44 +0000 (04:24 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 3 Jan 2009 04:24:44 +0000 (04:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61603 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86.td
lib/Target/X86/X86Subtarget.cpp

index 8867298abb8120b7d2bd1ef31a968228d4b067d9..7a2f2570b34ce7727e8a100b5a6e6c0de3cc76a4 100644 (file)
@@ -76,6 +76,8 @@ def : Proc<"prescott",        [FeatureSSE3, FeatureSlowBTMem]>;
 def : Proc<"nocona",          [FeatureSSE3,   Feature64Bit, FeatureSlowBTMem]>;
 def : Proc<"core2",           [FeatureSSSE3,  Feature64Bit, FeatureSlowBTMem]>;
 def : Proc<"penryn",          [FeatureSSE41,  Feature64Bit, FeatureSlowBTMem]>;
+def : Proc<"atom",            [FeatureSSE3,   Feature64Bit, FeatureSlowBTMem]>;
+def : Proc<"corei7",          [FeatureSSE42,  Feature64Bit, FeatureSlowBTMem]>;
 
 def : Proc<"k6",              [FeatureMMX]>;
 def : Proc<"k6-2",            [FeatureMMX,    Feature3DNow]>;
index a7df68b19f8a241dd1dc4c065149390414198f1d..c6cda56f7dd357308790b6e62626dab16487a027 100644 (file)
@@ -204,6 +204,7 @@ static const char *GetCurrentX86CPU() {
   unsigned Family = 0;
   unsigned Model  = 0;
   DetectFamilyModel(EAX, Family, Model);
+  bool HasSSE42 = (ECX >> 19) & 0x1;
 
   X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
   bool Em64T = (EDX >> 29) & 0x1;
@@ -254,7 +255,7 @@ static const char *GetCurrentX86CPU() {
         case 28:
           // Intel Atom, and Core i7 both have this model.
           // Atom has SSSE3, Core i7 has SSE4.2
-          return "core2";
+          return (HasSSE42) ? "corei7" : "atom";
         default:
           return (Em64T) ? "x86-64" : "pentium4";
         }