Re: [PATCH] RISC-V: Improve bswap8 when zbb is enabled

2025-07-15 Thread Jeff Law
On 7/10/25 8:44 AM, Dusan Stojkovic wrote: This peephole pattern combines the following instructions: bswap8: rev8a5,a0 -> li a4,-65536 -> sraia5,a5,32 -> and a5,a5,a4 -> roriw a5,a5,16 and a0,a0,a4 or a

[PATCH] RISC-V: Improve bswap8 when zbb is enabled

2025-07-10 Thread Dusan Stojkovic
This peephole pattern combines the following instructions: bswap8: rev8a5,a0 -> li a4,-65536 -> sraia5,a5,32 -> and a5,a5,a4 -> roriw a5,a5,16 and a0,a0,a4 or a0,a0,a5 sext.w a0,a0 ret And emits th