On 9/4/26 10:58 AM, Jakub Jelinek wrote:
On Fri, Sep 04, 2026 at 09:46:12AM -0600, Jeff Law wrote:
I'd be a lot more comfortable with a test in the testsuite that at least
verified the code generation via scan-asm or check-function-bodies. If you
look at crc-22-zbkb, I think it has the magic necessary to have a run test
which could be run on a suitable design or in QEMU.
So like this (only the tests were added, the rest of the patch is
identical):
2026-09-04 Jakub Jelinek <[email protected]>
PR target/126671
* config/riscv/bitmanip.md (bswaphi2): Use
TARGET_ZBB || TARGET_ZBKB condition instead of just
TARGET_ZBB.
(bitreverse<mode>2): New expander.
* gcc.target/riscv/bitreverse-1-zbkb.c: New test.
* gcc.target/riscv/bitreverse-2-zbkb.c: New test.
* gcc.target/riscv/bitreverse-3-zbkb.c: New test.
Works for me. Given no designs with zbkb are in the wild, I don' t mind
it going in now and we'll deal with any fallout post-commit.
Thanks. I'll have to tell Daniel this one is taken care of, he was
going to poke at it ;-)
jeff