Really force on 64bit for 64-bit targets. Should fix remaining failures on unknown...
authorEli Friedman <eli.friedman@gmail.com>
Fri, 8 Jul 2011 23:43:01 +0000 (23:43 +0000)
committerEli Friedman <eli.friedman@gmail.com>
Fri, 8 Jul 2011 23:43:01 +0000 (23:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134773 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/X86Subtarget.cpp

index 5bd70e402267a0c873a0c4c7129873de066cdedc..e780615da394229f43b4a9b093bce43bdd4859b8 100644 (file)
@@ -258,11 +258,19 @@ X86Subtarget::X86Subtarget(const std::string &TT, const std::string &CPU,
 #endif
     }
 
+    // Make sure 64-bit features are available in 64-bit mode. (But make sure
+    // SSE2 can be turned off explicitly.)
+    std::string FullFS = FS;
+    if (In64BitMode) {
+      if (!FullFS.empty())
+        FullFS = "+64bit,+sse2," + FullFS;
+      else
+        FullFS = "+64bit,+sse2";
+    }
+
     // If feature string is not empty, parse features string.
-    ParseSubtargetFeatures(CPUName, FS);
+    ParseSubtargetFeatures(CPUName, FullFS);
 
-    // All X86-64 CPUs also have SSE2, however user might request no SSE via 
-    // -mattr, so don't force SSELevel here.
     if (HasAVX)
       X86SSELevel = NoMMXSSE;
   } else {