* config/tc-mips.c (HAVE_64BIT_ADDRESS_CONSTANTS): New.
authorAlexandre Oliva <aoliva@redhat.com>
Sun, 6 Apr 2003 03:16:20 +0000 (03:16 +0000)
committerAlexandre Oliva <aoliva@redhat.com>
Sun, 6 Apr 2003 03:16:20 +0000 (03:16 +0000)
(macro): Use new macro to decide whether to emit constant address
as 32 or 64 bits if addresses are 32-bit wide but registers are
64-bit wide.

gas/ChangeLog
gas/config/tc-mips.c

index dde3c48dda864b569a3a73fc07c181f9b950f0d7..b4183d2ede55d38357e2367e40bb85572f83fc28 100644 (file)
@@ -1,3 +1,10 @@
+2003-04-06  Chris Demetriou  <cgd@broadcom.com>
+
+       * config/tc-mips.c (HAVE_64BIT_ADDRESS_CONSTANTS): New.
+       (macro): Use new macro to decide whether to emit constant address
+       as 32 or 64 bits if addresses are 32-bit wide but registers are
+       64-bit wide.
+
 2003-04-05  Stephane Carrez  <stcarrez@nerim.fr>
 
        * config/tc-m68hc11.c (M6811_OP_CALL_ADDR): New internal define.
index 2e114f4f542f8a3e1a1e941f751c50c59b424161..e07dde39f2f807b25da19599c4a0b6c2ccf5be22 100644 (file)
@@ -294,6 +294,8 @@ static int mips_32bitmode = 0;
         && mips_pic != EMBEDDED_PIC))
 
 #define HAVE_64BIT_ADDRESSES (! HAVE_32BIT_ADDRESSES)
+#define HAVE_64BIT_ADDRESS_CONSTANTS (HAVE_64BIT_ADDRESSES \
+                                     || HAVE_64BIT_GPRS)
 
 /* Return true if the given CPU supports the MIPS16 ASE.  */
 #define CPU_HAS_MIPS16(cpu)                                            \
@@ -5845,9 +5847,10 @@ macro (ip)
             probably attempt to generate 64-bit constants more
             efficiently in general.
           */
-         if (HAVE_64BIT_ADDRESSES
-             && !(offset_expr.X_op == O_constant
-                  && IS_SEXT_32BIT_NUM (offset_expr.X_add_number + 0x8000)))
+         if ((offset_expr.X_op != O_constant && HAVE_64BIT_ADDRESSES)
+             || (offset_expr.X_op == O_constant
+                 && !IS_SEXT_32BIT_NUM (offset_expr.X_add_number)
+                 && HAVE_64BIT_ADDRESS_CONSTANTS))
            {
              p = NULL;
 
@@ -5894,6 +5897,9 @@ macro (ip)
 
              return;
            }
+         else if (offset_expr.X_op == O_constant
+                  && !IS_SEXT_32BIT_NUM (offset_expr.X_add_number))
+           as_bad (_("load/store address overflow (max 32 bits)"));
 
          if (breg == 0)
            {