From c5979bc6a244692449d277e24083da7849f78bd7 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 9 Mar 2003 13:22:59 +0000 Subject: [PATCH] h8300.md (*tstsi_upper_bit): New. * config/h8300/h8300.md (*tstsi_upper_bit): New. (*iorsi3_e2f): Likewise. From-SVN: r64026 --- gcc/ChangeLog | 5 +++++ gcc/config/h8300/h8300.md | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f4941cf541b..f82c118d4a1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-03-09 Kazu Hirata + + * config/h8300/h8300.md (*tstsi_upper_bit): New. + (*iorsi3_e2f): Likewise. + 2003-03-08 Kazu Hirata * config/h8300/h8300.c (h8300_and_costs): Return the number of diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index 0c7ab11b581..4a97214e7ae 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -629,6 +629,27 @@ [(set_attr "length" "2") (set_attr "cc" "set_zn")]) +(define_insn_and_split "*tstsi_upper_bit" + [(set (cc0) + (zero_extract:SI (match_operand:SI 0 "register_operand" "r") + (const_int 1) + (match_operand 1 "const_int_operand" "n"))) + (clobber (match_scratch:SI 2 "=&r"))] + "(TARGET_H8300H || TARGET_H8300S) + && INTVAL (operands[1]) >= 16" + "#" + "&& reload_completed" + [(set (match_dup 2) + (ior:SI (and:SI (match_dup 2) + (const_int -65536)) + (lshiftrt:SI (match_dup 0) + (const_int 16)))) + (set (cc0) + (zero_extract:SI (match_dup 2) + (const_int 1) + (match_dup 3)))] + "operands[3] = GEN_INT (INTVAL (operands[1]) - 16);") + (define_insn "" [(set (cc0) (and:HI (match_operand:HI 0 "register_operand" "r") @@ -2878,6 +2899,17 @@ [(set_attr "cc" "clobber") (set_attr "length" "2")]) +(define_insn "*iorsi3_e2f" + [(set (match_operand:SI 0 "register_operand" "=r") + (ior:SI (and:SI (match_operand:SI 1 "register_operand" "0") + (const_int -65536)) + (lshiftrt:SI (match_operand:SI 2 "register_operand" "r") + (const_int 16))))] + "TARGET_H8300H || TARGET_H8300S" + "mov.w\\t%e2,%f0" + [(set_attr "length" "2") + (set_attr "cc" "clobber")]) + (define_insn_and_split "*iorsi3_two_qi_sext" [(set (match_operand:SI 0 "register_operand" "=r") (ior:SI (zero_extend:SI (match_operand:QI 1 "register_operand" "0")) -- 2.30.2