aarch64: Add memmove expansion for +mops
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>
Mon, 13 Dec 2021 14:13:21 +0000 (14:13 +0000)
committerKyrylo Tkachov <kyrylo.tkachov@arm.com>
Mon, 13 Dec 2021 15:16:28 +0000 (15:16 +0000)
commitbb768f8b45aa7ccf12774aa0c00b295032ee7c47
treefc97be718f95d57816cbec7102d4c0f84f4300cd
parent0caf592d6ae836a99907841fccd31c4c5f180e8d
aarch64: Add memmove expansion for +mops

This second patch in the series adds an inline movmem expansion for TARGET_MOPS
that emits the recommended sequence.

A new param aarch64-mops-memmove-size-threshold is added to control the memmove size threshold
for this expansion. Its default value is zero to be consistent with the current behaviour where
we always emit a libcall, as we don't currently have a movmem inline expansion
(we should add a compatible-everywhere inline expansion, but that's for the future), so we should
always prefer to emit the MOPS sequence when available in lieu of a libcall.

Bootstrapped and tested on aarch64-none-linux-gnu.

gcc/ChangeLog:

* config/aarch64/aarch64.md (aarch64_movmemdi): Define.
(movmemdi): Define.
(unspec): Add UNSPEC_MOVMEM.
* config/aarch64/aarch64.opt (aarch64-mops-memmove-size-threshold):
New param.

gcc/testsuite/ChangeLog:

* gcc.target/aarch64/mops_2.c: New test.
gcc/config/aarch64/aarch64.md
gcc/config/aarch64/aarch64.opt
gcc/testsuite/gcc.target/aarch64/mops_2.c [new file with mode: 0644]