Skip to content
Snippets Groups Projects
user avatar
Sudakshina Das authored
This patch implements aarch64 backend expansion for __builtin_memset. Most of
the implementation is based on the expansion of __builtin_memcpy. We change the
values of SET_RATIO and MOVE_RATIO for cases where we do not have to strictly
align and where we can benefit from NEON instructions in the backend.

gcc/ChangeLog:

	* config/aarch64/aarch64-protos.h (aarch64_expand_setmem): New
	declaration.
	* config/aarch64/aarch64.c (aarch64_gen_store_pair): Add case for
	E_V16QImode.
	(aarch64_set_one_block_and_progress_pointer): New helper for
	aarch64_expand_setmem.
	(aarch64_expand_setmem): Define the expansion for memset.
	* config/aarch64/aarch64.h (CLEAR_RATIO): Tweak to favor
	aarch64_expand_setmem when allowed and profitable.
	(SET_RATIO): Likewise.
	* config/aarch64/aarch64.md: Define pattern for setmemdi.

gcc/testsuite/ChangeLog:

	* g++.dg/tree-ssa/pr90883.C: Remove xfail for aarch64.
	* gcc.dg/tree-prof/stringop-2.c: Add xfail for aarch64.
	* gcc.target/aarch64/memset-corner-cases.c: New test.
	* gcc.target/aarch64/memset-q-reg.c: New test.
54bbde55
History
Name Last commit Last update