RFR: 8269404: Base64 Encoding optimization enhancements for x86 using AVX-512 [v4]
Jatin Bhateja
jbhateja at openjdk.java.net
Wed Jul 14 03:11:13 UTC 2021
On Tue, 13 Jul 2021 22:38:43 GMT, Scott Gibbons <github.com+6704669+asgibbons at openjdk.org> wrote:
>> src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 5480:
>>
>>> 5478: __ movl(rax, 0x0fc0fc00);
>>> 5479: __ vmovdqu(xmm1, ExternalAddress(StubRoutines::x86::base64_avx2_input_mask_addr()), rax);
>>> 5480: __ evpbroadcastd(xmm8, rax, Assembler::AVX_256bit);
>>
>> evpbroadcastd instruction asserts over VM_Version::supports_evex(), even though xmm1 is being used and vector length is 256bit this is a perfect case for EVEX->VEX demotion.
>> vpbroadcastd could be used in its place.
>
> There is no form of vpbroadcastd that takes a Register as a second argument. Only evpbroadcastd.
FTR we do have 256 bit vex encoded instruction to broadcast 32bit value into ymm.
VEX.256.66.0F38.W0 18 /r VBROADCASTSS ymm1,xmm2
https://www.felixcloutier.com/x86/vbroadcast
It seems to operates in floating point domain so sequence may incur domain change penalty, but still we can save dependency on AVX512 feature in a purely AVX2 code blob.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4601
More information about the hotspot-compiler-dev
mailing list