]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: vector absolute difference expander [PR117722]
authorVineet Gupta <vineetg@rivosinc.com>
Tue, 7 Jan 2025 22:28:25 +0000 (14:28 -0800)
committerVineet Gupta <vineetg@rivosinc.com>
Tue, 7 Jan 2025 22:28:25 +0000 (14:28 -0800)
commitb755c151fde4ad736405bb2e13a7de0420161179
tree5b7985fba6944b882e8c67f19dab0c2951318fdc
parent0115ef57efa9966fa7f448185dd5c741f58d4fac
RISC-V: vector absolute difference expander [PR117722]

This improves codegen for x264 sum of absolute difference routines.
The insn count is same, but we avoid double widening ops and ensuing
whole register moves.

Also for more general applicability, we chose to implement abs diff
vs. the sum of abs diff variant.

Suggested-by: Robin Dapp <rdapp@ventanamicro.com>
Co-authored-by: Pan Li <pan2.li@intel.com>
Signed-off-by: Vineet Gupta <vineetg@rivosinc.com>
PR target/117722

gcc/ChangeLog:
* config/riscv/autovec.md: Add uabd expander.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/rvv/autovec/pr117722.c: New test.
gcc/config/riscv/autovec.md
gcc/testsuite/gcc.target/riscv/rvv/autovec/pr117722.c [new file with mode: 0644]