RISC-V: Enable basic RVV auto-vectorization support.
commit2d76f2b45d6649174748d862a31bb95c53ee1117
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Sat, 6 May 2023 15:56:10 +0000 (6 09:56 -0600)
committerJeff Law <jlaw@ventanamicro>
Sat, 6 May 2023 15:57:41 +0000 (6 09:57 -0600)
tree3119b3c0fcfe250dd3f81428bb2bad2fe651d1d9
parent043550bceea7881163bba5d8a0486bb100a05809
RISC-V: Enable basic RVV auto-vectorization support.

gcc/ChangeLog:

* config/riscv/riscv-protos.h (preferred_simd_mode): New function.
* config/riscv/riscv-v.cc (autovec_use_vlmax_p): Ditto.
(preferred_simd_mode): Ditto.
* config/riscv/riscv.cc (riscv_get_arg_info): Handle RVV type in function arg.
(riscv_convert_vector_bits): Adjust for RVV auto-vectorization.
(riscv_preferred_simd_mode): New function.
(TARGET_VECTORIZE_PREFERRED_SIMD_MODE): New target hook support.
* config/riscv/vector.md: Add autovec.md.
* config/riscv/autovec.md: New file.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/rvv.exp: Add testcases for RVV auto-vectorization.
* gcc.target/riscv/rvv/autovec/fixed-vlmax-1.c: New test.
* gcc.target/riscv/rvv/autovec/partial/single_rgroup-1.c: New test.
* gcc.target/riscv/rvv/autovec/partial/single_rgroup-1.h: New test.
* gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-1.c: New test.
* gcc.target/riscv/rvv/autovec/scalable-1.c: New test.
* gcc.target/riscv/rvv/autovec/template-1.h: New test.
* gcc.target/riscv/rvv/autovec/v-1.c: New test.
* gcc.target/riscv/rvv/autovec/v-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve32f-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve32f-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve32f-3.c: New test.
* gcc.target/riscv/rvv/autovec/zve32f_zvl128b-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve32f_zvl128b-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve32x-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve32x-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve32x-3.c: New test.
* gcc.target/riscv/rvv/autovec/zve32x_zvl128b-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve32x_zvl128b-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve64d-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve64d-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve64d-3.c: New test.
* gcc.target/riscv/rvv/autovec/zve64d_zvl128b-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve64d_zvl128b-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve64f-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve64f-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve64f-3.c: New test.
* gcc.target/riscv/rvv/autovec/zve64f_zvl128b-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve64f_zvl128b-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve64x-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve64x-2.c: New test.
* gcc.target/riscv/rvv/autovec/zve64x-3.c: New test.
* gcc.target/riscv/rvv/autovec/zve64x_zvl128b-1.c: New test.
* gcc.target/riscv/rvv/autovec/zve64x_zvl128b-2.c: New test.
39 files changed:
gcc/config/riscv/autovec.md [new file with mode: 0644]
gcc/config/riscv/riscv-protos.h
gcc/config/riscv/riscv-v.cc
gcc/config/riscv/riscv.cc
gcc/config/riscv/vector.md
gcc/testsuite/gcc.target/riscv/rvv/autovec/fixed-vlmax-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup-1.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/partial/single_rgroup_run-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/scalable-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/template-1.h [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/v-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/v-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32f-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32f-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32f-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32f_zvl128b-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32f_zvl128b-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32x-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32x-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32x-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32x_zvl128b-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve32x_zvl128b-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64d-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64d-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64d-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64d_zvl128b-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64d_zvl128b-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64f-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64f-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64f-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64f_zvl128b-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64f_zvl128b-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64x-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64x-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64x-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64x_zvl128b-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/zve64x_zvl128b-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/rvv.exp