On Wed, 16 Nov 2022 at 04:45, Jeff Law <jeffreya...@gmail.com> wrote: > > > On 11/10/22 14:35, Philipp Tomsich wrote: > > Sequences of the form "a ^ C" with C being the positive half of a > > signed immediate's range with one extra bit set in addtion are mapped > > to xori and one binvi to avoid using a temporary (and a multi-insn > > sequence to load C into that temporary). > > > > gcc/ChangeLog: > > > > * config/riscv/bitmanip.md (*binvi<mode>_extrabit): New pattern. > > > > gcc/testsuite/ChangeLog: > > > > * gcc.target/riscv/zbs-binvi.c: New test. > > Could this have been potentially done by extending the ior pattern with > a code iterator that covered IOR/XOR? > > > Not a big deal, but if it'd work, consider to avoid the pattern duplication.
We'll rework to using an iterator and a mapping in v2 for the following cases, folding into a single patch: - X | C => bseti - X & ~C => bclri - X ^ C => binvi Thanks. Philipp.