[vectorIntrinsics+mask] RFR: 8268154: Add masking support for vector load intrinsics
Paul Sandoz
psandoz at openjdk.java.net
Wed Jun 9 22:27:22 UTC 2021
On Mon, 7 Jun 2021 09:05:44 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
> This patch adds the predicate support for masked load vector operation, including the Vector API java implementation and hotspot intrinsics changes. The main changes contain:
> - Adding a new hotspot intrinsic method (`loadMasked`), which can transform the vector mask class and value to hotspot. It is called by the masked `"fromArray"` API in JAVA level. The compiler will generate the masked vector load node if the current platform supports the predicate feature and backend has implemented it. Otherwise, the vector blend pattern will be generated like before.
> - Adding the similar masked support for load/store boolean/char array.
>
> Note that the intrinsification when there is the array range bailout is not implemented in this patch. We are considering making it vectorized with predicate feature for SVE/AVX-512 as well, and will create a separate patch for it in future.
>
> Also note that this patch doesn't contain any backend changes.
Java changes look good. No need for me to re-review to resolve the comment i made.
src/jdk.incubator.vector/share/classes/jdk/incubator/vector/X-Vector.java.template line 4579:
> 4577: a, arrayAddress(a, offset), m,
> 4578: a, offset, vsp,
> 4579: (arr, off, s, vm) -> s.ldOp(arr, off, (AbstractMask<$Boxtype$>) vm,
We can avoid the cast to `AbstractMask<$Boxtype$>` if we update the signature of the species `ldOp` to be e.g on `IntVector`:
<M> IntVector ldOp(M memory, int offset,
VectorMask<Integer> m,
FLdOp<M> f) {
return dummyVector().ldOp(memory, offset, m, f);
}
In general i think we need to review the generic signatures here and in `VectorSupport`, as they are a bit inconsistent. Something to consider later.
-------------
Marked as reviewed by psandoz (Committer).
PR: https://git.openjdk.java.net/panama-vector/pull/90
More information about the panama-dev
mailing list