1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld|st[^r]|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=+lse2 -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+lse2 -O1 | FileCheck %s --check-prefixes=CHECK,-O1
6 define dso_local i8 @load_atomic_i8_aligned_unordered(ptr %ptr) {
7 ; CHECK-LABEL: load_atomic_i8_aligned_unordered:
9 %r = load atomic i8, ptr %ptr unordered, align 1
13 define dso_local i8 @load_atomic_i8_aligned_unordered_const(ptr readonly %ptr) {
14 ; CHECK-LABEL: load_atomic_i8_aligned_unordered_const:
15 ; CHECK: ldrb w0, [x0]
16 %r = load atomic i8, ptr %ptr unordered, align 1
20 define dso_local i8 @load_atomic_i8_aligned_monotonic(ptr %ptr) {
21 ; CHECK-LABEL: load_atomic_i8_aligned_monotonic:
22 ; CHECK: ldrb w0, [x0]
23 %r = load atomic i8, ptr %ptr monotonic, align 1
27 define dso_local i8 @load_atomic_i8_aligned_monotonic_const(ptr readonly %ptr) {
28 ; CHECK-LABEL: load_atomic_i8_aligned_monotonic_const:
29 ; CHECK: ldrb w0, [x0]
30 %r = load atomic i8, ptr %ptr monotonic, align 1
34 define dso_local i8 @load_atomic_i8_aligned_acquire(ptr %ptr) {
35 ; CHECK-LABEL: load_atomic_i8_aligned_acquire:
36 ; CHECK: ldarb w0, [x0]
37 %r = load atomic i8, ptr %ptr acquire, align 1
41 define dso_local i8 @load_atomic_i8_aligned_acquire_const(ptr readonly %ptr) {
42 ; CHECK-LABEL: load_atomic_i8_aligned_acquire_const:
43 ; CHECK: ldarb w0, [x0]
44 %r = load atomic i8, ptr %ptr acquire, align 1
48 define dso_local i8 @load_atomic_i8_aligned_seq_cst(ptr %ptr) {
49 ; CHECK-LABEL: load_atomic_i8_aligned_seq_cst:
50 ; CHECK: ldarb w0, [x0]
51 %r = load atomic i8, ptr %ptr seq_cst, align 1
55 define dso_local i8 @load_atomic_i8_aligned_seq_cst_const(ptr readonly %ptr) {
56 ; CHECK-LABEL: load_atomic_i8_aligned_seq_cst_const:
57 ; CHECK: ldarb w0, [x0]
58 %r = load atomic i8, ptr %ptr seq_cst, align 1
62 define dso_local i16 @load_atomic_i16_aligned_unordered(ptr %ptr) {
63 ; CHECK-LABEL: load_atomic_i16_aligned_unordered:
64 ; CHECK: ldrh w0, [x0]
65 %r = load atomic i16, ptr %ptr unordered, align 2
69 define dso_local i16 @load_atomic_i16_aligned_unordered_const(ptr readonly %ptr) {
70 ; CHECK-LABEL: load_atomic_i16_aligned_unordered_const:
71 ; CHECK: ldrh w0, [x0]
72 %r = load atomic i16, ptr %ptr unordered, align 2
76 define dso_local i16 @load_atomic_i16_aligned_monotonic(ptr %ptr) {
77 ; CHECK-LABEL: load_atomic_i16_aligned_monotonic:
78 ; CHECK: ldrh w0, [x0]
79 %r = load atomic i16, ptr %ptr monotonic, align 2
83 define dso_local i16 @load_atomic_i16_aligned_monotonic_const(ptr readonly %ptr) {
84 ; CHECK-LABEL: load_atomic_i16_aligned_monotonic_const:
85 ; CHECK: ldrh w0, [x0]
86 %r = load atomic i16, ptr %ptr monotonic, align 2
90 define dso_local i16 @load_atomic_i16_aligned_acquire(ptr %ptr) {
91 ; CHECK-LABEL: load_atomic_i16_aligned_acquire:
92 ; CHECK: ldarh w0, [x0]
93 %r = load atomic i16, ptr %ptr acquire, align 2
97 define dso_local i16 @load_atomic_i16_aligned_acquire_const(ptr readonly %ptr) {
98 ; CHECK-LABEL: load_atomic_i16_aligned_acquire_const:
99 ; CHECK: ldarh w0, [x0]
100 %r = load atomic i16, ptr %ptr acquire, align 2
104 define dso_local i16 @load_atomic_i16_aligned_seq_cst(ptr %ptr) {
105 ; CHECK-LABEL: load_atomic_i16_aligned_seq_cst:
106 ; CHECK: ldarh w0, [x0]
107 %r = load atomic i16, ptr %ptr seq_cst, align 2
111 define dso_local i16 @load_atomic_i16_aligned_seq_cst_const(ptr readonly %ptr) {
112 ; CHECK-LABEL: load_atomic_i16_aligned_seq_cst_const:
113 ; CHECK: ldarh w0, [x0]
114 %r = load atomic i16, ptr %ptr seq_cst, align 2
118 define dso_local i32 @load_atomic_i32_aligned_unordered(ptr %ptr) {
119 ; CHECK-LABEL: load_atomic_i32_aligned_unordered:
120 ; CHECK: ldr w0, [x0]
121 %r = load atomic i32, ptr %ptr unordered, align 4
125 define dso_local i32 @load_atomic_i32_aligned_unordered_const(ptr readonly %ptr) {
126 ; CHECK-LABEL: load_atomic_i32_aligned_unordered_const:
127 ; CHECK: ldr w0, [x0]
128 %r = load atomic i32, ptr %ptr unordered, align 4
132 define dso_local i32 @load_atomic_i32_aligned_monotonic(ptr %ptr) {
133 ; CHECK-LABEL: load_atomic_i32_aligned_monotonic:
134 ; CHECK: ldr w0, [x0]
135 %r = load atomic i32, ptr %ptr monotonic, align 4
139 define dso_local i32 @load_atomic_i32_aligned_monotonic_const(ptr readonly %ptr) {
140 ; CHECK-LABEL: load_atomic_i32_aligned_monotonic_const:
141 ; CHECK: ldr w0, [x0]
142 %r = load atomic i32, ptr %ptr monotonic, align 4
146 define dso_local i32 @load_atomic_i32_aligned_acquire(ptr %ptr) {
147 ; CHECK-LABEL: load_atomic_i32_aligned_acquire:
148 ; CHECK: ldar w0, [x0]
149 %r = load atomic i32, ptr %ptr acquire, align 4
153 define dso_local i32 @load_atomic_i32_aligned_acquire_const(ptr readonly %ptr) {
154 ; CHECK-LABEL: load_atomic_i32_aligned_acquire_const:
155 ; CHECK: ldar w0, [x0]
156 %r = load atomic i32, ptr %ptr acquire, align 4
160 define dso_local i32 @load_atomic_i32_aligned_seq_cst(ptr %ptr) {
161 ; CHECK-LABEL: load_atomic_i32_aligned_seq_cst:
162 ; CHECK: ldar w0, [x0]
163 %r = load atomic i32, ptr %ptr seq_cst, align 4
167 define dso_local i32 @load_atomic_i32_aligned_seq_cst_const(ptr readonly %ptr) {
168 ; CHECK-LABEL: load_atomic_i32_aligned_seq_cst_const:
169 ; CHECK: ldar w0, [x0]
170 %r = load atomic i32, ptr %ptr seq_cst, align 4
174 define dso_local i64 @load_atomic_i64_aligned_unordered(ptr %ptr) {
175 ; CHECK-LABEL: load_atomic_i64_aligned_unordered:
176 ; CHECK: ldr x0, [x0]
177 %r = load atomic i64, ptr %ptr unordered, align 8
181 define dso_local i64 @load_atomic_i64_aligned_unordered_const(ptr readonly %ptr) {
182 ; CHECK-LABEL: load_atomic_i64_aligned_unordered_const:
183 ; CHECK: ldr x0, [x0]
184 %r = load atomic i64, ptr %ptr unordered, align 8
188 define dso_local i64 @load_atomic_i64_aligned_monotonic(ptr %ptr) {
189 ; CHECK-LABEL: load_atomic_i64_aligned_monotonic:
190 ; CHECK: ldr x0, [x0]
191 %r = load atomic i64, ptr %ptr monotonic, align 8
195 define dso_local i64 @load_atomic_i64_aligned_monotonic_const(ptr readonly %ptr) {
196 ; CHECK-LABEL: load_atomic_i64_aligned_monotonic_const:
197 ; CHECK: ldr x0, [x0]
198 %r = load atomic i64, ptr %ptr monotonic, align 8
202 define dso_local i64 @load_atomic_i64_aligned_acquire(ptr %ptr) {
203 ; CHECK-LABEL: load_atomic_i64_aligned_acquire:
204 ; CHECK: ldar x0, [x0]
205 %r = load atomic i64, ptr %ptr acquire, align 8
209 define dso_local i64 @load_atomic_i64_aligned_acquire_const(ptr readonly %ptr) {
210 ; CHECK-LABEL: load_atomic_i64_aligned_acquire_const:
211 ; CHECK: ldar x0, [x0]
212 %r = load atomic i64, ptr %ptr acquire, align 8
216 define dso_local i64 @load_atomic_i64_aligned_seq_cst(ptr %ptr) {
217 ; CHECK-LABEL: load_atomic_i64_aligned_seq_cst:
218 ; CHECK: ldar x0, [x0]
219 %r = load atomic i64, ptr %ptr seq_cst, align 8
223 define dso_local i64 @load_atomic_i64_aligned_seq_cst_const(ptr readonly %ptr) {
224 ; CHECK-LABEL: load_atomic_i64_aligned_seq_cst_const:
225 ; CHECK: ldar x0, [x0]
226 %r = load atomic i64, ptr %ptr seq_cst, align 8
230 define dso_local i128 @load_atomic_i128_aligned_unordered(ptr %ptr) {
231 ; CHECK-LABEL: load_atomic_i128_aligned_unordered:
232 ; CHECK: ldp x1, x0, [x0]
233 %r = load atomic i128, ptr %ptr unordered, align 16
237 define dso_local i128 @load_atomic_i128_aligned_unordered_const(ptr readonly %ptr) {
238 ; CHECK-LABEL: load_atomic_i128_aligned_unordered_const:
239 ; CHECK: ldp x1, x0, [x0]
240 %r = load atomic i128, ptr %ptr unordered, align 16
244 define dso_local i128 @load_atomic_i128_aligned_monotonic(ptr %ptr) {
245 ; CHECK-LABEL: load_atomic_i128_aligned_monotonic:
246 ; CHECK: ldp x1, x0, [x0]
247 %r = load atomic i128, ptr %ptr monotonic, align 16
251 define dso_local i128 @load_atomic_i128_aligned_monotonic_const(ptr readonly %ptr) {
252 ; CHECK-LABEL: load_atomic_i128_aligned_monotonic_const:
253 ; CHECK: ldp x1, x0, [x0]
254 %r = load atomic i128, ptr %ptr monotonic, align 16
258 define dso_local i128 @load_atomic_i128_aligned_acquire(ptr %ptr) {
259 ; CHECK-LABEL: load_atomic_i128_aligned_acquire:
260 ; CHECK: ldp x1, x0, [x0]
262 %r = load atomic i128, ptr %ptr acquire, align 16
266 define dso_local i128 @load_atomic_i128_aligned_acquire_const(ptr readonly %ptr) {
267 ; CHECK-LABEL: load_atomic_i128_aligned_acquire_const:
268 ; CHECK: ldp x1, x0, [x0]
270 %r = load atomic i128, ptr %ptr acquire, align 16
274 define dso_local i128 @load_atomic_i128_aligned_seq_cst(ptr %ptr) {
275 ; CHECK-LABEL: load_atomic_i128_aligned_seq_cst:
276 ; CHECK: ldp x1, x0, [x0]
278 %r = load atomic i128, ptr %ptr seq_cst, align 16
282 define dso_local i128 @load_atomic_i128_aligned_seq_cst_const(ptr readonly %ptr) {
283 ; CHECK-LABEL: load_atomic_i128_aligned_seq_cst_const:
284 ; CHECK: ldp x1, x0, [x0]
286 %r = load atomic i128, ptr %ptr seq_cst, align 16
290 define dso_local i8 @load_atomic_i8_unaligned_unordered(ptr %ptr) {
291 ; CHECK-LABEL: load_atomic_i8_unaligned_unordered:
292 ; CHECK: ldrb w0, [x0]
293 %r = load atomic i8, ptr %ptr unordered, align 1
297 define dso_local i8 @load_atomic_i8_unaligned_unordered_const(ptr readonly %ptr) {
298 ; CHECK-LABEL: load_atomic_i8_unaligned_unordered_const:
299 ; CHECK: ldrb w0, [x0]
300 %r = load atomic i8, ptr %ptr unordered, align 1
304 define dso_local i8 @load_atomic_i8_unaligned_monotonic(ptr %ptr) {
305 ; CHECK-LABEL: load_atomic_i8_unaligned_monotonic:
306 ; CHECK: ldrb w0, [x0]
307 %r = load atomic i8, ptr %ptr monotonic, align 1
311 define dso_local i8 @load_atomic_i8_unaligned_monotonic_const(ptr readonly %ptr) {
312 ; CHECK-LABEL: load_atomic_i8_unaligned_monotonic_const:
313 ; CHECK: ldrb w0, [x0]
314 %r = load atomic i8, ptr %ptr monotonic, align 1
318 define dso_local i8 @load_atomic_i8_unaligned_acquire(ptr %ptr) {
319 ; CHECK-LABEL: load_atomic_i8_unaligned_acquire:
320 ; CHECK: ldarb w0, [x0]
321 %r = load atomic i8, ptr %ptr acquire, align 1
325 define dso_local i8 @load_atomic_i8_unaligned_acquire_const(ptr readonly %ptr) {
326 ; CHECK-LABEL: load_atomic_i8_unaligned_acquire_const:
327 ; CHECK: ldarb w0, [x0]
328 %r = load atomic i8, ptr %ptr acquire, align 1
332 define dso_local i8 @load_atomic_i8_unaligned_seq_cst(ptr %ptr) {
333 ; CHECK-LABEL: load_atomic_i8_unaligned_seq_cst:
334 ; CHECK: ldarb w0, [x0]
335 %r = load atomic i8, ptr %ptr seq_cst, align 1
339 define dso_local i8 @load_atomic_i8_unaligned_seq_cst_const(ptr readonly %ptr) {
340 ; CHECK-LABEL: load_atomic_i8_unaligned_seq_cst_const:
341 ; CHECK: ldarb w0, [x0]
342 %r = load atomic i8, ptr %ptr seq_cst, align 1
346 define dso_local i16 @load_atomic_i16_unaligned_unordered(ptr %ptr) {
347 ; CHECK-LABEL: load_atomic_i16_unaligned_unordered:
348 ; CHECK: bl __atomic_load
349 %r = load atomic i16, ptr %ptr unordered, align 1
353 define dso_local i16 @load_atomic_i16_unaligned_unordered_const(ptr readonly %ptr) {
354 ; CHECK-LABEL: load_atomic_i16_unaligned_unordered_const:
355 ; CHECK: bl __atomic_load
356 %r = load atomic i16, ptr %ptr unordered, align 1
360 define dso_local i16 @load_atomic_i16_unaligned_monotonic(ptr %ptr) {
361 ; CHECK-LABEL: load_atomic_i16_unaligned_monotonic:
362 ; CHECK: bl __atomic_load
363 %r = load atomic i16, ptr %ptr monotonic, align 1
367 define dso_local i16 @load_atomic_i16_unaligned_monotonic_const(ptr readonly %ptr) {
368 ; CHECK-LABEL: load_atomic_i16_unaligned_monotonic_const:
369 ; CHECK: bl __atomic_load
370 %r = load atomic i16, ptr %ptr monotonic, align 1
374 define dso_local i16 @load_atomic_i16_unaligned_acquire(ptr %ptr) {
375 ; CHECK-LABEL: load_atomic_i16_unaligned_acquire:
376 ; CHECK: bl __atomic_load
377 %r = load atomic i16, ptr %ptr acquire, align 1
381 define dso_local i16 @load_atomic_i16_unaligned_acquire_const(ptr readonly %ptr) {
382 ; CHECK-LABEL: load_atomic_i16_unaligned_acquire_const:
383 ; CHECK: bl __atomic_load
384 %r = load atomic i16, ptr %ptr acquire, align 1
388 define dso_local i16 @load_atomic_i16_unaligned_seq_cst(ptr %ptr) {
389 ; CHECK-LABEL: load_atomic_i16_unaligned_seq_cst:
390 ; CHECK: bl __atomic_load
391 %r = load atomic i16, ptr %ptr seq_cst, align 1
395 define dso_local i16 @load_atomic_i16_unaligned_seq_cst_const(ptr readonly %ptr) {
396 ; CHECK-LABEL: load_atomic_i16_unaligned_seq_cst_const:
397 ; CHECK: bl __atomic_load
398 %r = load atomic i16, ptr %ptr seq_cst, align 1
402 define dso_local i32 @load_atomic_i32_unaligned_unordered(ptr %ptr) {
403 ; CHECK-LABEL: load_atomic_i32_unaligned_unordered:
404 ; CHECK: bl __atomic_load
405 %r = load atomic i32, ptr %ptr unordered, align 1
409 define dso_local i32 @load_atomic_i32_unaligned_unordered_const(ptr readonly %ptr) {
410 ; CHECK-LABEL: load_atomic_i32_unaligned_unordered_const:
411 ; CHECK: bl __atomic_load
412 %r = load atomic i32, ptr %ptr unordered, align 1
416 define dso_local i32 @load_atomic_i32_unaligned_monotonic(ptr %ptr) {
417 ; CHECK-LABEL: load_atomic_i32_unaligned_monotonic:
418 ; CHECK: bl __atomic_load
419 %r = load atomic i32, ptr %ptr monotonic, align 1
423 define dso_local i32 @load_atomic_i32_unaligned_monotonic_const(ptr readonly %ptr) {
424 ; CHECK-LABEL: load_atomic_i32_unaligned_monotonic_const:
425 ; CHECK: bl __atomic_load
426 %r = load atomic i32, ptr %ptr monotonic, align 1
430 define dso_local i32 @load_atomic_i32_unaligned_acquire(ptr %ptr) {
431 ; CHECK-LABEL: load_atomic_i32_unaligned_acquire:
432 ; CHECK: bl __atomic_load
433 %r = load atomic i32, ptr %ptr acquire, align 1
437 define dso_local i32 @load_atomic_i32_unaligned_acquire_const(ptr readonly %ptr) {
438 ; CHECK-LABEL: load_atomic_i32_unaligned_acquire_const:
439 ; CHECK: bl __atomic_load
440 %r = load atomic i32, ptr %ptr acquire, align 1
444 define dso_local i32 @load_atomic_i32_unaligned_seq_cst(ptr %ptr) {
445 ; CHECK-LABEL: load_atomic_i32_unaligned_seq_cst:
446 ; CHECK: bl __atomic_load
447 %r = load atomic i32, ptr %ptr seq_cst, align 1
451 define dso_local i32 @load_atomic_i32_unaligned_seq_cst_const(ptr readonly %ptr) {
452 ; CHECK-LABEL: load_atomic_i32_unaligned_seq_cst_const:
453 ; CHECK: bl __atomic_load
454 %r = load atomic i32, ptr %ptr seq_cst, align 1
458 define dso_local i64 @load_atomic_i64_unaligned_unordered(ptr %ptr) {
459 ; CHECK-LABEL: load_atomic_i64_unaligned_unordered:
460 ; CHECK: bl __atomic_load
461 %r = load atomic i64, ptr %ptr unordered, align 1
465 define dso_local i64 @load_atomic_i64_unaligned_unordered_const(ptr readonly %ptr) {
466 ; CHECK-LABEL: load_atomic_i64_unaligned_unordered_const:
467 ; CHECK: bl __atomic_load
468 %r = load atomic i64, ptr %ptr unordered, align 1
472 define dso_local i64 @load_atomic_i64_unaligned_monotonic(ptr %ptr) {
473 ; CHECK-LABEL: load_atomic_i64_unaligned_monotonic:
474 ; CHECK: bl __atomic_load
475 %r = load atomic i64, ptr %ptr monotonic, align 1
479 define dso_local i64 @load_atomic_i64_unaligned_monotonic_const(ptr readonly %ptr) {
480 ; CHECK-LABEL: load_atomic_i64_unaligned_monotonic_const:
481 ; CHECK: bl __atomic_load
482 %r = load atomic i64, ptr %ptr monotonic, align 1
486 define dso_local i64 @load_atomic_i64_unaligned_acquire(ptr %ptr) {
487 ; CHECK-LABEL: load_atomic_i64_unaligned_acquire:
488 ; CHECK: bl __atomic_load
489 %r = load atomic i64, ptr %ptr acquire, align 1
493 define dso_local i64 @load_atomic_i64_unaligned_acquire_const(ptr readonly %ptr) {
494 ; CHECK-LABEL: load_atomic_i64_unaligned_acquire_const:
495 ; CHECK: bl __atomic_load
496 %r = load atomic i64, ptr %ptr acquire, align 1
500 define dso_local i64 @load_atomic_i64_unaligned_seq_cst(ptr %ptr) {
501 ; CHECK-LABEL: load_atomic_i64_unaligned_seq_cst:
502 ; CHECK: bl __atomic_load
503 %r = load atomic i64, ptr %ptr seq_cst, align 1
507 define dso_local i64 @load_atomic_i64_unaligned_seq_cst_const(ptr readonly %ptr) {
508 ; CHECK-LABEL: load_atomic_i64_unaligned_seq_cst_const:
509 ; CHECK: bl __atomic_load
510 %r = load atomic i64, ptr %ptr seq_cst, align 1
514 define dso_local i128 @load_atomic_i128_unaligned_unordered(ptr %ptr) {
515 ; CHECK-LABEL: load_atomic_i128_unaligned_unordered:
516 ; CHECK: bl __atomic_load
517 %r = load atomic i128, ptr %ptr unordered, align 1
521 define dso_local i128 @load_atomic_i128_unaligned_unordered_const(ptr readonly %ptr) {
522 ; CHECK-LABEL: load_atomic_i128_unaligned_unordered_const:
523 ; CHECK: bl __atomic_load
524 %r = load atomic i128, ptr %ptr unordered, align 1
528 define dso_local i128 @load_atomic_i128_unaligned_monotonic(ptr %ptr) {
529 ; CHECK-LABEL: load_atomic_i128_unaligned_monotonic:
530 ; CHECK: bl __atomic_load
531 %r = load atomic i128, ptr %ptr monotonic, align 1
535 define dso_local i128 @load_atomic_i128_unaligned_monotonic_const(ptr readonly %ptr) {
536 ; CHECK-LABEL: load_atomic_i128_unaligned_monotonic_const:
537 ; CHECK: bl __atomic_load
538 %r = load atomic i128, ptr %ptr monotonic, align 1
542 define dso_local i128 @load_atomic_i128_unaligned_acquire(ptr %ptr) {
543 ; CHECK-LABEL: load_atomic_i128_unaligned_acquire:
544 ; CHECK: bl __atomic_load
545 %r = load atomic i128, ptr %ptr acquire, align 1
549 define dso_local i128 @load_atomic_i128_unaligned_acquire_const(ptr readonly %ptr) {
550 ; CHECK-LABEL: load_atomic_i128_unaligned_acquire_const:
551 ; CHECK: bl __atomic_load
552 %r = load atomic i128, ptr %ptr acquire, align 1
556 define dso_local i128 @load_atomic_i128_unaligned_seq_cst(ptr %ptr) {
557 ; CHECK-LABEL: load_atomic_i128_unaligned_seq_cst:
558 ; CHECK: bl __atomic_load
559 %r = load atomic i128, ptr %ptr seq_cst, align 1
563 define dso_local i128 @load_atomic_i128_unaligned_seq_cst_const(ptr readonly %ptr) {
564 ; CHECK-LABEL: load_atomic_i128_unaligned_seq_cst_const:
565 ; CHECK: bl __atomic_load
566 %r = load atomic i128, ptr %ptr seq_cst, align 1
569 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: