From patchwork Sat Sep 18 14:27:09 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [ARM] Hookize GO_IF_MODE_DEPENDENT_ADDRESS X-Patchwork-Submitter: Anatoly Sokolov X-Patchwork-Id: 65126 Message-Id: <456931950.20100918182709@post.ru> To: gcc-patches@gcc.gnu.org Cc: nickc@redhat.com Date: Sat, 18 Sep 2010 18:27:09 +0400 From: Anatoly Sokolov List-Id: 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. 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)