On Fri, 13 Nov 2026 23:58:07 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 two additional 
> commits since the last revision:
> 
>  - Remove unnecessary tmp variable
>  - Move to add/sub-shift instructions to separate shift add/sub instruction 
> set

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

> 8974:       __ add(c[i - 5], c[i - 5], vt);
> 8975:       __ asr(vt, v, 36);
> 8976:       __ add(c[i - 4], c[i - 4], vt);

This separation of shift and add instructions is extreme microarchitecture 
tweakiness, and arguably overfitting generic AArch64 to a silicon 
implementation of it.

At least, please create a function for the combined shift-and-add, with a 
comment which explains why it exists at all, and specify here exactly which 
microarchitecture you're tuning for. And let's see if this tweak helps an 
independent implementation.

Remember we're programming for an ISA, not a specific implementation of it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/33618#discussion_r4572954612

Reply via email to