Patchwork [ARM] Call arm_legitimize_reload_address for TARGET_32BIT.

login
register
mail settings
Submitter Ramana Radhakrishnan
Date Dec. 14, 2011, 11:44 a.m.
Message ID <CACUk7=X3isn+QxNEwZoW+J+dJBhcM5z5kt+=8SxU+7d64+tfxQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/131355/
State New
Headers show

Comments

Ramana Radhakrishnan - Dec. 14, 2011, 11:44 a.m.
And this time with the patch .

2011-12-14  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>

       * config/arm/arm.h (LEGITIMIZE_RELOAD_ADDRESS): Call
       arm_legitimize_reload_address for Thumb2 as well. Adjust call
       to thumb_legitimize_reload_address.
       * config/arm/arm-protos.h (thumb1_legitimize_reload_address): Renamed
       from thumb_legitimize_reload_address.

Patch

diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 296550a..1bbf855 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -59,7 +59,7 @@  extern int arm_legitimate_address_outer_p (enum machine_mode, rtx, RTX_CODE, int
 extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
 extern bool arm_legitimize_reload_address (rtx *, enum machine_mode, int, int,
 					   int);
-extern rtx thumb_legitimize_reload_address (rtx *, enum machine_mode, int, int,
+extern rtx thumb1_legitimize_reload_address (rtx *, enum machine_mode, int, int,
 					    int);
 extern int thumb1_legitimate_address_p (enum machine_mode, rtx, int);
 extern int arm_const_double_rtx (rtx);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index 65b4e9d..8f21495 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -6789,7 +6789,7 @@  arm_legitimize_reload_address (rtx *p,
 }
 
 rtx
-thumb_legitimize_reload_address (rtx *x_p,
+thumb1_legitimize_reload_address (rtx *x_p,
 				 enum machine_mode mode,
 				 int opnum, int type,
 				 int ind_levels ATTRIBUTE_UNUSED)
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 8a9ed1f..3cfe3e6 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1237,7 +1237,7 @@  enum reg_class
    operand.  If we find one, push the reload and jump to WIN.  This
    macro is used in only one place: `find_reloads_address' in reload.c.
 
-   For the ARM, we wish to handle large displacements off a base
+   For ARM and Thumb2, we wish to handle large displacements off a base
    register by splitting the addend across a MOV and the mem insn.
    This can cut the number of reloads needed.  */
 #define ARM_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND, WIN)	   \
@@ -1256,10 +1256,9 @@  enum reg_class
 /* We could probably achieve better results by defining PROMOTE_MODE to help
    cope with the variances between the Thumb's signed and unsigned byte and
    halfword load instructions.  */
-/* ??? This should be safe for thumb2, but we may be able to do better.  */
-#define THUMB_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_L, WIN)     \
+#define THUMB1_LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_L, WIN)     \
 do {									      \
-  rtx new_x = thumb_legitimize_reload_address (&X, MODE, OPNUM, TYPE, IND_L); \
+  rtx new_x = thumb1_legitimize_reload_address (&X, MODE, OPNUM, TYPE, IND_L); \
   if (new_x)								      \
     {									      \
       X = new_x;							      \
@@ -1268,10 +1267,10 @@  do {									      \
 } while (0)
 
 #define LEGITIMIZE_RELOAD_ADDRESS(X, MODE, OPNUM, TYPE, IND_LEVELS, WIN)   \
-  if (TARGET_ARM)							   \
+  if (TARGET_32BIT)							   \
     ARM_LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN); \
   else									   \
-    THUMB_LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN)
+    THUMB1_LEGITIMIZE_RELOAD_ADDRESS (X, MODE, OPNUM, TYPE, IND_LEVELS, WIN)
 
 /* Return the maximum number of consecutive registers
    needed to represent mode MODE in a register of class CLASS.