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
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,