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.
73 lines
1.3 KiB
Plaintext
73 lines
1.3 KiB
Plaintext
test compile
|
|
target s390x
|
|
|
|
function %atomic_load_i64(i64) -> i64 {
|
|
block0(v0: i64):
|
|
v1 = atomic_load.i64 little v0
|
|
return v1
|
|
}
|
|
|
|
; check: lrvg %r2, 0(%r2)
|
|
; nextln: br %r14
|
|
|
|
function %atomic_load_i64_sym() -> i64 {
|
|
gv0 = symbol colocated %sym
|
|
block0:
|
|
v0 = symbol_value.i64 gv0
|
|
v1 = atomic_load.i64 little v0
|
|
return v1
|
|
}
|
|
|
|
; check: larl %r1, %sym + 0 ; lrvg %r2, 0(%r1)
|
|
; nextln: br %r14
|
|
|
|
function %atomic_load_i32(i64) -> i32 {
|
|
block0(v0: i64):
|
|
v1 = atomic_load.i32 little v0
|
|
return v1
|
|
}
|
|
|
|
; check: lrv %r2, 0(%r2)
|
|
; nextln: br %r14
|
|
|
|
function %atomic_load_i32_sym() -> i32 {
|
|
gv0 = symbol colocated %sym
|
|
block0:
|
|
v0 = symbol_value.i64 gv0
|
|
v1 = atomic_load.i32 little v0
|
|
return v1
|
|
}
|
|
|
|
; check: larl %r1, %sym + 0 ; lrv %r2, 0(%r1)
|
|
; nextln: br %r14
|
|
|
|
function %atomic_load_i16(i64) -> i16 {
|
|
block0(v0: i64):
|
|
v1 = atomic_load.i16 little v0
|
|
return v1
|
|
}
|
|
|
|
; check: lrvh %r2, 0(%r2)
|
|
; nextln: br %r14
|
|
|
|
function %atomic_load_i16_sym() -> i16 {
|
|
gv0 = symbol colocated %sym
|
|
block0:
|
|
v0 = symbol_value.i64 gv0
|
|
v1 = atomic_load.i16 little v0
|
|
return v1
|
|
}
|
|
|
|
; check: larl %r1, %sym + 0 ; lrvh %r2, 0(%r1)
|
|
; nextln: br %r14
|
|
|
|
function %atomic_load_i8(i64) -> i8 {
|
|
block0(v0: i64):
|
|
v1 = atomic_load.i8 little v0
|
|
return v1
|
|
}
|
|
|
|
; check: llc %r2, 0(%r2)
|
|
; nextln: br %r14
|
|
|