[vector] Mask/Shuffle from/intoArray

Lupusoru, Razvan A razvan.a.lupusoru at intel.com
Fri Mar 16 04:53:52 UTC 2018


You're right - I forgot that we add that extra layer explicitly during boxing/unboxing to handle the transition to/from hardware representation. I just got excited because for a second there it looked like we could get the intrinsification for free.

--Razvan

-----Original Message-----
From: Paul Sandoz [mailto:paul.sandoz at oracle.com] 
Sent: Thursday, March 15, 2018 5:05 PM
To: Lupusoru, Razvan A <razvan.a.lupusoru at intel.com>
Cc: panama-dev at openjdk.java.net
Subject: Re: [vector] Mask/Shuffle from/intoArray



> On Mar 15, 2018, at 4:13 PM, Lupusoru, Razvan A <razvan.a.lupusoru at intel.com> wrote:
> 
> Looks good to me!
> 

Thanks.


> Also, I wonder what will happen if you try to intrinsify the intoArray using same support that was made to intrinsify vector stores.
> 

Unsure, might be problematic if the mask and vector hardware representation differ e.g. opmask register?

Paul.


> This is what you would put in X-VectorBits.java.template:
>    @Override
>    @ForceInline
>    public void intoArray(boolean[] a, int ix) {
>        Objects.requireNonNull(a);
>        ix = VectorIntrinsics.checkIndex(ix, a.length, LENGTH);
>        VectorIntrinsics.store($masktype$.class, boolean.class, LENGTH,
>                               a, ix, this,
>                               (arr, idx, v) -> v.forEach((i, a_) -> ((boolean[])arr)[idx + i] = a_));
>    }
> 
> --Razvan
> 
> -----Original Message-----
> From: panama-dev [mailto:panama-dev-bounces at openjdk.java.net] On Behalf Of Paul Sandoz
> Sent: Thursday, March 15, 2018 4:02 PM
> To: panama-dev at openjdk.java.net
> Subject: [vector] Mask/Shuffle from/intoArray
> 
> Hi,
> 
> http://cr.openjdk.java.net/~psandoz/panama/mask-to-from-array/webrev/ <http://cr.openjdk.java.net/~psandoz/panama/mask-to-from-array/webrev/>
> 
> Methods have been added to create Mask or Shuffle from an array at a index, and likewise store values into an array at an index. 
> 
> I kept the Mask/Shuffle.toArray array returning methods. For consistency I added a *Vector.toArray.
> 
> I tried to improve the names and consistency of the existing Species factory methods:
> 
>  constantMask -> maskFromValues
>  trueMask -> maskAllTrue
>  falseMask -> maskAllFalse
>  constantShuffle -> shuffleFromValues
> 
> Paul.
> 



More information about the panama-dev mailing list