Commit 5083912d by Philippe De Muyter Committed by Philippe De Muyter

m68k.c (output_btst): Use `movew to ccr' when useful.

2007-04-18  Philippe De Muyter  <phdm@macqel.be>

	* config/m68k/m68k.c (output_btst): Use `movew to ccr' when useful.

From-SVN: r123959
parent 05fb69e4
2007-04-18 Philippe De Muyter <phdm@macqel.be>
* config/m68k/m68k.c (output_btst): Use `movew to ccr' when useful.
2007-04-18 Dirk Mueller <dmueller@suse.de>
PR diagnostic/31227
......
......@@ -1550,6 +1550,27 @@ output_btst (rtx *operands, rtx countop, rtx dataop, rtx insn, int signpos)
if (count == 7
&& next_insn_tests_no_inequality (insn))
return "tst%.b %1";
/* Try to use `movew to ccr' followed by the appropriate branch insn.
On some m68k variants unfortunately that's slower than btst.
On 68000 and higher, that should also work for all HImode operands. */
if (TUNE_CPU32 || TARGET_COLDFIRE || optimize_size)
{
if (count == 3 && DATA_REG_P (operands[1])
&& next_insn_tests_no_inequality (insn))
{
cc_status.flags = CC_NOT_NEGATIVE | CC_Z_IN_NOT_N | CC_NO_OVERFLOW;
return "move%.w %1,%%ccr";
}
if (count == 2 && DATA_REG_P (operands[1])
&& next_insn_tests_no_inequality (insn))
{
cc_status.flags = CC_NOT_NEGATIVE | CC_INVERTED | CC_NO_OVERFLOW;
return "move%.w %1,%%ccr";
}
/* count == 1 followed by bvc/bvs and
count == 0 followed by bcc/bcs are also possible, but need
m68k-specific CC_Z_IN_NOT_V and CC_Z_IN_NOT_C flags. */
}
cc_status.flags = CC_NOT_NEGATIVE;
}
......
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