Hi all, Following up from patch 3/4 there are a few more instances where we check that an RTX is CONST_INT_P and then compare its INTVAL against 1 or 0. These can be replaced by just comparing the RTX directly against CONST1_RTX or CONST0_RTX.
This patch does that. Bootstrapped and tested on arm-none-linux-gnueabihf. Committing to trunk as obvious. Thanks, Kyrill 2016-05-24 Kyrylo Tkachov <kyrylo.tkac...@arm.com> * config/arm/neon.md (ashldi3_neon): Replace comparison of INTVAL of operands[2] against 1 with comparison against CONST1_RTX. (<shift>di3_neon): Likewise. * config/arm/predicates.md (const0_operand): Replace with comparison against CONST0_RTX.
diff --git a/gcc/config/arm/neon.md b/gcc/config/arm/neon.md index 21eed7bb99c48d508a1c8be9c8f992ae07f3d550..e2fdfbb04621ee6f8603849be089e8bce624214d 100644 --- a/gcc/config/arm/neon.md +++ b/gcc/config/arm/neon.md @@ -1082,7 +1082,7 @@ (define_insn_and_split "ashldi3_neon" } else { - if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) == 1 + if (operands[2] == CONST1_RTX (SImode) && (!reg_overlap_mentioned_p (operands[0], operands[1]) || REGNO (operands[0]) == REGNO (operands[1]))) /* This clobbers CC. */ @@ -1184,7 +1184,7 @@ (define_insn_and_split "<shift>di3_neon" } else { - if (CONST_INT_P (operands[2]) && INTVAL (operands[2]) == 1 + if (operands[2] == CONST1_RTX (SImode) && (!reg_overlap_mentioned_p (operands[0], operands[1]) || REGNO (operands[0]) == REGNO (operands[1]))) /* This clobbers CC. */ diff --git a/gcc/config/arm/predicates.md b/gcc/config/arm/predicates.md index 86c1bb62ae9ba433afe3169e07055c1b818e26c8..762c828c98bdccebb773142f1202ec171e3438f7 100644 --- a/gcc/config/arm/predicates.md +++ b/gcc/config/arm/predicates.md @@ -149,8 +149,7 @@ (define_predicate "arm_not_immediate_operand" (match_test "const_ok_for_arm (~INTVAL (op))"))) (define_predicate "const0_operand" - (and (match_code "const_int") - (match_test "INTVAL (op) == 0"))) + (match_test "op == CONST0_RTX (mode)")) ;; Something valid on the RHS of an ARM data-processing instruction (define_predicate "arm_rhs_operand"