1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -O1 | FileCheck %s --check-prefixes=CHECK,-O1
6 define dso_local void @store_atomic_i8_aligned_unordered(i8 %value, ptr %ptr) {
7 ; CHECK-LABEL: store_atomic_i8_aligned_unordered:
9 store atomic i8 %value, ptr %ptr unordered, align 1
13 define dso_local void @store_atomic_i8_aligned_monotonic(i8 %value, ptr %ptr) {
14 ; CHECK-LABEL: store_atomic_i8_aligned_monotonic:
15 ; CHECK: strb w0, [x1]
16 store atomic i8 %value, ptr %ptr monotonic, align 1
20 define dso_local void @store_atomic_i8_aligned_release(i8 %value, ptr %ptr) {
21 ; CHECK-LABEL: store_atomic_i8_aligned_release:
22 ; CHECK: stlrb w0, [x1]
23 store atomic i8 %value, ptr %ptr release, align 1
27 define dso_local void @store_atomic_i8_aligned_seq_cst(i8 %value, ptr %ptr) {
28 ; CHECK-LABEL: store_atomic_i8_aligned_seq_cst:
29 ; CHECK: stlrb w0, [x1]
30 store atomic i8 %value, ptr %ptr seq_cst, align 1
34 define dso_local void @store_atomic_i16_aligned_unordered(i16 %value, ptr %ptr) {
35 ; CHECK-LABEL: store_atomic_i16_aligned_unordered:
36 ; CHECK: strh w0, [x1]
37 store atomic i16 %value, ptr %ptr unordered, align 2
41 define dso_local void @store_atomic_i16_aligned_monotonic(i16 %value, ptr %ptr) {
42 ; CHECK-LABEL: store_atomic_i16_aligned_monotonic:
43 ; CHECK: strh w0, [x1]
44 store atomic i16 %value, ptr %ptr monotonic, align 2
48 define dso_local void @store_atomic_i16_aligned_release(i16 %value, ptr %ptr) {
49 ; CHECK-LABEL: store_atomic_i16_aligned_release:
50 ; CHECK: stlrh w0, [x1]
51 store atomic i16 %value, ptr %ptr release, align 2
55 define dso_local void @store_atomic_i16_aligned_seq_cst(i16 %value, ptr %ptr) {
56 ; CHECK-LABEL: store_atomic_i16_aligned_seq_cst:
57 ; CHECK: stlrh w0, [x1]
58 store atomic i16 %value, ptr %ptr seq_cst, align 2
62 define dso_local void @store_atomic_i32_aligned_unordered(i32 %value, ptr %ptr) {
63 ; CHECK-LABEL: store_atomic_i32_aligned_unordered:
65 store atomic i32 %value, ptr %ptr unordered, align 4
69 define dso_local void @store_atomic_i32_aligned_monotonic(i32 %value, ptr %ptr) {
70 ; CHECK-LABEL: store_atomic_i32_aligned_monotonic:
72 store atomic i32 %value, ptr %ptr monotonic, align 4
76 define dso_local void @store_atomic_i32_aligned_release(i32 %value, ptr %ptr) {
77 ; CHECK-LABEL: store_atomic_i32_aligned_release:
78 ; CHECK: stlr w0, [x1]
79 store atomic i32 %value, ptr %ptr release, align 4
83 define dso_local void @store_atomic_i32_aligned_seq_cst(i32 %value, ptr %ptr) {
84 ; CHECK-LABEL: store_atomic_i32_aligned_seq_cst:
85 ; CHECK: stlr w0, [x1]
86 store atomic i32 %value, ptr %ptr seq_cst, align 4
90 define dso_local void @store_atomic_i64_aligned_unordered(i64 %value, ptr %ptr) {
91 ; CHECK-LABEL: store_atomic_i64_aligned_unordered:
93 store atomic i64 %value, ptr %ptr unordered, align 8
97 define dso_local void @store_atomic_i64_aligned_monotonic(i64 %value, ptr %ptr) {
98 ; CHECK-LABEL: store_atomic_i64_aligned_monotonic:
100 store atomic i64 %value, ptr %ptr monotonic, align 8
104 define dso_local void @store_atomic_i64_aligned_release(i64 %value, ptr %ptr) {
105 ; CHECK-LABEL: store_atomic_i64_aligned_release:
106 ; CHECK: stlr x0, [x1]
107 store atomic i64 %value, ptr %ptr release, align 8
111 define dso_local void @store_atomic_i64_aligned_seq_cst(i64 %value, ptr %ptr) {
112 ; CHECK-LABEL: store_atomic_i64_aligned_seq_cst:
113 ; CHECK: stlr x0, [x1]
114 store atomic i64 %value, ptr %ptr seq_cst, align 8
118 define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr) {
119 ; -O0-LABEL: store_atomic_i128_aligned_unordered:
120 ; -O0: bl __aarch64_cas16_relax
121 ; -O0: eor x8, x0, x8
122 ; -O0: eor x9, x1, x9
123 ; -O0: orr x8, x8, x9
124 ; -O0: subs x8, x8, #0
126 ; -O1-LABEL: store_atomic_i128_aligned_unordered:
127 ; -O1: ldxp xzr, x8, [x2]
128 ; -O1: stxp w8, x0, x1, [x2]
129 store atomic i128 %value, ptr %ptr unordered, align 16
133 define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) {
134 ; -O0-LABEL: store_atomic_i128_aligned_monotonic:
135 ; -O0: bl __aarch64_cas16_relax
136 ; -O0: eor x8, x0, x8
137 ; -O0: eor x9, x1, x9
138 ; -O0: orr x8, x8, x9
139 ; -O0: subs x8, x8, #0
141 ; -O1-LABEL: store_atomic_i128_aligned_monotonic:
142 ; -O1: ldxp xzr, x8, [x2]
143 ; -O1: stxp w8, x0, x1, [x2]
144 store atomic i128 %value, ptr %ptr monotonic, align 16
148 define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) {
149 ; -O0-LABEL: store_atomic_i128_aligned_release:
150 ; -O0: bl __aarch64_cas16_rel
151 ; -O0: eor x8, x0, x8
152 ; -O0: eor x9, x1, x9
153 ; -O0: orr x8, x8, x9
154 ; -O0: subs x8, x8, #0
156 ; -O1-LABEL: store_atomic_i128_aligned_release:
157 ; -O1: ldxp xzr, x8, [x2]
158 ; -O1: stlxp w8, x0, x1, [x2]
159 store atomic i128 %value, ptr %ptr release, align 16
163 define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) {
164 ; -O0-LABEL: store_atomic_i128_aligned_seq_cst:
165 ; -O0: bl __aarch64_cas16_acq_rel
166 ; -O0: eor x8, x0, x8
167 ; -O0: eor x9, x1, x9
168 ; -O0: orr x8, x8, x9
169 ; -O0: subs x8, x8, #0
171 ; -O1-LABEL: store_atomic_i128_aligned_seq_cst:
172 ; -O1: ldaxp xzr, x8, [x2]
173 ; -O1: stlxp w8, x0, x1, [x2]
174 store atomic i128 %value, ptr %ptr seq_cst, align 16
178 define dso_local void @store_atomic_i8_unaligned_unordered(i8 %value, ptr %ptr) {
179 ; CHECK-LABEL: store_atomic_i8_unaligned_unordered:
180 ; CHECK: strb w0, [x1]
181 store atomic i8 %value, ptr %ptr unordered, align 1
185 define dso_local void @store_atomic_i8_unaligned_monotonic(i8 %value, ptr %ptr) {
186 ; CHECK-LABEL: store_atomic_i8_unaligned_monotonic:
187 ; CHECK: strb w0, [x1]
188 store atomic i8 %value, ptr %ptr monotonic, align 1
192 define dso_local void @store_atomic_i8_unaligned_release(i8 %value, ptr %ptr) {
193 ; CHECK-LABEL: store_atomic_i8_unaligned_release:
194 ; CHECK: stlrb w0, [x1]
195 store atomic i8 %value, ptr %ptr release, align 1
199 define dso_local void @store_atomic_i8_unaligned_seq_cst(i8 %value, ptr %ptr) {
200 ; CHECK-LABEL: store_atomic_i8_unaligned_seq_cst:
201 ; CHECK: stlrb w0, [x1]
202 store atomic i8 %value, ptr %ptr seq_cst, align 1
206 define dso_local void @store_atomic_i16_unaligned_unordered(i16 %value, ptr %ptr) {
207 ; CHECK-LABEL: store_atomic_i16_unaligned_unordered:
208 ; CHECK: bl __atomic_store
209 store atomic i16 %value, ptr %ptr unordered, align 1
213 define dso_local void @store_atomic_i16_unaligned_monotonic(i16 %value, ptr %ptr) {
214 ; CHECK-LABEL: store_atomic_i16_unaligned_monotonic:
215 ; CHECK: bl __atomic_store
216 store atomic i16 %value, ptr %ptr monotonic, align 1
220 define dso_local void @store_atomic_i16_unaligned_release(i16 %value, ptr %ptr) {
221 ; CHECK-LABEL: store_atomic_i16_unaligned_release:
222 ; CHECK: bl __atomic_store
223 store atomic i16 %value, ptr %ptr release, align 1
227 define dso_local void @store_atomic_i16_unaligned_seq_cst(i16 %value, ptr %ptr) {
228 ; CHECK-LABEL: store_atomic_i16_unaligned_seq_cst:
229 ; CHECK: bl __atomic_store
230 store atomic i16 %value, ptr %ptr seq_cst, align 1
234 define dso_local void @store_atomic_i32_unaligned_unordered(i32 %value, ptr %ptr) {
235 ; CHECK-LABEL: store_atomic_i32_unaligned_unordered:
236 ; CHECK: bl __atomic_store
237 store atomic i32 %value, ptr %ptr unordered, align 1
241 define dso_local void @store_atomic_i32_unaligned_monotonic(i32 %value, ptr %ptr) {
242 ; CHECK-LABEL: store_atomic_i32_unaligned_monotonic:
243 ; CHECK: bl __atomic_store
244 store atomic i32 %value, ptr %ptr monotonic, align 1
248 define dso_local void @store_atomic_i32_unaligned_release(i32 %value, ptr %ptr) {
249 ; CHECK-LABEL: store_atomic_i32_unaligned_release:
250 ; CHECK: bl __atomic_store
251 store atomic i32 %value, ptr %ptr release, align 1
255 define dso_local void @store_atomic_i32_unaligned_seq_cst(i32 %value, ptr %ptr) {
256 ; CHECK-LABEL: store_atomic_i32_unaligned_seq_cst:
257 ; CHECK: bl __atomic_store
258 store atomic i32 %value, ptr %ptr seq_cst, align 1
262 define dso_local void @store_atomic_i64_unaligned_unordered(i64 %value, ptr %ptr) {
263 ; CHECK-LABEL: store_atomic_i64_unaligned_unordered:
264 ; CHECK: bl __atomic_store
265 store atomic i64 %value, ptr %ptr unordered, align 1
269 define dso_local void @store_atomic_i64_unaligned_monotonic(i64 %value, ptr %ptr) {
270 ; CHECK-LABEL: store_atomic_i64_unaligned_monotonic:
271 ; CHECK: bl __atomic_store
272 store atomic i64 %value, ptr %ptr monotonic, align 1
276 define dso_local void @store_atomic_i64_unaligned_release(i64 %value, ptr %ptr) {
277 ; CHECK-LABEL: store_atomic_i64_unaligned_release:
278 ; CHECK: bl __atomic_store
279 store atomic i64 %value, ptr %ptr release, align 1
283 define dso_local void @store_atomic_i64_unaligned_seq_cst(i64 %value, ptr %ptr) {
284 ; CHECK-LABEL: store_atomic_i64_unaligned_seq_cst:
285 ; CHECK: bl __atomic_store
286 store atomic i64 %value, ptr %ptr seq_cst, align 1
290 define dso_local void @store_atomic_i128_unaligned_unordered(i128 %value, ptr %ptr) {
291 ; CHECK-LABEL: store_atomic_i128_unaligned_unordered:
292 ; CHECK: bl __atomic_store
293 store atomic i128 %value, ptr %ptr unordered, align 1
297 define dso_local void @store_atomic_i128_unaligned_monotonic(i128 %value, ptr %ptr) {
298 ; CHECK-LABEL: store_atomic_i128_unaligned_monotonic:
299 ; CHECK: bl __atomic_store
300 store atomic i128 %value, ptr %ptr monotonic, align 1
304 define dso_local void @store_atomic_i128_unaligned_release(i128 %value, ptr %ptr) {
305 ; CHECK-LABEL: store_atomic_i128_unaligned_release:
306 ; CHECK: bl __atomic_store
307 store atomic i128 %value, ptr %ptr release, align 1
311 define dso_local void @store_atomic_i128_unaligned_seq_cst(i128 %value, ptr %ptr) {
312 ; CHECK-LABEL: store_atomic_i128_unaligned_seq_cst:
313 ; CHECK: bl __atomic_store
314 store atomic i128 %value, ptr %ptr seq_cst, align 1