From patchwork Wed Sep 15 22:31:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: ARM: More reorganization of extend patterns (PR43137) Date: Wed, 15 Sep 2010 12:31:01 -0000 From: Bernd Schmidt X-Patchwork-Id: 64922 Message-Id: <4C914925.1030003@codesourcery.com> To: Richard Earnshaw Cc: GCC Patches On 09/01/2010 05:52 PM, Richard Earnshaw wrote: > On Tue, 2010-07-13 at 10:56 +0100, Bernd Schmidt wrote: >> This patch merges a number of different extend:DI patterns by using a >> QHSI mode_iterator. It also removes separate patterns from thumb2.md >> as >> we can just set attr ce_count for ARM patterns as well. I've >> completed >> what I'd partially done in my previous patch, which is to remove >> unnecessary constant pool handling from these patterns - none of them >> accept constants. > The define_mode_attrs need to be moved to iterators.md. Also, a number > of patterns have been changed (inconsistently with the rest of arm.md) > to not have the terminating ')' in column 1. > > Otherwise, OK. This had one undesirable side effect. The extendsidi patterns now accept memory arguments, which can make it impossible for the combiner to generate adddi_[zs]esidi patterns. Fixed with this patch, regression tested in the same way as the previous one. Ok? Bernd * config/arm/iterators.md (qhs_extenddi_op): New mode_attr. * config/arm/arm.md (zero_extenddi2, extenddi2): Use it for the source operand. Index: gcc/config/arm/iterators.md =================================================================== --- gcc/config/arm/iterators.md (revision 163935) +++ gcc/config/arm/iterators.md (working copy) @@ -374,6 +374,9 @@ (define_mode_attr V_unpack [(V16QI "V8 (define_mode_attr qhs_zextenddi_cond [(SI "") (HI "&& arm_arch6") (QI "")]) (define_mode_attr qhs_sextenddi_cond [(SI "") (HI "&& arm_arch6") (QI "&& arm_arch6")]) +(define_mode_attr qhs_extenddi_op [(SI "s_register_operand") + (HI "nonimmediate_operand") + (QI "nonimmediate_operand")]) ;;---------------------------------------------------------------------------- ;; Code attributes Index: gcc/config/arm/arm.md =================================================================== --- gcc/config/arm/arm.md (revision 163935) +++ gcc/config/arm/arm.md (working copy) @@ -4039,7 +4039,7 @@ (define_expand "truncdfhf2" (define_insn "zero_extenddi2" [(set (match_operand:DI 0 "s_register_operand" "=r") - (zero_extend:DI (match_operand:QHSI 1 "nonimmediate_operand" "rm")))] + (zero_extend:DI (match_operand:QHSI 1 "" "rm")))] "TARGET_32BIT " "#" [(set_attr "length" "8") @@ -4049,7 +4049,7 @@ (define_insn "zero_extenddi2" (define_insn "extenddi2" [(set (match_operand:DI 0 "s_register_operand" "=r") - (sign_extend:DI (match_operand:QHSI 1 "nonimmediate_operand" "rm")))] + (sign_extend:DI (match_operand:QHSI 1 "" "rm")))] "TARGET_32BIT " "#" [(set_attr "length" "8")