RFR: 8360559: Optimize Math.sinh for x86 64 bit platforms [v2]

Mohamed Issa missa at openjdk.org
Thu Jul 31 21:27:55 UTC 2025


On Wed, 30 Jul 2025 18:26:22 GMT, Sandhya Viswanathan <sviswanathan at openjdk.org> wrote:

>> Mohamed Issa has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Move error bound to separate section in comment header
>
> src/hotspot/cpu/x86/stubGenerator_x86_64_sinh.cpp line 325:
> 
>> 323:   __ jcc(Assembler::aboveEqual, L_2TAG_PACKET_0_0_2); // Branch only if |x| is not in [23/64, 3*2^8)
>> 324:   __ movsd(xmm3, ExternalAddress(HALFMASK), r11 /*rscratch*/);
>> 325:   __ movsd(xmm1, ExternalAddress(L2E), r11 /*rscratch*/);
> 
> xmm1 is used at L_2TAG_PACKET_0_0_2 -> L_2TAG_PACKET_3_0_2 line 507 below so should be loaded prior to L_2TAG_PACKET_0_0_2.

At the end of L_2TAG_PACKET_3_0_2, the goal is to generate +/- Infinity and set the overflow flag, so the L2E load into xmm1 actually doesn't matter in this case. I'll move the load to ensure xmm1 is initialized with a known value before it's used though.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26152#discussion_r2246405871


More information about the core-libs-dev mailing list