aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard@codesourcery.com>2007-09-10 14:51:48 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2007-09-10 14:51:48 +0000
commit7d8bed7be6a13f1c25743a1bc45361d9f4f3a662 (patch)
tree88992e8920e23fa7c52aa92c76a3834463e74984
parentb3a06f593c5e947e2ec92da37878d423ce6f021e (diff)
downloadgcc-7d8bed7be6a13f1c25743a1bc45361d9f4f3a662.zip
gcc-7d8bed7be6a13f1c25743a1bc45361d9f4f3a662.tar.gz
gcc-7d8bed7be6a13f1c25743a1bc45361d9f4f3a662.tar.bz2
mips.h (MIPS_ARCH_FLOAT_SPEC): New macro.
gcc/ * config/mips/mips.h (MIPS_ARCH_FLOAT_SPEC): New macro. * config/mips/mips.c (mips_cpu_info_table): Mention it in the the introductory comment. (MIPS_MARCH_CONTROLS_SOFT_FLOAT): Delete. (override_options): Don't test for it. * config/mips/sde.h (MIPS_MARCH_CONTROLS_SOFT_FLOAT): Delete. (DRIVER_SELF_SPECS): Add MIPS_ARCH_FLOAT_SPEC. * config/mips/vr.h: As for config/mips/sde.h. From-SVN: r128346
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/mips/mips.c33
-rw-r--r--gcc/config/mips/mips.h10
-rw-r--r--gcc/config/mips/sde.h6
-rw-r--r--gcc/config/mips/vr.h4
5 files changed, 31 insertions, 33 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d26bf10..4a5dc46 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2007-09-10 Richard Sandiford <richard@codesourcery.com>
+
+ * config/mips/mips.h (MIPS_ARCH_FLOAT_SPEC): New macro.
+ * config/mips/mips.c (mips_cpu_info_table): Mention it in the
+ the introductory comment.
+ (MIPS_MARCH_CONTROLS_SOFT_FLOAT): Delete.
+ (override_options): Don't test for it.
+ * config/mips/sde.h (MIPS_MARCH_CONTROLS_SOFT_FLOAT): Delete.
+ (DRIVER_SELF_SPECS): Add MIPS_ARCH_FLOAT_SPEC.
+ * config/mips/vr.h: As for config/mips/sde.h.
+
2007-09-10 Trevor Smigiel <trevor_smigiel@playstation.sony.com>
Revital Eres <eres@il.ibm.com>
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 2063100..5ff9073 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -740,9 +740,10 @@ const struct attribute_spec mips_attribute_table[] =
matched in the order listed. The first mention of an ISA level is
taken as the canonical name for that ISA.
- To ease comparison, please keep this table in the same order as
- gas's mips_cpu_info_table[]. Please also make sure that
- MIPS_ISA_LEVEL_SPEC handles all -march options correctly. */
+ To ease comparison, please keep this table in the same order
+ as gas's mips_cpu_info_table[]. Please also make sure that
+ MIPS_ISA_LEVEL_SPEC and MIPS_ARCH_FLOAT_SPEC handle all -march
+ options correctly. */
const struct mips_cpu_info mips_cpu_info_table[] = {
/* Entries for generic ISAs */
{ "mips1", PROCESSOR_R3000, 1 },
@@ -1216,12 +1217,6 @@ static const unsigned char mips16e_save_restore_regs[] = {
31, 30, 23, 22, 21, 20, 19, 18, 17, 16, 7, 6, 5, 4
};
-/* Nonzero if -march should decide the default value of
- MASK_SOFT_FLOAT_ABI. */
-#ifndef MIPS_MARCH_CONTROLS_SOFT_FLOAT
-#define MIPS_MARCH_CONTROLS_SOFT_FLOAT 0
-#endif
-
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.half\t"
@@ -5517,26 +5512,6 @@ override_options (void)
target_flags &= ~MASK_LONG64;
}
- if (MIPS_MARCH_CONTROLS_SOFT_FLOAT
- && (target_flags_explicit & MASK_SOFT_FLOAT_ABI) == 0)
- {
- /* For some configurations, it is useful to have -march control
- the default setting of MASK_SOFT_FLOAT_ABI. */
- switch ((int) mips_arch)
- {
- case PROCESSOR_R4100:
- case PROCESSOR_R4111:
- case PROCESSOR_R4120:
- case PROCESSOR_R4130:
- target_flags |= MASK_SOFT_FLOAT_ABI;
- break;
-
- default:
- target_flags &= ~MASK_SOFT_FLOAT_ABI;
- break;
- }
- }
-
if (!TARGET_OLDABI)
flag_pcc_struct_return = 0;
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index cc6b500..9fe11d0 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -658,6 +658,16 @@ extern enum mips_code_readable_setting mips_code_readable;
%{march=mips64|march=5k*|march=20k*|march=sb1*|march=sr71000: -mips64} \
%{!march=*: -" MULTILIB_ISA_DEFAULT "}}"
+/* A spec that infers a -mhard-float or -msoft-float setting from an
+ -march argument. Note that soft-float and hard-float code are not
+ link-compatible. */
+
+#define MIPS_ARCH_FLOAT_SPEC \
+ "%{mhard-float|msoft-float|march=mips*:; \
+ march=vr41*|march=m4k|march=4k*|march=24kc|march=24kec \
+ |march=34kc|march=74kc|march=5kc: -msoft-float; \
+ march=*: -mhard-float}"
+
/* A spec condition that matches 32-bit options. It only works if
MIPS_ISA_LEVEL_SPEC has been applied. */
diff --git a/gcc/config/mips/sde.h b/gcc/config/mips/sde.h
index d8094c5..7573bd6 100644
--- a/gcc/config/mips/sde.h
+++ b/gcc/config/mips/sde.h
@@ -20,15 +20,15 @@ along with GCC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-/* Let the -march option set soft-float. */
-#define MIPS_MARCH_CONTROLS_SOFT_FLOAT 1
-
#define DRIVER_SELF_SPECS \
/* Make sure a -mips option is present. This helps us to pick \
the right multilib, and also makes the later specs easier \
to write. */ \
MIPS_ISA_LEVEL_SPEC, \
\
+ /* Infer the default float setting from -march. */ \
+ MIPS_ARCH_FLOAT_SPEC, \
+ \
/* If no ABI option is specified, infer one from the ISA level \
or -mgp setting. */ \
"%{!mabi=*: %{" MIPS_32BIT_OPTION_SPEC ": -mabi=32;: -mabi=n32}}", \
diff --git a/gcc/config/mips/vr.h b/gcc/config/mips/vr.h
index b4949f7..9492cac 100644
--- a/gcc/config/mips/vr.h
+++ b/gcc/config/mips/vr.h
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see
#define DEFAULT_VR_ARCH "mfix-vr4130"
#define MIPS_ABI_DEFAULT ABI_EABI
-#define MIPS_MARCH_CONTROLS_SOFT_FLOAT 1
#define MULTILIB_DEFAULTS \
{ MULTILIB_ENDIAN_DEFAULT, \
MULTILIB_ABI_DEFAULT, \
@@ -41,6 +40,9 @@ along with GCC; see the file COPYING3. If not see
/* Same idea for -mfix-vr4130. */ \
"%{mfix-vr4130:%{!march=*:-march=vr4130}}", \
\
+ /* Infer the default float setting from -march. */ \
+ MIPS_ARCH_FLOAT_SPEC, \
+ \
/* Make -mabi=eabi -mlong32 the default. */ \
"%{!mabi=*:-mabi=eabi %{!mlong*:-mlong32}}", \
\