[vector] Mask/Shuffle from/intoArray

Lupusoru, Razvan A razvan.a.lupusoru at intel.com
Thu Mar 15 23:13:14 UTC 2018


Looks good to me!

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

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