RFR: 8373069: RISC-V: implement GHASH intrinsic

Fei Yang fyang at openjdk.org
Wed Dec 10 16:12:28 UTC 2025


On Fri, 28 Nov 2025 03:54:29 GMT, Anjian Wen <wenanjian at openjdk.org> wrote:

> support GHASH intrinsic for crypt GCM, which need zvkg extension. 
> 
> passed the tests in 
> test/hotspot/jtreg/compiler/codegen/aes/
> test/jdk/com/sun/crypto

src/hotspot/cpu/riscv/assembler_riscv.hpp line 1989:

> 1987: 
> 1988:   // Vector GHASH (Zvkg) Extension
> 1989:   INSN(vgmul_vv, 0b1110111, 0b010, 0b10001, 0b1, 0b101000);

Seems not used anywhere?

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 2857:

> 2855:     VectorRegister partial_hash = v29;
> 2856:     VectorRegister hash_subkey = v30;
> 2857:     VectorRegister cipher_text = v31;

Can we simply start from `v1` here?

src/hotspot/cpu/riscv/stubGenerator_riscv.cpp line 7109:

> 7107:     }
> 7108: 
> 7109:     if (UseGHASHIntrinsics && UseZvbb) {

Do we need to re-check `UseZvbb` here? `UseGHASHIntrinsics` will be disabled if we don't have `UseZvbb`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28548#discussion_r2607290431
PR Review Comment: https://git.openjdk.org/jdk/pull/28548#discussion_r2607281675
PR Review Comment: https://git.openjdk.org/jdk/pull/28548#discussion_r2607273308


More information about the hotspot-dev mailing list