1 ; RUN: llc < %s -O0 -march=x86 -mcpu=corei7 -verify-machineinstrs | FileCheck %s --check-prefix X32
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
14 %t2 = atomicrmw add i64* @sc64, i64 3 acquire
19 %t3 = atomicrmw add i64* @sc64, i64 5 acquire
24 %t4 = atomicrmw add i64* @sc64, i64 %t3 acquire
33 define void @atomic_fetch_sub64() nounwind {
34 ; X64-LABEL: atomic_fetch_sub64:
35 ; X32-LABEL: atomic_fetch_sub64:
36 %t1 = atomicrmw sub i64* @sc64, i64 1 acquire
41 %t2 = atomicrmw sub i64* @sc64, i64 3 acquire
46 %t3 = atomicrmw sub i64* @sc64, i64 5 acquire
51 %t4 = atomicrmw sub i64* @sc64, i64 %t3 acquire
60 define void @atomic_fetch_and64() nounwind {
61 ; X64-LABEL: atomic_fetch_and:64
62 ; X32-LABEL: atomic_fetch_and64:
63 %t1 = atomicrmw and i64* @sc64, i64 3 acquire
68 %t2 = atomicrmw and i64* @sc64, i64 4294967297 acquire
73 %t3 = atomicrmw and i64* @sc64, i64 %t2 acquire
82 define void @atomic_fetch_or64() nounwind {
83 ; X64-LABEL: atomic_fetch_or64:
84 ; X32-LABEL: atomic_fetch_or64:
85 %t1 = atomicrmw or i64* @sc64, i64 3 acquire
90 %t2 = atomicrmw or i64* @sc64, i64 4294967297 acquire
95 %t3 = atomicrmw or i64* @sc64, i64 %t2 acquire
104 define void @atomic_fetch_xor64() nounwind {
105 ; X64-LABEL: atomic_fetch_xor:64
106 ; X32-LABEL: atomic_fetch_xor64:
107 %t1 = atomicrmw xor i64* @sc64, i64 3 acquire
112 %t2 = atomicrmw xor i64* @sc64, i64 4294967297 acquire
117 %t3 = atomicrmw xor i64* @sc64, i64 %t2 acquire
126 define void @atomic_fetch_nand64(i64 %x) nounwind {
127 ; X64-LABEL: atomic_fetch_nand64:
128 ; X32-LABEL: atomic_fetch_nand64:
129 %t1 = atomicrmw nand i64* @sc64, i64 %x acquire
140 define void @atomic_fetch_max64(i64 %x) nounwind {
141 ; X64-LABEL: atomic_fetch_max:64
142 ; X32-LABEL: atomic_fetch_max64:
143 %t1 = atomicrmw max i64* @sc64, i64 %x acquire
154 define void @atomic_fetch_min64(i64 %x) nounwind {
155 ; X64-LABEL: atomic_fetch_min64:
156 ; X32-LABEL: atomic_fetch_min64:
157 %t1 = atomicrmw min i64* @sc64, i64 %x acquire
168 define void @atomic_fetch_umax64(i64 %x) nounwind {
169 ; X64-LABEL: atomic_fetch_umax:64
170 ; X32-LABEL: atomic_fetch_umax64:
171 %t1 = atomicrmw umax i64* @sc64, i64 %x acquire
182 define void @atomic_fetch_umin64(i64 %x) nounwind {
183 ; X64-LABEL: atomic_fetch_umin64:
184 ; X32-LABEL: atomic_fetch_umin64:
185 %t1 = atomicrmw umin i64* @sc64, i64 %x acquire
196 define void @atomic_fetch_cmpxchg64() nounwind {
197 ; X64-LABEL: atomic_fetch_cmpxchg:64
198 ; X32-LABEL: atomic_fetch_cmpxchg64:
199 %t1 = cmpxchg i64* @sc64, i64 0, i64 1 acquire acquire
206 define void @atomic_fetch_store64(i64 %x) nounwind {
207 ; X64-LABEL: atomic_fetch_store64:
208 ; X32-LABEL: atomic_fetch_store64:
209 store atomic i64 %x, i64* @sc64 release, align 8
216 define void @atomic_fetch_swap64(i64 %x) nounwind {
217 ; X64-LABEL: atomic_fetch_swap64:
218 ; X32-LABEL: atomic_fetch_swap64:
219 %t1 = atomicrmw xchg i64* @sc64, i64 %x acquire