RFR: 8353500: [s390x] Intrinsify Unsafe::setMemory [v4]

Lutz Schmidt lucy at openjdk.org
Mon May 26 08:16:16 UTC 2025


On Fri, 23 May 2025 08:18:12 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Ah, thanks! I was not aware of that. That means the current implementation is probably wrong in some cases (mvc generated by gcc). Or is mvc only used in the single Byte aligned case?
>
>> Ah, thanks! I was not aware of that. That means the current implementation is probably wrong in some cases (mvc generated by gcc). Or is mvc only used in the single Byte aligned case?
> 
> Yes, that's right, just for the byte-aligned case.

The atomicity spec cited by @theRealAph severely limits the optimisation options. Depending on the data alignment, you have to use 8, 4, or 2-byte stores. Only for the unaligned case there are no hard restrictions, just the soft "let's be nice" conventions. 

With that said, the vector implementation should be ok. It is just not as nice as a byte store loop. There could be as many as 15 uninitialised bytes if just the last byte of a vector store is not writable. I would take that risk.

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

PR Comment: https://git.openjdk.org/jdk/pull/24480#issuecomment-2908902764


More information about the hotspot-compiler-dev mailing list