c4x-protos.h (c4x_legitimize_reload_address): Remove.
authorHerman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
Tue, 23 Jan 2001 05:28:15 +0000 (06:28 +0100)
committerMichael Hayes <m.hayes@gcc.gnu.org>
Tue, 23 Jan 2001 05:28:15 +0000 (05:28 +0000)
* c4x-protos.h (c4x_legitimize_reload_address): Remove.
* c4x.c (c4x_legitimize_reload_address): Remove.
* c4x.h (LEGITIMIZE_RELOAD_ADDRESS): Rewrite to generate correct
reload address for ldp(k) insn.

From-SVN: r39194

gcc/ChangeLog
gcc/config/c4x/c4x-protos.h
gcc/config/c4x/c4x.c
gcc/config/c4x/c4x.h

index 7ab2abcf79e5e8bd74b57baca2e9ad221e293c03..7b17a864e3843a9966ac3d8a1a0855e3d6fedac4 100644 (file)
@@ -1,3 +1,10 @@
+2001-01-23  Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+       * c4x-protos.h (c4x_legitimize_reload_address): Remove.
+       * c4x.c (c4x_legitimize_reload_address): Remove.
+       * c4x.h (LEGITIMIZE_RELOAD_ADDRESS): Rewrite to generate correct
+       reload address for ldp(k) insn.
+
 Mon Jan 22 20:53:47 2001  Jeffrey A Law  (law@cygnus.com)
 
        * pa.md (return_internal): Add a USE of the PIC register to ensure
index 4814e97cd8c0e948205133b6eda9968441e676e0..9685f3915dcdbcaafecd354d7edbf6846f3ab3b5 100644 (file)
@@ -91,8 +91,6 @@ extern int c4x_hard_regno_mode_ok PARAMS ((unsigned int, enum machine_mode));
 extern struct rtx_def *c4x_legitimize_address PARAMS ((rtx,
                                                       enum machine_mode));
 
-extern struct rtx_def *c4x_legitimize_reload_address PARAMS ((rtx, enum machine_mode, rtx));
-
 extern int c4x_address_cost PARAMS ((rtx));
 
 extern void c4x_print_operand PARAMS ((FILE *, rtx, int));
index 3ce7987c06d36c8e5ac12444599deaff95af3507..346459f0d071d2da1149af8e644d17ffdd2d258d 100644 (file)
@@ -1679,32 +1679,6 @@ c4x_legitimize_address (orig, mode)
 }
 
 
-rtx
-c4x_legitimize_reload_address (orig, mode, insn)
-     rtx orig ATTRIBUTE_UNUSED;
-     enum machine_mode mode;
-     rtx insn;
-{                                                                      
-  if (mode != HImode 
-      && mode != HFmode
-      && GET_MODE (orig) != HImode
-      && GET_MODE (orig) != HFmode
-      && (GET_CODE (orig) == CONST                                     
-          || GET_CODE (orig) == SYMBOL_REF                             
-          || GET_CODE (orig) == LABEL_REF))
-    {                                                                   
-      rtx dp_reg = gen_rtx_REG (Pmode, DP_REGNO);                      
-      if (! TARGET_SMALL)                                              
-        emit_insn_before (gen_rtx_SET (VOIDmode, dp_reg,               
-                                      gen_rtx_HIGH (Pmode, orig)),     
-                         insn);
-      return gen_rtx_LO_SUM (Pmode, dp_reg, orig);
-    }
-
-  return NULL_RTX;
-}
-
-
 /* Provide the costs of an addressing mode that contains ADDR.
    If ADDR is not a valid address, its cost is irrelevant.  
    This is used in cse and loop optimisation to determine
index 49b979eca5192173ec464e53e0ceda65653615a4..ce1493debd13e0d96c5a72d4f15237189f5cb8b5 100644 (file)
@@ -1705,18 +1705,55 @@ CUMULATIVE_ARGS;
 
 #define LEGITIMIZE_RELOAD_ADDRESS(X,MODE,OPNUM,TYPE,IND_LEVELS,WIN)     \
 {                                                                      \
-  rtx new;                                                             \
-  new = c4x_legitimize_reload_address (X, MODE, insn);                 \
-  if (new != NULL_RTX)                                                 \
-  {                                                                    \
-    (X) = new;                                                         \
-   /* We do not have to call push_reload because we do not require      \
-      any more reloads.  */                                            \
-    goto WIN;                                                          \
-  }                                                                    \
+  if (MODE != HImode                                                   \
+      && MODE != HFmode                                                        \
+      && GET_MODE (X) != HImode                                                \
+      && GET_MODE (X) != HFmode                                                \
+      && (GET_CODE (X) == CONST                                                \
+          || GET_CODE (X) == SYMBOL_REF                                        \
+          || GET_CODE (X) == LABEL_REF))                               \
+    {                                                                  \
+      if (! TARGET_SMALL)                                              \
+       {                                                               \
+          int i;                                                       \
+         X = gen_rtx_LO_SUM (GET_MODE (X),                             \
+                             gen_rtx_HIGH (GET_MODE (X), X), X);       \
+          i = push_reload (XEXP (X, 0), NULL_RTX,                      \
+                          &XEXP (X, 0), NULL_PTR,                      \
+                          DP_REG, GET_MODE (X), VOIDmode, 0, 0,        \
+                          OPNUM, TYPE);                                \
+          /* The only valid reg is DP. This is a fixed reg and will    \
+            normally not be used so force it.  */                      \
+          rld[i].reg_rtx = gen_rtx_REG (Pmode, DP_REGNO);              \
+          rld[i].nocombine = 1;                                        \
+        }                                                              \
+      goto WIN;                                                                \
+   }                                                                   \
+  else if (MODE != HImode                                              \
+           && MODE != HFmode                                           \
+           && GET_MODE (X) != HImode                                   \
+           && GET_MODE (X) != HFmode                                   \
+           && GET_CODE (X) == LO_SUM                                   \
+           && GET_CODE (XEXP (X,0)) == HIGH                            \
+           && (GET_CODE (XEXP (XEXP (X,0),0)) == CONST                 \
+               || GET_CODE (XEXP (XEXP (X,0),0)) == SYMBOL_REF         \
+               || GET_CODE (XEXP (XEXP (X,0),0)) == LABEL_REF))                \
+    {                                                                  \
+      if (! TARGET_SMALL)                                              \
+       {                                                               \
+          int i = push_reload (XEXP (X, 0), NULL_RTX,                  \
+                              &XEXP (X, 0), NULL_PTR,                  \
+                              DP_REG, GET_MODE (X), VOIDmode, 0, 0,    \
+                              OPNUM, TYPE);                            \
+          /* The only valid reg is DP. This is a fixed reg and will    \
+            normally not be used so force it.  */                      \
+          rld[i].reg_rtx = gen_rtx_REG (Pmode, DP_REGNO);              \
+          rld[i].nocombine = 1;                                        \
+        }                                                              \
+      goto WIN;                                                                \
+   }                                                                   \
 }
 
-
 /* No mode-dependent addresses on the C4x are autoincrements.  */
 
 #define GO_IF_MODE_DEPENDENT_ADDRESS(ADDR, LABEL)      \