def mno_dsp : Flag<["-"], "mno-dsp">, Group<m_Group>;
def mdspr2 : Flag<["-"], "mdspr2">, Group<m_Group>;
def mno_dspr2 : Flag<["-"], "mno-dspr2">, Group<m_Group>;
+def msingle_float : Flag<["-"], "msingle-float">, Group<m_Group>;
+def mdouble_float : Flag<["-"], "mdouble-float">, Group<m_Group>;
def mips32 : Flag<["-"], "mips32">, Group<mips_CPUs_Group>,
HelpText<"Equivalent to -march=mips32">, Flags<[HelpHidden]>;
def mips32r2 : Flag<["-"], "mips32r2">, Group<mips_CPUs_Group>,
FloatABI = "hard";
else {
FloatABI = A->getValue();
- if (FloatABI != "soft" && FloatABI != "single" && FloatABI != "hard") {
+ if (FloatABI != "soft" && FloatABI != "hard") {
D.Diag(diag::err_drv_invalid_mfloat_abi) << A->getAsString(Args);
FloatABI = "hard";
}
CmdArgs.push_back("-mips16-hard-float");
}
}
- else if (FloatABI == "single") {
- // Restrict the use of hardware floating-point
- // instructions to 32-bit operations.
- CmdArgs.push_back("-target-feature");
- CmdArgs.push_back("+single-float");
- }
else {
// Floating point operations and argument passing are hard.
assert(FloatABI == "hard" && "Invalid float abi!");
CmdArgs.push_back("hard");
}
+ if (Arg *A = Args.getLastArg(options::OPT_msingle_float,
+ options::OPT_mdouble_float)) {
+ if (A->getOption().matches(options::OPT_msingle_float)) {
+ // Restrict the use of hardware floating-point
+ // instructions to 32-bit operations.
+ CmdArgs.push_back("-target-feature");
+ CmdArgs.push_back("+single-float");
+ }
+ }
+
AddTargetFeature(Args, CmdArgs,
options::OPT_mips16, options::OPT_mno_mips16,
"mips16");
// CHECK-ABI-SOFT: "-mfloat-abi" "soft"
// CHECK-ABI-SOFT: "-target-feature" "+soft-float"
//
-// -mfloat-abi=single
+// -mdouble-float
// RUN: %clang -c %s -### -o %t.o 2>&1 \
-// RUN: -target mips-linux-gnu -mfloat-abi=single \
+// RUN: -target mips-linux-gnu -msingle-float -mdouble-float \
+// RUN: | FileCheck --check-prefix=CHECK-ABI-DOUBLE %s
+// CHECK-ABI-DOUBLE: "-mfloat-abi" "hard"
+// CHECK-ABI-DOUBLE-NOT: "+single-float"
+//
+// -msingle-float
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target mips-linux-gnu -mdouble-float -msingle-float \
// RUN: | FileCheck --check-prefix=CHECK-ABI-SINGLE %s
+// CHECK-ABI-SINGLE: "-mfloat-abi" "hard"
// CHECK-ABI-SINGLE: "-target-feature" "+single-float"
//
+// -msoft-float -msingle-float
+// RUN: %clang -c %s -### -o %t.o 2>&1 \
+// RUN: -target mips-linux-gnu -msoft-float -msingle-float \
+// RUN: | FileCheck --check-prefix=CHECK-ABI-SOFT-SINGLE %s
+// CHECK-ABI-SOFT-SINGLE: "-mfloat-abi" "soft"
+// CHECK-ABI-SOFT-SINGLE: "-target-feature" "+single-float"
+//
// Default -mips16
// RUN: %clang -c %s -### -o %t.o 2>&1 \
// RUN: -target mips-linux-gnu -mips16 \