forked from OSchip/llvm-project
[Driver][Mips] Support more MIPS CPU names: mips1 - mips5.
llvm-svn: 212338
This commit is contained in:
parent
3c5b126239
commit
26610c5960
|
@ -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]>;
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -57,6 +57,36 @@
|
|||
// 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"
|
||||
|
|
|
@ -52,6 +52,31 @@
|
|||
// 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
|
||||
|
|
Loading…
Reference in New Issue