Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1359,6 +1359,12 @@ def mips32r2 : Flag<["-"], "mips32r2">, Alias, AliasArgs<["mips32r2"]>, HelpText<"Equivalent to -march=mips32r2">, Flags<[HelpHidden]>; +def mips32r3 : Flag<["-"], "mips32r3">, + Alias, AliasArgs<["mips32r3"]>, + HelpText<"Equivalent to -march=mips32r3">, Flags<[HelpHidden]>; +def mips32r5 : Flag<["-"], "mips32r5">, + Alias, AliasArgs<["mips32r5"]>, + HelpText<"Equivalent to -march=mips32r5">, Flags<[HelpHidden]>; def mips32r6 : Flag<["-"], "mips32r6">, Alias, AliasArgs<["mips32r6"]>, HelpText<"Equivalent to -march=mips32r6">, Flags<[HelpHidden]>; @@ -1368,6 +1374,12 @@ def mips64r2 : Flag<["-"], "mips64r2">, Alias, AliasArgs<["mips64r2"]>, HelpText<"Equivalent to -march=mips64r2">, Flags<[HelpHidden]>; +def mips64r3 : Flag<["-"], "mips64r3">, + Alias, AliasArgs<["mips64r3"]>, + HelpText<"Equivalent to -march=mips64r3">, Flags<[HelpHidden]>; +def mips64r5 : Flag<["-"], "mips64r5">, + Alias, AliasArgs<["mips64r5"]>, + HelpText<"Equivalent to -march=mips64r5">, Flags<[HelpHidden]>; def mips64r6 : Flag<["-"], "mips64r6">, Alias, AliasArgs<["mips64r6"]>, HelpText<"Equivalent to -march=mips64r6">, Flags<[HelpHidden]>; Index: lib/Basic/Targets.cpp =================================================================== --- lib/Basic/Targets.cpp +++ lib/Basic/Targets.cpp @@ -5688,9 +5688,13 @@ .Case("mips5", true) .Case("mips32", IsMips32) .Case("mips32r2", IsMips32) + .Case("mips32r3", IsMips32) + .Case("mips32r5", IsMips32) .Case("mips32r6", IsMips32) .Case("mips64", true) .Case("mips64r2", true) + .Case("mips64r3", true) + .Case("mips64r5", true) .Case("mips64r6", true) .Case("octeon", true) .Default(false); @@ -5953,6 +5957,10 @@ Builder.defineMacro("__mips_isa_rev", "1"); else if (CPUStr == "mips32r2") Builder.defineMacro("__mips_isa_rev", "2"); + else if (CPUStr == "mips32r3") + Builder.defineMacro("__mips_isa_rev", "3"); + else if (CPUStr == "mips32r5") + Builder.defineMacro("__mips_isa_rev", "5"); else if (CPUStr == "mips32r6") Builder.defineMacro("__mips_isa_rev", "6"); @@ -6102,6 +6110,10 @@ Builder.defineMacro("__mips_isa_rev", "1"); else if (CPUStr == "mips64r2") Builder.defineMacro("__mips_isa_rev", "2"); + else if (CPUStr == "mips64r3") + Builder.defineMacro("__mips_isa_rev", "3"); + else if (CPUStr == "mips64r5") + Builder.defineMacro("__mips_isa_rev", "5"); else if (CPUStr == "mips64r6") Builder.defineMacro("__mips_isa_rev", "6"); Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -5626,8 +5626,8 @@ return llvm::StringSwitch(CPUName) .Cases("mips2", "mips3", "mips4", "mips5", true) - .Cases("mips32", "mips32r2", true) - .Cases("mips64", "mips64r2", true) + .Cases("mips32", "mips32r2", "mips32r3", "mips32r5", true) + .Cases("mips64", "mips64r2", "mips64r3", "mips64r5", true) .Default(false); } Index: test/Driver/mips-as.c =================================================================== --- test/Driver/mips-as.c +++ test/Driver/mips-as.c @@ -98,6 +98,16 @@ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R2 %s // MIPS-ALIAS-32R2: as{{(.exe)?}}" "-march" "mips32r2" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" // +// RUN: %clang -target mips-linux-gnu -mips32r3 -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R3 %s +// MIPS-ALIAS-32R3: as{{(.exe)?}}" "-march" "mips32r3" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// +// RUN: %clang -target mips-linux-gnu -mips32r5 -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R5 %s +// MIPS-ALIAS-32R5: as{{(.exe)?}}" "-march" "mips32r5" "-mabi" "32" "-mno-shared" "-call_nonpic" "-EB" +// // RUN: %clang -target mips-linux-gnu -mips32r6 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-32R6 %s @@ -113,6 +123,16 @@ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R2 %s // MIPS-ALIAS-64R2: as{{(.exe)?}}" "-march" "mips64r2" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" // +// RUN: %clang -target mips64-linux-gnu -mips64r3 -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R3 %s +// MIPS-ALIAS-64R3: as{{(.exe)?}}" "-march" "mips64r3" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// +// RUN: %clang -target mips64-linux-gnu -mips64r5 -### \ +// RUN: -no-integrated-as -c %s 2>&1 \ +// RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R5 %s +// MIPS-ALIAS-64R5: as{{(.exe)?}}" "-march" "mips64r5" "-mabi" "64" "-mno-shared" "-KPIC" "-EB" +// // RUN: %clang -target mips64-linux-gnu -mips64r6 -### \ // RUN: -no-integrated-as -c %s 2>&1 \ // RUN: | FileCheck -check-prefix=MIPS-ALIAS-64R6 %s Index: test/Preprocessor/init.c =================================================================== --- test/Preprocessor/init.c +++ test/Preprocessor/init.c @@ -4264,6 +4264,24 @@ // MIPS-ARCH-32R2:#define __mips_isa_rev 2 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none \ +// RUN: -target-cpu mips32r3 < /dev/null \ +// RUN: | FileCheck -check-prefix MIPS-ARCH-32R3 %s +// +// MIPS-ARCH-32R3:#define _MIPS_ARCH "mips32r3" +// MIPS-ARCH-32R3:#define _MIPS_ARCH_MIPS32R3 1 +// MIPS-ARCH-32R3:#define _MIPS_ISA _MIPS_ISA_MIPS32 +// MIPS-ARCH-32R3:#define __mips_isa_rev 3 +// +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none \ +// RUN: -target-cpu mips32r5 < /dev/null \ +// RUN: | FileCheck -check-prefix MIPS-ARCH-32R5 %s +// +// MIPS-ARCH-32R5:#define _MIPS_ARCH "mips32r5" +// MIPS-ARCH-32R5:#define _MIPS_ARCH_MIPS32R5 1 +// MIPS-ARCH-32R5:#define _MIPS_ISA _MIPS_ISA_MIPS32 +// MIPS-ARCH-32R5:#define __mips_isa_rev 5 +// +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips-none-none \ // RUN: -target-cpu mips32r6 < /dev/null \ // RUN: | FileCheck -check-prefix MIPS-ARCH-32R6 %s // @@ -4300,6 +4318,24 @@ // MIPS-ARCH-64R2:#define __mips_isa_rev 2 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \ +// RUN: -target-cpu mips64r3 < /dev/null \ +// RUN: | FileCheck -check-prefix MIPS-ARCH-64R3 %s +// +// MIPS-ARCH-64R3:#define _MIPS_ARCH "mips64r3" +// MIPS-ARCH-64R3:#define _MIPS_ARCH_MIPS64R3 1 +// MIPS-ARCH-64R3:#define _MIPS_ISA _MIPS_ISA_MIPS64 +// MIPS-ARCH-64R3:#define __mips_isa_rev 3 +// +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \ +// RUN: -target-cpu mips64r5 < /dev/null \ +// RUN: | FileCheck -check-prefix MIPS-ARCH-64R5 %s +// +// MIPS-ARCH-64R5:#define _MIPS_ARCH "mips64r5" +// MIPS-ARCH-64R5:#define _MIPS_ARCH_MIPS64R5 1 +// MIPS-ARCH-64R5:#define _MIPS_ISA _MIPS_ISA_MIPS64 +// MIPS-ARCH-64R5:#define __mips_isa_rev 5 +// +// RUN: %clang_cc1 -E -dM -ffreestanding -triple=mips64-none-none \ // RUN: -target-cpu mips64r6 < /dev/null \ // RUN: | FileCheck -check-prefix MIPS-ARCH-64R6 %s //