1 ; RUN: llc < %s -O0 -march=x86-64 -mcpu=corei7 -verify-machineinstrs | FileCheck %s --check-prefix X64
3 @sc64 = external global i64
5 define void @atomic_fetch_add64() nounwind {
6 ; X64-LABEL: atomic_fetch_add64:
7 ; X32-LABEL: atomic_fetch_add64:
9 %t1 = atomicrmw add i64* @sc64, i64 1 acquire
12 %t2 = atomicrmw add i64* @sc64, i64 3 acquire
15 %t3 = atomicrmw add i64* @sc64, i64 5 acquire
18 %t4 = atomicrmw add i64* @sc64, i64 %t3 acquire
25 define void @atomic_fetch_sub64() nounwind {
26 ; X64-LABEL: atomic_fetch_sub64:
27 ; X32-LABEL: atomic_fetch_sub64:
28 %t1 = atomicrmw sub i64* @sc64, i64 1 acquire
31 %t2 = atomicrmw sub i64* @sc64, i64 3 acquire
34 %t3 = atomicrmw sub i64* @sc64, i64 5 acquire
37 %t4 = atomicrmw sub i64* @sc64, i64 %t3 acquire
44 define void @atomic_fetch_and64() nounwind {
45 ; X64-LABEL: atomic_fetch_and64:
46 ; X32-LABEL: atomic_fetch_and64:
47 %t1 = atomicrmw and i64* @sc64, i64 3 acquire
50 %t2 = atomicrmw and i64* @sc64, i64 5 acquire
54 %t3 = atomicrmw and i64* @sc64, i64 %t2 acquire
61 define void @atomic_fetch_or64() nounwind {
62 ; X64-LABEL: atomic_fetch_or64:
63 ; X32-LABEL: atomic_fetch_or64:
64 %t1 = atomicrmw or i64* @sc64, i64 3 acquire
67 %t2 = atomicrmw or i64* @sc64, i64 5 acquire
71 %t3 = atomicrmw or i64* @sc64, i64 %t2 acquire
78 define void @atomic_fetch_xor64() nounwind {
79 ; X64-LABEL: atomic_fetch_xor64:
80 ; X32-LABEL: atomic_fetch_xor64:
81 %t1 = atomicrmw xor i64* @sc64, i64 3 acquire
84 %t2 = atomicrmw xor i64* @sc64, i64 5 acquire
88 %t3 = atomicrmw xor i64* @sc64, i64 %t2 acquire
95 define void @atomic_fetch_nand64(i64 %x) nounwind {
96 ; X64-LABEL: atomic_fetch_nand64:
97 ; X32-LABEL: atomic_fetch_nand64:
98 %t1 = atomicrmw nand i64* @sc64, i64 %x acquire
114 define void @atomic_fetch_max64(i64 %x) nounwind {
115 ; X64-LABEL: atomic_fetch_max64:
116 ; X32-LABEL: atomic_fetch_max64:
117 %t1 = atomicrmw max i64* @sc64, i64 %x acquire
135 define void @atomic_fetch_min64(i64 %x) nounwind {
136 ; X64-LABEL: atomic_fetch_min64:
137 ; X32-LABEL: atomic_fetch_min64:
138 %t1 = atomicrmw min i64* @sc64, i64 %x acquire
156 define void @atomic_fetch_umax64(i64 %x) nounwind {
157 ; X64-LABEL: atomic_fetch_umax64:
158 ; X32-LABEL: atomic_fetch_umax64:
159 %t1 = atomicrmw umax i64* @sc64, i64 %x acquire
177 define void @atomic_fetch_umin64(i64 %x) nounwind {
178 ; X64-LABEL: atomic_fetch_umin64:
179 ; X32-LABEL: atomic_fetch_umin64:
180 %t1 = atomicrmw umin i64* @sc64, i64 %x acquire
198 define void @atomic_fetch_cmpxchg64() nounwind {
199 ; X64-LABEL: atomic_fetch_cmpxchg64:
200 ; X32-LABEL: atomic_fetch_cmpxchg64:
201 %t1 = cmpxchg i64* @sc64, i64 0, i64 1 acquire acquire
211 define void @atomic_fetch_store64(i64 %x) nounwind {
212 ; X64-LABEL: atomic_fetch_store64:
213 ; X32-LABEL: atomic_fetch_store64:
214 store atomic i64 %x, i64* @sc64 release, align 8
224 define void @atomic_fetch_swap64(i64 %x) nounwind {
225 ; X64-LABEL: atomic_fetch_swap64:
226 ; X32-LABEL: atomic_fetch_swap64:
227 %t1 = atomicrmw xchg i64* @sc64, i64 %x acquire