mips.h (LONG_MAX_SPEC): Rewrite, along with SUBTARGET_CPP_SIZE_SPEC.
authorAlexandre Oliva <aoliva@redhat.com>
Fri, 8 Mar 2002 05:59:25 +0000 (05:59 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 8 Mar 2002 05:59:25 +0000 (05:59 +0000)
* config/mips/mips.h (LONG_MAX_SPEC): Rewrite, along with
SUBTARGET_CPP_SIZE_SPEC.
* config/mips/abi64.h (LONG_MAX_SPEC): Delete.

From-SVN: r50425

gcc/ChangeLog
gcc/config/mips/abi64.h
gcc/config/mips/mips.h

index eabbbbc433a19aede4ff9fea1ba20cfa564708aa..254d804ea5f9055c508240b3fde185fc21b38928 100644 (file)
@@ -1,5 +1,9 @@
 2002-03-08  Alexandre Oliva  <aoliva@redhat.com>
 
+       * config/mips/mips.h (LONG_MAX_SPEC): Rewrite, along with
+       SUBTARGET_CPP_SIZE_SPEC.
+       * config/mips/abi64.h (LONG_MAX_SPEC): Delete.
+
        * config/mips/mips.h (SUBTARGET_CPP_SIZE_SPEC): Simplify.
 
 2002-03-07  Alexandre Oliva  <aoliva@redhat.com>
index 13581a3a712d763fe6b1ae86e298454effef6f64..43887d532f5b18a08f07760fda14556b691109e7 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of target machine for GNU compiler.  64 bit ABI support.
-   Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001 Free Software Foundation, Inc.
+   Copyright (C) 1994, 1995, 1996, 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
 
 This file is part of GNU CC.
 
@@ -214,25 +214,6 @@ Boston, MA 02111-1307, USA.  */
   (mips_abi == ABI_EABI && (NAMED)                                     \
    && FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED))
 
-/* Define LONG_MAX correctly for all users.  We need to handle 32 bit EABI,
-   64 bit EABI, N32, and N64 as possible defaults.  The checks performed here
-   are the same as the checks in override_options in mips.c that determines
-   whether MASK_LONG64 will be set.
-
-   This does not handle inappropriate options or ununusal option
-   combinations.  */
-
-#undef LONG_MAX_SPEC
-#if ((MIPS_ABI_DEFAULT == ABI_64) || ((MIPS_ABI_DEFAULT == ABI_EABI) && ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_64BIT)))
-#define LONG_MAX_SPEC \
-  "%{!mabi=32:%{!mabi=n32:%{!mlong32:%{!mgp32:%{!mips1:%{!mips2:-D__LONG_MAX__=9223372036854775807L}}}}}}"
-#else
-#define LONG_MAX_SPEC \
-  "%{mabi=64:-D__LONG_MAX__=9223372036854775807L} \
-   %{mlong64:-D__LONG_MAX__=9223372036854775807L} \
-   %{mgp64:-D__LONG_MAX__=9223372036854775807L}"
-#endif
-
 /* ??? Unimplemented stuff follows.  */
 
 /* ??? Add support for 16 byte/128 bit long doubles here when
index 80d7dea210e6dce1a32c0256a70c9096e2321c7f..24c6e976af951c09b62085f1099694f2e0ebd675 100644 (file)
@@ -1060,6 +1060,23 @@ extern int mips_abi;
  %{mgp64:%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}} \
 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
 "
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi|!mabi=*:\
+  %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+    %{mips3|mips4|mips5|mips64|mgp64: \
+      -D__LONG_MAX__=9223372036854775807L}}}}}}}} \
+"
+#else /* ABI_DEFAULT != ABI_EABI */
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi:\
+  %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+    %{mips3|mips4|mips5|mips64|mgp64: \
+      -D__LONG_MAX__=9223372036854775807L}}}}}}}} \
+"
 #endif
 
 #if MIPS_ABI_DEFAULT == ABI_O64
@@ -1131,6 +1148,21 @@ extern int mips_abi;
  %{!mgp32:%{mlong64:-D__SIZE_TYPE__=long\\ unsigned\\ int -D__PTRDIFF_TYPE__=long\\ int}}} \
 %{mabi=32:-D__SIZE_TYPE__=unsigned\\ int -D__PTRDIFF_TYPE__=int} \
 "
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi|!mabi=*:\
+  %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+    -D__LONG_MAX__=9223372036854775807L}}}}}}}\
+"
+#else /* ABI_DEFAULT != ABI_EABI */
+#define LONG_MAX_SPEC "\
+%{mlong64:-D__LONG_MAX__=9223372036854775807L}\
+%{!mlong64:\
+ %{mabi=eabi:\
+  %{!mips1:%{!mips2:%{!mips32:%{!mgp32:%{!mlong32: \
+    -D__LONG_MAX__=9223372036854775807L}}}}}}}\
+"
 #endif
 
 #if MIPS_ABI_DEFAULT == ABI_O64
@@ -1188,16 +1220,6 @@ extern int mips_abi;
 #define SUBTARGET_CPP_SPEC ""
 #endif
 
-/* If we're using 64bit longs, then we have to define __LONG_MAX__
-   correctly.  Similarly for 64bit ints and __INT_MAX__.  */
-#ifndef LONG_MAX_SPEC
-#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_LONG64)
-#define LONG_MAX_SPEC "%{!mlong32:-D__LONG_MAX__=9223372036854775807L}"
-#else
-#define LONG_MAX_SPEC "%{mlong64:-D__LONG_MAX__=9223372036854775807L}"
-#endif
-#endif
-
 /* Define appropriate macros for fpr register size.  */
 #ifndef CPP_FPR_SPEC
 #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_FLOAT64)