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

Martin Doerr mdoerr at openjdk.org
Wed Feb 19 15:13:01 UTC 2025


On Wed, 19 Feb 2025 08:39:34 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 incrementally with one additional commit since the last revision:
> 
>   remove not needed variables

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

> 657:     __ beq(CR0, L_trigger_assert);
> 658:     __ b(L_skip_assert);                          // Skip assertion if 'blocks' is nonzero
> 659:     __ bind(L_trigger_assert);

The 3 lines above and the labels should be removed. `asm_assert_eq` already does that.

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

> 690:     __ andi(temp1, data, 15);
> 691:     __ cmpwi(CR0, temp1, 0);
> 692:     __ beq(CR0, L_aligned_loop);

I'd change it to something like `bne(CR0, L_prepare_unaligned_loop)` and move the next lines there. This will also avoid one extra branch.

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

> 695:     __ lvx(vHigh, temp1, data);
> 696:     __ b(L_unaligned_loop);
> 697:     __ bind(L_aligned_loop);

I suggest adding an empty line before every `bind` statement to improve readability.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20235#discussion_r1961849682
PR Review Comment: https://git.openjdk.org/jdk/pull/20235#discussion_r1961857833
PR Review Comment: https://git.openjdk.org/jdk/pull/20235#discussion_r1961862843


More information about the hotspot-dev mailing list