* config/h8300/h8300.md (a peephole2): New.
authorKazu Hirata <kazu@cs.umass.edu>
Mon, 3 Mar 2003 12:57:10 +0000 (12:57 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Mon, 3 Mar 2003 12:57:10 +0000 (12:57 +0000)
From-SVN: r63719

gcc/ChangeLog
gcc/config/h8300/h8300.md

index 8b81f7e31eb8c379fb1f38538901212138f72399..5d6ece21ceecff21fb4ead8b2ac61d5c06828c83 100644 (file)
@@ -1,3 +1,7 @@
+2003-03-03  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.md (a peephole2): New.
+
 2003-03-03  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.md (*extzv_8_8): Use shorter code when
index 28cb87ec7ff461cbe7049cb6bd5e992e8a67baf6..1c031b90381def8cb7e6922318515cee639a7eb5 100644 (file)
                  ? gen_rtx_GE (VOIDmode, cc0_rtx, const0_rtx)
                  : gen_rtx_LT (VOIDmode, cc0_rtx, const0_rtx));")
 
+(define_peephole2
+  [(set (match_operand:SI 0 "register_operand" "")
+       (match_operand:SI 1 "register_operand" ""))
+   (set (match_dup 0)
+       (and:SI (match_dup 0)
+               (const_int 255)))]
+  "(TARGET_H8300H || TARGET_H8300S)
+   && REG_P (operands[0])
+   && REG_P (operands[1])
+   && REGNO (operands[0]) != REGNO (operands[1])"
+  [(set (match_dup 0)
+       (const_int 0))
+   (set (strict_low_part (match_dup 2))
+       (match_dup 3))]
+  "operands[2] = gen_rtx_REG (QImode, REGNO (operands[0]));
+   operands[3] = gen_rtx_REG (QImode, REGNO (operands[1]));")
+
 ;; (compare (reg:SI) (const_int)) takes 6 bytes, so we try to achieve
 ;; the equivalent with shorter sequences.  Here is the summary.  Cases
 ;; are grouped for each define_peephole2.