Re: [PATCH v5 07/18] RISC-V: Add ANDI_ADD macro-fusion recognition
Jeffrey Law <[email protected]>
| Newsgroups | gmane.comp.gcc.patches |
|---|---|
| Message-ID | <[email protected]> |
On 8/13/2026 11:58 PM, Jin Ma wrote: > Recognize ANDI followed by an ADD/ADDI-type instruction when the > result register forms the required dependency. An ADD may use the ANDI > result as both source operands; no source-inequality constraint is > imposed. > > Leave the fusion disabled by default. > > gcc/ChangeLog: > > * config/riscv/riscv-fusion.cc (riscv_fuse_andi_add): New function. > (riscv_fusion_table): Add RISCV_FUSE_ANDI_ADD. > * config/riscv/riscv-protos.h (enum riscv_fusion_pairs): Add > RISCV_FUSE_ANDI_ADD. > > gcc/testsuite/ChangeLog: > > * gcc.target/riscv/fusion-andi-add-addi.c: New test. > * gcc.target/riscv/fusion-andi-adduw-rtl.c: Likewise. > * gcc.target/riscv/fusion-special-positive-rtl-andi-add.c: Likewise. > > Signed-off-by: Jin Ma <[email protected]> OK once prerequisites are approved. jeff