]> granicus.if.org Git - clang/commitdiff
[Driver][Mips] Support more MIPS CPU names: mips1 - mips5.
authorSimon Atanasyan <simon@atanasyan.com>
Fri, 4 Jul 2014 12:36:56 +0000 (12:36 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Fri, 4 Jul 2014 12:36:56 +0000 (12:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212338 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Driver/Options.td
lib/Basic/Targets.cpp
test/Driver/mips-abi.c
test/Driver/mips-as.c

index 6569858338f5e860abf59958fec03d2b6a73d442..d0cccb6d15d91fe68c47d46f379abfd6231771f5 100644 (file)
@@ -1213,6 +1213,21 @@ def mfp64 : Flag<["-"], "mfp64">, Group<m_Group>,
 def mfp32 : Flag<["-"], "mfp32">, Group<m_Group>,
   HelpText<"Use 32-bit floating point registers (MIPS only)">;
 def mnan_EQ : Joined<["-"], "mnan=">, Group<m_Group>;
+def mips1 : Flag<["-"], "mips1">,
+  Alias<march_EQ>, AliasArgs<["mips1"]>,
+  HelpText<"Equivalent to -march=mips1">, Flags<[HelpHidden]>;
+def mips2 : Flag<["-"], "mips2">,
+  Alias<march_EQ>, AliasArgs<["mips2"]>,
+  HelpText<"Equivalent to -march=mips2">, Flags<[HelpHidden]>;
+def mips3 : Flag<["-"], "mips3">,
+  Alias<march_EQ>, AliasArgs<["mips3"]>,
+  HelpText<"Equivalent to -march=mips3">, Flags<[HelpHidden]>;
+def mips4 : Flag<["-"], "mips4">,
+  Alias<march_EQ>, AliasArgs<["mips4"]>,
+  HelpText<"Equivalent to -march=mips4">, Flags<[HelpHidden]>;
+def mips5 : Flag<["-"], "mips5">,
+  Alias<march_EQ>, AliasArgs<["mips5"]>,
+  HelpText<"Equivalent to -march=mips5">, Flags<[HelpHidden]>;
 def mips32 : Flag<["-"], "mips32">,
   Alias<march_EQ>, AliasArgs<["mips32"]>,
   HelpText<"Equivalent to -march=mips32">, Flags<[HelpHidden]>;
index 81a00038ba3027c1dc5f6be678aa0b52849c8811..9e3686be0bd2f4bae59779f3c0cb457cf35ebc81 100644 (file)
@@ -5309,6 +5309,11 @@ public:
                     getTriple().getArch() == llvm::Triple::mipsel;
     CPU = Name;
     return llvm::StringSwitch<bool>(Name)
+        .Case("mips1", IsMips32)
+        .Case("mips2", IsMips32)
+        .Case("mips3", true)
+        .Case("mips4", true)
+        .Case("mips5", true)
         .Case("mips32", IsMips32)
         .Case("mips32r2", IsMips32)
         .Case("mips32r6", IsMips32)
index c17a4be968934eb4e5eaf5cb97f2b075177a26aa..f58ba0e6418d084d18b0fbaa73d8e31ca2d5c918 100644 (file)
 // MIPS-ABI-UNKNOWN: error: unknown target ABI 'unknown'
 //
 // RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:        -march=mips1 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ARCH-1 %s
+// MIPS-ARCH-1: "-target-cpu" "mips1"
+// MIPS-ARCH-1: "-target-abi" "o32"
+//
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:        -march=mips2 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ARCH-2 %s
+// MIPS-ARCH-2: "-target-cpu" "mips2"
+// MIPS-ARCH-2: "-target-abi" "o32"
+//
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:        -march=mips3 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ARCH-3 %s
+// MIPS-ARCH-3: "-target-cpu" "mips3"
+// MIPS-ARCH-3: "-target-abi" "o32"
+//
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:        -march=mips4 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ARCH-4 %s
+// MIPS-ARCH-4: "-target-cpu" "mips4"
+// MIPS-ARCH-4: "-target-abi" "o32"
+//
+// RUN: %clang -target mips-linux-gnu -### -c %s \
+// RUN:        -march=mips5 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ARCH-5 %s
+// MIPS-ARCH-5: "-target-cpu" "mips5"
+// MIPS-ARCH-5: "-target-abi" "o32"
+//
+// RUN: %clang -target mips-linux-gnu -### -c %s \
 // RUN:        -march=mips32 2>&1 \
 // RUN:   | FileCheck -check-prefix=MIPS-ARCH-32 %s
 // MIPS-ARCH-32: "-target-cpu" "mips32"
index cf85978960667eee43398cf162ee5a01b077951d..27517accba604ea7af33821badd362f35fa4ffc9 100644 (file)
 // RUN:   | FileCheck -check-prefix=MIPS-32R2 %s
 // MIPS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-EB"
 //
+// RUN: %clang -target mips-linux-gnu -mips1 -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ALIAS-1 %s
+// MIPS-ALIAS-1: as{{(.exe)?}}" "-march" "mips1" "-mabi" "32" "-EB"
+//
+// RUN: %clang -target mips-linux-gnu -mips2 -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ALIAS-2 %s
+// MIPS-ALIAS-2: as{{(.exe)?}}" "-march" "mips2" "-mabi" "32" "-EB"
+//
+// RUN: %clang -target mips-linux-gnu -mips3 -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ALIAS-3 %s
+// MIPS-ALIAS-3: as{{(.exe)?}}" "-march" "mips3" "-mabi" "32" "-EB"
+//
+// RUN: %clang -target mips-linux-gnu -mips4 -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ALIAS-4 %s
+// MIPS-ALIAS-4: as{{(.exe)?}}" "-march" "mips4" "-mabi" "32" "-EB"
+//
+// RUN: %clang -target mips-linux-gnu -mips5 -### \
+// RUN:   -no-integrated-as -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=MIPS-ALIAS-5 %s
+// MIPS-ALIAS-5: as{{(.exe)?}}" "-march" "mips5" "-mabi" "32" "-EB"
+//
 // RUN: %clang -target mips-linux-gnu -mips32 -### \
 // RUN:   -no-integrated-as -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=MIPS-ALIAS-32 %s