Files
wasmtime/cranelift/filetests/filetests/isa/s390x/atomic_cas.clif
Ulrich Weigand 46b73431ca s390x: Add support for atomic operations (part 1)
This adds full back-end support for the Fence, AtomicLoad
and AtomicStore operations, and partial support for the
AtomicCas and AtomicRmw operations.

The missing pieces include sub-word operations, operations
on little-endian memory requiring byte-swapping, and some
of the subtypes of AtomicRmw -- everything that cannot be
implemented without a compare-and-swap loop.  This will be
done in a follow-up patch.

This patch already suffices to make the test suite green
again after a recent change that now requires atomic
operations when accessing the heap.
2021-06-15 17:12:11 +02:00

26 lines
493 B
Plaintext

test compile
target s390x
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ATOMIC_CAS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
function %atomic_cas_i64(i64, i64, i64) -> i64 {
block0(v0: i64, v1: i64, v2: i64):
v3 = atomic_cas.i64 v2, v0, v1
return v3
}
; check: csg %r2, %r3, 0(%r4)
; nextln: br %r14
function %atomic_cas_i32(i32, i32, i64) -> i32 {
block0(v0: i32, v1: i32, v2: i64):
v3 = atomic_cas.i32 v2, v0, v1
return v3
}
; check: cs %r2, %r3, 0(%r4)
; nextln: br %r14