1 ; RUN: llc < %s -O0 -march=x86 -mcpu=corei7 | FileCheck %s --check-prefix X32
4 @sc64 = external global i64
6 define void @atomic_fetch_add64() nounwind {
7 ; X32: 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 ; X32: atomic_fetch_sub64
35 %t1 = atomicrmw sub i64* @sc64, i64 1 acquire
40 %t2 = atomicrmw sub i64* @sc64, i64 3 acquire
45 %t3 = atomicrmw sub i64* @sc64, i64 5 acquire
50 %t4 = atomicrmw sub i64* @sc64, i64 %t3 acquire
59 define void @atomic_fetch_and64() nounwind {
60 ; X32: atomic_fetch_and64
61 %t1 = atomicrmw and i64* @sc64, i64 3 acquire
66 %t2 = atomicrmw and i64* @sc64, i64 5 acquire
71 %t3 = atomicrmw and i64* @sc64, i64 %t2 acquire
80 define void @atomic_fetch_or64() nounwind {
81 ; X32: atomic_fetch_or64
82 %t1 = atomicrmw or i64* @sc64, i64 3 acquire
87 %t2 = atomicrmw or i64* @sc64, i64 5 acquire
92 %t3 = atomicrmw or i64* @sc64, i64 %t2 acquire
101 define void @atomic_fetch_xor64() nounwind {
102 ; X32: atomic_fetch_xor64
103 %t1 = atomicrmw xor i64* @sc64, i64 3 acquire
108 %t2 = atomicrmw xor i64* @sc64, i64 5 acquire
113 %t3 = atomicrmw xor i64* @sc64, i64 %t2 acquire
122 define void @atomic_fetch_nand64(i64 %x) nounwind {
123 ; X32: atomic_fetch_nand64
124 %t1 = atomicrmw nand i64* @sc64, i64 %x acquire
135 define void @atomic_fetch_max64(i64 %x) nounwind {
136 %t1 = atomicrmw max i64* @sc64, i64 %x acquire
148 define void @atomic_fetch_min64(i64 %x) nounwind {
149 %t1 = atomicrmw min i64* @sc64, i64 %x acquire
161 define void @atomic_fetch_umax64(i64 %x) nounwind {
162 %t1 = atomicrmw umax i64* @sc64, i64 %x acquire
174 define void @atomic_fetch_umin64(i64 %x) nounwind {
175 %t1 = atomicrmw umin i64* @sc64, i64 %x acquire
187 define void @atomic_fetch_cmpxchg64() nounwind {
188 %t1 = cmpxchg i64* @sc64, i64 0, i64 1 acquire
195 define void @atomic_fetch_store64(i64 %x) nounwind {
196 store atomic i64 %x, i64* @sc64 release, align 8
203 define void @atomic_fetch_swap64(i64 %x) nounwind {
204 %t1 = atomicrmw xchg i64* @sc64, i64 %x acquire