RFR: 8358179: Performance regression in Math.cbrt [v2]

Mohamed Issa missa at openjdk.org
Fri Jun 27 01:43:16 UTC 2025


On Thu, 26 Jun 2025 22:52:39 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Mohamed Issa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Ensure ABS_MASK is a 128-bit memory sized location and only use equal enum for UCOMISD checks
>
> src/hotspot/cpu/x86/stubGenerator_x86_64_cbrt.cpp line 51:
> 
>> 49: ATTRIBUTE_ALIGNED(16) static const juint _ABS_MASK[] =
>> 50: {
>> 51:     4294967295, 2147483647
> 
> This should be a 128 bit constant as we are using it with andpd.  Also please add in comments the hex value.

I changed it into a 128 bit constant and added comments showing the hex value.

> src/hotspot/cpu/x86/stubGenerator_x86_64_cbrt.cpp line 217:
> 
>> 215:   __ bind(B1_1);
>> 216:   __ ucomisd(xmm0, ExternalAddress(ZERON), r11 /*rscratch*/);
>> 217:   __ jcc(Assembler::zero, L_2TAG_PACKET_1_0_1); // Branch only if x is +/- zero or NaN
> 
> This could be Assembler::equal to be consistent.

I switched it to Assembler::equal.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25962#discussion_r2170483184
PR Review Comment: https://git.openjdk.org/jdk/pull/25962#discussion_r2170483818


More information about the hotspot-compiler-dev mailing list