RFR: 8341052: SHA-512 implementation using SHA-NI

Sandhya Viswanathan sviswanathan at openjdk.org
Fri Oct 4 20:46:34 UTC 2024


On Mon, 19 Aug 2024 21:34:05 GMT, Smita Kamath <svkamath at openjdk.org> wrote:

> 8341052: SHA-512 implementation using SHA-NI

src/hotspot/cpu/x86/assembler_x86.cpp line 6766:

> 6764: 
> 6765: void Assembler::sha512msg1(XMMRegister dst, XMMRegister src) {
> 6766:   assert(VM_Version::supports_sha512(), "");

For all the new sha512 instructions, this should be:
assert(VM_Version::supports_sha512() && VM_Version::supports_avx(), "");

src/hotspot/cpu/x86/assembler_x86.cpp line 6767:

> 6765: void Assembler::sha512msg1(XMMRegister dst, XMMRegister src) {
> 6766:   assert(VM_Version::supports_sha512(), "");
> 6767:   InstructionAttr attributes(AVX_256bit, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false);

For all the new sha512 instructions legacy_mode should be true.

src/hotspot/cpu/x86/assembler_x86.cpp line 11696:

> 11694: }
> 11695: 
> 11696: void Assembler::vbroadcasti128(XMMRegister dst, Address src) {

Please see vbroadcastf128, good to take vector_len as argument here also and have an assert to confirm that it is AVX-256 bit. 
Also need:
attributes.set_address_attributes(/* tuple_type */ EVEX_T4, /* input_size_in_bits */ EVEX_32bit);

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20633#discussion_r1788266957
PR Review Comment: https://git.openjdk.org/jdk/pull/20633#discussion_r1788269351
PR Review Comment: https://git.openjdk.org/jdk/pull/20633#discussion_r1788284731


More information about the hotspot-dev mailing list