* [PATCH 3/5] xtensa: Fix instruction counting regarding block move expansion
@ 2022-05-13 13:29 Takayuki 'January June' Suwa
2022-05-26 16:44 ` Max Filippov
0 siblings, 1 reply; 2+ messages in thread
From: Takayuki 'January June' Suwa @ 2022-05-13 13:29 UTC (permalink / raw)
To: gcc-patches
This patch makes counting the number of instructions of the remainder
(modulo 4) part more accurate.
gcc/ChangeLog:
* gcc/config/xtensa/xtensa.cc (xtensa_expand_block_move):
Make instruction counting more accurate, and simplify emitting insns.
---
gcc/config/xtensa/xtensa.cc | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc
index c5518ff9549..d2aabf38339 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];
}
--
2.20.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH 3/5] xtensa: Fix instruction counting regarding block move expansion
2022-05-13 13:29 [PATCH 3/5] xtensa: Fix instruction counting regarding block move expansion Takayuki 'January June' Suwa
@ 2022-05-26 16:44 ` Max Filippov
0 siblings, 0 replies; 2+ messages in thread
From: Max Filippov @ 2022-05-26 16:44 UTC (permalink / raw)
To: Takayuki 'January June' Suwa; +Cc: GCC Patches
On Fri, May 13, 2022 at 6:35 AM Takayuki 'January June' Suwa
<jjsuwa_sys3175@yahoo.co.jp> wrote:
>
> This patch makes counting the number of instructions of the remainder
> (modulo 4) part more accurate.
>
> gcc/ChangeLog:
>
> * gcc/config/xtensa/xtensa.cc (xtensa_expand_block_move):
> Make instruction counting more accurate, and simplify emitting insns.
> ---
> gcc/config/xtensa/xtensa.cc | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
This patch is whitespace-damaged and does not apply as is.
I've applied the changes manually.
Regtested for target=xtensa-linux-uclibc, no new regressions.
Changelog has extra 'gcc/' in paths, so I've dropped this part.
Committed to master.
--
Thanks.
-- Max
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-05-26 16:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-13 13:29 [PATCH 3/5] xtensa: Fix instruction counting regarding block move expansion Takayuki 'January June' Suwa
2022-05-26 16:44 ` Max Filippov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).