Re: [PATCH v2] RISC-V: No extensions for SImode min/max against safe constant

2022-11-18 Thread Philipp Tomsich
Applied to master. Thanks! --Philipp. On Fri, 18 Nov 2022 at 21:11, Jeff Law wrote: > > On 11/8/22 17:06, Philipp Tomsich wrote: > > Optimize the common case of a SImode min/max against a constant > > that is safe both for sign- and zero-extension. > > E.g., consider the case > >int

Re: [PATCH v2] RISC-V: No extensions for SImode min/max against safe constant

2022-11-18 Thread Jeff Law via Gcc-patches
On 11/8/22 17:06, Philipp Tomsich wrote: Optimize the common case of a SImode min/max against a constant that is safe both for sign- and zero-extension. E.g., consider the case int f(unsigned int* a) { const int C = 1000; return *a * 3 > C ? C : *a * 3; } where the constant

[PATCH v2] RISC-V: No extensions for SImode min/max against safe constant

2022-11-08 Thread Philipp Tomsich
Optimize the common case of a SImode min/max against a constant that is safe both for sign- and zero-extension. E.g., consider the case int f(unsigned int* a) { const int C = 1000; return *a * 3 > C ? C : *a * 3; } where the constant C will yield the same result in DImode whether