]> git.ipfire.org Git - thirdparty/gcc.git/commit
[committed] [RISC-V] Provide splitting guidance to combine to faciliate shNadd.uw...
authorJeff Law <jlaw@ventanamicro.com>
Fri, 10 May 2024 03:07:06 +0000 (21:07 -0600)
committerJeff Law <jlaw@ventanamicro.com>
Fri, 10 May 2024 03:07:06 +0000 (21:07 -0600)
commitbfb88b1406cdd8d3f97e280b0d63529aa925f18a
treee87b120cb851e363f33e3c8f0bc7a70ba5016030
parentd7bb8eaade3cd3aa70715c8567b4d7b08098e699
[committed] [RISC-V] Provide splitting guidance to combine to faciliate shNadd.uw generation

This fixes a minor code quality issue I found while comparing GCC and LLVM.
Essentially we want to do a bit of re-association to generate shNadd.uw
instructions.

Combine does the right thing and finds all the necessary instructions,
reassociates the operands, combines constants, etc.  Where is fails is finding
a good split point.  The backend can trivially provide guidance on how to split
via a define_split pattern.

This has survived both Ventana's internal CI system (rv64gcb) as well as my own
(rv64gc, rv32gcv).

I'll wait for the external CI system to give the all-clear before pushing.

gcc/
* config/riscv/bitmanip.md: Add splitter for shadd feeding another
add instruction.

gcc/testsuite/

* gcc.target/riscv/zba-shadduw.c: New test.
gcc/config/riscv/bitmanip.md
gcc/testsuite/gcc.target/riscv/zba-shadduw.c [new file with mode: 0644]