On Wed, 25 Nov 2026 06:42:04 GMT, Shawn Emery <[email protected]> wrote:

>> This set of changes implements multiplication and squaring field operations 
>> on the P-384 curve using AArch64 intrinsics.  The performance gains from 
>> this enhancement yields:
>> 
>> Key pair generation - P-384: +38%
>> Key agreement - P-384: +37%
>> KEM decapsulation - secP384r1: +36%
>> KEM encapsulation - secP384r1: +36%
>> 
>> Key pair generation - secP384r1MLKEM1024: +35%
>> KEM decapsulation - secP384r1MLKEM1024: +35%
>> KEM encapsulation - secP384r1MLKEM1024: +36%
>> 
>> ---------
>> - [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 one additional 
> commit since the last revision:
> 
>   Update based on comments from @adinn and @theRealAph

Thank you for the fixes. Looks good modulo one small tweak for the mul routine.

src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp line 9033:

> 9031: 
> 9032:   // Perform high/low multiplication with signed 7x55 bit limbs
> 9033:   void mulhl_P384(Register a, Register b, Register high, Register low, 
> Register c[], int i, int j) {

This is my fault for not being clear in the original request but you ought 
really to be doing the index add (i + j) or, in the case of square (i * 2) at 
the call site and passing that as a single index argument.
You could also document the fact that the output low and high results are 
written to adjacent array slots at index i and i+1. So ...
Suggestion:

  // output a * b as 2*55 bit products in (high, low) and
  // accumulate (high, low) into (c[i], c[i+1])
  void mulhl_P384(Register a, Register b, Register high, Register low, Register 
c[], int i) {

And then replace i + j in the body of the method with i

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

PR Review: https://git.openjdk.org/jdk/pull/33618#pullrequestreview-6055744722
PR Review Comment: https://git.openjdk.org/jdk/pull/33618#discussion_r4693446064

Reply via email to