Index: include/clang/Driver/Options.td =================================================================== --- include/clang/Driver/Options.td +++ include/clang/Driver/Options.td @@ -1249,6 +1249,9 @@ def mips64r6 : Flag<["-"], "mips64r6">, Alias, AliasArgs<["mips64r6"]>, HelpText<"Equivalent to -march=mips64r6">, Flags<[HelpHidden]>; +def mfpxx : Flag<["-"], "mfpxx">, Group, + HelpText<"Avoid FPU mode dependent operations when used with the O32 ABI">, + Flags<[HelpHidden]>; def modd_spreg : Flag<["-"], "modd-spreg">, Group, HelpText<"Enable odd single-precision floating point registers">, Flags<[HelpHidden]>; Index: lib/Driver/Tools.cpp =================================================================== --- lib/Driver/Tools.cpp +++ lib/Driver/Tools.cpp @@ -1058,6 +1058,10 @@ "msa"); AddTargetFeature(Args, Features, options::OPT_mfp64, options::OPT_mfp32, "fp64"); + if (Args.getLastArg(options::OPT_mfpxx)) { + Features.push_back(Args.MakeArgString("+fpxx")); + Features.push_back(Args.MakeArgString("+nooddspreg")); + } AddTargetFeature(Args, Features, options::OPT_mno_odd_spreg, options::OPT_modd_spreg, "nooddspreg"); } Index: test/Driver/mips-features.c =================================================================== --- test/Driver/mips-features.c +++ test/Driver/mips-features.c @@ -70,6 +70,18 @@ // RUN: | FileCheck --check-prefix=CHECK-NOMODDSPREG %s // CHECK-NOMODDSPREG: "-target-feature" "+nooddspreg" // +// -mfpxx +// RUN: %clang -target mips-linux-gnu -### -c %s -mfpxx 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MFPXX %s +// CHECK-MFPXX: "-target-feature" "+fpxx" +// CHECK-MFPXX: "-target-feature" "+nooddspreg" +// +// -mfpxx -modd-spreg +// RUN: %clang -target mips-linux-gnu -### -c %s -mfpxx -modd-spreg 2>&1 \ +// RUN: | FileCheck --check-prefix=CHECK-MFPXX-ODDSPREG %s +// CHECK-MFPXX-ODDSPREG: "-target-feature" "+fpxx" +// CHECK-MFPXX-ODDSPREG: "-target-feature" "-nooddspreg" +// // -mfp64 // RUN: %clang -target mips-linux-gnu -### -c %s \ // RUN: -mfp32 -mfp64 2>&1 \