Commit 19327363 by Georg-Johann Lay Committed by Georg-Johann Lay

avr.c (out_movhi_r_mr): Only SBIW if X is not unused after.

	* config/avr/avr.c (out_movhi_r_mr) [REG_X + PLUS]: Only SBIW if
	X is not unused after.

From-SVN: r242909
parent 03612f25
2016-11-28 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr.c (out_movhi_r_mr) [REG_X + PLUS]: Only SBIW if
X is not unused after.
2016-11-28 Bernd Schmidt <bschmidt@redhat.com> 2016-11-28 Bernd Schmidt <bschmidt@redhat.com>
PR rtl-optimization/78120 PR rtl-optimization/78120
...@@ -4028,16 +4028,22 @@ out_movhi_r_mr (rtx_insn *insn, rtx op[], int *plen) ...@@ -4028,16 +4028,22 @@ out_movhi_r_mr (rtx_insn *insn, rtx op[], int *plen)
optimization options. */ optimization options. */
if (reg_base == REG_X) if (reg_base == REG_X)
return reg_base == reg_dest {
? avr_asm_len ("adiw r26,%o1" CR_TAB if (reg_base == reg_dest)
"ld __tmp_reg__,X+" CR_TAB return avr_asm_len ("adiw r26,%o1" CR_TAB
"ld %B0,X" CR_TAB "ld __tmp_reg__,X+" CR_TAB
"mov %A0,__tmp_reg__", op, plen, -4) "ld %B0,X" CR_TAB
"mov %A0,__tmp_reg__", op, plen, -4);
: avr_asm_len ("adiw r26,%o1" CR_TAB
"ld %A0,X+" CR_TAB avr_asm_len ("adiw r26,%o1" CR_TAB
"ld %B0,X" CR_TAB "ld %A0,X+" CR_TAB
"sbiw r26,%o1+1", op, plen, -4); "ld %B0,X", op, plen, -3);
if (!reg_unused_after (insn, XEXP (base, 0)))
avr_asm_len ("sbiw r26,%o1+1", op, plen, 1);
return "";
}
return reg_base == reg_dest return reg_base == reg_dest
? avr_asm_len ("ldd __tmp_reg__,%A1" CR_TAB ? avr_asm_len ("ldd __tmp_reg__,%A1" CR_TAB
......
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