[vectorIntrinsics+mask] RFR: 8271539: Add masking support for load/store from/into byte array/buffer
Paul Sandoz
psandoz at openjdk.java.net
Wed Aug 4 16:01:51 UTC 2021
On Wed, 4 Aug 2021 01:20:30 GMT, Xiaohong Gong <xgong at openjdk.org> wrote:
> This patch adds the predicate support for the following masked vector load/store operations:
> - fromByteArray/fromByteBuffer
> - intoByteArray/intoByteBuffer
>
> The masked APIs can respectively call the `VectorSupport.loadMasked/storeMasked` intrinsics with transforming the right mask class and value to them. The hotspot compiler will check whether it is using byte array/buffer when doing the memory accessing, and the input vector mask should be reinterpreted to a mask with the byte element type before used if it is. Besides, similar with the non-masked operations, the input vector to store should be reinterpreted to byte type before storing, and the vector loaded from the byte memory should be reinterpreted to the real vector type.
>
> Also fix an issue when checking array indexes with mask before calling the intrinsics. The original checking method doesn't take effect for negative offset.
>
> Note that this patch doesn't contain any backend changes.
I browsed through but need to go through in more detail, but i have a question. You fixed an issue with `AbstractMask.checkIndexByLane`. I am wondering if our tests are insufficient or that this change exposed a bug and the tests previously passed because the fallback correctly failed when accessing out-of-bounds?
-------------
PR: https://git.openjdk.java.net/panama-vector/pull/107
More information about the panama-dev
mailing list