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

RISC-V: Add RVV vwmacc/vwmaccu/vwmaccsu combine lowering optmization

Fix according to comments from Robin of V1 patch.

This patch add combine optimization for following case:
__attribute__ ((noipa)) void
vwmaccsu (int16_t *__restrict dst, int8_t *__restrict a, uint8_t *__restrict b,
	  int n)
{
  for (int i = 0; i < n; i++)
    dst[i] += (int16_t) a[i] * (int16_t) b[i];
}

Before this patch:
...
vsext.vf2
vzext.vf2
vmadd.vv
..

After this patch:
...
vwmaccsu.vv
...

gcc/ChangeLog:

	* config/riscv/autovec-opt.md (*<optab>_fma<mode>): New pattern.
	(*single_<optab>mult_plus<mode>): Ditto.
	(*double_<optab>mult_plus<mode>): Ditto.
	(*sign_zero_extend_fma): Ditto.
	(*zero_sign_extend_fma): Ditto.
	* config/riscv/riscv-protos.h (enum insn_type): New enum.

gcc/testsuite/ChangeLog:

	* gcc.target/riscv/rvv/autovec/widen/widen-8.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen-9.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen-complicate-5.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen-complicate-6.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen_run-8.c: New test.
	* gcc.target/riscv/rvv/autovec/widen/widen_run-9.c: New test.
parent 4ede915d
No related branches found
No related tags found
No related merge requests found
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