+2010-05-20 Richard Sandiford <rdsandiford@googlemail.com>
+
+ * config.gcc (mips*-sde-elf*): Don't use sdemtk.opt.
+ * config/mips/mips.h (TARGET_CPU_CPP_BUILTINS): Define __mips_no_float
+ for TARGET_NO_FLOAT.
+ * config/mips/mips.c (mips_file_start): Expand conditional expression
+ into "if" statements. Use .gnu_attribute 4,0 for TARGET_NO_FLOAT.
+ (mips_override_options): Move -mno-float override -msoft-float and
+ -mhard-float.
+ * config/mips/mips.opt (mno-float): Move from sdemtk.opt, but add
+ Condition(TARGET_SUPPORTS_NO_FLOAT).
+ * config/mips/sdemtk.h (TARGET_OS_CPP_BUILTINS): Don't set
+ __mips_no_float here.
+ (SUBTARGET_OVERRIDE_OPTIONS): Delete.
+ (TARGET_SUPPORTS_NO_FLOAT): Define.
+ * config/mips/sdemtk.opt: Delete.
+
2010-05-20 Segher Boessenkool <segher@kernel.crashing.org>
* ipa-prop.c (compute_complex_ancestor_jump_func): Bail
# MIPS toolkit libraries.
tm_file="$tm_file mips/sdemtk.h"
tmake_file="$tmake_file mips/t-sdemtk"
- extra_options="$extra_options mips/sdemtk.opt"
case ${enable_threads} in
"" | yes | mipssde)
thread_file='mipssde'
"\t.previous\n", TARGET_LONG64 ? 64 : 32);
#ifdef HAVE_AS_GNU_ATTRIBUTE
- fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n",
- (TARGET_HARD_FLOAT_ABI
- ? (TARGET_DOUBLE_FLOAT
- ? ((!TARGET_64BIT && TARGET_FLOAT64) ? 4 : 1) : 2) : 3));
+ {
+ int attr;
+
+ /* No floating-point operations, -mno-float. */
+ if (TARGET_NO_FLOAT)
+ attr = 0;
+ /* Soft-float code, -msoft-float. */
+ else if (!TARGET_HARD_FLOAT_ABI)
+ attr = 3;
+ /* Single-float code, -msingle-float. */
+ else if (!TARGET_DOUBLE_FLOAT)
+ attr = 2;
+ /* 64-bit FP registers on a 32-bit target, -mips32r2 -mfp64. */
+ else if (!TARGET_64BIT && TARGET_FLOAT64)
+ attr = 4;
+ /* Regular FP code, FP regs same size as GP regs, -mdouble-float. */
+ else
+ attr = 1;
+
+ fprintf (asm_out_file, "\t.gnu_attribute 4, %d\n", attr);
+ }
#endif
}
SUBTARGET_OVERRIDE_OPTIONS;
#endif
+ /* -mno-float overrides -mhard-float and -msoft-float. */
+ if (TARGET_NO_FLOAT)
+ {
+ target_flags |= MASK_SOFT_FLOAT_ABI;
+ target_flags_explicit |= MASK_SOFT_FLOAT_ABI;
+ }
+
/* Set the small data limit. */
mips_small_data_threshold = (g_switch_set
? g_switch_value
\
/* These defines reflect the ABI in use, not whether the \
FPU is directly accessible. */ \
- if (TARGET_HARD_FLOAT_ABI) \
+ if (TARGET_NO_FLOAT) \
+ builtin_define ("__mips_no_float"); \
+ else if (TARGET_HARD_FLOAT_ABI) \
builtin_define ("__mips_hard_float"); \
else \
builtin_define ("__mips_soft_float"); \
Target Report Var(TARGET_MT)
Allow the use of MT instructions
+mno-float
+Target Report RejectNegative Var(TARGET_NO_FLOAT) Condition(TARGET_SUPPORTS_NO_FLOAT)
+Prevent the use of all floating-point operations
+
mno-flush-func
Target RejectNegative
Do not use a cache-flushing function before calling stack trampolines
builtin_define ("__mipsfp64"); \
\
if (TARGET_NO_FLOAT) \
- { \
- builtin_define ("__NO_FLOAT"); \
- builtin_define ("__mips_no_float"); \
- } \
+ builtin_define ("__NO_FLOAT"); \
else if (TARGET_SOFT_FLOAT_ABI) \
builtin_define ("__SOFT_FLOAT"); \
else if (TARGET_SINGLE_FLOAT) \
} \
while (0)
-#undef SUBTARGET_OVERRIDE_OPTIONS
-#define SUBTARGET_OVERRIDE_OPTIONS \
- do \
- { \
- if (TARGET_NO_FLOAT) \
- { \
- target_flags |= MASK_SOFT_FLOAT_ABI; \
- target_flags_explicit |= MASK_SOFT_FLOAT_ABI; \
- } \
- } \
- while (0)
-
/* For __clear_cache in libgcc2.c. */
#ifdef IN_LIBGCC2
extern void mips_sync_icache (void *beg, unsigned long len);
/* ...nor does the call sequence preserve $31. */
#undef MIPS_SAVE_REG_FOR_PROFILING_P
#define MIPS_SAVE_REG_FOR_PROFILING_P(REGNO) ((REGNO) == RETURN_ADDR_REGNUM)
+
+/* Compile in support for the -mno-float option. */
+#define TARGET_SUPPORTS_NO_FLOAT 1
+++ /dev/null
-; Options for the MIPS SDE configuration.
-;
-; Copyright (C) 2007 Free Software Foundation, Inc.
-;
-; This file is part of GCC.
-;
-; GCC is free software; you can redistribute it and/or modify it under
-; the terms of the GNU General Public License as published by the Free
-; Software Foundation; either version 3, or (at your option) any later
-; version.
-;
-; GCC is distributed in the hope that it will be useful, but WITHOUT
-; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-; License for more details.
-;
-; You should have received a copy of the GNU General Public License
-; along with GCC; see the file COPYING3. If not see
-; <http://www.gnu.org/licenses/>.
-
-mno-float
-Target Report RejectNegative Var(TARGET_NO_FLOAT)
-Prevent the use of all floating-point operations