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

Jie Fu jiefu at openjdk.java.net
Wed Jan 27 11:56:47 UTC 2021


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

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

Commit messages:
 - 8260501: [Vector API] Improve register usage for shift operations on x86

Changes: https://git.openjdk.java.net/jdk/pull/2257/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=2257&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8260501
  Stats: 86 lines in 1 file changed: 46 ins; 22 del; 18 mod
  Patch: https://git.openjdk.java.net/jdk/pull/2257.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/2257/head:pull/2257

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


More information about the hotspot-compiler-dev mailing list