thumb2.md (peephole2 to convert zero_extract/compare of lowest bits to lshift/compare...
authorWei Guozhi <carrot@google.com>
Wed, 7 Jul 2010 17:55:27 +0000 (17:55 +0000)
committerJing Yu <jingyu@gcc.gnu.org>
Wed, 7 Jul 2010 17:55:27 +0000 (17:55 +0000)
2010-07-07  Wei Guozhi  <carrot@google.com>

        * config/arm/thumb2.md (peephole2 to convert zero_extract/compare
        of lowest bits to lshift/compare): New.

From-SVN: r161929

gcc/ChangeLog
gcc/config/arm/thumb2.md

index 45e211a531fa31640674474fe170a1b077f9dd51..e3330dc4150918f0b15333669666f7ad88ce30a3 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-07  Wei Guozhi  <carrot@google.com>
+
+       * config/arm/thumb2.md (peephole2 to convert zero_extract/compare
+       of lowest bits to lshift/compare): New.
+
 2010-07-07  Tom Tromey  <tromey@redhat.com>
 
        * doc/tm.texi: Update.
index 2e03b8d643083fe2673f022b016b8f1ad7bd16a6..77f1ac49f4956bd7bac114733aecb55d17d736f5 100644 (file)
                                VOIDmode, operands[0], const0_rtx);
   ")
 
+(define_peephole2
+  [(set (match_operand:CC_NOOV 0 "cc_register" "")
+       (compare:CC_NOOV (zero_extract:SI
+                         (match_operand:SI 1 "low_register_operand" "")
+                         (match_operand:SI 2 "const_int_operand" "")
+                         (const_int 0))
+                        (const_int 0)))
+   (match_scratch:SI 3 "l")
+   (set (pc)
+       (if_then_else (match_operator:CC_NOOV 4 "equality_operator"
+                      [(match_dup 0) (const_int 0)])
+                     (match_operand 5 "" "")
+                     (match_operand 6 "" "")))]
+  "TARGET_THUMB2
+   && (INTVAL (operands[2]) > 0 && INTVAL (operands[2]) < 32)"
+  [(parallel [(set (match_dup 0)
+                  (compare:CC_NOOV (ashift:SI (match_dup 1) (match_dup 2))
+                                   (const_int 0)))
+             (clobber (match_dup 3))])
+   (set (pc)
+       (if_then_else (match_op_dup 4 [(match_dup 0) (const_int 0)])
+                     (match_dup 5) (match_dup 6)))]
+  ")