]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH v2 2/3] RISC-V: setmem for RISCV with V extension
authorSergei Lewis <slewis@rivosinc.com>
Mon, 24 Jun 2024 20:20:14 +0000 (14:20 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Mon, 24 Jun 2024 20:20:14 +0000 (14:20 -0600)
commita424318d32103dde827e8507fa27d24d33407ec9
treee4d7bfacd4bb9d0e5f3245724c42b54dd374d3dc
parent580c37f1ef7db8e7a398184eb8f5d7555124d30a
[PATCH v2 2/3] RISC-V: setmem for RISCV with V extension

This is primarily Sergei's work, my contributions were limited to
merging his expander with the one that's on the trunk, allowing
non-constant value and trivial testsuite adjustments due to option renaming.

I'm doing setmem first because it's the easiest.  The others will follow
soon enough.

I've tested this in my system, waiting on pre-commit CI to render its
verdict before moving forward.

gcc/ChangeLog

* config/riscv/riscv-protos.h (riscv_vector::expand_vec_setmem): New
function declaration.

* config/riscv/riscv-string.cc (riscv_vector::expand_vec_setmem): New
function: this generates an inline vectorised memory set, if and only if
we know the entire operation can be performed in a single vector store.

* config/riscv/riscv.md (setmem<mode>): Try riscv_vector::expand_vec_setmem
for constant lengths.  Do not require operand 2 to be a constant.

gcc/testsuite/ChangeLog

* gcc.target/riscv/rvv/base/setmem-1.c: New tests
* gcc.target/riscv/rvv/base/setmem-2.c: New tests
* gcc.target/riscv/rvv/base/setmem-3.c: New tests
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv-string.cc
gcc/config/riscv/riscv.md
gcc/testsuite/gcc.target/riscv/rvv/base/setmem-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/base/setmem-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/base/setmem-3.c [new file with mode: 0644]