[vector] Mask/Shuffle from/intoArray

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


Not in the way you would expect, due to many changes required to support k register allocation and fixing assembler to remove the hardcoded k register concept. For now what happens is that all masking is done with blend for all architecture variants. And in case of AVX512, we transfer k register to vector register, then back to k register when we use it.

--Razvan

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

Although now i have read your email on "1-byte and 2-byte vectors” are opmask registers leveraged at the moment on AVX-512 architectures?

Paul.

> On Mar 15, 2018, at 9:53 PM, Lupusoru, Razvan A <razvan.a.lupusoru at intel.com> wrote:
> 
> 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