RFR: 8318678: Vector access on heap MemorySegments only works for byte[] [v2]

Paul Sandoz psandoz at openjdk.org
Thu Oct 26 16:48:34 UTC 2023


On Thu, 26 Oct 2023 09:17:25 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This PR proposes removing the restriction that only heap `MemorySegment` wrapping a `byte` array can be accessed by Vectors. Now any array type can be used provided the element alignment constraints are respected.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Allow unaligned array access

We also need to review the intrinsic for load/store found here to ensure, when the hardware supports it, that mixed access is optimized:

https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/vectorIntrinsics.cpp#L967

I recommend writing a simple benchmark with various forms of mixed access and verify the intrinsics kick in (longer term IR tests would be preferable).

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

PR Comment: https://git.openjdk.org/jdk/pull/16360#issuecomment-1781482409


More information about the core-libs-dev mailing list