[ARM][4/4] Simplify checks for CONST_INT_P and comparison against 1/0
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Tue, 24 May 2016 14:04:03 +0000 (14:04 +0000)
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>
Tue, 24 May 2016 14:04:03 +0000 (14:04 +0000)
* 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.

From-SVN: r236641

gcc/ChangeLog
gcc/config/arm/neon.md
gcc/config/arm/predicates.md

index a932987aab9bf4d5eb37f6ea59a740acaaebe6d4..a76178edd00d3db55c05f54e931a6fdf18b1e872 100644 (file)
@@ -1,3 +1,11 @@
+2016-05-24  Kyrylo Tkachov  <kyrylo.tkachov@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.
+
 2016-05-24  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        * config/arm/arm.md (ashldi3): Replace comparison of INTVAL of
index 21eed7bb99c48d508a1c8be9c8f992ae07f3d550..e2fdfbb04621ee6f8603849be089e8bce624214d 100644 (file)
       }
     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.  */
       }
     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.  */
index 4b4b4fe9e45a0957bf8f5b19633c99b2a7b34eb8..4504ecc2810ced15cb70ab93487635c7dafa9972 100644 (file)
        (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"