Re: [PATCH 1/3] RISC-V: Improve codegen for negative repeating large constants

2024-09-04 Thread Jeff Law
On 9/2/24 2:01 PM, Raphael Moreira Zinsly wrote: Improve handling of constants where its upper and lower 32-bit halves are the same and have negative values. e.g. for: unsigned long f (void) { return 0xf0f0f0f0f0f0f0f0UL; } Without the patch: li a0,-252645376 addia0,a0,240 li

[PATCH 1/3] RISC-V: Improve codegen for negative repeating large constants

2024-09-02 Thread Raphael Moreira Zinsly
Improve handling of constants where its upper and lower 32-bit halves are the same and have negative values. e.g. for: unsigned long f (void) { return 0xf0f0f0f0f0f0f0f0UL; } Without the patch: li a0,-252645376 addia0,a0,240 li a5,-252645376 addia5,a5,241 sllia5,a5,32 add