[vectorIntrinsics+mask] RFR: 8264563: Add masked vector intrinsics for binary/store operations [v8]
Xiaohong Gong
xgong at openjdk.java.net
Fri Apr 30 01:53:20 UTC 2021
On Thu, 29 Apr 2021 15:31:12 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:
>> I think there is no similar issue with masked binary operations if missing this check here. There is implicit null check and type cast check for `m` before it calls `intoArray0`:
>>
>> void intoArray(byte[] a, int offset,
>> VectorMask<Byte> m) {
>> if (m.allTrue()) {
>> intoArray(a, offset);
>> } else {
>> ByteSpecies vsp = vspecies();
>> checkMaskFromIndexSize(offset, vsp, m, 1, a.length);
>> intoArray0(a, offset, m);
>> }
>> }
>>
>> The type cast exception will be thrown out inside `checkMaskFromIndexSize(offset, vsp, m, 1, a.length);` if the species are not matched. And we can see there is `m.allTrue()` at the begining of `intoArray`.
>>
>> Anyway, adding this check is also ok for me. I can add it if adding the check looks better for you.
>
>> The type cast exception will be thrown out inside `checkMaskFromIndexSize(offset, vsp, m, 1, a.length);` if the species are not matched. And we can see there is `m.allTrue()` at the begining of `intoArray`.
>>
>> Anyway, adding this check is also ok for me. I can add it if adding the check looks better for you.
>
> Let's revisit after you integrate. We can iterate on this with additional PRs.
Thanks!
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/57
More information about the panama-dev
mailing list