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_be -mattr=+v8a -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+v8a -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: ldxp x10, x12, [x9]
123 ; -O0: stxp w8, x14, x15, [x9]
124 ; -O0: stxp w8, x10, x12, [x9]
125 ; -O0: subs x12, x12, x13
126 ; -O0: ccmp x10, x11, #0, eq
128 ; -O1-LABEL: store_atomic_i128_aligned_unordered:
129 ; -O1: ldxp xzr, x8, [x2]
130 ; -O1: stxp w8, x1, x0, [x2]
131 store atomic i128 %value, ptr %ptr unordered, align 16
135 define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) {
136 ; -O0-LABEL: store_atomic_i128_aligned_monotonic:
137 ; -O0: ldxp x10, x12, [x9]
140 ; -O0: stxp w8, x14, x15, [x9]
141 ; -O0: stxp w8, x10, x12, [x9]
142 ; -O0: subs x12, x12, x13
143 ; -O0: ccmp x10, x11, #0, eq
145 ; -O1-LABEL: store_atomic_i128_aligned_monotonic:
146 ; -O1: ldxp xzr, x8, [x2]
147 ; -O1: stxp w8, x1, x0, [x2]
148 store atomic i128 %value, ptr %ptr monotonic, align 16
152 define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) {
153 ; -O0-LABEL: store_atomic_i128_aligned_release:
154 ; -O0: ldxp x10, x12, [x9]
157 ; -O0: stlxp w8, x14, x15, [x9]
158 ; -O0: stlxp w8, x10, x12, [x9]
159 ; -O0: subs x12, x12, x13
160 ; -O0: ccmp x10, x11, #0, eq
162 ; -O1-LABEL: store_atomic_i128_aligned_release:
163 ; -O1: ldxp xzr, x8, [x2]
164 ; -O1: stlxp w8, x1, x0, [x2]
165 store atomic i128 %value, ptr %ptr release, align 16
169 define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) {
170 ; -O0-LABEL: store_atomic_i128_aligned_seq_cst:
171 ; -O0: ldaxp x10, x12, [x9]
174 ; -O0: stlxp w8, x14, x15, [x9]
175 ; -O0: stlxp w8, x10, x12, [x9]
176 ; -O0: subs x12, x12, x13
177 ; -O0: ccmp x10, x11, #0, eq
179 ; -O1-LABEL: store_atomic_i128_aligned_seq_cst:
180 ; -O1: ldaxp xzr, x8, [x2]
181 ; -O1: stlxp w8, x1, x0, [x2]
182 store atomic i128 %value, ptr %ptr seq_cst, align 16
186 define dso_local void @store_atomic_i8_unaligned_unordered(i8 %value, ptr %ptr) {
187 ; CHECK-LABEL: store_atomic_i8_unaligned_unordered:
188 ; CHECK: strb w0, [x1]
189 store atomic i8 %value, ptr %ptr unordered, align 1
193 define dso_local void @store_atomic_i8_unaligned_monotonic(i8 %value, ptr %ptr) {
194 ; CHECK-LABEL: store_atomic_i8_unaligned_monotonic:
195 ; CHECK: strb w0, [x1]
196 store atomic i8 %value, ptr %ptr monotonic, align 1
200 define dso_local void @store_atomic_i8_unaligned_release(i8 %value, ptr %ptr) {
201 ; CHECK-LABEL: store_atomic_i8_unaligned_release:
202 ; CHECK: stlrb w0, [x1]
203 store atomic i8 %value, ptr %ptr release, align 1
207 define dso_local void @store_atomic_i8_unaligned_seq_cst(i8 %value, ptr %ptr) {
208 ; CHECK-LABEL: store_atomic_i8_unaligned_seq_cst:
209 ; CHECK: stlrb w0, [x1]
210 store atomic i8 %value, ptr %ptr seq_cst, align 1
214 define dso_local void @store_atomic_i16_unaligned_unordered(i16 %value, ptr %ptr) {
215 ; CHECK-LABEL: store_atomic_i16_unaligned_unordered:
216 ; CHECK: bl __atomic_store
217 store atomic i16 %value, ptr %ptr unordered, align 1
221 define dso_local void @store_atomic_i16_unaligned_monotonic(i16 %value, ptr %ptr) {
222 ; CHECK-LABEL: store_atomic_i16_unaligned_monotonic:
223 ; CHECK: bl __atomic_store
224 store atomic i16 %value, ptr %ptr monotonic, align 1
228 define dso_local void @store_atomic_i16_unaligned_release(i16 %value, ptr %ptr) {
229 ; CHECK-LABEL: store_atomic_i16_unaligned_release:
230 ; CHECK: bl __atomic_store
231 store atomic i16 %value, ptr %ptr release, align 1
235 define dso_local void @store_atomic_i16_unaligned_seq_cst(i16 %value, ptr %ptr) {
236 ; CHECK-LABEL: store_atomic_i16_unaligned_seq_cst:
237 ; CHECK: bl __atomic_store
238 store atomic i16 %value, ptr %ptr seq_cst, align 1
242 define dso_local void @store_atomic_i32_unaligned_unordered(i32 %value, ptr %ptr) {
243 ; CHECK-LABEL: store_atomic_i32_unaligned_unordered:
244 ; CHECK: bl __atomic_store
245 store atomic i32 %value, ptr %ptr unordered, align 1
249 define dso_local void @store_atomic_i32_unaligned_monotonic(i32 %value, ptr %ptr) {
250 ; CHECK-LABEL: store_atomic_i32_unaligned_monotonic:
251 ; CHECK: bl __atomic_store
252 store atomic i32 %value, ptr %ptr monotonic, align 1
256 define dso_local void @store_atomic_i32_unaligned_release(i32 %value, ptr %ptr) {
257 ; CHECK-LABEL: store_atomic_i32_unaligned_release:
258 ; CHECK: bl __atomic_store
259 store atomic i32 %value, ptr %ptr release, align 1
263 define dso_local void @store_atomic_i32_unaligned_seq_cst(i32 %value, ptr %ptr) {
264 ; CHECK-LABEL: store_atomic_i32_unaligned_seq_cst:
265 ; CHECK: bl __atomic_store
266 store atomic i32 %value, ptr %ptr seq_cst, align 1
270 define dso_local void @store_atomic_i64_unaligned_unordered(i64 %value, ptr %ptr) {
271 ; CHECK-LABEL: store_atomic_i64_unaligned_unordered:
272 ; CHECK: bl __atomic_store
273 store atomic i64 %value, ptr %ptr unordered, align 1
277 define dso_local void @store_atomic_i64_unaligned_monotonic(i64 %value, ptr %ptr) {
278 ; CHECK-LABEL: store_atomic_i64_unaligned_monotonic:
279 ; CHECK: bl __atomic_store
280 store atomic i64 %value, ptr %ptr monotonic, align 1
284 define dso_local void @store_atomic_i64_unaligned_release(i64 %value, ptr %ptr) {
285 ; CHECK-LABEL: store_atomic_i64_unaligned_release:
286 ; CHECK: bl __atomic_store
287 store atomic i64 %value, ptr %ptr release, align 1
291 define dso_local void @store_atomic_i64_unaligned_seq_cst(i64 %value, ptr %ptr) {
292 ; CHECK-LABEL: store_atomic_i64_unaligned_seq_cst:
293 ; CHECK: bl __atomic_store
294 store atomic i64 %value, ptr %ptr seq_cst, align 1
298 define dso_local void @store_atomic_i128_unaligned_unordered(i128 %value, ptr %ptr) {
299 ; CHECK-LABEL: store_atomic_i128_unaligned_unordered:
300 ; CHECK: bl __atomic_store
301 store atomic i128 %value, ptr %ptr unordered, align 1
305 define dso_local void @store_atomic_i128_unaligned_monotonic(i128 %value, ptr %ptr) {
306 ; CHECK-LABEL: store_atomic_i128_unaligned_monotonic:
307 ; CHECK: bl __atomic_store
308 store atomic i128 %value, ptr %ptr monotonic, align 1
312 define dso_local void @store_atomic_i128_unaligned_release(i128 %value, ptr %ptr) {
313 ; CHECK-LABEL: store_atomic_i128_unaligned_release:
314 ; CHECK: bl __atomic_store
315 store atomic i128 %value, ptr %ptr release, align 1
319 define dso_local void @store_atomic_i128_unaligned_seq_cst(i128 %value, ptr %ptr) {
320 ; CHECK-LABEL: store_atomic_i128_unaligned_seq_cst:
321 ; CHECK: bl __atomic_store
322 store atomic i128 %value, ptr %ptr seq_cst, align 1