From 4a210f9e6e644f55cbb49c72fb1ed48344cb85f1 Mon Sep 17 00:00:00 2001 From: thorpej Date: Sun, 15 Sep 2002 19:15:28 +0000 Subject: [PATCH] * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Add MIPS ABI CPP macros. (TARGET_CPU_CPP_BUILTINS): Redefine. (SUBTARGET_EXTRA_SPECS): Remove subtarget_endian_default. (SUBTARGET_ENDIAN_DEFAULT_SPEC): Remove. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@57171 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 +++++ gcc/config/mips/netbsd.h | 79 +++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 80 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dbe92ef9cd6..a379167e47e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2002-09-15 Jason Thorpe + + * config/mips/netbsd.h (TARGET_OS_CPP_BUILTINS): Add + MIPS ABI CPP macros. + (TARGET_CPU_CPP_BUILTINS): Redefine. + (SUBTARGET_EXTRA_SPECS): Remove subtarget_endian_default. + (SUBTARGET_ENDIAN_DEFAULT_SPEC): Remove. + 2002-09-15 Kaveh R. Ghazi * ia64/aix.h (TARGET_OS_CPP_BUILTINS): Fix typo. diff --git a/gcc/config/mips/netbsd.h b/gcc/config/mips/netbsd.h index 02ba41386e3..fa6291dd9ec 100644 --- a/gcc/config/mips/netbsd.h +++ b/gcc/config/mips/netbsd.h @@ -38,9 +38,81 @@ Boston, MA 02111-1307, USA. */ builtin_assert ("machine=mips"); \ if (TARGET_LONG64) \ builtin_define ("__LONG64"); \ + \ + if (mips_abi == ABI_EABI) \ + builtin_define ("__mips_eabi"); \ + else if (mips_abi == ABI_N32) \ + builtin_define ("__mips_n32"); \ + else if (mips_abi == ABI_64) \ + builtin_define ("__mips_n64"); \ + else if (mips_abi == ABI_O64) \ + builtin_define ("__mips_o64"); \ } \ while (0) +/* The generic MIPS TARGET_CPU_CPP_BUILTINS are incorrect for NetBSD. + Specifically, they define too many namespace-invasive macros. Override + them here. Note this is structured for easy comparison to the version + in mips.h. + + FIXME: This probably isn't the best solution. But in the absense + of something better, it will have to do, for now. */ + +#undef TARGET_CPU_CPP_BUILTINS +#define TARGET_CPU_CPP_BUILTINS() \ + do \ + { \ + builtin_assert ("cpu=mips"); \ + builtin_define ("__mips__"); \ + builtin_define ("_mips"); \ + \ + /* No _R3000 or _R4000. */ \ + if (TARGET_64BIT) \ + builtin_define ("__mips64"); \ + \ + if (TARGET_FLOAT64) \ + builtin_define ("__mips_fpr=64"); \ + else \ + builtin_define ("__mips_fpr=32"); \ + \ + if (TARGET_MIPS16) \ + builtin_define ("__mips16"); \ + \ + MIPS_CPP_SET_PROCESSOR ("_MIPS_ARCH", mips_arch_info); \ + MIPS_CPP_SET_PROCESSOR ("_MIPS_TUNE", mips_tune_info); \ + \ + if (ISA_MIPS1) \ + builtin_define ("__mips=1"); \ + else if (ISA_MIPS2) \ + builtin_define ("__mips=2"); \ + else if (ISA_MIPS3) \ + builtin_define ("__mips=3"); \ + else if (ISA_MIPS4) \ + builtin_define ("__mips=4"); \ + else if (ISA_MIPS32) \ + builtin_define ("__mips=32"); \ + else if (ISA_MIPS64) \ + builtin_define ("__mips=64"); \ + \ + if (TARGET_HARD_FLOAT) \ + builtin_define ("__mips_hard_float"); \ + else if (TARGET_SOFT_FLOAT) \ + builtin_define ("__mips_soft_float"); \ + \ + if (TARGET_SINGLE_FLOAT) \ + builtin_define ("__mips_single_float"); \ + \ + if (TARGET_BIG_ENDIAN) \ + builtin_define ("__MIPSEB__"); \ + else \ + builtin_define ("__MIPSEL__"); \ + \ + /* No language dialect defines. */ \ + \ + /* ABIs handled in TARGET_OS_CPP_BUILTINS. */ \ + } \ + while (0) + /* Include the generic MIPS ELF configuration. */ #include @@ -60,17 +132,10 @@ Boston, MA 02111-1307, USA. */ /* Extra specs we need. */ #undef SUBTARGET_EXTRA_SPECS #define SUBTARGET_EXTRA_SPECS \ - { "subtarget_endian_default", SUBTARGET_ENDIAN_DEFAULT_SPEC }, \ { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ { "netbsd_link_spec", NETBSD_LINK_SPEC_ELF }, \ { "netbsd_entry_point", NETBSD_ENTRY_POINT }, -#if TARGET_ENDIAN_DEFAULT != 0 -#define SUBTARGET_ENDIAN_DEFAULT_SPEC "-D__MIPSEB__" -#else -#define SUBTARGET_ENDIAN_DEFAULT_SPEC "-D__MIPSEL__" -#endif - /* Provide a SUBTARGET_CPP_SPEC appropriate for NetBSD. */ #undef SUBTARGET_CPP_SPEC -- 2.11.4.GIT