On Thu, 28 May 2026 07:39:45 GMT, Shawn Emery <[email protected]> wrote:

>> Curve25519 polynomial arithmetic is performed with intrinsincs implemented 
>> in GPR related instructions for multiplication and squaring operations 
>> (methods mult() and square()).  Benchmark improvements include:
>> 
>> - X25519 encapsulation: +19%
>> - X25519 decapsulation: +19%
>> - X25519-MLKEM encapsulation: +12%
>> - X25519-MLKEM decapsulation: +15%
>> - X22519 key agreement: +19%
>> - X25519 key-pair generation: +19%
>> - X25519-MLKEM key-pair generation: +13%
>> - EdDSA key-pair generation: +20%
>> - EdDSA signing: +19%
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Shawn Emery has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Remove commented code
>  - Comments from @vpaprotsk

src/hotspot/cpu/x86/stubGenerator_x86_64_poly25519.cpp line 183:

> 181:   }
> 182: 
> 183:   __ pop_ppx(rdx);

Oh! this is clever!! nice!

Could you add a comment in the parent function:
// __ pop_ppx(rdx); // restored in the helper already

("Clever code should have comments".. lack of 'symmetry' caught my attention.. 
but as long as its noted, don't have a problem)

src/hotspot/cpu/x86/stubGenerator_x86_64_poly25519.cpp line 224:

> 222:   multiply_25519_scalar(aLimbs, bLimbs, rLimbs, c, bArg, d, b, mask, 
> _masm);
> 223: 
> 224:   __ pop_ppx(r15);

Comment here?
`// __ pop_ppx(rdx); // restored in the helper already`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/31087#discussion_r3319063758
PR Review Comment: https://git.openjdk.org/jdk/pull/31087#discussion_r3319068590

Reply via email to