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

Xiaohong Gong xgong at openjdk.java.net
Thu Apr 29 10:07:01 UTC 2021


On Wed, 21 Apr 2021 10:55:44 GMT, Vladimir Ivanov <vlivanov at openjdk.org> wrote:

>>> > I am tempted to have a template method for both non-mask and mask. Thus specialized code (that before calling the intrinsic) may be somewhat duplicated before calling `binaryMaskOp`, using a constant for the op -> lambda function, and passing in null or the mask value.
>>> 
>>> Yeah, that's why I added the `lanewise0` and `lanewise0Template` methods.
>> 
>> I am suggesting to separate out templates for non-masked and masked, similar to the current pattern. That would result in some duplication for the special cases, but i think makes it easier to reason about in one place, rather than being somewhat spread out. Perhaps easier to explain as code. We should just iterate on the branch.
>
> It's better to ask @PaulSandoz about how to better shape implementation code on JDK side.
> 
> IMO having an explicit null check (e.g., `Objects.requireNonNull()`) as part of argument validation in all public methods for masked operations should be a bare minimum. We already rely on the ability to propagate all the important information from the call site down to the intrinsic call.

@iwanowww @PaulSandoz all your significant comments have been addressed! Could you please have a look again? Thanks so much!

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

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


More information about the panama-dev mailing list