aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp>2022-05-13 22:29:22 +0900
committerMax Filippov <jcmvbkbc@gmail.com>2022-05-26 09:40:41 -0700
commit3397563ad6c8fc5d9675faf507e52dd2ed284202 (patch)
treedfb1bf58f023dd822b0d77d94a8ebc8dc93c1ff6
parent9b251fe2e39a49c0d3ecd34cf8c5d55544efd159 (diff)
downloadgcc-3397563ad6c8fc5d9675faf507e52dd2ed284202.zip
gcc-3397563ad6c8fc5d9675faf507e52dd2ed284202.tar.gz
gcc-3397563ad6c8fc5d9675faf507e52dd2ed284202.tar.bz2
xtensa: Fix instruction counting regarding block move expansion
This patch makes counting the number of instructions of the remainder (modulo 4) part more accurate. gcc/ChangeLog: * config/xtensa/xtensa.cc (xtensa_expand_block_move): Make instruction counting more accurate, and simplify emitting insns.
-rw-r--r--gcc/config/xtensa/xtensa.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc
index c5518ff..d2aabf3 100644
--- a/gcc/config/xtensa/xtensa.cc
+++ b/gcc/config/xtensa/xtensa.cc
@@ -1313,7 +1313,7 @@ xtensa_expand_block_move (rtx *operands)
move_ratio = 4;
if (optimize > 2)
move_ratio = LARGEST_MOVE_RATIO;
- num_pieces = (bytes / align) + (bytes % align); /* Close enough anyway. */
+ num_pieces = (bytes / align) + ((bytes % align + 1) / 2);
if (num_pieces > move_ratio)
return 0;
@@ -1350,7 +1350,7 @@ xtensa_expand_block_move (rtx *operands)
temp[next] = gen_reg_rtx (mode[next]);
x = adjust_address (src_mem, mode[next], offset_ld);
- emit_insn (gen_rtx_SET (temp[next], x));
+ emit_move_insn (temp[next], x);
offset_ld += next_amount;
bytes -= next_amount;
@@ -1360,9 +1360,9 @@ xtensa_expand_block_move (rtx *operands)
if (active[phase])
{
active[phase] = false;
-
+
x = adjust_address (dst_mem, mode[phase], offset_st);
- emit_insn (gen_rtx_SET (x, temp[phase]));
+ emit_move_insn (x, temp[phase]);
offset_st += amount[phase];
}