Re: RISC-V: avoid splitting small constants in bcrli_nottwobits patterns

2023-04-25 Thread Jeff Law via Gcc-patches
On 4/20/23 14:11, Jivan Hakobyan via Gcc-patches wrote: and_nottwobits.patch RISC-V: avoid splitting small constant in *bclri_nottwobits and *bclridisi_nottwobit patterns gcc/ * config/riscv/bitmanip.md Updated predicats of bclri_nottwobits and bclridisi_nottwobits

RISC-V: avoid splitting small constants in bcrli_nottwobits patterns

2023-04-20 Thread Jivan Hakobyan via Gcc-patches
Hi all. I have noticed that in the case when we try to clear two bits through a small constant, and ZBS is enabled then GCC split it into two "andi" instructions. For example for the following C code: int foo(int a) { return a & ~ 0x101; } GCC generates the following: foo: andi a0,