[vectorIntrinsics+mask] RFR: 8273057: [vector] New VectorAPI "SelectiveStore"

Joshua Zhu jzhu at openjdk.java.net
Mon Sep 6 07:18:57 UTC 2021


On Fri, 3 Sep 2021 20:13:46 GMT, Paul Sandoz <paul.sandoz at oracle.com> wrote:

> In summary, from the discussion, compress/expand are:
> 
> - important conceptually, even if the same functionality could be composed from shuffles (such as used by an implementation); and
> 
> - at the right level to reliably optimize on supporting hardware.
> 
> So specification-wise we introduce expanding/compressing cross-lane operations. API-wise I prefer two distinct methods rather that one that accepts boolean indicating expansion or compression. We can declare one intrinsic method in VectorSupport.

Thanks Paul for bringing the deep design thinking.
John Rose's encompassing knowledge impresses me a lot.
Also thank Sandhya and Ningsheng for comments.

I will refactor my codes and implement these two cross-lane data movement primitives: mask-based compression & expansion.
They will work on general vectors and be declared:

    $abstractvectortype$ compress(VectorMask<$Boxtype$> m);
    $abstractvectortype$ expand(VectorMask<$Boxtype$> m);

These two vector-to-vector operations together with a store/load and prefix mask could be optimized further into single memory version instruction on supported architecture.

-------------

PR: https://git.openjdk.java.net/panama-vector/pull/115


More information about the panama-dev mailing list