int ctz3 (unsigned x) { static int table[32] = { 0, 1, 2,24, 3,19, 6,25, 22, 4,20,10,16, 7,12,26, 31,23,18, 5,21, 9,15,11,30,17, 8,14,29,13,28,27 }; if (x == 0) return 32; x = (x & -x) * 0x04D7651F; return table[x >> 27]; } riscv64-unknown-linux-gnu-gcc -O2 -march=rv64gc_zbb Before ctz3: ctzw a0,a0 ret Now ctz3: ctzw a0,a0 andi a0,a0,127 ret Bisected this to c23a9c87cc62bd177 ("Some additional zero-extension related optimizations in simplify-rtx.")
Dup of bug 106888. *** This bug has been marked as a duplicate of bug 106888 ***