-
- Downloads
RISC-V: Support 128 bit vector chunk
RISC-V has provide different VLEN configuration by different ISA extension like `zve32x`, `zve64x` and `v` zve32x just guarantee the minimal VLEN is 32 bits, zve64x guarantee the minimal VLEN is 64 bits, and v guarantee the minimal VLEN is 128 bits, Current status (without this patch): Zve32x: Mode for one vector register mode is VNx1SImode and VNx1DImode is invalid mode - one vector register could hold 1 + 1x SImode where x is 0~n, so it might hold just one SI Zve64x: Mode for one vector register mode is VNx1DImode or VNx2SImode - one vector register could hold 1 + 1x DImode where x is 0~n, so it might hold just one DI. - one vector register could hold 2 + 2x SImode where x is 0~n, so it might hold just two SI. However `v` extension guarantees the minimal VLEN is 128 bits. We introduce another type/mode mapping for this configure: v: Mode for one vector register mode is VNx2DImode or VNx4SImode - one vector register could hold 2 + 2x DImode where x is 0~n, so it will hold at least two DI - one vector register could hold 4 + 4x SImode where x is 0~n, so it will hold at least four DI This patch model the mode more precisely for the RVV, and help some middle-end optimization that assume number of element must be a multiple of two. gcc/ChangeLog: * config/riscv/riscv-modes.def (FLOAT_MODE): Add chunk 128 support. (VECTOR_BOOL_MODE): Ditto. (ADJUST_NUNITS): Ditto. (ADJUST_ALIGNMENT): Ditto. (ADJUST_BYTESIZE): Ditto. (ADJUST_PRECISION): Ditto. (RVV_MODES): Ditto. (VECTOR_MODE_WITH_PREFIX): Ditto. * config/riscv/riscv-v.cc (ENTRY): Ditto. (get_vlmul): Ditto. (get_ratio): Ditto. * config/riscv/riscv-vector-builtins.cc (DEF_RVV_TYPE): Ditto. * config/riscv/riscv-vector-builtins.def (DEF_RVV_TYPE): Ditto. (vbool64_t): Ditto. (vbool32_t): Ditto. (vbool16_t): Ditto. (vbool8_t): Ditto. (vbool4_t): Ditto. (vbool2_t): Ditto. (vbool1_t): Ditto. (vint8mf8_t): Ditto. (vuint8mf8_t): Ditto. (vint8mf4_t): Ditto. (vuint8mf4_t): Ditto. (vint8mf2_t): Ditto. (vuint8mf2_t): Ditto. (vint8m1_t): Ditto. (vuint8m1_t): Ditto. (vint8m2_t): Ditto. (vuint8m2_t): Ditto. (vint8m4_t): Ditto. (vuint8m4_t): Ditto. (vint8m8_t): Ditto. (vuint8m8_t): Ditto. (vint16mf4_t): Ditto. (vuint16mf4_t): Ditto. (vint16mf2_t): Ditto. (vuint16mf2_t): Ditto. (vint16m1_t): Ditto. (vuint16m1_t): Ditto. (vint16m2_t): Ditto. (vuint16m2_t): Ditto. (vint16m4_t): Ditto. (vuint16m4_t): Ditto. (vint16m8_t): Ditto. (vuint16m8_t): Ditto. (vint32mf2_t): Ditto. (vuint32mf2_t): Ditto. (vint32m1_t): Ditto. (vuint32m1_t): Ditto. (vint32m2_t): Ditto. (vuint32m2_t): Ditto. (vint32m4_t): Ditto. (vuint32m4_t): Ditto. (vint32m8_t): Ditto. (vuint32m8_t): Ditto. (vint64m1_t): Ditto. (vuint64m1_t): Ditto. (vint64m2_t): Ditto. (vuint64m2_t): Ditto. (vint64m4_t): Ditto. (vuint64m4_t): Ditto. (vint64m8_t): Ditto. (vuint64m8_t): Ditto. (vfloat32mf2_t): Ditto. (vfloat32m1_t): Ditto. (vfloat32m2_t): Ditto. (vfloat32m4_t): Ditto. (vfloat32m8_t): Ditto. (vfloat64m1_t): Ditto. (vfloat64m2_t): Ditto. (vfloat64m4_t): Ditto. (vfloat64m8_t): Ditto. * config/riscv/riscv-vector-switch.def (ENTRY): Ditto. * config/riscv/riscv.cc (riscv_legitimize_poly_move): Ditto. (riscv_convert_vector_bits): Ditto. * config/riscv/riscv.md: * config/riscv/vector-iterators.md: * config/riscv/vector.md (@pred_indexed_<order>store<VNX32_QH:mode><VNX32_QHI:mode>): Ditto. (@pred_indexed_<order>store<VNX32_QHS:mode><VNX32_QHSI:mode>): Ditto. (@pred_indexed_<order>store<VNX64_Q:mode><VNX64_Q:mode>): Ditto. (@pred_indexed_<order>store<VNX64_QH:mode><VNX64_QHI:mode>): Ditto. (@pred_indexed_<order>store<VNX128_Q:mode><VNX128_Q:mode>): Ditto. (@pred_reduc_<reduc><mode><vlmul1_zve64>): Ditto. (@pred_widen_reduc_plus<v_su><mode><vwlmul1_zve64>): Ditto. (@pred_reduc_plus<order><mode><vlmul1_zve64>): Ditto. (@pred_widen_reduc_plus<order><mode><vwlmul1_zve64>): Ditto. gcc/testsuite/ChangeLog: * gcc.target/riscv/rvv/base/pr108185-4.c: Adapt testcase. * gcc.target/riscv/rvv/base/spill-1.c: Ditto. * gcc.target/riscv/rvv/base/spill-11.c: Ditto. * gcc.target/riscv/rvv/base/spill-2.c: Ditto. * gcc.target/riscv/rvv/base/spill-3.c: Ditto. * gcc.target/riscv/rvv/base/spill-5.c: Ditto. * gcc.target/riscv/rvv/base/spill-9.c: Ditto.
Showing
- gcc/config/riscv/riscv-modes.def 50 additions, 39 deletionsgcc/config/riscv/riscv-modes.def
- gcc/config/riscv/riscv-v.cc 13 additions, 4 deletionsgcc/config/riscv/riscv-v.cc
- gcc/config/riscv/riscv-vector-builtins.cc 7 additions, 4 deletionsgcc/config/riscv/riscv-vector-builtins.cc
- gcc/config/riscv/riscv-vector-builtins.def 104 additions, 68 deletionsgcc/config/riscv/riscv-vector-builtins.def
- gcc/config/riscv/riscv-vector-switch.def 58 additions, 47 deletionsgcc/config/riscv/riscv-vector-switch.def
- gcc/config/riscv/riscv.cc 11 additions, 1 deletiongcc/config/riscv/riscv.cc
- gcc/config/riscv/riscv.md 7 additions, 7 deletionsgcc/config/riscv/riscv.md
- gcc/config/riscv/vector-iterators.md 340 additions, 231 deletionsgcc/config/riscv/vector-iterators.md
- gcc/config/riscv/vector.md 186 additions, 47 deletionsgcc/config/riscv/vector.md
- gcc/testsuite/gcc.target/riscv/rvv/base/pr108185-4.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/base/pr108185-4.c
- gcc/testsuite/gcc.target/riscv/rvv/base/spill-1.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/base/spill-1.c
- gcc/testsuite/gcc.target/riscv/rvv/base/spill-11.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/base/spill-11.c
- gcc/testsuite/gcc.target/riscv/rvv/base/spill-2.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/base/spill-2.c
- gcc/testsuite/gcc.target/riscv/rvv/base/spill-3.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/base/spill-3.c
- gcc/testsuite/gcc.target/riscv/rvv/base/spill-5.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/base/spill-5.c
- gcc/testsuite/gcc.target/riscv/rvv/base/spill-9.c 1 addition, 1 deletiongcc/testsuite/gcc.target/riscv/rvv/base/spill-9.c
Loading
Please register or sign in to comment