RISC-V: Support cond vmulh.vv and vmulu.vv autovec patterns
commitc0a70df6403397a69204cba1df82114a9ddf7076
authorLehua Ding <lehua.ding@rivai.ai>
Tue, 12 Sep 2023 08:41:46 +0000 (12 16:41 +0800)
committerLehua Ding <lehua.ding@rivai.ai>
Wed, 13 Sep 2023 09:56:16 +0000 (13 17:56 +0800)
treef3e1dd9172c0fd1b13173228df55e0b6bba88009
parent842e4d51c11ff5ac842d925e73f4094901f4a9be
RISC-V: Support cond vmulh.vv and vmulu.vv autovec patterns

This patch adds combine patterns to combine vmulh[u].vv + vcond_mask
to mask vmulh[u].vv. For vmulsu.vv, it can not be produced in midend
currently. We will send another patch to take this issue.

gcc/ChangeLog:

* config/riscv/autovec-opt.md (*cond_<mulh_table><mode>3_highpart):
New combine pattern.
* config/riscv/autovec.md (smul<mode>3_highpart): Mrege smul and umul.
(<mulh_table><mode>3_highpart): Merged pattern.
(umul<mode>3_highpart): Mrege smul and umul.
* config/riscv/vector-iterators.md (umul): New iterators.
(UNSPEC_VMULHU): New iterators.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/cond/cond_mulh-1.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_mulh-2.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_mulh_run-1.c: New test.
* gcc.target/riscv/rvv/autovec/cond/cond_mulh_run-2.c: New test.
gcc/config/riscv/autovec-opt.md
gcc/config/riscv/autovec.md
gcc/config/riscv/vector-iterators.md
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_mulh-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_mulh-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_mulh_run-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/rvv/autovec/cond/cond_mulh_run-2.c [new file with mode: 0644]