AArch64: Add inline memmove expansion
commitbbdb72ba29ead4931a6cfff023c0485fa25e648b
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Fri, 1 Dec 2023 15:05:53 +0000 (1 15:05 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Fri, 15 Dec 2023 13:19:40 +0000 (15 13:19 +0000)
tree64ee18aefebb804cdd9c9cf39cbbc2c56447936a
parent5ddf651ad91d34b754dbe280e5ab2b19cf90f8ee
AArch64: Add inline memmove expansion

Add support for inline memmove expansions.  The generated code is identical
as for memcpy, except that all loads are emitted before stores rather than
being interleaved.  The maximum size is 256 bytes which requires at most 16
registers.

gcc/ChangeLog:
* config/aarch64/aarch64.opt (aarch64_mops_memmove_size_threshold):
Change default.
* config/aarch64/aarch64.md (cpymemdi): Add a parameter.
(movmemdi): Call aarch64_expand_cpymem.
* config/aarch64/aarch64.cc (aarch64_copy_one_block): Rename function,
simplify, support storing generated loads/stores.
(aarch64_expand_cpymem): Support expansion of memmove.
* config/aarch64/aarch64-protos.h (aarch64_expand_cpymem): Add bool arg.

gcc/testsuite/ChangeLog:
* gcc.target/aarch64/memmove.c: Add new test.
* gcc.target/aarch64/memmove2.c: Likewise.
gcc/config/aarch64/aarch64-protos.h
gcc/config/aarch64/aarch64.cc
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/aarch64.opt
gcc/testsuite/gcc.target/aarch64/memmove.c [new file with mode: 0644]
gcc/testsuite/gcc.target/aarch64/memmove2.c [new file with mode: 0644]