Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1238,6 +1238,10 @@ def mips64r2 : Flag<["-"], "mips64r2">, Alias, AliasArgs<["mips64r2"]>, HelpText<"Equivalent to -march=mips64r2">, Flags<[HelpHidden]>; +def modd_spreg : Flag<["-"], "modd-spreg">, Group, + HelpText<"Enable odd single-precision floating point registers">; +def mno_odd_spreg : Flag<["-"], "mno-odd-spreg">, Group, + HelpText<"Disable odd single-precision floating point registers">; def module_file_info : Flag<["-"], "module-file-info">, Flags<[DriverOption,CC1Option]>, Group; def mthumb : Flag<["-"], "mthumb">, Group; def mtune_EQ : Joined<["-"], "mtune=">, Group; Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -1050,6 +1050,8 @@ "msa"); AddTargetFeature(Args, Features, options::OPT_mfp64, options::OPT_mfp32, "fp64"); + AddTargetFeature(Args, Features, options::OPT_mno_odd_spreg, + options::OPT_modd_spreg, "nooddspreg"); } void Clang::AddMIPSTargetArgs(const ArgList &Args, Index: test/Driver/mips-features.c =================================================================== --- test/Driver/mips-features.c +++ test/Driver/mips-features.c @@ -60,6 +60,16 @@ // RUN: | FileCheck --check-prefix=CHECK-NOMMSA %s // CHECK-NOMMSA: "-target-feature" "-msa" // +// -modd-spreg +// RUN: %clang -target mips-linux-gnu -### -c %s -mno-odd-spreg -modd-spreg 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MODDSPREG %s +// CHECK-MODDSPREG: "-target-feature" "-nooddspreg" +// +// -mno-odd-spreg +// RUN: %clang -target mips-linux-gnu -### -c %s -modd-spreg -mno-odd-spreg 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-NOMODDSPREG %s +// CHECK-NOMODDSPREG: "-target-feature" "+nooddspreg" +// // -mfp64 // RUN: %clang -target mips-linux-gnu -### -c %s \ // RUN: -mfp32 -mfp64 2>&1 \