Commit 6590e19a by Ulrich Weigand Committed by Ulrich Weigand

s390-protos.h (s390_emit_compare): Add prototype.

	* config/s390/s390-protos.h (s390_emit_compare): Add prototype.
	(s390_emit_jump): Likewise.
	* config/s390/s390.c (s390_emit_compare): New function.
	(s390_emit_jump): Likewise.
	* config/s390/s390.md ("beq", "bne", "bgt", "bgtu", "blt", "bltu",
	"bge", "bgeu", "ble", "bleu", "bunordered", "bordered", "buneq",
	"bungt", "bunlt", "bunge", "bunle", "bltgt"): Use s390_emit_compare
	and s390_emit_jump.
	("cjump"): Remove, replace by ...
	("*cjump_64", "*cjump_31"): ... these insns.  Improve length default.
	("icjump", "*icjump_64", "*icjump_31"): Likewise.
	("trap"): Fix type attribute.
	("conditional_trap"): Use s390_emit_compare.
	("doloop_si"): Remove, replace by ...
	("doloop_si64", "doloop_si31"): ... these new insn_and_split.
	Merge existing splitter into insn_and_split.  Improve length default.
	("doloop_di"): Merge with existing splitter into insn_and_split.
	("doloop"): Adapt.
	("jump"): Convert to expander.  Use s390_emit_jump.
	("*jump_64", "*jump_31"): New insns.  Improve length default.

From-SVN: r83574
parent 44ee9aef
2004-06-23 Ulrich Weigand <uweigand@de.ibm.com>
* config/s390/s390-protos.h (s390_emit_compare): Add prototype.
(s390_emit_jump): Likewise.
* config/s390/s390.c (s390_emit_compare): New function.
(s390_emit_jump): Likewise.
* config/s390/s390.md ("beq", "bne", "bgt", "bgtu", "blt", "bltu",
"bge", "bgeu", "ble", "bleu", "bunordered", "bordered", "buneq",
"bungt", "bunlt", "bunge", "bunle", "bltgt"): Use s390_emit_compare
and s390_emit_jump.
("cjump"): Remove, replace by ...
("*cjump_64", "*cjump_31"): ... these insns. Improve length default.
("icjump", "*icjump_64", "*icjump_31"): Likewise.
("trap"): Fix type attribute.
("conditional_trap"): Use s390_emit_compare.
("doloop_si"): Remove, replace by ...
("doloop_si64", "doloop_si31"): ... these new insn_and_split.
Merge existing splitter into insn_and_split. Improve length default.
("doloop_di"): Merge with existing splitter into insn_and_split.
("doloop"): Adapt.
("jump"): Convert to expander. Use s390_emit_jump.
("*jump_64", "*jump_31"): New insns. Improve length default.
2004-06-23 Wu Yongwei <adah@sh163.net>
* gthr-win32.h (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust.
......
......@@ -52,6 +52,8 @@ extern enum machine_mode s390_tm_ccmode (rtx, rtx, int);
extern enum machine_mode s390_select_ccmode (enum rtx_code, rtx, rtx);
extern int s390_alc_comparison (rtx op, enum machine_mode mode);
extern int s390_slb_comparison (rtx op, enum machine_mode mode);
extern rtx s390_emit_compare (enum rtx_code, rtx, rtx);
extern void s390_emit_jump (rtx, rtx);
extern int symbolic_reference_mentioned_p (rtx);
extern int tls_symbolic_reference_mentioned_p (rtx);
extern int legitimate_la_operand_p (rtx);
......
......@@ -468,6 +468,36 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1)
}
}
/* Emit a compare instruction suitable to implement the comparison
OP0 CODE OP1. Return the correct condition RTL to be placed in
the IF_THEN_ELSE of the conditional branch testing the result. */
rtx
s390_emit_compare (enum rtx_code code, rtx op0, rtx op1)
{
enum machine_mode mode = s390_select_ccmode (code, op0, op1);
rtx cc = gen_rtx_REG (mode, CC_REGNUM);
emit_insn (gen_rtx_SET (VOIDmode, cc, gen_rtx_COMPARE (mode, op0, op1)));
return gen_rtx_fmt_ee (code, VOIDmode, cc, const0_rtx);
}
/* Emit a jump instruction to TARGET. If COND is NULL_RTX, emit an
unconditional jump, else a conditional jump under condition COND. */
void
s390_emit_jump (rtx target, rtx cond)
{
rtx insn;
target = gen_rtx_LABEL_REF (VOIDmode, target);
if (cond)
target = gen_rtx_IF_THEN_ELSE (VOIDmode, cond, target, pc_rtx);
insn = gen_rtx_SET (VOIDmode, pc_rtx, target);
emit_jump_insn (insn);
}
/* Return nonzero if OP is a valid comparison operator
for an ALC condition in mode MODE. */
......
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