[vectorIntrinsics+mask] RFR: 8264563: Add masked vector intrinsics for binary/store operations [v6]

Vladimir Ivanov vlivanov at openjdk.java.net
Thu Apr 22 10:21:40 UTC 2021


On Thu, 22 Apr 2021 09:35:44 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:

>> Xiaohong Gong has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add vector species checking to mask value for masked operations
>
> src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java line 649:
> 
>> 647:             ((jdk.incubator.vector.VectorMask<Byte>) m).vectorSpecies();
>> 648:         if (maskSpecies != vspecies()) {
>> 649:             throw AbstractSpecies.checkFailed(maskSpecies, vspecies());
> 
> @iwanowww @PaulSandoz , the new commit add a type check to the mask value in the masked `lanewise` API. This could raise an implicit null check for the mask value. I tried to use `m.getClass()` at first, but I didn't find a reasonable way to use it in this API. Does this change make sense for you? Thanks!

Yes, it looks fine to me. 

I suggest to factor the check into a helper method (`AbstractVector::check(VectorMask m)`) and call it next to the check on `Vector`s.

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

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


More information about the panama-dev mailing list