RFR: 8269404: Base64 Encoding optimization enhancements for x86 using AVX-512 [v4]

Scott Gibbons github.com+6704669+asgibbons at openjdk.java.net
Tue Jul 13 22:42:16 UTC 2021


On Sun, 11 Jul 2021 08:51:08 GMT, Jatin Bhateja <jbhateja at openjdk.org> wrote:

>> Scott Gibbons has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Addressing review comments.
>
> src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 5432:
> 
>> 5430:       __ addptr(encode_table, isURL);
>> 5431:       __ shrl(isURL, 6); // restore isURL
>> 5432: 
> 
> Just a suggestion to save redundant addptr and shr/l in case isUrl is zero. 
> 
> lea (encode_table , ExternalAddress(...));
> cmp isUrl $0;
> cmovne(encode_table, Address(encode_table, 64));

I'll keep this in mind for the future.  Thanks.

> src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 5463:
> 
>> 5461:     if (VM_Version::supports_avx2()
>> 5462:         && VM_Version::supports_avx512vlbw()) {
>> 5463:       /*
> 
> Its not clear why are you checking for existence of AVX512VLBW if this block is emitting AVX2 code.

There are VL/BW instructions in the loop.

> 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.

> src/hotspot/cpu/x86/stubGenerator_x86_64.cpp line 5487:
> 
>> 5485: 
>> 5486:       __ subl(length, 24);
>> 5487:       __ evpbroadcastd(xmm7, rax, Assembler::AVX_256bit);
> 
> Same as above, all the other occurrences in this block can be replaced by vpboradcastd.

Same as above.  No form of vpbroadcastd takes a Register as second argument.

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

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


More information about the hotspot-compiler-dev mailing list