]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH v2 1/2] RISC-V: Make vectorized memset handle more cases
authorCraig Blackmore <craig.blackmore@embecosm.com>
Mon, 4 Nov 2024 20:55:19 +0000 (13:55 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Mon, 4 Nov 2024 20:55:19 +0000 (13:55 -0700)
commitb30c6a5eabaf476663f1a1e41165967e782eccd3
tree757153dde1595a5305c825c9673ff70279934af3
parentfe97ac43e05a8da8a12fbad2208a1ebb19d2d6c9
[PATCH v2 1/2] RISC-V: Make vectorized memset handle more cases

`expand_vec_setmem` only generated vectorized memset if it fitted into a
single vector store of at least (TARGET_MIN_VLEN / 8) bytes.  Also,
without dynamic LMUL the operation was always TARGET_MAX_LMUL even if it
would have fitted a smaller LMUL.

Allow vectorized memset to be generated for smaller lengths and smaller
LMUL by switching to using use_vector_string_op.  Smaller LMUL can be
seen in setmem-3.c:f3.  Smaller lengths will be seen after the second
patch in this series which selectively disables by pieces.

gcc/ChangeLog:

* config/riscv/riscv-string.cc
(use_vector_stringop_p): Add comment.
(expand_vec_setmem): Use use_vector_stringop_p instead of
check_vectorise_memory_operation.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/base/setmem-3.c: Expect smaller lmul.
gcc/config/riscv/riscv-string.cc
gcc/testsuite/gcc.target/riscv/rvv/base/setmem-3.c