[vector] Update to Shuffle specification

Deshpande, Vivek R vivek.r.deshpande at intel.com
Wed Jun 6 20:45:37 UTC 2018


Hi Paul

It looks good me. I would make changes to the implementation  of the swizzle intrinsics accordingly.

Regards,
Vivek

-----Original Message-----
From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Paul Sandoz
Sent: Friday, June 01, 2018 3:37 PM
To: panama-dev at openjdk.java.net
Subject: Re: [vector] Update to Shuffle specification

Here is another revision with more changes based on our discussions:

  http://cr.openjdk.java.net/~psandoz/panama/shuffle-shuffle/webrev/ 

- add methods to convert between Shuffle and Vector of the same length
- remove the Mask and Shuffle reshape/resize/rebracket methods
- add cast to Mask and Shuffle that convert only to type/shape combination with the same length
- modify Vector.cast that converts only to type/shape combination with the same length
- change the specification of Shuffle to ensure lane elements will be within the range of (0, length].
- change the signature of Vector.shuffle to conform to the specification changes of Shuffle
- rename Vector shuffle and swizzle methods to rearrange
- Add Shuffle.rearrange

I left the Vector.cast implementation intact (except for the length check) and focused on tests. A future patch will reduce down the implementation.

John and I discussed naming around Vector.shuffle/swizzle and felt that rearrange better expressed the functionality of unary and binary rearrangement (“rearrange” was already being used in the class documentation, so that’s a good sign). 

We can simplify the binary rearrangement’s signature, previously it took two shuffles, but we can reduce that to one, so in effect the Mask is the extra bit that is used in some x86 shuffle instructions. This implies we may need to add a method to blend two shuffles together (better expressed on shuffle without transferring to/from the vector domain).

Paul.



> On May 25, 2018, at 11:44 AM, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:
> 
> Hi,
> 
> See this patch for an update to the Shuffle specification (as previously discussed):
> 
>  http://cr.openjdk.java.net/~psandoz/panama/shuffle-shuffle/webrev/ 
> <http://cr.openjdk.java.net/~psandoz/panama/shuffle-shuffle/webrev/>
> 
> I have not adjusted the internal represent to leverage ByteVector. That will require further investigation and may require an intrinsic to create a ByteVector from an int[] array (perhaps similar to creating a Mask from a boolean[]).
> 
> Paul.



More information about the panama-dev mailing list