Patchwork [ARM] Hookize GO_IF_MODE_DEPENDENT_ADDRESS

login
register
mail settings
Submitter Anatoly Sokolov
Date Sept. 18, 2010, 2:27 p.m.
Message ID <456931950.20100918182709@post.ru>
Download mbox | patch
Permalink /patch/65126/
State New
Headers show

Comments

Anatoly Sokolov - Sept. 18, 2010, 2:27 p.m.
Hi.

  This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macro from the ARM
back end in the GCC and introduces equivalent TARGET_MODE_DEPENDENT_ADDRESS_P
target hook.

  Bootstrapped and regression tested on armv5tel-unknown-linux-gnueabi.

  OK to install?

        * config/arm/arm.h (CLASS_LIKELY_SPILLED_P): Remove.
        * config/arm/arm.c (TARGET_CLASS_LIKELY_SPILLED_P): Define.
        (arm_class_likely_spilled_p): New function.




Anatoly.
Anatoly Sokolov - Sept. 18, 2010, 2:41 p.m.
>  This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macro from the 
> ARM
> back end in the GCC and introduces equivalent 
> TARGET_MODE_DEPENDENT_ADDRESS_P
> target hook.

Sorry, this patch removes CLASS_LIKELY_SPILLED_P macro.
Richard Earnshaw - Sept. 20, 2010, 5 p.m.
On Sat, 2010-09-18 at 18:27 +0400, Anatoly Sokolov wrote:
> Hi.
> 
>   This patch removes obsolete GO_IF_MODE_DEPENDENT_ADDRESS macro from the ARM
> back end in the GCC and introduces equivalent TARGET_MODE_DEPENDENT_ADDRESS_P
> target hook.
> 
>   Bootstrapped and regression tested on armv5tel-unknown-linux-gnueabi.
> 
>   OK to install?
> 
>         * config/arm/arm.h (CLASS_LIKELY_SPILLED_P): Remove.
>         * config/arm/arm.c (TARGET_CLASS_LIKELY_SPILLED_P): Define.
>         (arm_class_likely_spilled_p): New function.
> 
> 

OK.

R.

Patch

Index: gcc/config/arm/arm.c
===================================================================
--- gcc/config/arm/arm.c        (revision 164355)
+++ gcc/config/arm/arm.c        (working copy)
@@ -239,6 +239,7 @@ 
 static bool cortex_a9_sched_adjust_cost (rtx, rtx, rtx, int *);
 static bool xscale_sched_adjust_cost (rtx, rtx, rtx, int *);
 static unsigned int arm_units_per_simd_word (enum machine_mode);
+static bool arm_class_likely_spilled_p (reg_class_t);
 
 
 /* Table of machine attributes.  */
@@ -545,6 +546,9 @@ 
 #undef TARGET_CAN_ELIMINATE
 #define TARGET_CAN_ELIMINATE arm_can_eliminate
 
+#undef TARGET_CLASS_LIKELY_SPILLED_P
+#define TARGET_CLASS_LIKELY_SPILLED_P arm_class_likely_spilled_p
+
 struct gcc_target targetm = TARGET_INITIALIZER;
 
 /* Obstack for minipool constant handling.  */
@@ -21892,6 +21897,22 @@ 
          ? (TARGET_NEON_VECTORIZE_QUAD ? 16 : 8) : UNITS_PER_WORD);
 }
 
+/* Implement TARGET_CLASS_LIKELY_SPILLED_P.
+ 
+   We need to define this for LO_REGS on thumb.  Otherwise we can end up
+   using r0-r4 for function arguments, r7 for the stack frame and don't
+   have enough left over to do doubleword arithmetic.  */
+
+static bool
+arm_class_likely_spilled_p (reg_class_t rclass)
+{
+  if ((TARGET_THUMB && rclass == LO_REGS)
+      || rclass  == CC_REG)
+    return true;
+
+  return false;
+}
+
 /* Implements target hook small_register_classes_for_mode_p.  */
 bool
 arm_small_register_classes_for_mode_p (enum machine_mode mode ATTRIBUTE_UNUSED)
Index: gcc/config/arm/arm.h
===================================================================
--- gcc/config/arm/arm.h        (revision 164355)
+++ gcc/config/arm/arm.h        (working copy)
@@ -1284,13 +1284,6 @@ 
      || reg_classes_intersect_p (VFP_REGS, (CLASS))    \
    : 0)
 
-/* We need to define this for LO_REGS on thumb.  Otherwise we can end up
-   using r0-r4 for function arguments, r7 for the stack frame and don't
-   have enough left over to do doubleword arithmetic.  */
-#define CLASS_LIKELY_SPILLED_P(CLASS)  \
-    ((TARGET_THUMB && (CLASS) == LO_REGS)      \
-     || (CLASS) == CC_REG)
-
 /* The class value for index registers, and the one for base regs.  */
 #define INDEX_REG_CLASS  (TARGET_THUMB1 ? LO_REGS : GENERAL_REGS)
 #define BASE_REG_CLASS   (TARGET_THUMB1 ? LO_REGS : CORE_REGS)