RFR: 8260501: [Vector API] Improve register usage for shift operations on x86 [v2]

Vladimir Ivanov vlivanov at openjdk.java.net
Thu Jan 28 08:24:46 UTC 2021


On Thu, 28 Jan 2021 02:09:58 GMT, Jie Fu <jiefu at openjdk.org> wrote:

>> Hi all,
>> 
>> I found the register usage is less optimized for some shift operations.
>> For example, vshiftL_imm [1]/vshiftI_imm require dst != src.
>> But it's actually fine for the register allocator to assign dst == src.
>> 
>> Also, vshiftL [2]/vshiftI/vshiftS require dst != src.
>> But it's actually required for UseAVX==0 only.
>> For the most common cases (UseAVX > 0), it's fine to assign dst == src.
>> 
>> The fix splits vshiftS/vshiftI/vshiftL into UseAVX > 0 and UseAVX == 0 cases.
>> And just removes the unreasonable requirement for vshiftI_imm and vshiftL_imm. 
>> 
>> Testing:
>>   - jdk/incubator/vector/ on x64 with UseAVX=3/2/1/0, no regression
>> 
>> Thanks.
>> Best regards,
>> Jie
>> 
>> [1] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/x86.ad#L6058
>> [2] https://github.com/openjdk/jdk/blob/master/src/hotspot/cpu/x86/x86.ad#L6037
>
> Jie Fu has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Recuce the binary size
>  - Revert changes

Looks good.

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

Marked as reviewed by vlivanov (Reviewer).

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


More information about the hotspot-compiler-dev mailing list