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

Suchismith Roy sroy at openjdk.org
Mon Feb 10 13:20:13 UTC 2025


On Sat, 8 Feb 2025 12:00:35 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> vspltisb(vZero,0) is needed. 
>>     __ vsldoi(vTmp8, vTmp5, vZero, 8);          // mL : Extract the lower 64 bits of M
>>     __ vsldoi(vTmp9, vZero, vTmp5, 8);          // mH : Extract the higher 64 bits of M
>>     We need to extract appropriate bits and for that vZero needs to be initialised to 0 always.
>
> The problem is that you're overwriting it below which should not be done:
> 
>     __ vxor(vZero, vTmp4, vTmp10);
>     __ vmr(vState, vZero);
> 
> Why not `__ vxor(vState, vTmp4, vTmp10);`?

We are storing the result in each operation into vState to re use in the next operation using 
__ vxor(vH, vH, vState);
This is similar to https://github.com/openjdk/jdk/blob/c9cadbd23fb13933b8968f283d27842cd35f8d6f/src/java.base/share/classes/com/sun/crypto/provider/GHASH.java#L118

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

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


More information about the hotspot-dev mailing list