h8300.md (a peephole2): Generalize to accept a memory operand.
authorKazu Hirata <kazu@cs.umass.edu>
Thu, 6 Mar 2003 01:34:55 +0000 (01:34 +0000)
committerKazu Hirata <kazu@gcc.gnu.org>
Thu, 6 Mar 2003 01:34:55 +0000 (01:34 +0000)
* config/h8300/h8300.md (a peephole2): Generalize to
accept a memory operand.

From-SVN: r63883

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

index 5d76f719e8f9b6063a8d7668efb45945e43c2fd2..e5c4f3c0e10d798144a428b38c761101456256d3 100644 (file)
@@ -1,3 +1,8 @@
+2003-03-05  Kazu Hirata  <kazu@cs.umass.edu>
+
+       * config/h8300/h8300.md (a peephole2): Generalize to
+       accept a memory operand.
+
 Wed Mar  5 19:34:18 2003  Olivier Hainque <hainque@act-europe.fr>
 
        * config/alpha/alpha.h (PRINT_OPERAND_PUNCT_VALID_P): Add '+'.
index cb6bc7a0dbd2fa9ac9412c16ee3008656c9d4e5b..ed154b7d79a2ad3938b9fd34b1e0f8307ba04b3e 100644 (file)
 
 (define_peephole2
   [(set (match_operand:SI 0 "register_operand" "")
-       (match_operand:SI 1 "register_operand" ""))
+       (match_operand:SI 1 "general_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])"
+   && !reg_overlap_mentioned_p (operands[0], operands[1])
+   && !(GET_CODE (operands[1]) == MEM && MEM_VOLATILE_P (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]));")
+  "operands[2] = gen_lowpart (QImode, operands[0]);
+   operands[3] = gen_lowpart (QImode, 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