1 ; RUN: llc < %s -march=sparc -mcpu=v9 -verify-machineinstrs | FileCheck %s --check-prefixes=SPARC,SPARC32
2 ; RUN: llc < %s -march=sparcv9 -verify-machineinstrs | FileCheck %s --check-prefixes=SPARC,SPARC64
4 ; SPARC-LABEL: test_atomic_i64
5 ; SPARC32: __atomic_load_8
11 ; SPARC64: stx {{.+}}, [%o2]
12 define i64 @test_atomic_i64(ptr %ptr1, ptr %ptr2, ptr %ptr3) {
14 %0 = load atomic i64, ptr %ptr1 acquire, align 8
15 %1 = load atomic i64, ptr %ptr2 acquire, align 8
17 store atomic i64 %2, ptr %ptr3 release, align 8
21 ; SPARC-LABEL: test_cmpxchg_i64
22 ; SPARC32: __atomic_compare_exchange_8
23 ; SPARC64: mov 123, [[R:%[gilo][0-7]]]
24 ; SPARC64: casx [%o1], %o0, [[R]]
26 define i64 @test_cmpxchg_i64(i64 %a, ptr %ptr) {
28 %pair = cmpxchg ptr %ptr, i64 %a, i64 123 monotonic monotonic
29 %b = extractvalue { i64, i1 } %pair, 0
33 ; SPARC-LABEL: test_swap_i64
34 ; SPARC32: __atomic_exchange_8
35 ; SPARC64: casx [%o1],
37 define i64 @test_swap_i64(i64 %a, ptr %ptr) {
39 %b = atomicrmw xchg ptr %ptr, i64 42 monotonic
43 ; SPARC-LABEL: test_load_sub_64
44 ; SPARC32: __atomic_fetch_sub_8
49 define zeroext i64 @test_load_sub_64(ptr %p, i64 zeroext %v) {
51 %0 = atomicrmw sub ptr %p, i64 %v seq_cst
55 ; SPARC-LABEL: test_load_max_64
56 ; SPARC32: __atomic_compare_exchange_8
62 define zeroext i64 @test_load_max_64(ptr %p, i64 zeroext %v) {
64 %0 = atomicrmw max ptr %p, i64 %v seq_cst