On Tue, 7 Feb 2023 00:57:54 GMT, Joe Darcy wrote:
>> Tagir F. Valeev has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Added explanatory comments
>
> src/java.base/share/classes/java/lang/Math.java line 2266:
>
>> 2264: // If min
On Mon, 6 Feb 2023 09:46:15 GMT, Tagir F. Valeev wrote:
>> clamp() methods added to Math and StrictMath
>>
>> `int clamp(long, int, int)` is somewhat different, as it accepts a `long`
>> value and safely clamps it to an `int` range. Other overloads work with a
>> particular type (long, float a
On Mon, 6 Feb 2023 09:46:15 GMT, Tagir F. Valeev wrote:
>> clamp() methods added to Math and StrictMath
>>
>> `int clamp(long, int, int)` is somewhat different, as it accepts a `long`
>> value and safely clamps it to an `int` range. Other overloads work with a
>> particular type (long, float a
On Mon, 6 Feb 2023 10:01:49 GMT, Quan Anh Mai wrote:
> Suggestion: Refactor the uncommon cases into separate functions so the
> compiler can have easier time inlining the common path. Thanks
@merykitty this probably needs confirmation from VM folks. I'm pretty sure that
C2 will be capable to d
On Mon, 6 Feb 2023 09:46:15 GMT, Tagir F. Valeev wrote:
>> clamp() methods added to Math and StrictMath
>>
>> `int clamp(long, int, int)` is somewhat different, as it accepts a `long`
>> value and safely clamps it to an `int` range. Other overloads work with a
>> particular type (long, float a
> clamp() methods added to Math and StrictMath
>
> `int clamp(long, int, int)` is somewhat different, as it accepts a `long`
> value and safely clamps it to an `int` range. Other overloads work with a
> particular type (long, float and double). Using similar approach in other
> cases (e.g. `flo