Commit 2873836b by Kazu Hirata Committed by Kazu Hirata

h8300-protos.h: Add prototypes for const_int_qi_operand and const_int_hi_operand.

	* config/h8300/h8300-protos.h: Add prototypes for
	const_int_qi_operand and const_int_hi_operand.
	* config/h8300/h8300.c (const_int_qi_operand): New.
	(const_int_hi_operand): Likewise.
	* config/h8300/h8300.md (three peepholes): New.

From-SVN: r60600
parent b63d28bf
2002-12-29 Kazu Hirata <kazu@cs.umass.edu>
* config/h8300/h8300-protos.h: Add prototypes for
const_int_qi_operand and const_int_hi_operand.
* config/h8300/h8300.c (const_int_qi_operand): New.
(const_int_hi_operand): Likewise.
* config/h8300/h8300.md (three peepholes): New.
2002-12-28 Joseph S. Myers <jsm@polyomino.org.uk>
* doc/cpp.texi, doc/gcc.texi, doc/gccint.texi, doc/install.texi:
......
......@@ -64,6 +64,8 @@ extern int bit_operand PARAMS ((rtx, enum machine_mode));
extern int bit_memory_operand PARAMS ((rtx, enum machine_mode));
extern int const_le_2_operand PARAMS ((rtx, enum machine_mode));
extern int const_le_6_operand PARAMS ((rtx, enum machine_mode));
extern int const_int_qi_operand PARAMS ((rtx, enum machine_mode));
extern int const_int_hi_operand PARAMS ((rtx, enum machine_mode));
extern int incdec_operand PARAMS ((rtx, enum machine_mode));
extern int bit_operator PARAMS ((rtx, enum machine_mode));
extern int nshift_operator PARAMS ((rtx, enum machine_mode));
......
......@@ -1851,6 +1851,28 @@ const_le_6_operand (x, mode)
&& abs (INTVAL (x)) <= 6);
}
/* Return nonzero if X is a constant expressible in QImode. */
int
const_int_qi_operand (x, mode)
rtx x;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (x) == CONST_INT
&& (INTVAL (x) & 0xff) == INTVAL (x));
}
/* Return nonzero if X is a constant expressible in HImode. */
int
const_int_hi_operand (x, mode)
rtx x;
enum machine_mode mode ATTRIBUTE_UNUSED;
{
return (GET_CODE (x) == CONST_INT
&& (INTVAL (x) & 0xffff) == INTVAL (x));
}
/* Return nonzero if X is a constant suitable for inc/dec. */
int
......
......@@ -2962,3 +2962,77 @@
(pc)))]
"operands[1] = GEN_INT (- INTVAL (operands[1]));
split_adds_subs (SImode, operands, 1);")
;; Narrow the mode of testing if possible.
(define_peephole2
[(set (match_operand:HI 0 "register_operand" "")
(and:HI (match_dup 0)
(match_operand:HI 1 "const_int_qi_operand" "")))
(set (cc0)
(match_dup 0))
(set (pc)
(if_then_else (match_operator 3 "eqne_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 2 "" ""))
(pc)))]
"find_regno_note (next_nonnote_insn (insn), REG_DEAD, REGNO (operands[0]))"
[(set (match_dup 4)
(and:QI (match_dup 4)
(match_dup 5)))
(set (cc0)
(match_dup 4))
(set (pc)
(if_then_else (match_op_dup 3 [(cc0) (const_int 0)])
(label_ref (match_dup 2))
(pc)))]
"operands[4] = gen_rtx_REG (QImode, REGNO (operands[0]));
operands[5] = GEN_INT (trunc_int_for_mode (INTVAL (operands[1]), QImode));")
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
(and:SI (match_dup 0)
(match_operand:SI 1 "const_int_qi_operand" "")))
(set (cc0)
(match_dup 0))
(set (pc)
(if_then_else (match_operator 3 "eqne_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 2 "" ""))
(pc)))]
"find_regno_note (next_nonnote_insn (insn), REG_DEAD, REGNO (operands[0]))"
[(set (match_dup 4)
(and:QI (match_dup 4)
(match_dup 5)))
(set (cc0)
(match_dup 4))
(set (pc)
(if_then_else (match_op_dup 3 [(cc0) (const_int 0)])
(label_ref (match_dup 2))
(pc)))]
"operands[4] = gen_rtx_REG (QImode, REGNO (operands[0]));
operands[5] = GEN_INT (trunc_int_for_mode (INTVAL (operands[1]), QImode));")
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
(and:SI (match_dup 0)
(match_operand:SI 1 "const_int_hi_operand" "")))
(set (cc0)
(match_dup 0))
(set (pc)
(if_then_else (match_operator 3 "eqne_operator"
[(cc0) (const_int 0)])
(label_ref (match_operand 2 "" ""))
(pc)))]
"find_regno_note (next_nonnote_insn (insn), REG_DEAD, REGNO (operands[0]))"
[(set (match_dup 4)
(and:HI (match_dup 4)
(match_dup 5)))
(set (cc0)
(match_dup 4))
(set (pc)
(if_then_else (match_op_dup 3 [(cc0) (const_int 0)])
(label_ref (match_dup 2))
(pc)))]
"operands[4] = gen_rtx_REG (HImode, REGNO (operands[0]));
operands[5] = GEN_INT (trunc_int_for_mode (INTVAL (operands[1]), HImode));")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment