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 ; X32-LABEL: atomic_fetch_add64:
8 %t1 = atomicrmw add i64* @sc64, i64 1 acquire
13 %t2 = atomicrmw add i64* @sc64, i64 3 acquire
18 %t3 = atomicrmw add i64* @sc64, i64 5 acquire
23 %t4 = atomicrmw add i64* @sc64, i64 %t3 acquire
32 define void @atomic_fetch_sub64() nounwind {
33 ; X32-LABEL: atomic_fetch_sub64:
34 %t1 = atomicrmw sub i64* @sc64, i64 1 acquire
39 %t2 = atomicrmw sub i64* @sc64, i64 3 acquire
44 %t3 = atomicrmw sub i64* @sc64, i64 5 acquire
49 %t4 = atomicrmw sub i64* @sc64, i64 %t3 acquire
58 define void @atomic_fetch_and64() nounwind {
59 ; X32-LABEL: atomic_fetch_and64:
60 %t1 = atomicrmw and i64* @sc64, i64 3 acquire
65 %t2 = atomicrmw and i64* @sc64, i64 4294967297 acquire
70 %t3 = atomicrmw and i64* @sc64, i64 %t2 acquire
79 define void @atomic_fetch_or64() nounwind {
80 ; X32-LABEL: atomic_fetch_or64:
81 %t1 = atomicrmw or i64* @sc64, i64 3 acquire
86 %t2 = atomicrmw or i64* @sc64, i64 4294967297 acquire
91 %t3 = atomicrmw or i64* @sc64, i64 %t2 acquire
100 define void @atomic_fetch_xor64() nounwind {
101 ; X32-LABEL: atomic_fetch_xor64:
102 %t1 = atomicrmw xor i64* @sc64, i64 3 acquire
107 %t2 = atomicrmw xor i64* @sc64, i64 4294967297 acquire
112 %t3 = atomicrmw xor i64* @sc64, i64 %t2 acquire
121 define void @atomic_fetch_nand64(i64 %x) nounwind {
122 ; X32-LABEL: atomic_fetch_nand64:
123 %t1 = atomicrmw nand i64* @sc64, i64 %x acquire
134 define void @atomic_fetch_max64(i64 %x) nounwind {
135 ; X32-LABEL: atomic_fetch_max64:
136 %t1 = atomicrmw max i64* @sc64, i64 %x acquire
147 define void @atomic_fetch_min64(i64 %x) nounwind {
148 ; X32-LABEL: atomic_fetch_min64:
149 %t1 = atomicrmw min i64* @sc64, i64 %x acquire
160 define void @atomic_fetch_umax64(i64 %x) nounwind {
161 ; X32-LABEL: atomic_fetch_umax64:
162 %t1 = atomicrmw umax i64* @sc64, i64 %x acquire
173 define void @atomic_fetch_umin64(i64 %x) nounwind {
174 ; X32-LABEL: atomic_fetch_umin64:
175 %t1 = atomicrmw umin i64* @sc64, i64 %x acquire
186 define void @atomic_fetch_cmpxchg64() nounwind {
187 ; X32-LABEL: atomic_fetch_cmpxchg64:
188 %t1 = cmpxchg i64* @sc64, i64 0, i64 1 acquire acquire
195 define void @atomic_fetch_store64(i64 %x) nounwind {
196 ; X32-LABEL: atomic_fetch_store64:
197 store atomic i64 %x, i64* @sc64 release, align 8
204 define void @atomic_fetch_swap64(i64 %x) nounwind {
205 ; X32-LABEL: atomic_fetch_swap64:
206 %t1 = atomicrmw xchg i64* @sc64, i64 %x acquire