diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c4d1807ca26..76e38ad310e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2003-09-29 Kazu Hirata + + * config/h8300/h8300.md (*tstsi_variable_bit): New. + (*tstsi_variable_bit_qi): Likewise. + 2003-09-28 Phil Edwards * doc/cppopts.texi: Use 'dashMP' instead of '-MP' as a cross- diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md index b17a03ead80..33828bc1e5e 100644 --- a/gcc/config/h8300/h8300.md +++ b/gcc/config/h8300/h8300.md @@ -652,6 +652,42 @@ (match_dup 3)))] "operands[3] = GEN_INT (INTVAL (operands[1]) - 16);") +(define_insn "*tstsi_variable_bit" + [(set (cc0) + (zero_extract:SI (match_operand:SI 0 "register_operand" "r") + (const_int 1) + (and:SI (match_operand:SI 1 "register_operand" "r") + (const_int 7))))] + "TARGET_H8300H || TARGET_H8300S" + "btst %w1,%w0" + [(set_attr "length" "2") + (set_attr "cc" "set_zn")]) + +(define_insn_and_split "*tstsi_variable_bit_qi" + [(set (cc0) + (zero_extract:SI (zero_extend:SI (match_operand:QI 0 "general_operand_src" "r,U,mn>")) + (const_int 1) + (and:SI (match_operand:SI 1 "register_operand" "r,r,r") + (const_int 7)))) + (clobber (match_scratch:QI 2 "=X,X,&r"))] + "(TARGET_H8300H || TARGET_H8300S)" + "@ + btst\\t%w1,%X0 + btst\\t%w1,%X0 + #" + "&& reload_completed + && !EXTRA_CONSTRAINT (operands[0], 'U')" + [(set (match_dup 2) + (match_dup 0)) + (parallel [(set (cc0) (zero_extract:SI (zero_extend:SI (match_dup 2)) + (const_int 1) + (and:SI (match_dup 1) + (const_int 7)))) + (clobber (scratch:QI))])] + "" + [(set_attr "length" "2,8,10") + (set_attr "cc" "set_zn,set_zn,set_zn")]) + (define_insn "tstqi" [(set (cc0) (match_operand:QI 0 "register_operand" "r"))] ""