[vectorIntrinsics] RFR: Load store memory segment

Xiaohong Gong xgong at openjdk.java.net
Wed Mar 30 02:20:02 UTC 2022


On Tue, 29 Mar 2022 21:47:02 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

> This is the initial implementation for loading/storing vectors from/to memory segments.
> 
> Some of the changes are related to `int` -> `long` for the offset. I had to change the load/store intrinsic signatures to accept an offset as a `long`. This does not affect the C2 implementation, only the fallback lambdas. So in some cases there is a downcast to `int`, which is safe because the original input was an `int` e.g. the offset for primitive array access. 
> 
> Some changes related to module dependency and memory segment proxies will go away when the Memory Segment API is integrated into `java.base` as a preview API.
>  
> There is still more work to do but i wanted to get this in now and iterate:
> - I will remove the `byte[]` and `ByteBuffer` accepting load/store methods in a following PR.
> - some additional negative tests are required, specifically if a scope of segment is not alive, or the segment covers a heap array other than `byte[]`.

src/jdk.incubator.vector/share/classes/jdk/incubator/vector/ByteVector.java line 3369:

> 3367:     /**
> 3368:      * Loads a vector from a {@linkplain ByteBuffer byte buffer}
> 3369:      * starting at an offset into the byte buffer

Should be `{@linkplain MemorySegment memory segment}` and the `memory segment buffer` ?

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

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


More information about the panama-dev mailing list