[vector] RFR (M): Fix ByteVector/ShortVector.shiftR

Vladimir Ivanov vladimir.x.ivanov at oracle.com
Wed Feb 20 22:43:52 UTC 2019


http://cr.openjdk.java.net/~vlivanov/panama/vector/shiftr/webrev.00/

ByteVector/ShortVector.shiftR erroneously behaves as signed (and not 
unsigned) shift. (There's aShiftR for the former.)

While fixing that, I spotted a bug in existing implementation - missing 
AD instructions for some shapes with constants.

So, the patch contains the following:

   * adjusts default implementation to do zero extension first: (a & 
0xFF) >>> (b & 7) and (a & 0xFFFF) >>> (b & 15)

   * adjusts C2 to do zero extension;

   * unifies IR shape for constant and variable shifts making 
LShiftCntV/RShiftCntV nodes mandatory; then extend AD instructions for 
constant shifts to take them into account.

The last point requires changes both on x86 & aarch64 side and I try to 
cover both.

Best regards,
Vladimir Ivanov


More information about the panama-dev mailing list