Re: RISC-V: Use extension instructions instead of bitwise "and"

2023-05-29 Thread Jeff Law via Gcc-patches
On 5/23/23 13:46, Jivan Hakobyan via Gcc-patches wrote: In the case where the target supports extension instructions, it is preferable to use that instead of doing the same in other ways. For the following case void foo (unsigned long a, unsigned long* ptr) { ptr[0] = a & 0xUL;

RISC-V: Use extension instructions instead of bitwise "and"

2023-05-23 Thread Jivan Hakobyan via Gcc-patches
In the case where the target supports extension instructions, it is preferable to use that instead of doing the same in other ways. For the following case void foo (unsigned long a, unsigned long* ptr) { ptr[0] = a & 0xUL; ptr[1] &= 0xUL; } GCC generates foo: li