[vector] optimize rotate left/right

Lupusoru, Razvan A razvan.a.lupusoru at intel.com
Fri May 18 21:05:53 UTC 2018


Hi Paul,

I am not quite sure that taking negative of shift count is correct. I believe that for int case, it should be 32 - shiftcount. 

public final IntVector<S> rotateL(int s) {
  return shiftL(s).or(shiftR(Integer.SIZE-s));
}

Does that sound right to you?

Thanks,
Razvan

-----Original Message-----
From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Paul Sandoz
Sent: Thursday, May 17, 2018 5:51 PM
To: panama-dev at openjdk.java.net
Subject: [vector] optimize rotate left/right

Hi,

We can implement the rotate left/right by composing with shift left/right and or:
 
  http://cr.openjdk.java.net/~psandoz/panama/bit-rotate-optimize/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/bit-rotate-optimize/webrev/>

(Tests are needed for shift and rotate)

I made the methods final to indicate that they are considered suitable optimized (thus the test reporting on method overriding can skip these methods).

Paul.


More information about the panama-dev mailing list