RISC-V: Add vec_init expander for masks [PR112854].
commit056cce412862f8d9b56a40dfbcbc3f9fa7f92883
authorRobin Dapp <rdapp@ventanamicro.com>
Tue, 5 Dec 2023 14:24:12 +0000 (5 15:24 +0100)
committerRobin Dapp <rdapp@ventanamicro.com>
Wed, 6 Dec 2023 09:27:48 +0000 (6 10:27 +0100)
treebdfd043a2b6bb56bbaf5cec085d42b7c7f584a2c
parente44ed92dbbe9d4e5c23f486cd2f77a6f9ee513c5
RISC-V: Add vec_init expander for masks [PR112854].

PR112854 shows a problem on rv32 with zvl1024b.  During the course of
expand_constructor we try to overlay/subreg a 64-element mask by a
scalar (Pmode) register.  This works for zvl512b and its maximum of
32 elements but fails for rv32 and 64 elements.

To circumvent this this patch adds a vec_init expander for vector masks
by initializing a QImode vector and comparing that against 0.

gcc/ChangeLog:

PR target/112854
PR target/112872

* config/riscv/autovec.md (vec_init<mode>qi): New expander.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr112854.c: New test.
* gcc.target/riscv/rvv/autovec/pr112872.c: New test.
gcc/config/riscv/autovec.md
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112854.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr112872.c [new file with mode: 0644]