RFR: 8268276: Base64 Decoding optimization for x86 using AVX-512 [v2]

Scott Gibbons github.com+6704669+asgibbons at openjdk.java.net
Tue Jun 8 00:14:16 UTC 2021


On Mon, 7 Jun 2021 22:34:33 GMT, Corey Ashford <cashford at openjdk.org> wrote:

>> Scott Gibbons has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Update full name
>
> src/java.base/share/classes/java/util/Base64.java line 813:
> 
>> 811:             while (sp < sl) {
>> 812:                 if (shiftto == 18 && sp < sl - 4) {       // fast path
>> 813:                     int dl = decodeBlock(src, sp, sl, dst, dp, isURL, isMIME);
> 
> This new param is passed all the way down to the intrinsic.  I think existing intrinsics can safely ignore this parameter if it doesn't help the implementation (for example PPC64-LE has 16-byte vector registers, so isn't quite as seriously impacted by MIME).  However, in the code for the PPC64-LE intrinsic, this new parameter isn't mentioned.  I think if you're going to add a new parameter, it should be mentioned in the existing intrinsics as being present, but unused.

Are you suggesting that I change *all* intrinsic implementations (aarch64, ppc, etc.)?  I have no problem doing that - just checking if this is what's desired.

> src/java.base/share/classes/java/util/Base64.java line 818:
> 
>> 816:                      * bytes of data were returned.
>> 817:                      */
>> 818:                     int chars_decoded = ((dl + 2) / 3) * 4;
> 
> In the PR comments, you say, "A change was also made here removing the restriction that the intrinsic must return an even multiple of 3 bytes decoded.", however there's still a comment in the code above that says:
> 
>          * If the intrinsic function does not process all of the bytes in
>          * src, it must process a multiple of four of them, making the
>          * returned destination length a multiple of three.
>         
> So this comment needs to be changed or removed to reflect your commit.

I will change the comment, and add verbage regarding the new parameter.  Thank you.

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

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



More information about the build-dev mailing list