RFR: JDK-8216437 : PPC64: Add intrinsic for GHASH algorithm [v20]

Martin Doerr mdoerr at openjdk.org
Sat Feb 8 12:27:14 UTC 2025


On Fri, 7 Feb 2025 13:50:27 GMT, Suchismith Roy <sroy at openjdk.org> wrote:

>> JBS Issue : [JDK-8216437](https://bugs.openjdk.org/browse/JDK-8216437)
>> 
>> Currently acceleration code for GHASH is missing for PPC64. 
>> 
>> The current implementation utlilises SIMD instructions on Power and uses Karatsuba multiplication for obtaining the final result.
>
> Suchismith Roy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 42 commits:
> 
>  - Merge branch 'openjdk:master' into ghash_processblocks
>  - adapt Condition registers
>  - Merge branch 'openjdk:master' into ghash_processblocks
>  - restore chnges
>  - restore chnges
>  - permute vHigh,vLow
>  - indentation
>  - comments
>  - vsx logic change
>  - spaces
>  - ... and 32 more: https://git.openjdk.org/jdk/compare/86cec4ea...d22fcf25

src/hotspot/cpu/ppc/stubGenerator_ppc.cpp line 661:

> 659:     __ andi(temp1, data, 15);
> 660:     __ cmpwi(CR0, temp1, 0);
> 661:     __ beq(CR0, L_aligned);                    // Check if address is aligned (mask lower 4 bits)

The alignment check should not be in the loop. Better check before and use 2 loops.
It would be interesting to know how often the data is aligned.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20235#discussion_r1947715475


More information about the hotspot-dev mailing list