RFR: 8353500: [s390x] Intrinsify Unsafe::setMemory [v4]
Andrew Haley
aph at openjdk.org
Thu May 22 09:50:58 UTC 2025
On Wed, 23 Apr 2025 06:09:25 GMT, Amit Kumar <amitkumar at openjdk.org> wrote:
>> Unsafe::setMemory intrinsic implementation for s390x.
>>
>> Stub Code:
>>
>>
>> StubRoutines::unsafe_setmemory [0x000003ffb04b63c0, 0x000003ffb04b64d0] (272 bytes)
>> --------------------------------------------------------------------------------
>> 0x000003ffb04b63c0: ogrk %r1,%r2,%r3
>> 0x000003ffb04b63c4: nill %r1,7
>> 0x000003ffb04b63c8: je 0x000003ffb04b6410
>> 0x000003ffb04b63cc: nill %r1,3
>> 0x000003ffb04b63d0: je 0x000003ffb04b6460
>> 0x000003ffb04b63d4: nill %r1,1
>> 0x000003ffb04b63d8: jlh 0x000003ffb04b64a0
>> 0x000003ffb04b63dc: risbg %r4,%r4,48,55,8
>> 0x000003ffb04b63e2: risbgz %r1,%r3,32,63,62
>> 0x000003ffb04b63e8: je 0x000003ffb04b6402
>> 0x000003ffb04b63ec: nopr
>> 0x000003ffb04b63ee: nopr
>> 0x000003ffb04b63f0: sth %r4,0(%r2)
>> 0x000003ffb04b63f4: sth %r4,2(%r2)
>> 0x000003ffb04b63f8: agfi %r2,4
>> 0x000003ffb04b63fe: brct %r1,0x000003ffb04b63f0
>> 0x000003ffb04b6402: nilf %r3,2
>> 0x000003ffb04b6408: ber %r14
>> 0x000003ffb04b640a: sth %r4,0(%r2)
>> 0x000003ffb04b640e: br %r14
>> 0x000003ffb04b6410: risbg %r4,%r4,48,55,8
>> 0x000003ffb04b6416: risbg %r4,%r4,32,47,16
>> 0x000003ffb04b641c: risbg %r4,%r4,0,31,32
>> 0x000003ffb04b6422: risbgz %r1,%r3,32,63,60
>> 0x000003ffb04b6428: je 0x000003ffb04b6446
>> 0x000003ffb04b642c: nopr
>> 0x000003ffb04b642e: nopr
>> 0x000003ffb04b6430: stg %r4,0(%r2)
>> 0x000003ffb04b6436: stg %r4,8(%r2)
>> 0x000003ffb04b643c: agfi %r2,16
>> 0x000003ffb04b6442: brct %r1,0x000003ffb04b6430
>> 0x000003ffb04b6446: nilf %r3,8
>> 0x000003ffb04b644c: ber %r14
>> 0x000003ffb04b644e: stg %r4,0(%r2)
>> 0x000003ffb04b6454: br %r14
>> 0x000003ffb04b6456: nopr
>> 0x000003ffb04b6458: nopr
>> 0x000003ffb04b645a: nopr
>> 0x000003ffb04b645c: nopr
>> 0x000003ffb04b645e: nopr
>> 0x000003ffb04b6460: risbg %r4,%r4,48,55,8
>> 0x000003ffb04b6466: risbg %r4,%r4,32,47,16
>> 0x000003ffb04b646c: risbgz %r1,%r3,32,63,61
>> 0x000003ffb04b6472: je 0x000003ffb04b6492
>> 0x000003ffb04b6476: nopr
>> 0x000003ffb04b6478: nopr
>> 0x000003ffb04b647a: nopr
>> 0x000003ffb04b647c: nopr
>> 0x000003ffb04b647e: nopr
>> 0x000003ffb04b6480: st %r4,0(%r2)
>> 0x000003ffb04b6484: st %r4,4(%r2)
>> 0x000003ffb04b6488: agfi %r2,8
>> 0x000003ffb04b648e: brct %r1,0x000003ffb04b6480
>> 0x000003ffb04b6492: nilf %r3,4
>> 0x000003ffb04b6498: ber %r14
>> 0x000003ffb04b649a: st %r4,0(%r2)
>> 0x0000...
>
> Amit Kumar has updated the pull request incrementally with one additional commit since the last revision:
>
> improved mvc implementation
There's a lot of confusion about this. There is no requirement that all bytes before the non-writable address have been written when hitting a signal. Behaving nicely when writing beyond allocated memory is "best effort" only: we're trying to be nice, that's all.
The atomicity requirement is here , in the specification of `Unsafe::SetMemory`:
* <p>The stores are in coherent (atomic) units of a size determined
* by the address and length parameters. If the effective address and
* length are all even modulo 8, the stores take place in 'long' units.
* If the effective address and length are (resp.) even modulo 4 or 2,
* the stores take place in units of 'int' or 'short'.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24480#issuecomment-2900591094
More information about the hotspot-compiler-dev
mailing list