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. OK. jeff