Skip to content
Snippets Groups Projects
Commit bf9eee73 authored by Juzhe-Zhong's avatar Juzhe-Zhong Committed by Pan Li
Browse files

RISC-V: Support RVV permutation auto-vectorization

This patch supports vector permutation for VLS only by vec_perm pattern.
We will support TARGET_VECTORIZE_VEC_PERM_CONST to support VLA permutation
in the future.

Fixed following comments from Robin.

gcc/ChangeLog:

	* config/riscv/autovec.md (vec_perm<mode>): New pattern.
	* config/riscv/predicates.md (vector_perm_operand): New predicate.
	* config/riscv/riscv-protos.h (enum insn_type): New enum.
	(expand_vec_perm): New function.
	* config/riscv/riscv-v.cc (const_vec_all_in_range_p): Ditto.
	(gen_const_vector_dup): Ditto.
	(emit_vlmax_gather_insn): Ditto.
	(emit_vlmax_masked_gather_mu_insn): Ditto.
	(expand_vec_perm): Ditto.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm-2.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm-3.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm-4.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm-5.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm-6.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm-7.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm.h: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm_run-1.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm_run-2.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm_run-3.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm_run-4.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm_run-5.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm_run-6.c: New test.
	* gcc.target/riscv/rvv/autovec/vls-vlmax/perm_run-7.c: New test.
parent 84749914
No related branches found
No related tags found
Loading
Showing
with 1217 additions and 0 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment