[cfe-commits] r97714 - in /cfe/trunk: include/clang/Driver/Options.td lib/Basic/Targets.cpp

Eric Christopher echristo at apple.com
Wed Mar 3 18:26:37 PST 2010


Author: echristo
Date: Wed Mar  3 20:26:37 2010
New Revision: 97714

URL: http://llvm.org/viewvc/llvm-project?rev=97714&view=rev
Log:
Add in -msse4.1 and -msse4.2 options and continuing a rather
hacky solution for translating.  Expanded on comment explaining
the hack a bit.

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Basic/Targets.cpp

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=97714&r1=97713&r2=97714&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Wed Mar  3 20:26:37 2010
@@ -64,6 +64,7 @@
 //   , => _COMMA
 //   = => _EQ
 //   C++ => CXX
+//   . => _
 
 // Developer Driver Options
 
@@ -420,6 +421,8 @@
 def mno_sse3 : Flag<"-mno-sse3">, Group<m_x86_Features_Group>;
 def mno_sse4a : Flag<"-mno-sse4a">, Group<m_x86_Features_Group>;
 def mno_sse4 : Flag<"-mno-sse4">, Group<m_x86_Features_Group>;
+def mno_sse4_1 : Flag<"-mno-sse4.1">, Group<m_x86_Features_Group>;
+def mno_sse4_2 : Flag<"-mno-sse4.2">, Group<m_x86_Features_Group>;
 def mno_sse : Flag<"-mno-sse">, Group<m_x86_Features_Group>;
 def mno_ssse3 : Flag<"-mno-ssse3">, Group<m_x86_Features_Group>;
 
@@ -434,6 +437,8 @@
 def msse3 : Flag<"-msse3">, Group<m_x86_Features_Group>;
 def msse4a : Flag<"-msse4a">, Group<m_x86_Features_Group>;
 def msse4 : Flag<"-msse4">, Group<m_x86_Features_Group>;
+def msse4_1 : Flag<"-msse4.1">, Group<m_x86_Features_Group>;
+def msse4_2 : Flag<"-msse4.2">, Group<m_x86_Features_Group>;
 def msse : Flag<"-msse">, Group<m_x86_Features_Group>;
 def mssse3 : Flag<"-mssse3">, Group<m_x86_Features_Group>;
 def mthumb : Flag<"-mthumb">, Group<m_Group>;

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=97714&r1=97713&r2=97714&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Mar  3 20:26:37 2010
@@ -734,8 +734,10 @@
 bool X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
                                       const std::string &Name,
                                       bool Enabled) const {
-  // FIXME: This *really* should not be here.
-  if (!Features.count(Name) && Name != "sse4")
+  // FIXME: This *really* should not be here.  We need some way of translating
+  // options into llvm subtarget features.
+  if (!Features.count(Name) &&
+      (Name != "sse4" && Name != "sse4.2" && Name != "sse4.1"))
     return false;
 
   if (Enabled) {
@@ -751,9 +753,12 @@
     else if (Name == "ssse3")
       Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
         Features["ssse3"] = true;
-    else if (Name == "sse4")
+    else if (Name == "sse4" || Name == "sse4.2")
       Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
         Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
+    else if (Name == "sse4.1")
+      Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
+        Features["ssse3"] = Features["sse41"] = true;
     else if (Name == "3dnow")
       Features["3dnowa"] = true;
     else if (Name == "3dnowa")





More information about the cfe-commits mailing list