On Wed, 11 Nov 2026 10:20:38 GMT, Andrew Haley <[email protected]> wrote:
>> 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 9016: > >> 9014: __ mov(c[i], zr); >> 9015: } >> 9016: > > The first thing that strikes me is that this looks like a straightforward > translation of the version in the IntegerPolynomialP384 class. So from where > comes the advantage, and how big is it? The advantage of the intrinsics version over C2 is that we have greater control of the registers in the way that they are allocated, their lifetime, and instruction sequences that C2 does not use. Specifically, the stub allocates all 14 column registers throughout the lifetime of both multiplication and reduction operations. Whereas Java does not necessarily keep these loaded between the multiplication and reduction helper method. So overall the benefit by combining these two stages we get better performance, whereas register spills and loads may be a downfall of C2 given inlining boundaries. As a result of these efficiencies we see, on average, throughput increase 36% vs. C2 performance for P-384 key generation and key agreement. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/33618#discussion_r4582809941
