Gelbpunkt opened PR #14771 from Gelbpunkt:s390x-128bit-atomic-cas to bytecodealliance:main:
Depends on #14770
This adds and makes use of the
CDSGinstruction. Since the 128-bit integers are stored in VRs andCDSGoperates onRegPairs, we need to introduce some helpers to move data between VRs andRegPairs by extracting or inserting two lanes ofI64s.I've verified this in qemu-user and on a z15 inside z/VM with the atomic-128 runtest, but we're missing an implementation of
atomic_rmwbefore that can be enabled on s390x.
I'm not sure where to put these helpers, if there's a better place than
lower.isle, which I suspect there may be, please let me know :)
Gelbpunkt updated PR #14771.
github-actions[bot] added the label cranelift on PR #14771.
Gelbpunkt updated PR #14771.
Gelbpunkt updated PR #14771.
Gelbpunkt edited PR #14771:
This adds and makes use of the
CDSGinstruction. Since the 128-bit integers are stored in VRs andCDSGoperates onRegPairs, we need to introduce some helpers to move data between VRs andRegPairs by extracting or inserting two lanes ofI64s.I've verified this in qemu-user and on a z15 inside z/VM with the atomic-128 runtest, but we're missing an implementation of
atomic_rmwbefore that can be enabled on s390x.
I'm not sure where to put these helpers, if there's a better place than
lower.isle, which I suspect there may be, please let me know :)
Gelbpunkt has marked PR #14771 as ready for review.
Gelbpunkt requested wasmtime-compiler-s390x-reviewers for a review on PR #14771.
Gelbpunkt requested alexcrichton for a review on PR #14771.
Gelbpunkt requested wasmtime-compiler-reviewers for a review on PR #14771.
alexcrichton requested theotherjimmy for a review on PR #14771.
:thumbs_up: theotherjimmy submitted PR review:
Looks BE only for now. is LE planned? (same as i64, could be implemented with before and after byte swaps)
Gelbpunkt commented on PR #14771:
is LE planned?
I don't have immediate plans for that because our usecase in rustc_codegen_cranelift doesn't require it. Could potentially look into it as a follow-up once
atomic_rmwis also done.
alexcrichton commented on PR #14771:
@theotherjimmy oh also you're now added to the s390x-reviewers group for this repo so you should have write access to merge PRs and you'll also get auto-tagged for review occasionally. I'll queue up since I'm here but wanted to let you know too
alexcrichton added PR #14771 cranelift: Implement 128-bit atomic CAS for s390x to the merge queue.
:check: alexcrichton merged PR #14771.
alexcrichton removed PR #14771 cranelift: Implement 128-bit atomic CAS for s390x from the merge queue.
Last updated: Oct 31 2026 at 23:03 UTC