[vectorIntrinsics+mask] RFR: 8271539: Add masking support for load/store from/into byte array/buffer

Xiaohong Gong xgong at openjdk.java.net
Fri Aug 13 09:17:49 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.

Hi @jatin-bhateja, I have to integrate this PR now in case it blocks any further development. Any comments are still welcome and we can revisit them in future if needed. Thanks so much!

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

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


More information about the panama-dev mailing list