[cfe-commits] r159769 - in /cfe/trunk: include/clang/Driver/Options.td lib/Basic/Targets.cpp lib/Driver/Tools.cpp test/Driver/mips-features.c

Simon Atanasyan satanasyan at mips.com
Thu Jul 5 12:23:00 PDT 2012


Author: atanasyan
Date: Thu Jul  5 14:23:00 2012
New Revision: 159769

URL: http://llvm.org/viewvc/llvm-project?rev=159769&view=rev
Log:
MIPS: Add -mdsp/-mno-dsp and -mdspr2/-mno-dspr2 command line options support.

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Basic/Targets.cpp
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/mips-features.c

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=159769&r1=159768&r2=159769&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Thu Jul  5 14:23:00 2012
@@ -848,6 +848,10 @@
 def mfma4 : Flag<"-mfma4">, Group<m_x86_Features_Group>;
 def mips16 : Flag<"-mips16">, Group<m_Group>;
 def mno_mips16 : Flag<"-mno-mips16">, Group<m_Group>;
+def mdsp : Flag<"-mdsp">, Group<m_Group>;
+def mno_dsp : Flag<"-mno-dsp">, Group<m_Group>;
+def mdspr2 : Flag<"-mdspr2">, Group<m_Group>;
+def mno_dspr2 : Flag<"-mno-dspr2">, Group<m_Group>;
 def mthumb : Flag<"-mthumb">, Group<m_Group>;
 def mtune_EQ : Joined<"-mtune=">, Group<m_Group>;
 def multi__module : Flag<"-multi_module">;

Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=159769&r1=159768&r2=159769&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Thu Jul  5 14:23:00 2012
@@ -3719,7 +3719,7 @@
         Name == "o32" || Name == "n32" || Name == "n64" || Name == "eabi" ||
         Name == "mips32" || Name == "mips32r2" ||
         Name == "mips64" || Name == "mips64r2" ||
-        Name == "mips16") {
+        Name == "mips16" || Name == "dsp" || Name == "dspr2") {
       Features[Name] = Enabled;
       return true;
     }

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=159769&r1=159768&r2=159769&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Thu Jul  5 14:23:00 2012
@@ -937,6 +937,12 @@
   AddTargetFeature(Args, CmdArgs,
                    options::OPT_mips16, options::OPT_mno_mips16,
                    "mips16");
+  AddTargetFeature(Args, CmdArgs,
+                   options::OPT_mdsp, options::OPT_mno_dsp,
+                   "dsp");
+  AddTargetFeature(Args, CmdArgs,
+                   options::OPT_mdspr2, options::OPT_mno_dspr2,
+                   "dspr2");
 }
 
 /// getPPCTargetCPU - Get the (LLVM) name of the PowerPC cpu we are targeting.

Modified: cfe/trunk/test/Driver/mips-features.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/mips-features.c?rev=159769&r1=159768&r2=159769&view=diff
==============================================================================
--- cfe/trunk/test/Driver/mips-features.c (original)
+++ cfe/trunk/test/Driver/mips-features.c Thu Jul  5 14:23:00 2012
@@ -11,3 +11,27 @@
 // RUN:     -mips16 -mno-mips16 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-NOMIPS16 %s
 // CHECK-NOMIPS16: "-target-feature" "-mips16"
+//
+// -mdsp
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mno-dsp -mdsp 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-MDSP %s
+// CHECK-MDSP: "-target-feature" "+dsp"
+//
+// -mno-dsp
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mdsp -mno-dsp 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-NOMDSP %s
+// CHECK-NOMDSP: "-target-feature" "-dsp"
+//
+// -mdspr2
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mno-dspr2 -mdspr2 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-MDSPR2 %s
+// CHECK-MDSPR2: "-target-feature" "+dspr2"
+//
+// -mno-dspr2
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:     -mdspr2 -mno-dspr2 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-NOMDSPR2 %s
+// CHECK-NOMDSPR2: "-target-feature" "-dspr2"





More information about the cfe-commits mailing list