https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50481
--- Comment #32 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <[email protected]>: https://gcc.gnu.org/g:07ce51abde6d6f92febab863a68c69266a808f9f commit r17-591-g07ce51abde6d6f92febab863a68c69266a808f9f Author: Jakub Jelinek <[email protected]> Date: Tue May 19 09:29:33 2026 +0200 optabs: Handle bitreverse using widening or two bitreverses of halves [PR50481] 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. 2026-05-19 Jakub Jelinek <[email protected]> PR target/50481 * optabs.cc (widen_bswap): Add UNOPTAB argument and use it instead of hardcoded bswap_optab. Rename to ... (widen_bswap_or_bitreverse): ... this. (expand_doubleword_bswap): Add UNOPTAB argument and use it instead of hardcoded bswap_optab. Rename to ... (expand_doubleword_bswap_or_bitreverse): ... this. (expand_bitreverse): Use widen_bswap_or_bitreverse and expand_doubleword_bswap_or_bitreverse. (expand_unop): Adjust widen_bswap and expand_doubleword_bswap callers to use new names and add an extra bswap_optab argument. Reviewed-by: Jeffrey Law <[email protected]>
