RFR: 8267125: AES Galois CounterMode (GCM) interleaved implementation using AVX512 + VAES instructions [v10]

Vladimir Kozlov kvn at openjdk.java.net
Wed Aug 18 01:19:36 UTC 2021


On Tue, 17 Aug 2021 23:37:55 GMT, Smita Kamath <svkamath at openjdk.org> wrote:

>> I would like to submit AES-GCM optimization for x86_64 architectures supporting AVX3+VAES (Evex encoded AES). This optimization interleaves AES and GHASH operations.
>> Performance gain of ~1.5x - 2x for message sizes 8k and above.
>
> Smita Kamath has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Moved declaration in vmStructs.cpp to other AESCrypt declarations

src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 7712:

> 7710:         StubRoutines::x86::_counter_mask_addr = counter_mask_addr();
> 7711:         StubRoutines::x86::_ghash_poly512_addr = ghash_polynomial512_addr();
> 7712:         StubRoutines::x86::_ghash_long_swap_mask_addr = generate_ghash_long_swap_mask();

`_counter_mask_addr = counter_mask_addr()` and `_ghash_long_swap_mask_addr = generate_ghash_long_swap_mask()` are called by other intrinsics too. Which duplicates code in codeCache.
They should be called only once when they are used. May be `counter_mask_addr()` and `generate_ghash_long_swap_mask()` method should check that addresses already recorded and return it.

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

PR: https://git.openjdk.java.net/jdk/pull/4019


More information about the hotspot-compiler-dev mailing list