On Wed, 2026-05-20 at 09:12 +0800, Lulu Cheng wrote:
>
> 在 2026/5/19 上午10:54, Xi Ruoyao 写道:
> > r17-523 has added the __builtin_bitreverse{8,16,32,64} builtins and
> > established that the standard optab names for them are
> > bitreverse<mode>2. Rename the rbit<mode> expanders so they'll be used
> > for those builtins.
> >
> > r17-567 has already removed the uses of rbit<mode> so the old names do
> > not need to be kept.
> >
> > PR target/50481
>
> Hi,
>
> It looks like you missed a spot in the code that needed an update.
>
>
> diff --git a/gcc/config/loongarch/loongarch.md
> b/gcc/config/loongarch/loongarch.md
>
> index c9ccc78d991..0b9881ed7a1 100644
> --- a/gcc/config/loongarch/loongarch.md
> +++ b/gcc/config/loongarch/loongarch.md
> @@ -4901,7 +4901,7 @@ (define_expand "crc_rev<mode>si4"
> expand_reversed_crc_table_based only accepts one helper
> for reversing data elements and CRC states. */
> auto mode = GET_MODE (*r);
> - auto rbit = (mode == <MODE>mode ? gen_rbit<mode> : gen_rbitsi);
This is already removed in r17-567 ("middle-end: Optimize reversed CRC
table-based implementation") which uses a reversed polynomial lookup
table directly instead of bit reflection operations.
> + auto rbit = (mode == <MODE>mode ? gen_bitreverse<mode>2 :
> gen_bitreversesi2);
> rtx out = gen_reg_rtx (mode);
>
> emit_insn (rbit (out, *r));
--
Xi Ruoyao <[email protected]>