===================================================================
@@ -3080,7 +3080,7 @@
esac
fi
-# Infer a default setting for --with-float.
+# Infer a default setting for --with-float and --with-fpu.
if test x$with_float = x; then
case ${target} in
mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
@@ -3089,6 +3089,17 @@
with_float=soft
;;
esac
+else
+ case ${target} in
+ mips64r5900-*-* | mips64r5900el-*-* | mipsr5900-*-* | mipsr5900el-*-*)
+ if test $with_float = hard; then
+ if test x$with_fpu = x; then
+ # The FPU of the R5900 is 32 bit.
+ with_fpu=single
+ fi
+ fi
+ ;;
+ esac
fi
# Support --with-fpmath.
@@ -3469,7 +3480,7 @@
;;
mips*-*-*)
- supported_defaults="abi arch arch_32 arch_64 float tune tune_32 tune_64 divide llsc mips-plt synci"
+ supported_defaults="abi arch arch_32 arch_64 float fpu tune tune_32 tune_64 divide llsc mips-plt synci"
case ${with_float} in
"" | soft | hard)
@@ -3481,6 +3492,16 @@
;;
esac
+ case ${with_fpu} in
+ "" | single | double)
+ # OK
+ ;;
+ *)
+ echo "Unknown fpu type used in --with-fpu=$with_fpu" 1>&2
+ exit 1
+ ;;
+ esac
+
case ${with_abi} in
"" | 32 | o64 | n32 | 64 | eabi)
# OK
===================================================================
@@ -16830,6 +16830,19 @@
target_flags &= ~MASK_FLOAT64;
}
+ if (TARGET_HARD_FLOAT_ABI && TARGET_FLOAT64 && TARGET_MIPS5900)
+ {
+ /* FPU of r5900 only supports 32 bit. */
+ error ("unsupported combination: %s", "-march=r5900 -mfp64 -mhard-float");
+ }
+
+ if (TARGET_HARD_FLOAT_ABI && TARGET_DOUBLE_FLOAT && TARGET_MIPS5900)
+ {
+ /* FPU of r5900 only supports 32 bit. */
+ error ("unsupported combination: %s",
+ "-march=r5900 -mdouble-float -mhard-float");
+ }
+
/* End of code shared with GAS. */
/* If a -mlong* option was given, check that it matches the ABI,
@@ -17139,6 +17152,11 @@
filling. Registering the pass must be done at start up. It's
convenient to do it here. */
register_pass (&insert_pass_mips_machine_reorg2);
+
+ if (TARGET_HARD_FLOAT_ABI && TARGET_MIPS5900)
+ {
+ REAL_MODE_FORMAT (SFmode) = &spu_single_format;
+ }
}
/* Swap the register information for registers I and I + 1, which
===================================================================
@@ -754,6 +754,7 @@
{"tune_64", "%{" OPT_ARCH64 ":%{!mtune=*:-mtune=%(VALUE)}}" }, \
{"abi", "%{!mabi=*:-mabi=%(VALUE)}" }, \
{"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }, \
+ {"fpu", "%{!msingle-float:%{!mdouble-float:-m%(VALUE)-float}}" }, \
{"divide", "%{!mdivide-traps:%{!mdivide-breaks:-mdivide-%(VALUE)}}" }, \
{"llsc", "%{!mllsc:%{!mno-llsc:-m%(VALUE)}}" }, \
{"mips-plt", "%{!mplt:%{!mno-plt:-m%(VALUE)}}" }, \
@@ -859,7 +860,8 @@
|| TARGET_LOONGSON_2EF)
/* ISA has LDC1 and SDC1. */
-#define ISA_HAS_LDC1_SDC1 (!ISA_MIPS1 && !TARGET_MIPS16)
+#define ISA_HAS_LDC1_SDC1 (!ISA_MIPS1 && !TARGET_MIPS16 \
+ && !TARGET_MIPS5900)
/* ISA has the mips4 FP condition code instructions: FP-compare to CC,
branch on CC, and move (both FP and non-FP) on CC. */