]> gcc.gnu.org Git - gcc.git/commitdiff
abi64.h (LONG_MAX_SPEC): Check MIPS_ABI_DEFAULT and TARGET_DEFAULT, and define __LONG...
authorJim Wilson <wilson@cygnus.com>
Wed, 24 Dec 1997 22:10:46 +0000 (22:10 +0000)
committerJeff Law <law@gcc.gnu.org>
Wed, 24 Dec 1997 22:10:46 +0000 (15:10 -0700)
        * abi64.h (LONG_MAX_SPEC): Check MIPS_ABI_DEFAULT and TARGET_DEFAULT,
        and define __LONG_MAX__ appropriately.  Add support for -mabi=X,
        -mlong64, and -mgp{32,64} options.
        * mips.c (mips_abi): Change type to int.
        * mips.h (enum mips_abi_type): Delete.
        (ABI_32, ABI_N32, ABI_64, ABI_EABI): Define as constants.
        (mips_abi): Change type to int.

From-SVN: r17229

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

index be8f5ffe8b8081594c4d9b0332d373ec507b3c5c..fd3149d4700bf5050b4d6700574bc47ae2acafdc 100644 (file)
@@ -1,3 +1,13 @@
+Wed Dec 24 23:12:14 1997  Jim Wilson  <wilson@cygnus.com>
+
+       * abi64.h (LONG_MAX_SPEC): Check MIPS_ABI_DEFAULT and TARGET_DEFAULT,
+       and define __LONG_MAX__ appropriately.  Add support for -mabi=X,
+       -mlong64, and -mgp{32,64} options.
+       * mips.c (mips_abi): Change type to int.
+       * mips.h (enum mips_abi_type): Delete.
+       (ABI_32, ABI_N32, ABI_64, ABI_EABI): Define as constants.
+       (mips_abi): Change type to int.
+
 Wed Dec 24 22:38:34 1997  John Carr  <jfc@mit.edu>
 
        * flags.h, toplev.c, calls.c, alias.c: Remove flag_alias_check;
index a3e768cdc2d276efb412395b2d90c815d5f65397..4f6fccfafb9919e007a29b70508adaa8b3222d52 100644 (file)
@@ -213,8 +213,24 @@ extern struct rtx_def *mips_function_value ();
   (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
-#define LONG_MAX_SPEC "%{!mno-long64:-D__LONG_MAX__=9223372036854775807LL}"
+#if ((MIPS_ABI_DEFAULT == ABI_64) || ((MIPS_ABI_DEFAULT == ABI_EABI) && ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_64BIT)))
+#define LONG_MAX_SPEC \
+  "%{!mabi=n32:%{!mno-long64:%{!mgp32:-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.  */
 
index 6e01a92df507613a9a84d0616c9f785bd26c3038..88569abdba81b15ba5dd6a309ac68103d8908c06 100644 (file)
@@ -194,9 +194,9 @@ enum processor_type mips_cpu;
 int mips_isa;
 
 #ifdef MIPS_ABI_DEFAULT
-/* which ABI to use.  This is defined to a constant in mips.h if the target
+/* Which ABI to use.  This is defined to a constant in mips.h if the target
    doesn't support multiple ABIs.  */
-enum mips_abi_type mips_abi;
+int mips_abi;
 #endif
 
 /* Strings to hold which cpu and instruction set architecture to use.  */
index 5ce0c17210a7df5a1d58579dc6b12a3c6c87f058..919092d9782c878128b62b3a33360ee8044931a4 100644 (file)
@@ -75,21 +75,20 @@ enum processor_type {
 /* Recast the cpu class to be the cpu attribute.  */
 #define mips_cpu_attr ((enum attr_cpu)mips_cpu)
 
-/* Which ABI to use.  This is only used by the Irix 6 port currently.  */
+/* Which ABI to use.  These are constants because abi64.h must check their
+   value at preprocessing time.  */
 
-enum mips_abi_type {
-  ABI_32,
-  ABI_N32,
-  ABI_64,
-  ABI_EABI
-};
+#define ABI_32  0
+#define ABI_N32 1
+#define ABI_64  2
+#define ABI_EABI 3
 
 #ifndef MIPS_ABI_DEFAULT
 /* We define this away so that there is no extra runtime cost if the target
    doesn't support multiple ABIs.  */
 #define mips_abi ABI_32
 #else
-extern enum mips_abi_type mips_abi;
+extern int mips_abi;
 #endif
 
 /* Whether to emit abicalls code sequences or not.  */
This page took 0.088081 seconds and 5 git commands to generate.