[vectorIntrinsics+mask] RFR: 8264563: Add masked vector intrinsics for binary/store operations [v5]
Jatin Bhateja
jbhateja at openjdk.java.net
Wed Apr 21 11:48:42 UTC 2021
On Wed, 21 Apr 2021 09:58:21 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
> > I have one request: `m == null` should be part of internal agreement between JVM and JDK and completely hidden from users. It means that all non-masked operations (when/if they are migrated to masked intrinsics) should pass `null` constant as a mask and all masked operations should perform the null check to ensure mask value is always non-null and clearly communicate that to JITs.
>
> Thanks for your comments @iwanowww ! This is a really great question that I also considered it before. Yes, I think it has to guarantee the mask value is non-null for masked operations, so that the JIT can clearly know how to generate right codes. Since the `m == null` check in API implementation could block the vector box elimination, I think we could add a check (e.g. `this.check(m);`) like what have done for two normal vectors for the masked `lanewise` APIs. Although this is mainly used to check the species of two vectors, it can expose the `null` value of mask at the beginning of API. Sounds ok? Thanks!
Passing an extra primitive flag whose value is true for masked and false otherwise could be a safe check to skip intrinsification if mask argument is null for a masked vector operation. As @iwanowww suggested @PaulSandoz should be able to better guide us here.
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/57
More information about the panama-dev
mailing list