Commit 99052692 by Kaz Kojima

sh.c (expand_cbranchdi4): Use a scratch register for the none zero constant…

sh.c (expand_cbranchdi4): Use a scratch register for the none zero constant operand except for EQ and NE...

	* config/sh/sh.c (expand_cbranchdi4): Use a scratch register
	for the none zero constant operand except for EQ and NE
	comprisons even when the first operand is R0.

From-SVN: r147661
parent f4aa3848
2009-05-18 Kaz Kojima <kkojima@gcc.gnu.org>
* config/sh/sh.c (expand_cbranchdi4): Use a scratch register
for the none zero constant operand except for EQ and NE
comprisons even when the first operand is R0.
2009-05-18 Andreas Krebbel <krebbel1@de.ibm.com> 2009-05-18 Andreas Krebbel <krebbel1@de.ibm.com>
* config/s390/2064.md: Remove trailing whitespaces. * config/s390/2064.md: Remove trailing whitespaces.
......
...@@ -1632,7 +1632,8 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison) ...@@ -1632,7 +1632,8 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison)
operands[2] = op2h; operands[2] = op2h;
operands[4] = NULL_RTX; operands[4] = NULL_RTX;
if (reload_completed if (reload_completed
&& ! arith_reg_or_0_operand (op2h, SImode) && true_regnum (op1h) && ! arith_reg_or_0_operand (op2h, SImode)
&& (true_regnum (op1h) || (comparison != EQ && comparison != NE))
&& (msw_taken != LAST_AND_UNUSED_RTX_CODE && (msw_taken != LAST_AND_UNUSED_RTX_CODE
|| msw_skip != LAST_AND_UNUSED_RTX_CODE)) || msw_skip != LAST_AND_UNUSED_RTX_CODE))
{ {
...@@ -1662,8 +1663,12 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison) ...@@ -1662,8 +1663,12 @@ expand_cbranchdi4 (rtx *operands, enum rtx_code comparison)
if (lsw_taken != LAST_AND_UNUSED_RTX_CODE) if (lsw_taken != LAST_AND_UNUSED_RTX_CODE)
{ {
if (reload_completed if (reload_completed
&& ! arith_reg_or_0_operand (op2l, SImode) && true_regnum (op1l)) && ! arith_reg_or_0_operand (op2l, SImode)
operands[4] = scratch; && (true_regnum (op1l) || (lsw_taken != EQ && lsw_taken != NE)))
{
emit_move_insn (scratch, operands[2]);
operands[2] = scratch;
}
expand_cbranchsi4 (operands, lsw_taken, lsw_taken_prob); expand_cbranchsi4 (operands, lsw_taken, lsw_taken_prob);
} }
if (msw_skip != LAST_AND_UNUSED_RTX_CODE) if (msw_skip != LAST_AND_UNUSED_RTX_CODE)
......
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