diff options
author | Robin Dapp <rdapp@ventanamicro.com> | 2024-08-27 10:25:34 +0200 |
---|---|---|
committer | Robin Dapp <rdapp@ventanamicro.com> | 2024-08-29 10:27:53 +0200 |
commit | 4ff4875a79ccb302dc2401c32fe0af2187b61b99 (patch) | |
tree | 17fb99cc9612c4a54ce9e439d3e2b366a4db61cb /gcc/gimple-loop-jam.cc | |
parent | 3cb92be94e6581697369eeafdb67057c8cfba73f (diff) | |
download | gcc-4ff4875a79ccb302dc2401c32fe0af2187b61b99.zip gcc-4ff4875a79ccb302dc2401c32fe0af2187b61b99.tar.gz gcc-4ff4875a79ccb302dc2401c32fe0af2187b61b99.tar.bz2 |
RISC-V: Fix subreg of VLS modes larger than a vector [PR116086].
When the source mode is potentially larger than one vector (e.g. an
LMUL2 mode for VLEN=128) we don't know which vector the subreg actually
refers to. For zvl128b and LMUL=2 the subreg in (subreg:V2DI (reg:V4DI))
could actually be the a full (high) vector register of a two-register
group (at VLEN=128) or the higher part of a single register (at VLEN>128).
As the subreg is statically ambiguous we prevent such situations in
can_change_mode_class.
The culprit in PR116086 is
_12 = BIT_FIELD_REF <vect_cst__42, 128, 128>;
which can be expanded with a vector-vector extract (from V4DI to V2DI).
This patch adds a VLS-mode vector-vector extract that handles "halving"
cases like this one by sliding down the source vector, thus making sure
the correct part is used.
PR target/116086
gcc/ChangeLog:
* config/riscv/autovec.md (vec_extract<mode><v_half>): Add
vector-vector extract for VLS modes.
* config/riscv/riscv.cc (riscv_can_change_mode_class): Forbid
VLS modes larger than one vector.
* config/riscv/vector-iterators.md: Add vector-vector extract
iterators.
gcc/testsuite/ChangeLog:
* lib/target-supports.exp: Add effective target checks for
zvl256b and zvl512b.
* gcc.target/riscv/rvv/autovec/pr116086-2-run.c: New test.
* gcc.target/riscv/rvv/autovec/pr116086-2.c: New test.
* gcc.target/riscv/rvv/autovec/pr116086.c: New test.
Diffstat (limited to 'gcc/gimple-loop-jam.cc')
0 files changed, 0 insertions, 0 deletions