]> gcc.gnu.org Git - gcc.git/commit
RISC-V: Use vmv1r.v instead of vmv.v.v for fma output reloads [PR114200].
authorRobin Dapp <rdapp@ventanamicro.com>
Wed, 6 Mar 2024 11:15:40 +0000 (12:15 +0100)
committerRobin Dapp <rdapp@ventanamicro.com>
Wed, 6 Mar 2024 19:30:15 +0000 (20:30 +0100)
commit59554a50be8ebbd52e8a6348a92110af182e1874
treeb0b1cbf30fc0c817a2c8b52d63350bcbd5a15710
parent9ae83078fe45d093bbaa02b8348f2407fe0c62d6
RISC-V: Use vmv1r.v instead of vmv.v.v for fma output reloads [PR114200].

Three-operand instructions like vmacc are modeled with an implicit
output reload when the output does not match one of the operands.  For
this we use vmv.v.v which is subject to length masking.

In a situation where the current vl is less than the full vlenb
and the fma's result value is used as input for a vector reduction
(which is never length masked) we effectively only reduce vl
elements.  The masked-out elements are relevant for the
reduction, though, leading to a wrong result.

This patch replaces the vmv reloads by full-register reloads.

gcc/ChangeLog:

PR target/114200
PR target/114202

* config/riscv/vector.md: Use vmv[1248]r.v instead of vmv.v.v.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr114200.c: New test.
* gcc.target/riscv/rvv/autovec/pr114202.c: New test.
gcc/config/riscv/vector.md
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr114200.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr114202.c [new file with mode: 0644]
This page took 0.067527 seconds and 6 git commands to generate.