[vectorIntrinsics+mask] RFR: 8268154: Add masking support for vector load intrinsics
Xiaohong Gong
xgong at openjdk.java.net
Thu Jun 10 02:08:34 UTC 2021
On Wed, 9 Jun 2021 22:20:55 GMT, Paul Sandoz <psandoz 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.
>
> 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.
Thanks for looking at this PR @PaulSandoz ! This looks ok to me and will change it later.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/90
More information about the panama-dev
mailing list