From e2c14f5d512a5a5e8a658030789dea947c42068e Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Mon, 2 Jul 2007 10:11:56 +0000 Subject: [PATCH] gcc/ * config.gcc (mipsisa32-*-elf*, mipsisa32el-*-elf*) (mipsisa32r2-*-elf*, mipsisa32r2el-*-elf*) (mipsisa64-*-elf*, mipsisa64el-*-elf*): Combine top-level stanzas. Use the first part of the triplet to set MIPS_ISA_DEFAULT. Remove redundant setting of MASK_FLOAT64 and MASK_64BIT for the 64-bit targets. Add support for *-elfoabi*. * config/mips/t-isa3264 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Use different settings if $(tm_defines) does not select the EABI. (MULTILIB_EXCLUSIONS): Define in those circumstances. * config/mips/mips.h (MIPS_ISA_LEVEL_OPTION_SPEC): New macro. (MIPS_ARCH_OPTION_SPEC): Likewise. (MIPS_ISA_LEVEL_SPEC): Likewise. (OPTION_DEFAULT_SPECS): Use MIPS_ARCH_OPTION_SPEC. * config/mips/elfoabi.h: New file. From-SVN: r126195 --- gcc/ChangeLog | 17 ++++++++++++++++ gcc/config.gcc | 41 +++++++++++++++++++++++++-------------- gcc/config/mips/elfoabi.h | 41 +++++++++++++++++++++++++++++++++++++++ gcc/config/mips/mips.h | 25 +++++++++++++++++++++++- gcc/config/mips/t-isa3264 | 10 ++++++++++ 5 files changed, 118 insertions(+), 16 deletions(-) create mode 100644 gcc/config/mips/elfoabi.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 31e1b425bea..f1452ac2a19 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,20 @@ +2007-07-02 Richard Sandiford + + * config.gcc (mipsisa32-*-elf*, mipsisa32el-*-elf*) + (mipsisa32r2-*-elf*, mipsisa32r2el-*-elf*) + (mipsisa64-*-elf*, mipsisa64el-*-elf*): Combine top-level + stanzas. Use the first part of the triplet to set MIPS_ISA_DEFAULT. + Remove redundant setting of MASK_FLOAT64 and MASK_64BIT for the + 64-bit targets. Add support for *-elfoabi*. + * config/mips/t-isa3264 (MULTILIB_OPTIONS, MULTILIB_DIRNAMES): Use + different settings if $(tm_defines) does not select the EABI. + (MULTILIB_EXCLUSIONS): Define in those circumstances. + * config/mips/mips.h (MIPS_ISA_LEVEL_OPTION_SPEC): New macro. + (MIPS_ARCH_OPTION_SPEC): Likewise. + (MIPS_ISA_LEVEL_SPEC): Likewise. + (OPTION_DEFAULT_SPECS): Use MIPS_ARCH_OPTION_SPEC. + * config/mips/elfoabi.h: New file. + 2007-07-02 Richard Guenther * tree-flow.h (tree_ssa_useless_type_conversion_1): Rename to ... diff --git a/gcc/config.gcc b/gcc/config.gcc index 9700c046e3c..d3358c3fad4 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -1673,24 +1673,35 @@ mips*-*-openbsd*) *) tm_defines="${tm_defines} TARGET_ENDIAN_DEFAULT=MASK_BIG_ENDIAN";; esac ;; -mipsisa32-*-elf* | mipsisa32el-*-elf*) - tm_file="elfos.h ${tm_file} mips/elf.h" - tmake_file=mips/t-isa3264 - tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32 MIPS_ABI_DEFAULT=ABI_EABI" - use_fixproto=yes - ;; -mipsisa32r2-*-elf* | mipsisa32r2el-*-elf*) - tm_file="elfos.h ${tm_file} mips/elf.h" - tmake_file=mips/t-isa3264 - tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33 MIPS_ABI_DEFAULT=ABI_EABI" - use_fixproto=yes - ;; +mipsisa32-*-elf* | mipsisa32el-*-elf* | \ +mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \ mipsisa64-*-elf* | mipsisa64el-*-elf*) tm_file="elfos.h ${tm_file} mips/elf.h" tmake_file=mips/t-isa3264 - target_cpu_default="MASK_64BIT|MASK_FLOAT64" - tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64 MIPS_ABI_DEFAULT=ABI_EABI" - use_fixproto=yes + case ${target} in + mipsisa32r2*) + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=33" + ;; + mipsisa32*) + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32" + ;; + mipsisa64*) + tm_defines="${tm_defines} MIPS_ISA_DEFAULT=64" + ;; + esac + case ${target} in + mipsisa32*-*-elfoabi*) + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_32" + tm_file="${tm_file} mips/elfoabi.h" + ;; + mipsisa64*-*-elfoabi*) + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_O64" + tm_file="${tm_file} mips/elfoabi.h" + ;; + *-*-elf*) + tm_defines="${tm_defines} MIPS_ABI_DEFAULT=ABI_EABI" + ;; + esac ;; mipsisa64sr71k-*-elf*) tm_file="elfos.h ${tm_file} mips/elf.h" diff --git a/gcc/config/mips/elfoabi.h b/gcc/config/mips/elfoabi.h new file mode 100644 index 00000000000..a6cffe101e7 --- /dev/null +++ b/gcc/config/mips/elfoabi.h @@ -0,0 +1,41 @@ +/* Target macros for mips*-elf targets that selected between o32 and o64 + based on the target architecture. + Copyright (C) 1994, 1997, 1999, 2000, 2002, 2003, 2004 + 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 2, 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 COPYING. If not, write to +the Free Software Foundation, 51 Franklin Street, Fifth Floor, +Boston, MA 02110-1301, USA. */ + +#define DRIVER_SELF_SPECS \ + /* Infer a -mips option from a -march option. This makes \ + -march pick the right multilib, and also makes the later \ + specs easier to write. */ \ + MIPS_ISA_LEVEL_SPEC, \ + \ + /* If no architecture option is specified, force the default to \ + be listed explicitly. This too makes later specs easier to \ + write. */ \ + "%{" MIPS_ISA_LEVEL_OPTION_SPEC ":;: -" MULTILIB_ISA_DEFAULT "}", \ + \ + /* If no ABI option is specified, infer one from the ISA level \ + or -mgp setting. */ \ + "%{!mabi=*: %{mips1|mips2|mips32*|mgp32: -mabi=32;: -mabi=o64}}", \ + \ + /* Remove a redundant -mfp64 for -mabi=o64; we want the !mfp64 \ + multilibs. There's no need to check whether the architecture \ + is 64-bit; cc1 will complain if it isn't. */ \ + "%{mabi=o64: %