On 5/18/2026 5:29 AM, Jakub Jelinek wrote:
> Hi!
>
> The following patch extends the widen_bswap and expand_doubleword_bswap
> functions to handle also bitreverse, so that all the backends with
> say just bitreversesi2 or bitreverse{s,d}i2 can handle also
> bitreverse{q,h}i2 and bitreverse{d,t}i2 easily.
>
> Tested on aarch64-linux with just bitreverse{s,d}i2 on
> builtin-bitreverse-1.c, ok for trunk if it passes full bootstrap/regtest?
>
> 2026-05-18 Jakub Jelinek <[email protected]>
>
> PR target/50481
> * optabs.cc (widen_bswap): Add UNOPTAB argument and use it instead
> of hardcoded bswap_optab.
> (expand_doubleword_bswap): Likewise.
> (expand_bitreverse): Use widen_bswap and expand_doubleword_bswap.
> (expand_unop): Adjust widen_bswap and expand_doubleword_bswap callers.
OK. Though consider renaming widen_bswap since it's more general than
just bswap now. Not a big deal though.
jeff