On 9/4/26 10:31 AM, Robin Dapp wrote:
Hi,
This patch adds a scalar memmove and tests for it. So far we only had a
vector implementation but most of the plumbing was already in place.
In order to wire up the scalar implementation, the patch adds a new
dispatcher riscv_expand_block_move and an overlap parameter to the
riscv_block_move routines. It adds overlap handling to
riscv_block_move_straight but not to riscv_block_move_loop. Thus,
expansion is limited to known lengths up to 96 bytes.
Regtested on rv64gcv_zvl512b.
Regards
Robin
gcc/ChangeLog:
* config/riscv/riscv-protos.h (riscv_expand_block_move):
Declare.
* config/riscv/riscv-string.cc (riscv_block_move_straight):
Handle overlap.
(riscv_adjust_block_mem): Add overlap param.
(riscv_block_move_loop): Likewise.
(riscv_expand_block_move_scalar): Add overlap param.
(riscv_expand_block_move): Likewise.
(expand_block_move): Likewise.
* config/riscv/riscv.md: Use riscv_expand_block_move.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/movmem-scalar-32.c: New test.
* gcc.target/riscv/movmem-scalar-64.c: New test.
* gcc.target/riscv/movmem-scalar-run.c: New test.
OK. I'm going to assume the proper guards are in place to avoid blowing
out the register file. The ChangeLog mentions adding an overlap param
to riscv_adjust_block_move, but I don't see that in the diff, guessing
you've got the wrong function name or perhaps the ChangeLog was from an
earlier version of the patch.
Jeff