+2003-09-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*tstsi_variable_bit): New.
+ (*tstsi_variable_bit_qi): Likewise.
+
2003-09-28 Phil Edwards <phil@codesourcery.com>
* doc/cppopts.texi: Use 'dashMP' instead of '-MP' as a cross-
(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"))]
""