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[^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=+v8.1a -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+v8.1a -O1 | FileCheck %s --check-prefixes=CHECK,-O1
6 define dso_local i8 @atomicrmw_xchg_i8_aligned_monotonic(ptr %ptr, i8 %value) {
7 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_monotonic:
8 ; CHECK: swpb w1, w0, [x0]
9 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
13 define dso_local i8 @atomicrmw_xchg_i8_aligned_acquire(ptr %ptr, i8 %value) {
14 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_acquire:
15 ; CHECK: swpab w1, w0, [x0]
16 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
20 define dso_local i8 @atomicrmw_xchg_i8_aligned_release(ptr %ptr, i8 %value) {
21 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_release:
22 ; CHECK: swplb w1, w0, [x0]
23 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
27 define dso_local i8 @atomicrmw_xchg_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
28 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_acq_rel:
29 ; CHECK: swpalb w1, w0, [x0]
30 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
34 define dso_local i8 @atomicrmw_xchg_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
35 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_seq_cst:
36 ; CHECK: swpalb w1, w0, [x0]
37 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
41 define dso_local i16 @atomicrmw_xchg_i16_aligned_monotonic(ptr %ptr, i16 %value) {
42 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_monotonic:
43 ; CHECK: swph w1, w0, [x0]
44 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 2
48 define dso_local i16 @atomicrmw_xchg_i16_aligned_acquire(ptr %ptr, i16 %value) {
49 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_acquire:
50 ; CHECK: swpah w1, w0, [x0]
51 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 2
55 define dso_local i16 @atomicrmw_xchg_i16_aligned_release(ptr %ptr, i16 %value) {
56 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_release:
57 ; CHECK: swplh w1, w0, [x0]
58 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 2
62 define dso_local i16 @atomicrmw_xchg_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
63 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_acq_rel:
64 ; CHECK: swpalh w1, w0, [x0]
65 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 2
69 define dso_local i16 @atomicrmw_xchg_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
70 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_seq_cst:
71 ; CHECK: swpalh w1, w0, [x0]
72 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 2
76 define dso_local i32 @atomicrmw_xchg_i32_aligned_monotonic(ptr %ptr, i32 %value) {
77 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_monotonic:
78 ; CHECK: swp w1, w0, [x0]
79 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 4
83 define dso_local i32 @atomicrmw_xchg_i32_aligned_acquire(ptr %ptr, i32 %value) {
84 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_acquire:
85 ; CHECK: swpa w1, w0, [x0]
86 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 4
90 define dso_local i32 @atomicrmw_xchg_i32_aligned_release(ptr %ptr, i32 %value) {
91 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_release:
92 ; CHECK: swpl w1, w0, [x0]
93 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 4
97 define dso_local i32 @atomicrmw_xchg_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
98 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_acq_rel:
99 ; CHECK: swpal w1, w0, [x0]
100 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 4
104 define dso_local i32 @atomicrmw_xchg_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
105 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_seq_cst:
106 ; CHECK: swpal w1, w0, [x0]
107 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 4
111 define dso_local i64 @atomicrmw_xchg_i64_aligned_monotonic(ptr %ptr, i64 %value) {
112 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_monotonic:
113 ; CHECK: swp x1, x0, [x0]
114 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 8
118 define dso_local i64 @atomicrmw_xchg_i64_aligned_acquire(ptr %ptr, i64 %value) {
119 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_acquire:
120 ; CHECK: swpa x1, x0, [x0]
121 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 8
125 define dso_local i64 @atomicrmw_xchg_i64_aligned_release(ptr %ptr, i64 %value) {
126 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_release:
127 ; CHECK: swpl x1, x0, [x0]
128 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 8
132 define dso_local i64 @atomicrmw_xchg_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
133 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_acq_rel:
134 ; CHECK: swpal x1, x0, [x0]
135 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 8
139 define dso_local i64 @atomicrmw_xchg_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
140 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_seq_cst:
141 ; CHECK: swpal x1, x0, [x0]
142 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 8
146 define dso_local i128 @atomicrmw_xchg_i128_aligned_monotonic(ptr %ptr, i128 %value) {
147 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
148 ; -O0: casp x0, x1, x2, x3, [x8]
149 ; -O0: subs x11, x9, x11
150 ; -O0: ccmp x8, x10, #0, eq
152 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
153 ; -O1: ldp x4, x5, [x0]
154 ; -O1: casp x4, x5, x2, x3, [x0]
156 ; -O1: ccmp x5, x7, #0, eq
157 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
161 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
162 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
163 ; -O0: caspa x0, x1, x2, x3, [x8]
164 ; -O0: subs x11, x9, x11
165 ; -O0: ccmp x8, x10, #0, eq
167 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
168 ; -O1: ldp x4, x5, [x0]
169 ; -O1: caspa x4, x5, x2, x3, [x0]
171 ; -O1: ccmp x5, x7, #0, eq
172 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
176 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
177 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
178 ; -O0: caspl x0, x1, x2, x3, [x8]
179 ; -O0: subs x11, x9, x11
180 ; -O0: ccmp x8, x10, #0, eq
182 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
183 ; -O1: ldp x4, x5, [x0]
184 ; -O1: caspl x4, x5, x2, x3, [x0]
186 ; -O1: ccmp x5, x7, #0, eq
187 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
191 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
192 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
193 ; -O0: caspal x0, x1, x2, x3, [x8]
194 ; -O0: subs x11, x9, x11
195 ; -O0: ccmp x8, x10, #0, eq
197 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
198 ; -O1: ldp x4, x5, [x0]
199 ; -O1: caspal x4, x5, x2, x3, [x0]
201 ; -O1: ccmp x5, x7, #0, eq
202 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
206 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
207 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
208 ; -O0: caspal x0, x1, x2, x3, [x8]
209 ; -O0: subs x11, x9, x11
210 ; -O0: ccmp x8, x10, #0, eq
212 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
213 ; -O1: ldp x4, x5, [x0]
214 ; -O1: caspal x4, x5, x2, x3, [x0]
216 ; -O1: ccmp x5, x7, #0, eq
217 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
221 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
222 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
223 ; CHECK: swpb w1, w0, [x0]
224 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
228 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
229 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
230 ; CHECK: swpab w1, w0, [x0]
231 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
235 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
236 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_release:
237 ; CHECK: swplb w1, w0, [x0]
238 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
242 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
243 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
244 ; CHECK: swpalb w1, w0, [x0]
245 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
249 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
250 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
251 ; CHECK: swpalb w1, w0, [x0]
252 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
256 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
257 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
258 ; CHECK: bl __atomic_exchange
259 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
263 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
264 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
265 ; CHECK: bl __atomic_exchange
266 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
270 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
271 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
272 ; CHECK: bl __atomic_exchange
273 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
277 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
278 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
279 ; CHECK: bl __atomic_exchange
280 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
284 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
285 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
286 ; CHECK: bl __atomic_exchange
287 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
291 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
292 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
293 ; CHECK: bl __atomic_exchange
294 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
298 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
299 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
300 ; CHECK: bl __atomic_exchange
301 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
305 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
306 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
307 ; CHECK: bl __atomic_exchange
308 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
312 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
313 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
314 ; CHECK: bl __atomic_exchange
315 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
319 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
320 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
321 ; CHECK: bl __atomic_exchange
322 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
326 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
327 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
328 ; CHECK: bl __atomic_exchange
329 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
333 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
334 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
335 ; CHECK: bl __atomic_exchange
336 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
340 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
341 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
342 ; CHECK: bl __atomic_exchange
343 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
347 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
348 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
349 ; CHECK: bl __atomic_exchange
350 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
354 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
355 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
356 ; CHECK: bl __atomic_exchange
357 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
361 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
362 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
363 ; CHECK: bl __atomic_exchange
364 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
368 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
369 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
370 ; CHECK: bl __atomic_exchange
371 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
375 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
376 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
377 ; CHECK: bl __atomic_exchange
378 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
382 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
383 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
384 ; CHECK: bl __atomic_exchange
385 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
389 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
390 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
391 ; CHECK: bl __atomic_exchange
392 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
396 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
397 ; CHECK-LABEL: atomicrmw_add_i8_aligned_monotonic:
398 ; CHECK: ldaddb w1, w0, [x0]
399 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
403 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
404 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acquire:
405 ; CHECK: ldaddab w1, w0, [x0]
406 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
410 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
411 ; CHECK-LABEL: atomicrmw_add_i8_aligned_release:
412 ; CHECK: ldaddlb w1, w0, [x0]
413 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
417 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
418 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acq_rel:
419 ; CHECK: ldaddalb w1, w0, [x0]
420 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
424 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
425 ; CHECK-LABEL: atomicrmw_add_i8_aligned_seq_cst:
426 ; CHECK: ldaddalb w1, w0, [x0]
427 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
431 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
432 ; CHECK-LABEL: atomicrmw_add_i16_aligned_monotonic:
433 ; CHECK: ldaddh w1, w0, [x0]
434 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
438 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
439 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acquire:
440 ; CHECK: ldaddah w1, w0, [x0]
441 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
445 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
446 ; CHECK-LABEL: atomicrmw_add_i16_aligned_release:
447 ; CHECK: ldaddlh w1, w0, [x0]
448 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
452 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
453 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acq_rel:
454 ; CHECK: ldaddalh w1, w0, [x0]
455 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
459 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
460 ; CHECK-LABEL: atomicrmw_add_i16_aligned_seq_cst:
461 ; CHECK: ldaddalh w1, w0, [x0]
462 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
466 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
467 ; CHECK-LABEL: atomicrmw_add_i32_aligned_monotonic:
468 ; CHECK: ldadd w1, w0, [x0]
469 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
473 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
474 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acquire:
475 ; CHECK: ldadda w1, w0, [x0]
476 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
480 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
481 ; CHECK-LABEL: atomicrmw_add_i32_aligned_release:
482 ; CHECK: ldaddl w1, w0, [x0]
483 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
487 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
488 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acq_rel:
489 ; CHECK: ldaddal w1, w0, [x0]
490 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
494 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
495 ; CHECK-LABEL: atomicrmw_add_i32_aligned_seq_cst:
496 ; CHECK: ldaddal w1, w0, [x0]
497 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
501 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
502 ; CHECK-LABEL: atomicrmw_add_i64_aligned_monotonic:
503 ; CHECK: ldadd x1, x0, [x0]
504 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
508 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
509 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acquire:
510 ; CHECK: ldadda x1, x0, [x0]
511 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
515 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
516 ; CHECK-LABEL: atomicrmw_add_i64_aligned_release:
517 ; CHECK: ldaddl x1, x0, [x0]
518 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
522 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
523 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acq_rel:
524 ; CHECK: ldaddal x1, x0, [x0]
525 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
529 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
530 ; CHECK-LABEL: atomicrmw_add_i64_aligned_seq_cst:
531 ; CHECK: ldaddal x1, x0, [x0]
532 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
536 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
537 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
538 ; -O0: adds x9, x10, x9
539 ; -O0: casp x0, x1, x2, x3, [x8]
540 ; -O0: subs x11, x9, x11
541 ; -O0: ccmp x8, x10, #0, eq
543 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
544 ; -O1: ldp x4, x5, [x0]
545 ; -O1: adds x9, x7, x3
546 ; -O1: casp x4, x5, x8, x9, [x0]
548 ; -O1: ccmp x5, x7, #0, eq
549 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
553 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
554 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
555 ; -O0: adds x9, x10, x9
556 ; -O0: caspa x0, x1, x2, x3, [x8]
557 ; -O0: subs x11, x9, x11
558 ; -O0: ccmp x8, x10, #0, eq
560 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
561 ; -O1: ldp x4, x5, [x0]
562 ; -O1: adds x9, x7, x3
563 ; -O1: caspa x4, x5, x8, x9, [x0]
565 ; -O1: ccmp x5, x7, #0, eq
566 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
570 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
571 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
572 ; -O0: adds x9, x10, x9
573 ; -O0: caspl x0, x1, x2, x3, [x8]
574 ; -O0: subs x11, x9, x11
575 ; -O0: ccmp x8, x10, #0, eq
577 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
578 ; -O1: ldp x4, x5, [x0]
579 ; -O1: adds x9, x7, x3
580 ; -O1: caspl x4, x5, x8, x9, [x0]
582 ; -O1: ccmp x5, x7, #0, eq
583 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
587 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
588 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
589 ; -O0: adds x9, x10, x9
590 ; -O0: caspal x0, x1, x2, x3, [x8]
591 ; -O0: subs x11, x9, x11
592 ; -O0: ccmp x8, x10, #0, eq
594 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
595 ; -O1: ldp x4, x5, [x0]
596 ; -O1: adds x9, x7, x3
597 ; -O1: caspal x4, x5, x8, x9, [x0]
599 ; -O1: ccmp x5, x7, #0, eq
600 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
604 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
605 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
606 ; -O0: adds x9, x10, x9
607 ; -O0: caspal x0, x1, x2, x3, [x8]
608 ; -O0: subs x11, x9, x11
609 ; -O0: ccmp x8, x10, #0, eq
611 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
612 ; -O1: ldp x4, x5, [x0]
613 ; -O1: adds x9, x7, x3
614 ; -O1: caspal x4, x5, x8, x9, [x0]
616 ; -O1: ccmp x5, x7, #0, eq
617 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
621 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
622 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
623 ; CHECK: ldaddb w1, w0, [x0]
624 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
628 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
629 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
630 ; CHECK: ldaddab w1, w0, [x0]
631 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
635 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
636 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
637 ; CHECK: ldaddlb w1, w0, [x0]
638 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
642 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
643 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
644 ; CHECK: ldaddalb w1, w0, [x0]
645 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
649 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
650 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
651 ; CHECK: ldaddalb w1, w0, [x0]
652 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
656 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
657 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
658 ; -O0: add w8, w9, w8
659 ; -O0: bl __atomic_compare_exchange
661 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
662 ; -O1: add w8, w0, w20
663 ; -O1: bl __atomic_compare_exchange
664 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
668 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
669 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
670 ; -O0: add w8, w9, w8
671 ; -O0: bl __atomic_compare_exchange
673 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
674 ; -O1: add w8, w0, w20
675 ; -O1: bl __atomic_compare_exchange
676 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
680 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
681 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
682 ; -O0: add w8, w9, w8
683 ; -O0: bl __atomic_compare_exchange
685 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
686 ; -O1: add w8, w0, w20
687 ; -O1: bl __atomic_compare_exchange
688 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
692 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
693 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
694 ; -O0: add w8, w9, w8
695 ; -O0: bl __atomic_compare_exchange
697 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
698 ; -O1: add w8, w0, w20
699 ; -O1: bl __atomic_compare_exchange
700 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
704 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
705 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
706 ; -O0: add w8, w9, w8
707 ; -O0: bl __atomic_compare_exchange
709 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
710 ; -O1: add w8, w0, w20
711 ; -O1: bl __atomic_compare_exchange
712 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
716 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
717 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
718 ; -O0: add w8, w9, w8
719 ; -O0: bl __atomic_compare_exchange
721 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
722 ; -O1: add w8, w0, w20
723 ; -O1: bl __atomic_compare_exchange
724 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
728 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
729 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
730 ; -O0: add w8, w9, w8
731 ; -O0: bl __atomic_compare_exchange
733 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
734 ; -O1: add w8, w0, w20
735 ; -O1: bl __atomic_compare_exchange
736 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
740 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
741 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
742 ; -O0: add w8, w9, w8
743 ; -O0: bl __atomic_compare_exchange
745 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
746 ; -O1: add w8, w0, w20
747 ; -O1: bl __atomic_compare_exchange
748 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
752 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
753 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
754 ; -O0: add w8, w9, w8
755 ; -O0: bl __atomic_compare_exchange
757 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
758 ; -O1: add w8, w0, w20
759 ; -O1: bl __atomic_compare_exchange
760 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
764 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
765 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
766 ; -O0: add w8, w9, w8
767 ; -O0: bl __atomic_compare_exchange
769 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
770 ; -O1: add w8, w0, w20
771 ; -O1: bl __atomic_compare_exchange
772 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
776 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
777 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
778 ; -O0: add x8, x9, x8
779 ; -O0: bl __atomic_compare_exchange
781 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
782 ; -O1: add x8, x0, x20
783 ; -O1: bl __atomic_compare_exchange
784 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
788 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
789 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
790 ; -O0: add x8, x9, x8
791 ; -O0: bl __atomic_compare_exchange
793 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
794 ; -O1: add x8, x0, x20
795 ; -O1: bl __atomic_compare_exchange
796 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
800 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
801 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
802 ; -O0: add x8, x9, x8
803 ; -O0: bl __atomic_compare_exchange
805 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
806 ; -O1: add x8, x0, x20
807 ; -O1: bl __atomic_compare_exchange
808 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
812 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
813 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
814 ; -O0: add x8, x9, x8
815 ; -O0: bl __atomic_compare_exchange
817 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
818 ; -O1: add x8, x0, x20
819 ; -O1: bl __atomic_compare_exchange
820 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
824 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
825 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
826 ; -O0: add x8, x9, x8
827 ; -O0: bl __atomic_compare_exchange
829 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
830 ; -O1: add x8, x0, x20
831 ; -O1: bl __atomic_compare_exchange
832 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
836 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
837 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
838 ; -O0: adds x9, x10, x9
839 ; -O0: bl __atomic_compare_exchange
841 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
842 ; -O1: ldp x0, x1, [x0]
843 ; -O1: adds x8, x1, x19
844 ; -O1: bl __atomic_compare_exchange
845 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
849 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
850 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
851 ; -O0: adds x9, x10, x9
852 ; -O0: bl __atomic_compare_exchange
854 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
855 ; -O1: ldp x0, x1, [x0]
856 ; -O1: adds x8, x1, x19
857 ; -O1: bl __atomic_compare_exchange
858 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
862 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
863 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
864 ; -O0: adds x9, x10, x9
865 ; -O0: bl __atomic_compare_exchange
867 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
868 ; -O1: ldp x0, x1, [x0]
869 ; -O1: adds x8, x1, x19
870 ; -O1: bl __atomic_compare_exchange
871 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
875 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
876 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
877 ; -O0: adds x9, x10, x9
878 ; -O0: bl __atomic_compare_exchange
880 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
881 ; -O1: ldp x0, x1, [x0]
882 ; -O1: adds x8, x1, x19
883 ; -O1: bl __atomic_compare_exchange
884 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
888 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
889 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
890 ; -O0: adds x9, x10, x9
891 ; -O0: bl __atomic_compare_exchange
893 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
894 ; -O1: ldp x0, x1, [x0]
895 ; -O1: adds x8, x1, x19
896 ; -O1: bl __atomic_compare_exchange
897 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
901 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
902 ; -O0-LABEL: atomicrmw_sub_i8_aligned_monotonic:
903 ; -O0: subs w8, w8, w1
904 ; -O0: ldaddb w8, w0, [x0]
906 ; -O1-LABEL: atomicrmw_sub_i8_aligned_monotonic:
907 ; -O1: ldaddb w8, w0, [x0]
908 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
912 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
913 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acquire:
914 ; -O0: subs w8, w8, w1
915 ; -O0: ldaddab w8, w0, [x0]
917 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acquire:
918 ; -O1: ldaddab w8, w0, [x0]
919 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
923 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
924 ; -O0-LABEL: atomicrmw_sub_i8_aligned_release:
925 ; -O0: subs w8, w8, w1
926 ; -O0: ldaddlb w8, w0, [x0]
928 ; -O1-LABEL: atomicrmw_sub_i8_aligned_release:
929 ; -O1: ldaddlb w8, w0, [x0]
930 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
934 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
935 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
936 ; -O0: subs w8, w8, w1
937 ; -O0: ldaddalb w8, w0, [x0]
939 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
940 ; -O1: ldaddalb w8, w0, [x0]
941 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
945 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
946 ; -O0-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
947 ; -O0: subs w8, w8, w1
948 ; -O0: ldaddalb w8, w0, [x0]
950 ; -O1-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
951 ; -O1: ldaddalb w8, w0, [x0]
952 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
956 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
957 ; -O0-LABEL: atomicrmw_sub_i16_aligned_monotonic:
958 ; -O0: subs w8, w8, w1
959 ; -O0: ldaddh w8, w0, [x0]
961 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
962 ; -O1: ldaddh w8, w0, [x0]
963 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
967 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
968 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
969 ; -O0: subs w8, w8, w1
970 ; -O0: ldaddah w8, w0, [x0]
972 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
973 ; -O1: ldaddah w8, w0, [x0]
974 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
978 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
979 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
980 ; -O0: subs w8, w8, w1
981 ; -O0: ldaddlh w8, w0, [x0]
983 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
984 ; -O1: ldaddlh w8, w0, [x0]
985 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
989 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
990 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
991 ; -O0: subs w8, w8, w1
992 ; -O0: ldaddalh w8, w0, [x0]
994 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
995 ; -O1: ldaddalh w8, w0, [x0]
996 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
1000 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1001 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1002 ; -O0: subs w8, w8, w1
1003 ; -O0: ldaddalh w8, w0, [x0]
1005 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1006 ; -O1: ldaddalh w8, w0, [x0]
1007 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1011 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1012 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1013 ; -O0: subs w8, w8, w1
1014 ; -O0: ldadd w8, w0, [x0]
1016 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1017 ; -O1: ldadd w8, w0, [x0]
1018 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1022 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1023 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
1024 ; -O0: subs w8, w8, w1
1025 ; -O0: ldadda w8, w0, [x0]
1027 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1028 ; -O1: ldadda w8, w0, [x0]
1029 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1033 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1034 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1035 ; -O0: subs w8, w8, w1
1036 ; -O0: ldaddl w8, w0, [x0]
1038 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1039 ; -O1: ldaddl w8, w0, [x0]
1040 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1044 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1045 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1046 ; -O0: subs w8, w8, w1
1047 ; -O0: ldaddal w8, w0, [x0]
1049 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1050 ; -O1: ldaddal w8, w0, [x0]
1051 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1055 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1056 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1057 ; -O0: subs w8, w8, w1
1058 ; -O0: ldaddal w8, w0, [x0]
1060 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1061 ; -O1: ldaddal w8, w0, [x0]
1062 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1066 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1067 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1068 ; -O0: subs x8, x8, x1
1069 ; -O0: ldadd x8, x0, [x0]
1071 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1072 ; -O1: ldadd x8, x0, [x0]
1073 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1077 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1078 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1079 ; -O0: subs x8, x8, x1
1080 ; -O0: ldadda x8, x0, [x0]
1082 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1083 ; -O1: ldadda x8, x0, [x0]
1084 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1088 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1089 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1090 ; -O0: subs x8, x8, x1
1091 ; -O0: ldaddl x8, x0, [x0]
1093 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1094 ; -O1: ldaddl x8, x0, [x0]
1095 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1099 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1100 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1101 ; -O0: subs x8, x8, x1
1102 ; -O0: ldaddal x8, x0, [x0]
1104 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1105 ; -O1: ldaddal x8, x0, [x0]
1106 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1110 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1111 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1112 ; -O0: subs x8, x8, x1
1113 ; -O0: ldaddal x8, x0, [x0]
1115 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1116 ; -O1: ldaddal x8, x0, [x0]
1117 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1121 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1122 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1123 ; -O0: subs x9, x10, x9
1124 ; -O0: casp x0, x1, x2, x3, [x8]
1125 ; -O0: subs x11, x9, x11
1126 ; -O0: ccmp x8, x10, #0, eq
1128 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1129 ; -O1: ldp x4, x5, [x0]
1130 ; -O1: subs x9, x7, x3
1131 ; -O1: casp x4, x5, x8, x9, [x0]
1133 ; -O1: ccmp x5, x7, #0, eq
1134 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1138 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1139 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1140 ; -O0: subs x9, x10, x9
1141 ; -O0: caspa x0, x1, x2, x3, [x8]
1142 ; -O0: subs x11, x9, x11
1143 ; -O0: ccmp x8, x10, #0, eq
1145 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1146 ; -O1: ldp x4, x5, [x0]
1147 ; -O1: subs x9, x7, x3
1148 ; -O1: caspa x4, x5, x8, x9, [x0]
1150 ; -O1: ccmp x5, x7, #0, eq
1151 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1155 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1156 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1157 ; -O0: subs x9, x10, x9
1158 ; -O0: caspl x0, x1, x2, x3, [x8]
1159 ; -O0: subs x11, x9, x11
1160 ; -O0: ccmp x8, x10, #0, eq
1162 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1163 ; -O1: ldp x4, x5, [x0]
1164 ; -O1: subs x9, x7, x3
1165 ; -O1: caspl x4, x5, x8, x9, [x0]
1167 ; -O1: ccmp x5, x7, #0, eq
1168 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1172 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1173 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1174 ; -O0: subs x9, x10, x9
1175 ; -O0: caspal x0, x1, x2, x3, [x8]
1176 ; -O0: subs x11, x9, x11
1177 ; -O0: ccmp x8, x10, #0, eq
1179 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1180 ; -O1: ldp x4, x5, [x0]
1181 ; -O1: subs x9, x7, x3
1182 ; -O1: caspal x4, x5, x8, x9, [x0]
1184 ; -O1: ccmp x5, x7, #0, eq
1185 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1189 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1190 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1191 ; -O0: subs x9, x10, x9
1192 ; -O0: caspal x0, x1, x2, x3, [x8]
1193 ; -O0: subs x11, x9, x11
1194 ; -O0: ccmp x8, x10, #0, eq
1196 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1197 ; -O1: ldp x4, x5, [x0]
1198 ; -O1: subs x9, x7, x3
1199 ; -O1: caspal x4, x5, x8, x9, [x0]
1201 ; -O1: ccmp x5, x7, #0, eq
1202 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1206 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1207 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1208 ; -O0: subs w8, w8, w1
1209 ; -O0: ldaddb w8, w0, [x0]
1211 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1212 ; -O1: ldaddb w8, w0, [x0]
1213 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1217 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1218 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1219 ; -O0: subs w8, w8, w1
1220 ; -O0: ldaddab w8, w0, [x0]
1222 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1223 ; -O1: ldaddab w8, w0, [x0]
1224 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1228 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1229 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1230 ; -O0: subs w8, w8, w1
1231 ; -O0: ldaddlb w8, w0, [x0]
1233 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1234 ; -O1: ldaddlb w8, w0, [x0]
1235 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1239 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1240 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1241 ; -O0: subs w8, w8, w1
1242 ; -O0: ldaddalb w8, w0, [x0]
1244 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1245 ; -O1: ldaddalb w8, w0, [x0]
1246 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1250 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1251 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1252 ; -O0: subs w8, w8, w1
1253 ; -O0: ldaddalb w8, w0, [x0]
1255 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1256 ; -O1: ldaddalb w8, w0, [x0]
1257 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1261 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1262 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1263 ; -O0: subs w8, w9, w8
1264 ; -O0: bl __atomic_compare_exchange
1266 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1267 ; -O1: sub w8, w0, w20
1268 ; -O1: bl __atomic_compare_exchange
1269 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1273 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1274 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1275 ; -O0: subs w8, w9, w8
1276 ; -O0: bl __atomic_compare_exchange
1278 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1279 ; -O1: sub w8, w0, w20
1280 ; -O1: bl __atomic_compare_exchange
1281 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1285 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1286 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1287 ; -O0: subs w8, w9, w8
1288 ; -O0: bl __atomic_compare_exchange
1290 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1291 ; -O1: sub w8, w0, w20
1292 ; -O1: bl __atomic_compare_exchange
1293 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1297 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1298 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1299 ; -O0: subs w8, w9, w8
1300 ; -O0: bl __atomic_compare_exchange
1302 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1303 ; -O1: sub w8, w0, w20
1304 ; -O1: bl __atomic_compare_exchange
1305 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1309 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1310 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1311 ; -O0: subs w8, w9, w8
1312 ; -O0: bl __atomic_compare_exchange
1314 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1315 ; -O1: sub w8, w0, w20
1316 ; -O1: bl __atomic_compare_exchange
1317 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1321 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1322 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1323 ; -O0: subs w8, w9, w8
1324 ; -O0: bl __atomic_compare_exchange
1326 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1327 ; -O1: sub w8, w0, w20
1328 ; -O1: bl __atomic_compare_exchange
1329 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1333 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1334 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1335 ; -O0: subs w8, w9, w8
1336 ; -O0: bl __atomic_compare_exchange
1338 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1339 ; -O1: sub w8, w0, w20
1340 ; -O1: bl __atomic_compare_exchange
1341 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1345 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1346 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1347 ; -O0: subs w8, w9, w8
1348 ; -O0: bl __atomic_compare_exchange
1350 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1351 ; -O1: sub w8, w0, w20
1352 ; -O1: bl __atomic_compare_exchange
1353 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1357 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1358 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1359 ; -O0: subs w8, w9, w8
1360 ; -O0: bl __atomic_compare_exchange
1362 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1363 ; -O1: sub w8, w0, w20
1364 ; -O1: bl __atomic_compare_exchange
1365 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1369 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1370 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1371 ; -O0: subs w8, w9, w8
1372 ; -O0: bl __atomic_compare_exchange
1374 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1375 ; -O1: sub w8, w0, w20
1376 ; -O1: bl __atomic_compare_exchange
1377 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1381 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1382 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1383 ; -O0: subs x8, x9, x8
1384 ; -O0: bl __atomic_compare_exchange
1386 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1387 ; -O1: sub x8, x0, x20
1388 ; -O1: bl __atomic_compare_exchange
1389 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1393 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1394 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1395 ; -O0: subs x8, x9, x8
1396 ; -O0: bl __atomic_compare_exchange
1398 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1399 ; -O1: sub x8, x0, x20
1400 ; -O1: bl __atomic_compare_exchange
1401 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1405 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1406 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1407 ; -O0: subs x8, x9, x8
1408 ; -O0: bl __atomic_compare_exchange
1410 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1411 ; -O1: sub x8, x0, x20
1412 ; -O1: bl __atomic_compare_exchange
1413 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1417 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1418 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1419 ; -O0: subs x8, x9, x8
1420 ; -O0: bl __atomic_compare_exchange
1422 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1423 ; -O1: sub x8, x0, x20
1424 ; -O1: bl __atomic_compare_exchange
1425 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1429 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1430 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1431 ; -O0: subs x8, x9, x8
1432 ; -O0: bl __atomic_compare_exchange
1434 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1435 ; -O1: sub x8, x0, x20
1436 ; -O1: bl __atomic_compare_exchange
1437 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1441 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1442 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1443 ; -O0: subs x9, x10, x9
1444 ; -O0: bl __atomic_compare_exchange
1446 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1447 ; -O1: ldp x0, x1, [x0]
1448 ; -O1: subs x8, x1, x19
1449 ; -O1: bl __atomic_compare_exchange
1450 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1454 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1455 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1456 ; -O0: subs x9, x10, x9
1457 ; -O0: bl __atomic_compare_exchange
1459 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1460 ; -O1: ldp x0, x1, [x0]
1461 ; -O1: subs x8, x1, x19
1462 ; -O1: bl __atomic_compare_exchange
1463 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1467 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1468 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1469 ; -O0: subs x9, x10, x9
1470 ; -O0: bl __atomic_compare_exchange
1472 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1473 ; -O1: ldp x0, x1, [x0]
1474 ; -O1: subs x8, x1, x19
1475 ; -O1: bl __atomic_compare_exchange
1476 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1480 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1481 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1482 ; -O0: subs x9, x10, x9
1483 ; -O0: bl __atomic_compare_exchange
1485 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1486 ; -O1: ldp x0, x1, [x0]
1487 ; -O1: subs x8, x1, x19
1488 ; -O1: bl __atomic_compare_exchange
1489 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1493 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1494 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1495 ; -O0: subs x9, x10, x9
1496 ; -O0: bl __atomic_compare_exchange
1498 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1499 ; -O1: ldp x0, x1, [x0]
1500 ; -O1: subs x8, x1, x19
1501 ; -O1: bl __atomic_compare_exchange
1502 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1506 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1507 ; CHECK-LABEL: atomicrmw_and_i8_aligned_monotonic:
1509 ; CHECK: ldclrb w8, w0, [x0]
1510 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1514 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1515 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acquire:
1517 ; CHECK: ldclrab w8, w0, [x0]
1518 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1522 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1523 ; CHECK-LABEL: atomicrmw_and_i8_aligned_release:
1525 ; CHECK: ldclrlb w8, w0, [x0]
1526 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1530 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1531 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1533 ; CHECK: ldclralb w8, w0, [x0]
1534 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1538 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1539 ; CHECK-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1541 ; CHECK: ldclralb w8, w0, [x0]
1542 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1546 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1547 ; CHECK-LABEL: atomicrmw_and_i16_aligned_monotonic:
1549 ; CHECK: ldclrh w8, w0, [x0]
1550 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1554 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1555 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acquire:
1557 ; CHECK: ldclrah w8, w0, [x0]
1558 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1562 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1563 ; CHECK-LABEL: atomicrmw_and_i16_aligned_release:
1565 ; CHECK: ldclrlh w8, w0, [x0]
1566 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1570 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1571 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1573 ; CHECK: ldclralh w8, w0, [x0]
1574 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1578 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1579 ; CHECK-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1581 ; CHECK: ldclralh w8, w0, [x0]
1582 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1586 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1587 ; CHECK-LABEL: atomicrmw_and_i32_aligned_monotonic:
1589 ; CHECK: ldclr w8, w0, [x0]
1590 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1594 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1595 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acquire:
1597 ; CHECK: ldclra w8, w0, [x0]
1598 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1602 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1603 ; CHECK-LABEL: atomicrmw_and_i32_aligned_release:
1605 ; CHECK: ldclrl w8, w0, [x0]
1606 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1610 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1611 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1613 ; CHECK: ldclral w8, w0, [x0]
1614 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1618 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1619 ; CHECK-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1621 ; CHECK: ldclral w8, w0, [x0]
1622 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1626 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1627 ; CHECK-LABEL: atomicrmw_and_i64_aligned_monotonic:
1629 ; CHECK: ldclr x8, x0, [x0]
1630 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1634 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1635 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acquire:
1637 ; CHECK: ldclra x8, x0, [x0]
1638 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1642 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1643 ; CHECK-LABEL: atomicrmw_and_i64_aligned_release:
1645 ; CHECK: ldclrl x8, x0, [x0]
1646 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1650 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1651 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1653 ; CHECK: ldclral x8, x0, [x0]
1654 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1658 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1659 ; CHECK-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1661 ; CHECK: ldclral x8, x0, [x0]
1662 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1666 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1667 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1668 ; -O0: and x2, x11, x12
1669 ; -O0: and x9, x10, x9
1670 ; -O0: casp x0, x1, x2, x3, [x8]
1671 ; -O0: subs x11, x9, x11
1672 ; -O0: ccmp x8, x10, #0, eq
1674 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1675 ; -O1: ldp x4, x5, [x0]
1676 ; -O1: and x8, x4, x2
1677 ; -O1: and x9, x7, x3
1678 ; -O1: casp x4, x5, x8, x9, [x0]
1680 ; -O1: ccmp x5, x7, #0, eq
1681 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1685 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1686 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1687 ; -O0: and x2, x11, x12
1688 ; -O0: and x9, x10, x9
1689 ; -O0: caspa x0, x1, x2, x3, [x8]
1690 ; -O0: subs x11, x9, x11
1691 ; -O0: ccmp x8, x10, #0, eq
1693 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1694 ; -O1: ldp x4, x5, [x0]
1695 ; -O1: and x8, x4, x2
1696 ; -O1: and x9, x7, x3
1697 ; -O1: caspa x4, x5, x8, x9, [x0]
1699 ; -O1: ccmp x5, x7, #0, eq
1700 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1704 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1705 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1706 ; -O0: and x2, x11, x12
1707 ; -O0: and x9, x10, x9
1708 ; -O0: caspl x0, x1, x2, x3, [x8]
1709 ; -O0: subs x11, x9, x11
1710 ; -O0: ccmp x8, x10, #0, eq
1712 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1713 ; -O1: ldp x4, x5, [x0]
1714 ; -O1: and x8, x4, x2
1715 ; -O1: and x9, x7, x3
1716 ; -O1: caspl x4, x5, x8, x9, [x0]
1718 ; -O1: ccmp x5, x7, #0, eq
1719 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1723 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1724 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1725 ; -O0: and x2, x11, x12
1726 ; -O0: and x9, x10, x9
1727 ; -O0: caspal x0, x1, x2, x3, [x8]
1728 ; -O0: subs x11, x9, x11
1729 ; -O0: ccmp x8, x10, #0, eq
1731 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1732 ; -O1: ldp x4, x5, [x0]
1733 ; -O1: and x8, x4, x2
1734 ; -O1: and x9, x7, x3
1735 ; -O1: caspal x4, x5, x8, x9, [x0]
1737 ; -O1: ccmp x5, x7, #0, eq
1738 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1742 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1743 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1744 ; -O0: and x2, x11, x12
1745 ; -O0: and x9, x10, x9
1746 ; -O0: caspal x0, x1, x2, x3, [x8]
1747 ; -O0: subs x11, x9, x11
1748 ; -O0: ccmp x8, x10, #0, eq
1750 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1751 ; -O1: ldp x4, x5, [x0]
1752 ; -O1: and x8, x4, x2
1753 ; -O1: and x9, x7, x3
1754 ; -O1: caspal x4, x5, x8, x9, [x0]
1756 ; -O1: ccmp x5, x7, #0, eq
1757 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1761 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1762 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1764 ; CHECK: ldclrb w8, w0, [x0]
1765 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1769 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1770 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acquire:
1772 ; CHECK: ldclrab w8, w0, [x0]
1773 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1777 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1778 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_release:
1780 ; CHECK: ldclrlb w8, w0, [x0]
1781 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1785 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1786 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1788 ; CHECK: ldclralb w8, w0, [x0]
1789 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1793 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1794 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1796 ; CHECK: ldclralb w8, w0, [x0]
1797 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1801 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1802 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1803 ; -O0: and w8, w9, w8
1804 ; -O0: bl __atomic_compare_exchange
1806 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1807 ; -O1: and w8, w0, w20
1808 ; -O1: bl __atomic_compare_exchange
1809 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1813 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1814 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1815 ; -O0: and w8, w9, w8
1816 ; -O0: bl __atomic_compare_exchange
1818 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1819 ; -O1: and w8, w0, w20
1820 ; -O1: bl __atomic_compare_exchange
1821 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1825 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1826 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1827 ; -O0: and w8, w9, w8
1828 ; -O0: bl __atomic_compare_exchange
1830 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1831 ; -O1: and w8, w0, w20
1832 ; -O1: bl __atomic_compare_exchange
1833 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1837 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1838 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1839 ; -O0: and w8, w9, w8
1840 ; -O0: bl __atomic_compare_exchange
1842 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1843 ; -O1: and w8, w0, w20
1844 ; -O1: bl __atomic_compare_exchange
1845 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1849 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1850 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1851 ; -O0: and w8, w9, w8
1852 ; -O0: bl __atomic_compare_exchange
1854 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1855 ; -O1: and w8, w0, w20
1856 ; -O1: bl __atomic_compare_exchange
1857 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1861 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1862 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1863 ; -O0: and w8, w9, w8
1864 ; -O0: bl __atomic_compare_exchange
1866 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1867 ; -O1: and w8, w0, w20
1868 ; -O1: bl __atomic_compare_exchange
1869 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1873 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1874 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1875 ; -O0: and w8, w9, w8
1876 ; -O0: bl __atomic_compare_exchange
1878 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1879 ; -O1: and w8, w0, w20
1880 ; -O1: bl __atomic_compare_exchange
1881 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1885 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1886 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1887 ; -O0: and w8, w9, w8
1888 ; -O0: bl __atomic_compare_exchange
1890 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
1891 ; -O1: and w8, w0, w20
1892 ; -O1: bl __atomic_compare_exchange
1893 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
1897 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1898 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1899 ; -O0: and w8, w9, w8
1900 ; -O0: bl __atomic_compare_exchange
1902 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1903 ; -O1: and w8, w0, w20
1904 ; -O1: bl __atomic_compare_exchange
1905 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
1909 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1910 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1911 ; -O0: and w8, w9, w8
1912 ; -O0: bl __atomic_compare_exchange
1914 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1915 ; -O1: and w8, w0, w20
1916 ; -O1: bl __atomic_compare_exchange
1917 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
1921 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1922 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1923 ; -O0: and x8, x9, x8
1924 ; -O0: bl __atomic_compare_exchange
1926 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1927 ; -O1: and x8, x0, x20
1928 ; -O1: bl __atomic_compare_exchange
1929 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
1933 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1934 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
1935 ; -O0: and x8, x9, x8
1936 ; -O0: bl __atomic_compare_exchange
1938 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
1939 ; -O1: and x8, x0, x20
1940 ; -O1: bl __atomic_compare_exchange
1941 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
1945 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
1946 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
1947 ; -O0: and x8, x9, x8
1948 ; -O0: bl __atomic_compare_exchange
1950 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
1951 ; -O1: and x8, x0, x20
1952 ; -O1: bl __atomic_compare_exchange
1953 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
1957 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1958 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1959 ; -O0: and x8, x9, x8
1960 ; -O0: bl __atomic_compare_exchange
1962 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1963 ; -O1: and x8, x0, x20
1964 ; -O1: bl __atomic_compare_exchange
1965 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
1969 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1970 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1971 ; -O0: and x8, x9, x8
1972 ; -O0: bl __atomic_compare_exchange
1974 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1975 ; -O1: and x8, x0, x20
1976 ; -O1: bl __atomic_compare_exchange
1977 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
1981 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1982 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1983 ; -O0: and x8, x11, x8
1984 ; -O0: and x9, x10, x9
1985 ; -O0: bl __atomic_compare_exchange
1987 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1988 ; -O1: ldp x0, x1, [x0]
1989 ; -O1: and x8, x1, x19
1990 ; -O1: and x9, x0, x21
1991 ; -O1: bl __atomic_compare_exchange
1992 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
1996 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1997 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
1998 ; -O0: and x8, x11, x8
1999 ; -O0: and x9, x10, x9
2000 ; -O0: bl __atomic_compare_exchange
2002 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
2003 ; -O1: ldp x0, x1, [x0]
2004 ; -O1: and x8, x1, x19
2005 ; -O1: and x9, x0, x21
2006 ; -O1: bl __atomic_compare_exchange
2007 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
2011 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
2012 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
2013 ; -O0: and x8, x11, x8
2014 ; -O0: and x9, x10, x9
2015 ; -O0: bl __atomic_compare_exchange
2017 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
2018 ; -O1: ldp x0, x1, [x0]
2019 ; -O1: and x8, x1, x19
2020 ; -O1: and x9, x0, x21
2021 ; -O1: bl __atomic_compare_exchange
2022 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
2026 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2027 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2028 ; -O0: and x8, x11, x8
2029 ; -O0: and x9, x10, x9
2030 ; -O0: bl __atomic_compare_exchange
2032 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2033 ; -O1: ldp x0, x1, [x0]
2034 ; -O1: and x8, x1, x19
2035 ; -O1: and x9, x0, x21
2036 ; -O1: bl __atomic_compare_exchange
2037 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2041 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2042 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2043 ; -O0: and x8, x11, x8
2044 ; -O0: and x9, x10, x9
2045 ; -O0: bl __atomic_compare_exchange
2047 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2048 ; -O1: ldp x0, x1, [x0]
2049 ; -O1: and x8, x1, x19
2050 ; -O1: and x9, x0, x21
2051 ; -O1: bl __atomic_compare_exchange
2052 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2056 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2057 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2058 ; -O0: and w8, w9, w8
2060 ; -O0: casb w8, w10, [x11]
2061 ; -O0: subs w9, w8, w9, uxtb
2062 ; -O0: subs w9, w9, #1
2064 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2065 ; -O1: and w10, w8, w1
2067 ; -O1: casb w9, w10, [x0]
2068 ; -O1: cmp w9, w8, uxtb
2069 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2073 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2074 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2075 ; -O0: and w8, w9, w8
2077 ; -O0: casab w8, w10, [x11]
2078 ; -O0: subs w9, w8, w9, uxtb
2079 ; -O0: subs w9, w9, #1
2081 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2082 ; -O1: and w10, w8, w1
2084 ; -O1: casab w9, w10, [x0]
2085 ; -O1: cmp w9, w8, uxtb
2086 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2090 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2091 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2092 ; -O0: and w8, w9, w8
2094 ; -O0: caslb w8, w10, [x11]
2095 ; -O0: subs w9, w8, w9, uxtb
2096 ; -O0: subs w9, w9, #1
2098 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2099 ; -O1: and w10, w8, w1
2101 ; -O1: caslb w9, w10, [x0]
2102 ; -O1: cmp w9, w8, uxtb
2103 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2107 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2108 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2109 ; -O0: and w8, w9, w8
2111 ; -O0: casalb w8, w10, [x11]
2112 ; -O0: subs w9, w8, w9, uxtb
2113 ; -O0: subs w9, w9, #1
2115 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2116 ; -O1: and w10, w8, w1
2118 ; -O1: casalb w9, w10, [x0]
2119 ; -O1: cmp w9, w8, uxtb
2120 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2124 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2125 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2126 ; -O0: and w8, w9, w8
2128 ; -O0: casalb w8, w10, [x11]
2129 ; -O0: subs w9, w8, w9, uxtb
2130 ; -O0: subs w9, w9, #1
2132 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2133 ; -O1: and w10, w8, w1
2135 ; -O1: casalb w9, w10, [x0]
2136 ; -O1: cmp w9, w8, uxtb
2137 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2141 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2142 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2143 ; -O0: and w8, w9, w8
2145 ; -O0: cash w8, w10, [x11]
2146 ; -O0: subs w9, w8, w9, uxth
2147 ; -O0: subs w9, w9, #1
2149 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2150 ; -O1: and w10, w8, w1
2152 ; -O1: cash w9, w10, [x0]
2153 ; -O1: cmp w9, w8, uxth
2154 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2158 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2159 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2160 ; -O0: and w8, w9, w8
2162 ; -O0: casah w8, w10, [x11]
2163 ; -O0: subs w9, w8, w9, uxth
2164 ; -O0: subs w9, w9, #1
2166 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2167 ; -O1: and w10, w8, w1
2169 ; -O1: casah w9, w10, [x0]
2170 ; -O1: cmp w9, w8, uxth
2171 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2175 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2176 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2177 ; -O0: and w8, w9, w8
2179 ; -O0: caslh w8, w10, [x11]
2180 ; -O0: subs w9, w8, w9, uxth
2181 ; -O0: subs w9, w9, #1
2183 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2184 ; -O1: and w10, w8, w1
2186 ; -O1: caslh w9, w10, [x0]
2187 ; -O1: cmp w9, w8, uxth
2188 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2192 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2193 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2194 ; -O0: and w8, w9, w8
2196 ; -O0: casalh w8, w10, [x11]
2197 ; -O0: subs w9, w8, w9, uxth
2198 ; -O0: subs w9, w9, #1
2200 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2201 ; -O1: and w10, w8, w1
2203 ; -O1: casalh w9, w10, [x0]
2204 ; -O1: cmp w9, w8, uxth
2205 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2209 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2210 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2211 ; -O0: and w8, w9, w8
2213 ; -O0: casalh w8, w10, [x11]
2214 ; -O0: subs w9, w8, w9, uxth
2215 ; -O0: subs w9, w9, #1
2217 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2218 ; -O1: and w10, w8, w1
2220 ; -O1: casalh w9, w10, [x0]
2221 ; -O1: cmp w9, w8, uxth
2222 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2226 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2227 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2228 ; -O0: and w8, w9, w8
2230 ; -O0: cas w8, w10, [x11]
2231 ; -O0: subs w9, w8, w9
2232 ; -O0: subs w9, w9, #1
2234 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2235 ; -O1: and w10, w8, w1
2237 ; -O1: cas w9, w10, [x0]
2239 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2243 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2244 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2245 ; -O0: and w8, w9, w8
2247 ; -O0: casa w8, w10, [x11]
2248 ; -O0: subs w9, w8, w9
2249 ; -O0: subs w9, w9, #1
2251 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2252 ; -O1: and w10, w8, w1
2254 ; -O1: casa w9, w10, [x0]
2256 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2260 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2261 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2262 ; -O0: and w8, w9, w8
2264 ; -O0: casl w8, w10, [x11]
2265 ; -O0: subs w9, w8, w9
2266 ; -O0: subs w9, w9, #1
2268 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2269 ; -O1: and w10, w8, w1
2271 ; -O1: casl w9, w10, [x0]
2273 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2277 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2278 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2279 ; -O0: and w8, w9, w8
2281 ; -O0: casal w8, w10, [x11]
2282 ; -O0: subs w9, w8, w9
2283 ; -O0: subs w9, w9, #1
2285 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2286 ; -O1: and w10, w8, w1
2288 ; -O1: casal w9, w10, [x0]
2290 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2294 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2295 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2296 ; -O0: and w8, w9, w8
2298 ; -O0: casal w8, w10, [x11]
2299 ; -O0: subs w9, w8, w9
2300 ; -O0: subs w9, w9, #1
2302 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2303 ; -O1: and w10, w8, w1
2305 ; -O1: casal w9, w10, [x0]
2307 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2311 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2312 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2313 ; -O0: and x8, x9, x8
2315 ; -O0: cas x8, x10, [x11]
2316 ; -O0: subs x9, x8, x9
2317 ; -O0: subs w9, w9, #1
2319 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2320 ; -O1: and x10, x8, x1
2322 ; -O1: cas x9, x10, [x0]
2324 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2328 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2329 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2330 ; -O0: and x8, x9, x8
2332 ; -O0: casa x8, x10, [x11]
2333 ; -O0: subs x9, x8, x9
2334 ; -O0: subs w9, w9, #1
2336 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2337 ; -O1: and x10, x8, x1
2339 ; -O1: casa x9, x10, [x0]
2341 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2345 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2346 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2347 ; -O0: and x8, x9, x8
2349 ; -O0: casl x8, x10, [x11]
2350 ; -O0: subs x9, x8, x9
2351 ; -O0: subs w9, w9, #1
2353 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2354 ; -O1: and x10, x8, x1
2356 ; -O1: casl x9, x10, [x0]
2358 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2362 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2363 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2364 ; -O0: and x8, x9, x8
2366 ; -O0: casal x8, x10, [x11]
2367 ; -O0: subs x9, x8, x9
2368 ; -O0: subs w9, w9, #1
2370 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2371 ; -O1: and x10, x8, x1
2373 ; -O1: casal x9, x10, [x0]
2375 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2379 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2380 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2381 ; -O0: and x8, x9, x8
2383 ; -O0: casal x8, x10, [x11]
2384 ; -O0: subs x9, x8, x9
2385 ; -O0: subs w9, w9, #1
2387 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2388 ; -O1: and x10, x8, x1
2390 ; -O1: casal x9, x10, [x0]
2392 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2396 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2397 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2398 ; -O0: and x9, x10, x9
2399 ; -O0: and x12, x11, x12
2402 ; -O0: casp x0, x1, x2, x3, [x8]
2403 ; -O0: subs x11, x9, x11
2404 ; -O0: ccmp x8, x10, #0, eq
2406 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2407 ; -O1: ldp x4, x5, [x0]
2408 ; -O1: and x8, x4, x2
2409 ; -O1: and x9, x7, x3
2412 ; -O1: casp x4, x5, x10, x11, [x0]
2414 ; -O1: ccmp x5, x7, #0, eq
2415 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2419 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2420 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2421 ; -O0: and x9, x10, x9
2422 ; -O0: and x12, x11, x12
2425 ; -O0: caspa x0, x1, x2, x3, [x8]
2426 ; -O0: subs x11, x9, x11
2427 ; -O0: ccmp x8, x10, #0, eq
2429 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2430 ; -O1: ldp x4, x5, [x0]
2431 ; -O1: and x8, x4, x2
2432 ; -O1: and x9, x7, x3
2435 ; -O1: caspa x4, x5, x10, x11, [x0]
2437 ; -O1: ccmp x5, x7, #0, eq
2438 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2442 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2443 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2444 ; -O0: and x9, x10, x9
2445 ; -O0: and x12, x11, x12
2448 ; -O0: caspl x0, x1, x2, x3, [x8]
2449 ; -O0: subs x11, x9, x11
2450 ; -O0: ccmp x8, x10, #0, eq
2452 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2453 ; -O1: ldp x4, x5, [x0]
2454 ; -O1: and x8, x4, x2
2455 ; -O1: and x9, x7, x3
2458 ; -O1: caspl x4, x5, x10, x11, [x0]
2460 ; -O1: ccmp x5, x7, #0, eq
2461 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2465 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2466 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2467 ; -O0: and x9, x10, x9
2468 ; -O0: and x12, x11, x12
2471 ; -O0: caspal x0, x1, x2, x3, [x8]
2472 ; -O0: subs x11, x9, x11
2473 ; -O0: ccmp x8, x10, #0, eq
2475 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2476 ; -O1: ldp x4, x5, [x0]
2477 ; -O1: and x8, x4, x2
2478 ; -O1: and x9, x7, x3
2481 ; -O1: caspal x4, x5, x10, x11, [x0]
2483 ; -O1: ccmp x5, x7, #0, eq
2484 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2488 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2489 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2490 ; -O0: and x9, x10, x9
2491 ; -O0: and x12, x11, x12
2494 ; -O0: caspal x0, x1, x2, x3, [x8]
2495 ; -O0: subs x11, x9, x11
2496 ; -O0: ccmp x8, x10, #0, eq
2498 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2499 ; -O1: ldp x4, x5, [x0]
2500 ; -O1: and x8, x4, x2
2501 ; -O1: and x9, x7, x3
2504 ; -O1: caspal x4, x5, x10, x11, [x0]
2506 ; -O1: ccmp x5, x7, #0, eq
2507 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2511 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2512 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2513 ; -O0: and w8, w9, w8
2515 ; -O0: casb w8, w10, [x11]
2516 ; -O0: subs w9, w8, w9, uxtb
2517 ; -O0: subs w9, w9, #1
2519 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2520 ; -O1: and w10, w8, w1
2522 ; -O1: casb w9, w10, [x0]
2523 ; -O1: cmp w9, w8, uxtb
2524 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2528 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2529 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2530 ; -O0: and w8, w9, w8
2532 ; -O0: casab w8, w10, [x11]
2533 ; -O0: subs w9, w8, w9, uxtb
2534 ; -O0: subs w9, w9, #1
2536 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2537 ; -O1: and w10, w8, w1
2539 ; -O1: casab w9, w10, [x0]
2540 ; -O1: cmp w9, w8, uxtb
2541 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2545 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2546 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2547 ; -O0: and w8, w9, w8
2549 ; -O0: caslb w8, w10, [x11]
2550 ; -O0: subs w9, w8, w9, uxtb
2551 ; -O0: subs w9, w9, #1
2553 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2554 ; -O1: and w10, w8, w1
2556 ; -O1: caslb w9, w10, [x0]
2557 ; -O1: cmp w9, w8, uxtb
2558 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2562 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2563 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2564 ; -O0: and w8, w9, w8
2566 ; -O0: casalb w8, w10, [x11]
2567 ; -O0: subs w9, w8, w9, uxtb
2568 ; -O0: subs w9, w9, #1
2570 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2571 ; -O1: and w10, w8, w1
2573 ; -O1: casalb w9, w10, [x0]
2574 ; -O1: cmp w9, w8, uxtb
2575 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2579 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2580 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2581 ; -O0: and w8, w9, w8
2583 ; -O0: casalb w8, w10, [x11]
2584 ; -O0: subs w9, w8, w9, uxtb
2585 ; -O0: subs w9, w9, #1
2587 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2588 ; -O1: and w10, w8, w1
2590 ; -O1: casalb w9, w10, [x0]
2591 ; -O1: cmp w9, w8, uxtb
2592 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2596 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2597 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2598 ; -O0: and w8, w9, w8
2600 ; -O0: bl __atomic_compare_exchange
2602 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2603 ; -O1: and w8, w0, w20
2605 ; -O1: bl __atomic_compare_exchange
2606 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2610 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2611 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2612 ; -O0: and w8, w9, w8
2614 ; -O0: bl __atomic_compare_exchange
2616 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2617 ; -O1: and w8, w0, w20
2619 ; -O1: bl __atomic_compare_exchange
2620 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2624 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2625 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2626 ; -O0: and w8, w9, w8
2628 ; -O0: bl __atomic_compare_exchange
2630 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2631 ; -O1: and w8, w0, w20
2633 ; -O1: bl __atomic_compare_exchange
2634 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2638 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2639 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2640 ; -O0: and w8, w9, w8
2642 ; -O0: bl __atomic_compare_exchange
2644 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2645 ; -O1: and w8, w0, w20
2647 ; -O1: bl __atomic_compare_exchange
2648 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2652 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2653 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2654 ; -O0: and w8, w9, w8
2656 ; -O0: bl __atomic_compare_exchange
2658 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2659 ; -O1: and w8, w0, w20
2661 ; -O1: bl __atomic_compare_exchange
2662 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2666 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2667 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2668 ; -O0: and w8, w9, w8
2670 ; -O0: bl __atomic_compare_exchange
2672 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2673 ; -O1: and w8, w0, w20
2675 ; -O1: bl __atomic_compare_exchange
2676 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2680 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2681 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2682 ; -O0: and w8, w9, w8
2684 ; -O0: bl __atomic_compare_exchange
2686 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2687 ; -O1: and w8, w0, w20
2689 ; -O1: bl __atomic_compare_exchange
2690 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2694 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2695 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2696 ; -O0: and w8, w9, w8
2698 ; -O0: bl __atomic_compare_exchange
2700 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2701 ; -O1: and w8, w0, w20
2703 ; -O1: bl __atomic_compare_exchange
2704 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2708 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2709 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2710 ; -O0: and w8, w9, w8
2712 ; -O0: bl __atomic_compare_exchange
2714 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2715 ; -O1: and w8, w0, w20
2717 ; -O1: bl __atomic_compare_exchange
2718 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2722 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2723 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2724 ; -O0: and w8, w9, w8
2726 ; -O0: bl __atomic_compare_exchange
2728 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2729 ; -O1: and w8, w0, w20
2731 ; -O1: bl __atomic_compare_exchange
2732 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2736 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2737 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2738 ; -O0: and x8, x9, x8
2740 ; -O0: bl __atomic_compare_exchange
2742 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2743 ; -O1: and x8, x0, x20
2745 ; -O1: bl __atomic_compare_exchange
2746 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2750 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2751 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2752 ; -O0: and x8, x9, x8
2754 ; -O0: bl __atomic_compare_exchange
2756 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2757 ; -O1: and x8, x0, x20
2759 ; -O1: bl __atomic_compare_exchange
2760 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2764 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2765 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2766 ; -O0: and x8, x9, x8
2768 ; -O0: bl __atomic_compare_exchange
2770 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2771 ; -O1: and x8, x0, x20
2773 ; -O1: bl __atomic_compare_exchange
2774 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2778 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2779 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2780 ; -O0: and x8, x9, x8
2782 ; -O0: bl __atomic_compare_exchange
2784 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2785 ; -O1: and x8, x0, x20
2787 ; -O1: bl __atomic_compare_exchange
2788 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2792 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2793 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2794 ; -O0: and x8, x9, x8
2796 ; -O0: bl __atomic_compare_exchange
2798 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2799 ; -O1: and x8, x0, x20
2801 ; -O1: bl __atomic_compare_exchange
2802 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2806 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2807 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2808 ; -O0: and x9, x11, x9
2809 ; -O0: and x8, x10, x8
2812 ; -O0: bl __atomic_compare_exchange
2814 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2815 ; -O1: ldp x0, x1, [x0]
2816 ; -O1: and x8, x1, x19
2817 ; -O1: and x9, x0, x21
2820 ; -O1: bl __atomic_compare_exchange
2821 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2825 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2826 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2827 ; -O0: and x9, x11, x9
2828 ; -O0: and x8, x10, x8
2831 ; -O0: bl __atomic_compare_exchange
2833 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2834 ; -O1: ldp x0, x1, [x0]
2835 ; -O1: and x8, x1, x19
2836 ; -O1: and x9, x0, x21
2839 ; -O1: bl __atomic_compare_exchange
2840 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2844 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2845 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2846 ; -O0: and x9, x11, x9
2847 ; -O0: and x8, x10, x8
2850 ; -O0: bl __atomic_compare_exchange
2852 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2853 ; -O1: ldp x0, x1, [x0]
2854 ; -O1: and x8, x1, x19
2855 ; -O1: and x9, x0, x21
2858 ; -O1: bl __atomic_compare_exchange
2859 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2863 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2864 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2865 ; -O0: and x9, x11, x9
2866 ; -O0: and x8, x10, x8
2869 ; -O0: bl __atomic_compare_exchange
2871 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2872 ; -O1: ldp x0, x1, [x0]
2873 ; -O1: and x8, x1, x19
2874 ; -O1: and x9, x0, x21
2877 ; -O1: bl __atomic_compare_exchange
2878 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2882 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2883 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2884 ; -O0: and x9, x11, x9
2885 ; -O0: and x8, x10, x8
2888 ; -O0: bl __atomic_compare_exchange
2890 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2891 ; -O1: ldp x0, x1, [x0]
2892 ; -O1: and x8, x1, x19
2893 ; -O1: and x9, x0, x21
2896 ; -O1: bl __atomic_compare_exchange
2897 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2901 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2902 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2903 ; CHECK: ldsetb w1, w0, [x0]
2904 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2908 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
2909 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
2910 ; CHECK: ldsetab w1, w0, [x0]
2911 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2915 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
2916 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
2917 ; CHECK: ldsetlb w1, w0, [x0]
2918 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2922 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2923 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
2924 ; CHECK: ldsetalb w1, w0, [x0]
2925 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2929 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2930 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
2931 ; CHECK: ldsetalb w1, w0, [x0]
2932 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
2936 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2937 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
2938 ; CHECK: ldseth w1, w0, [x0]
2939 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
2943 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
2944 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
2945 ; CHECK: ldsetah w1, w0, [x0]
2946 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
2950 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
2951 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
2952 ; CHECK: ldsetlh w1, w0, [x0]
2953 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
2957 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2958 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
2959 ; CHECK: ldsetalh w1, w0, [x0]
2960 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
2964 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2965 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
2966 ; CHECK: ldsetalh w1, w0, [x0]
2967 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
2971 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2972 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
2973 ; CHECK: ldset w1, w0, [x0]
2974 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
2978 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
2979 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
2980 ; CHECK: ldseta w1, w0, [x0]
2981 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
2985 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
2986 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
2987 ; CHECK: ldsetl w1, w0, [x0]
2988 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
2992 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2993 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
2994 ; CHECK: ldsetal w1, w0, [x0]
2995 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
2999 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3000 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
3001 ; CHECK: ldsetal w1, w0, [x0]
3002 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
3006 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3007 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
3008 ; CHECK: ldset x1, x0, [x0]
3009 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
3013 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
3014 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
3015 ; CHECK: ldseta x1, x0, [x0]
3016 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
3020 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
3021 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
3022 ; CHECK: ldsetl x1, x0, [x0]
3023 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
3027 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3028 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
3029 ; CHECK: ldsetal x1, x0, [x0]
3030 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
3034 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3035 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
3036 ; CHECK: ldsetal x1, x0, [x0]
3037 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
3041 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3042 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
3043 ; -O0: orr x2, x11, x12
3044 ; -O0: orr x9, x10, x9
3045 ; -O0: casp x0, x1, x2, x3, [x8]
3046 ; -O0: subs x11, x9, x11
3047 ; -O0: ccmp x8, x10, #0, eq
3049 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
3050 ; -O1: ldp x4, x5, [x0]
3051 ; -O1: orr x8, x4, x2
3052 ; -O1: orr x9, x7, x3
3053 ; -O1: casp x4, x5, x8, x9, [x0]
3055 ; -O1: ccmp x5, x7, #0, eq
3056 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
3060 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
3061 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
3062 ; -O0: orr x2, x11, x12
3063 ; -O0: orr x9, x10, x9
3064 ; -O0: caspa x0, x1, x2, x3, [x8]
3065 ; -O0: subs x11, x9, x11
3066 ; -O0: ccmp x8, x10, #0, eq
3068 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
3069 ; -O1: ldp x4, x5, [x0]
3070 ; -O1: orr x8, x4, x2
3071 ; -O1: orr x9, x7, x3
3072 ; -O1: caspa x4, x5, x8, x9, [x0]
3074 ; -O1: ccmp x5, x7, #0, eq
3075 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
3079 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
3080 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
3081 ; -O0: orr x2, x11, x12
3082 ; -O0: orr x9, x10, x9
3083 ; -O0: caspl x0, x1, x2, x3, [x8]
3084 ; -O0: subs x11, x9, x11
3085 ; -O0: ccmp x8, x10, #0, eq
3087 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
3088 ; -O1: ldp x4, x5, [x0]
3089 ; -O1: orr x8, x4, x2
3090 ; -O1: orr x9, x7, x3
3091 ; -O1: caspl x4, x5, x8, x9, [x0]
3093 ; -O1: ccmp x5, x7, #0, eq
3094 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
3098 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3099 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3100 ; -O0: orr x2, x11, x12
3101 ; -O0: orr x9, x10, x9
3102 ; -O0: caspal x0, x1, x2, x3, [x8]
3103 ; -O0: subs x11, x9, x11
3104 ; -O0: ccmp x8, x10, #0, eq
3106 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3107 ; -O1: ldp x4, x5, [x0]
3108 ; -O1: orr x8, x4, x2
3109 ; -O1: orr x9, x7, x3
3110 ; -O1: caspal x4, x5, x8, x9, [x0]
3112 ; -O1: ccmp x5, x7, #0, eq
3113 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
3117 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3118 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3119 ; -O0: orr x2, x11, x12
3120 ; -O0: orr x9, x10, x9
3121 ; -O0: caspal x0, x1, x2, x3, [x8]
3122 ; -O0: subs x11, x9, x11
3123 ; -O0: ccmp x8, x10, #0, eq
3125 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3126 ; -O1: ldp x4, x5, [x0]
3127 ; -O1: orr x8, x4, x2
3128 ; -O1: orr x9, x7, x3
3129 ; -O1: caspal x4, x5, x8, x9, [x0]
3131 ; -O1: ccmp x5, x7, #0, eq
3132 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
3136 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3137 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
3138 ; CHECK: ldsetb w1, w0, [x0]
3139 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3143 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3144 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
3145 ; CHECK: ldsetab w1, w0, [x0]
3146 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3150 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3151 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3152 ; CHECK: ldsetlb w1, w0, [x0]
3153 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3157 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3158 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3159 ; CHECK: ldsetalb w1, w0, [x0]
3160 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3164 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3165 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3166 ; CHECK: ldsetalb w1, w0, [x0]
3167 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3171 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3172 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3173 ; -O0: orr w8, w9, w8
3174 ; -O0: bl __atomic_compare_exchange
3176 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3177 ; -O1: orr w8, w0, w20
3178 ; -O1: bl __atomic_compare_exchange
3179 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3183 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3184 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3185 ; -O0: orr w8, w9, w8
3186 ; -O0: bl __atomic_compare_exchange
3188 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3189 ; -O1: orr w8, w0, w20
3190 ; -O1: bl __atomic_compare_exchange
3191 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3195 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3196 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3197 ; -O0: orr w8, w9, w8
3198 ; -O0: bl __atomic_compare_exchange
3200 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3201 ; -O1: orr w8, w0, w20
3202 ; -O1: bl __atomic_compare_exchange
3203 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3207 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3208 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3209 ; -O0: orr w8, w9, w8
3210 ; -O0: bl __atomic_compare_exchange
3212 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3213 ; -O1: orr w8, w0, w20
3214 ; -O1: bl __atomic_compare_exchange
3215 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3219 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3220 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3221 ; -O0: orr w8, w9, w8
3222 ; -O0: bl __atomic_compare_exchange
3224 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3225 ; -O1: orr w8, w0, w20
3226 ; -O1: bl __atomic_compare_exchange
3227 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3231 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3232 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3233 ; -O0: orr w8, w9, w8
3234 ; -O0: bl __atomic_compare_exchange
3236 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3237 ; -O1: orr w8, w0, w20
3238 ; -O1: bl __atomic_compare_exchange
3239 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3243 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3244 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3245 ; -O0: orr w8, w9, w8
3246 ; -O0: bl __atomic_compare_exchange
3248 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3249 ; -O1: orr w8, w0, w20
3250 ; -O1: bl __atomic_compare_exchange
3251 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3255 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3256 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3257 ; -O0: orr w8, w9, w8
3258 ; -O0: bl __atomic_compare_exchange
3260 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3261 ; -O1: orr w8, w0, w20
3262 ; -O1: bl __atomic_compare_exchange
3263 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3267 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3268 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3269 ; -O0: orr w8, w9, w8
3270 ; -O0: bl __atomic_compare_exchange
3272 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3273 ; -O1: orr w8, w0, w20
3274 ; -O1: bl __atomic_compare_exchange
3275 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3279 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3280 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3281 ; -O0: orr w8, w9, w8
3282 ; -O0: bl __atomic_compare_exchange
3284 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3285 ; -O1: orr w8, w0, w20
3286 ; -O1: bl __atomic_compare_exchange
3287 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3291 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3292 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3293 ; -O0: orr x8, x9, x8
3294 ; -O0: bl __atomic_compare_exchange
3296 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3297 ; -O1: orr x8, x0, x20
3298 ; -O1: bl __atomic_compare_exchange
3299 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3303 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3304 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3305 ; -O0: orr x8, x9, x8
3306 ; -O0: bl __atomic_compare_exchange
3308 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3309 ; -O1: orr x8, x0, x20
3310 ; -O1: bl __atomic_compare_exchange
3311 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3315 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3316 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3317 ; -O0: orr x8, x9, x8
3318 ; -O0: bl __atomic_compare_exchange
3320 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3321 ; -O1: orr x8, x0, x20
3322 ; -O1: bl __atomic_compare_exchange
3323 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3327 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3328 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3329 ; -O0: orr x8, x9, x8
3330 ; -O0: bl __atomic_compare_exchange
3332 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3333 ; -O1: orr x8, x0, x20
3334 ; -O1: bl __atomic_compare_exchange
3335 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3339 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3340 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3341 ; -O0: orr x8, x9, x8
3342 ; -O0: bl __atomic_compare_exchange
3344 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3345 ; -O1: orr x8, x0, x20
3346 ; -O1: bl __atomic_compare_exchange
3347 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3351 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3352 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3353 ; -O0: orr x8, x11, x8
3354 ; -O0: orr x9, x10, x9
3355 ; -O0: bl __atomic_compare_exchange
3357 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3358 ; -O1: ldp x0, x1, [x0]
3359 ; -O1: orr x8, x1, x19
3360 ; -O1: orr x9, x0, x21
3361 ; -O1: bl __atomic_compare_exchange
3362 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3366 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3367 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3368 ; -O0: orr x8, x11, x8
3369 ; -O0: orr x9, x10, x9
3370 ; -O0: bl __atomic_compare_exchange
3372 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3373 ; -O1: ldp x0, x1, [x0]
3374 ; -O1: orr x8, x1, x19
3375 ; -O1: orr x9, x0, x21
3376 ; -O1: bl __atomic_compare_exchange
3377 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3381 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3382 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3383 ; -O0: orr x8, x11, x8
3384 ; -O0: orr x9, x10, x9
3385 ; -O0: bl __atomic_compare_exchange
3387 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3388 ; -O1: ldp x0, x1, [x0]
3389 ; -O1: orr x8, x1, x19
3390 ; -O1: orr x9, x0, x21
3391 ; -O1: bl __atomic_compare_exchange
3392 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3396 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3397 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3398 ; -O0: orr x8, x11, x8
3399 ; -O0: orr x9, x10, x9
3400 ; -O0: bl __atomic_compare_exchange
3402 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3403 ; -O1: ldp x0, x1, [x0]
3404 ; -O1: orr x8, x1, x19
3405 ; -O1: orr x9, x0, x21
3406 ; -O1: bl __atomic_compare_exchange
3407 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3411 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3412 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3413 ; -O0: orr x8, x11, x8
3414 ; -O0: orr x9, x10, x9
3415 ; -O0: bl __atomic_compare_exchange
3417 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3418 ; -O1: ldp x0, x1, [x0]
3419 ; -O1: orr x8, x1, x19
3420 ; -O1: orr x9, x0, x21
3421 ; -O1: bl __atomic_compare_exchange
3422 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3426 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3427 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3428 ; CHECK: ldeorb w1, w0, [x0]
3429 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3433 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3434 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3435 ; CHECK: ldeorab w1, w0, [x0]
3436 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3440 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3441 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3442 ; CHECK: ldeorlb w1, w0, [x0]
3443 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3447 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3448 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3449 ; CHECK: ldeoralb w1, w0, [x0]
3450 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3454 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3455 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3456 ; CHECK: ldeoralb w1, w0, [x0]
3457 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3461 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3462 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3463 ; CHECK: ldeorh w1, w0, [x0]
3464 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3468 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3469 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3470 ; CHECK: ldeorah w1, w0, [x0]
3471 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3475 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3476 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3477 ; CHECK: ldeorlh w1, w0, [x0]
3478 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3482 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3483 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3484 ; CHECK: ldeoralh w1, w0, [x0]
3485 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3489 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3490 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3491 ; CHECK: ldeoralh w1, w0, [x0]
3492 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3496 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3497 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3498 ; CHECK: ldeor w1, w0, [x0]
3499 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3503 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3504 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3505 ; CHECK: ldeora w1, w0, [x0]
3506 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3510 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3511 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3512 ; CHECK: ldeorl w1, w0, [x0]
3513 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3517 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3518 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3519 ; CHECK: ldeoral w1, w0, [x0]
3520 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3524 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3525 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3526 ; CHECK: ldeoral w1, w0, [x0]
3527 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3531 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3532 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3533 ; CHECK: ldeor x1, x0, [x0]
3534 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3538 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3539 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3540 ; CHECK: ldeora x1, x0, [x0]
3541 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3545 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3546 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3547 ; CHECK: ldeorl x1, x0, [x0]
3548 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3552 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3553 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3554 ; CHECK: ldeoral x1, x0, [x0]
3555 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3559 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3560 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3561 ; CHECK: ldeoral x1, x0, [x0]
3562 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3566 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3567 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3568 ; -O0: eor x2, x11, x12
3569 ; -O0: eor x9, x10, x9
3570 ; -O0: casp x0, x1, x2, x3, [x8]
3571 ; -O0: subs x11, x9, x11
3572 ; -O0: ccmp x8, x10, #0, eq
3574 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3575 ; -O1: ldp x4, x5, [x0]
3576 ; -O1: eor x8, x4, x2
3577 ; -O1: eor x9, x7, x3
3578 ; -O1: casp x4, x5, x8, x9, [x0]
3580 ; -O1: ccmp x5, x7, #0, eq
3581 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3585 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3586 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3587 ; -O0: eor x2, x11, x12
3588 ; -O0: eor x9, x10, x9
3589 ; -O0: caspa x0, x1, x2, x3, [x8]
3590 ; -O0: subs x11, x9, x11
3591 ; -O0: ccmp x8, x10, #0, eq
3593 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3594 ; -O1: ldp x4, x5, [x0]
3595 ; -O1: eor x8, x4, x2
3596 ; -O1: eor x9, x7, x3
3597 ; -O1: caspa x4, x5, x8, x9, [x0]
3599 ; -O1: ccmp x5, x7, #0, eq
3600 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3604 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3605 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3606 ; -O0: eor x2, x11, x12
3607 ; -O0: eor x9, x10, x9
3608 ; -O0: caspl x0, x1, x2, x3, [x8]
3609 ; -O0: subs x11, x9, x11
3610 ; -O0: ccmp x8, x10, #0, eq
3612 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3613 ; -O1: ldp x4, x5, [x0]
3614 ; -O1: eor x8, x4, x2
3615 ; -O1: eor x9, x7, x3
3616 ; -O1: caspl x4, x5, x8, x9, [x0]
3618 ; -O1: ccmp x5, x7, #0, eq
3619 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3623 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3624 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3625 ; -O0: eor x2, x11, x12
3626 ; -O0: eor x9, x10, x9
3627 ; -O0: caspal x0, x1, x2, x3, [x8]
3628 ; -O0: subs x11, x9, x11
3629 ; -O0: ccmp x8, x10, #0, eq
3631 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3632 ; -O1: ldp x4, x5, [x0]
3633 ; -O1: eor x8, x4, x2
3634 ; -O1: eor x9, x7, x3
3635 ; -O1: caspal x4, x5, x8, x9, [x0]
3637 ; -O1: ccmp x5, x7, #0, eq
3638 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3642 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3643 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3644 ; -O0: eor x2, x11, x12
3645 ; -O0: eor x9, x10, x9
3646 ; -O0: caspal x0, x1, x2, x3, [x8]
3647 ; -O0: subs x11, x9, x11
3648 ; -O0: ccmp x8, x10, #0, eq
3650 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3651 ; -O1: ldp x4, x5, [x0]
3652 ; -O1: eor x8, x4, x2
3653 ; -O1: eor x9, x7, x3
3654 ; -O1: caspal x4, x5, x8, x9, [x0]
3656 ; -O1: ccmp x5, x7, #0, eq
3657 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3661 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3662 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3663 ; CHECK: ldeorb w1, w0, [x0]
3664 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3668 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3669 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3670 ; CHECK: ldeorab w1, w0, [x0]
3671 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3675 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3676 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3677 ; CHECK: ldeorlb w1, w0, [x0]
3678 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3682 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3683 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3684 ; CHECK: ldeoralb w1, w0, [x0]
3685 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3689 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3690 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3691 ; CHECK: ldeoralb w1, w0, [x0]
3692 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3696 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3697 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3698 ; -O0: eor w8, w9, w8
3699 ; -O0: bl __atomic_compare_exchange
3701 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3702 ; -O1: eor w8, w0, w20
3703 ; -O1: bl __atomic_compare_exchange
3704 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3708 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3709 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3710 ; -O0: eor w8, w9, w8
3711 ; -O0: bl __atomic_compare_exchange
3713 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3714 ; -O1: eor w8, w0, w20
3715 ; -O1: bl __atomic_compare_exchange
3716 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3720 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3721 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3722 ; -O0: eor w8, w9, w8
3723 ; -O0: bl __atomic_compare_exchange
3725 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3726 ; -O1: eor w8, w0, w20
3727 ; -O1: bl __atomic_compare_exchange
3728 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3732 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3733 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3734 ; -O0: eor w8, w9, w8
3735 ; -O0: bl __atomic_compare_exchange
3737 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3738 ; -O1: eor w8, w0, w20
3739 ; -O1: bl __atomic_compare_exchange
3740 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3744 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3745 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3746 ; -O0: eor w8, w9, w8
3747 ; -O0: bl __atomic_compare_exchange
3749 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3750 ; -O1: eor w8, w0, w20
3751 ; -O1: bl __atomic_compare_exchange
3752 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3756 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3757 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3758 ; -O0: eor w8, w9, w8
3759 ; -O0: bl __atomic_compare_exchange
3761 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3762 ; -O1: eor w8, w0, w20
3763 ; -O1: bl __atomic_compare_exchange
3764 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3768 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3769 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3770 ; -O0: eor w8, w9, w8
3771 ; -O0: bl __atomic_compare_exchange
3773 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3774 ; -O1: eor w8, w0, w20
3775 ; -O1: bl __atomic_compare_exchange
3776 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3780 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3781 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3782 ; -O0: eor w8, w9, w8
3783 ; -O0: bl __atomic_compare_exchange
3785 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3786 ; -O1: eor w8, w0, w20
3787 ; -O1: bl __atomic_compare_exchange
3788 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3792 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3793 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3794 ; -O0: eor w8, w9, w8
3795 ; -O0: bl __atomic_compare_exchange
3797 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3798 ; -O1: eor w8, w0, w20
3799 ; -O1: bl __atomic_compare_exchange
3800 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3804 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3805 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3806 ; -O0: eor w8, w9, w8
3807 ; -O0: bl __atomic_compare_exchange
3809 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3810 ; -O1: eor w8, w0, w20
3811 ; -O1: bl __atomic_compare_exchange
3812 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3816 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3817 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3818 ; -O0: eor x8, x9, x8
3819 ; -O0: bl __atomic_compare_exchange
3821 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3822 ; -O1: eor x8, x0, x20
3823 ; -O1: bl __atomic_compare_exchange
3824 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3828 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3829 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3830 ; -O0: eor x8, x9, x8
3831 ; -O0: bl __atomic_compare_exchange
3833 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3834 ; -O1: eor x8, x0, x20
3835 ; -O1: bl __atomic_compare_exchange
3836 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3840 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3841 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3842 ; -O0: eor x8, x9, x8
3843 ; -O0: bl __atomic_compare_exchange
3845 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3846 ; -O1: eor x8, x0, x20
3847 ; -O1: bl __atomic_compare_exchange
3848 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3852 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3853 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3854 ; -O0: eor x8, x9, x8
3855 ; -O0: bl __atomic_compare_exchange
3857 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3858 ; -O1: eor x8, x0, x20
3859 ; -O1: bl __atomic_compare_exchange
3860 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3864 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3865 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3866 ; -O0: eor x8, x9, x8
3867 ; -O0: bl __atomic_compare_exchange
3869 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3870 ; -O1: eor x8, x0, x20
3871 ; -O1: bl __atomic_compare_exchange
3872 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3876 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3877 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3878 ; -O0: eor x8, x11, x8
3879 ; -O0: eor x9, x10, x9
3880 ; -O0: bl __atomic_compare_exchange
3882 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3883 ; -O1: ldp x0, x1, [x0]
3884 ; -O1: eor x8, x1, x19
3885 ; -O1: eor x9, x0, x21
3886 ; -O1: bl __atomic_compare_exchange
3887 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
3891 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3892 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3893 ; -O0: eor x8, x11, x8
3894 ; -O0: eor x9, x10, x9
3895 ; -O0: bl __atomic_compare_exchange
3897 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3898 ; -O1: ldp x0, x1, [x0]
3899 ; -O1: eor x8, x1, x19
3900 ; -O1: eor x9, x0, x21
3901 ; -O1: bl __atomic_compare_exchange
3902 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
3906 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
3907 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
3908 ; -O0: eor x8, x11, x8
3909 ; -O0: eor x9, x10, x9
3910 ; -O0: bl __atomic_compare_exchange
3912 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
3913 ; -O1: ldp x0, x1, [x0]
3914 ; -O1: eor x8, x1, x19
3915 ; -O1: eor x9, x0, x21
3916 ; -O1: bl __atomic_compare_exchange
3917 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
3921 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3922 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3923 ; -O0: eor x8, x11, x8
3924 ; -O0: eor x9, x10, x9
3925 ; -O0: bl __atomic_compare_exchange
3927 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3928 ; -O1: ldp x0, x1, [x0]
3929 ; -O1: eor x8, x1, x19
3930 ; -O1: eor x9, x0, x21
3931 ; -O1: bl __atomic_compare_exchange
3932 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
3936 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3937 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3938 ; -O0: eor x8, x11, x8
3939 ; -O0: eor x9, x10, x9
3940 ; -O0: bl __atomic_compare_exchange
3942 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3943 ; -O1: ldp x0, x1, [x0]
3944 ; -O1: eor x8, x1, x19
3945 ; -O1: eor x9, x0, x21
3946 ; -O1: bl __atomic_compare_exchange
3947 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
3951 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3952 ; CHECK-LABEL: atomicrmw_max_i8_aligned_monotonic:
3953 ; CHECK: ldsmaxb w1, w0, [x0]
3954 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
3958 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
3959 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acquire:
3960 ; CHECK: ldsmaxab w1, w0, [x0]
3961 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
3965 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
3966 ; CHECK-LABEL: atomicrmw_max_i8_aligned_release:
3967 ; CHECK: ldsmaxlb w1, w0, [x0]
3968 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
3972 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3973 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acq_rel:
3974 ; CHECK: ldsmaxalb w1, w0, [x0]
3975 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
3979 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3980 ; CHECK-LABEL: atomicrmw_max_i8_aligned_seq_cst:
3981 ; CHECK: ldsmaxalb w1, w0, [x0]
3982 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
3986 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3987 ; CHECK-LABEL: atomicrmw_max_i16_aligned_monotonic:
3988 ; CHECK: ldsmaxh w1, w0, [x0]
3989 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
3993 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
3994 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acquire:
3995 ; CHECK: ldsmaxah w1, w0, [x0]
3996 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
4000 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
4001 ; CHECK-LABEL: atomicrmw_max_i16_aligned_release:
4002 ; CHECK: ldsmaxlh w1, w0, [x0]
4003 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
4007 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4008 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acq_rel:
4009 ; CHECK: ldsmaxalh w1, w0, [x0]
4010 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
4014 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4015 ; CHECK-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4016 ; CHECK: ldsmaxalh w1, w0, [x0]
4017 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
4021 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4022 ; CHECK-LABEL: atomicrmw_max_i32_aligned_monotonic:
4023 ; CHECK: ldsmax w1, w0, [x0]
4024 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
4028 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
4029 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acquire:
4030 ; CHECK: ldsmaxa w1, w0, [x0]
4031 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
4035 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
4036 ; CHECK-LABEL: atomicrmw_max_i32_aligned_release:
4037 ; CHECK: ldsmaxl w1, w0, [x0]
4038 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
4042 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4043 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4044 ; CHECK: ldsmaxal w1, w0, [x0]
4045 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
4049 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4050 ; CHECK-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4051 ; CHECK: ldsmaxal w1, w0, [x0]
4052 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
4056 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4057 ; CHECK-LABEL: atomicrmw_max_i64_aligned_monotonic:
4058 ; CHECK: ldsmax x1, x0, [x0]
4059 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
4063 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
4064 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acquire:
4065 ; CHECK: ldsmaxa x1, x0, [x0]
4066 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
4070 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
4071 ; CHECK-LABEL: atomicrmw_max_i64_aligned_release:
4072 ; CHECK: ldsmaxl x1, x0, [x0]
4073 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
4077 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4078 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4079 ; CHECK: ldsmaxal x1, x0, [x0]
4080 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
4084 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4085 ; CHECK-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4086 ; CHECK: ldsmaxal x1, x0, [x0]
4087 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
4091 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4092 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
4093 ; -O0: subs x13, x9, x10
4094 ; -O0: csel x9, x10, x9, lt
4095 ; -O0: csel x2, x11, x12, lt
4096 ; -O0: casp x0, x1, x2, x3, [x8]
4097 ; -O0: subs x11, x9, x11
4098 ; -O0: ccmp x8, x10, #0, eq
4100 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
4101 ; -O1: ldp x4, x5, [x0]
4103 ; -O1: csel x9, x7, x3, lt
4104 ; -O1: csel x8, x4, x2, lt
4105 ; -O1: casp x4, x5, x8, x9, [x0]
4107 ; -O1: ccmp x5, x7, #0, eq
4108 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
4112 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
4113 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
4114 ; -O0: subs x13, x9, x10
4115 ; -O0: csel x9, x10, x9, lt
4116 ; -O0: csel x2, x11, x12, lt
4117 ; -O0: caspa x0, x1, x2, x3, [x8]
4118 ; -O0: subs x11, x9, x11
4119 ; -O0: ccmp x8, x10, #0, eq
4121 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
4122 ; -O1: ldp x4, x5, [x0]
4124 ; -O1: csel x9, x7, x3, lt
4125 ; -O1: csel x8, x4, x2, lt
4126 ; -O1: caspa x4, x5, x8, x9, [x0]
4128 ; -O1: ccmp x5, x7, #0, eq
4129 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4133 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4134 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4135 ; -O0: subs x13, x9, x10
4136 ; -O0: csel x9, x10, x9, lt
4137 ; -O0: csel x2, x11, x12, lt
4138 ; -O0: caspl x0, x1, x2, x3, [x8]
4139 ; -O0: subs x11, x9, x11
4140 ; -O0: ccmp x8, x10, #0, eq
4142 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
4143 ; -O1: ldp x4, x5, [x0]
4145 ; -O1: csel x9, x7, x3, lt
4146 ; -O1: csel x8, x4, x2, lt
4147 ; -O1: caspl x4, x5, x8, x9, [x0]
4149 ; -O1: ccmp x5, x7, #0, eq
4150 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4154 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4155 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4156 ; -O0: subs x13, x9, x10
4157 ; -O0: csel x9, x10, x9, lt
4158 ; -O0: csel x2, x11, x12, lt
4159 ; -O0: caspal x0, x1, x2, x3, [x8]
4160 ; -O0: subs x11, x9, x11
4161 ; -O0: ccmp x8, x10, #0, eq
4163 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4164 ; -O1: ldp x4, x5, [x0]
4166 ; -O1: csel x9, x7, x3, lt
4167 ; -O1: csel x8, x4, x2, lt
4168 ; -O1: caspal x4, x5, x8, x9, [x0]
4170 ; -O1: ccmp x5, x7, #0, eq
4171 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4175 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4176 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4177 ; -O0: subs x13, x9, x10
4178 ; -O0: csel x9, x10, x9, lt
4179 ; -O0: csel x2, x11, x12, lt
4180 ; -O0: caspal x0, x1, x2, x3, [x8]
4181 ; -O0: subs x11, x9, x11
4182 ; -O0: ccmp x8, x10, #0, eq
4184 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4185 ; -O1: ldp x4, x5, [x0]
4187 ; -O1: csel x9, x7, x3, lt
4188 ; -O1: csel x8, x4, x2, lt
4189 ; -O1: caspal x4, x5, x8, x9, [x0]
4191 ; -O1: ccmp x5, x7, #0, eq
4192 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4196 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4197 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4198 ; CHECK: ldsmaxb w1, w0, [x0]
4199 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4203 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4204 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acquire:
4205 ; CHECK: ldsmaxab w1, w0, [x0]
4206 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4210 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4211 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_release:
4212 ; CHECK: ldsmaxlb w1, w0, [x0]
4213 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4217 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4218 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4219 ; CHECK: ldsmaxalb w1, w0, [x0]
4220 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4224 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4225 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4226 ; CHECK: ldsmaxalb w1, w0, [x0]
4227 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4231 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4232 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4234 ; -O0: subs w10, w10, w8, sxth
4235 ; -O0: csel w8, w9, w8, gt
4236 ; -O0: bl __atomic_compare_exchange
4238 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4240 ; -O1: cmp w8, w20, sxth
4241 ; -O1: csel w8, w0, w20, gt
4242 ; -O1: bl __atomic_compare_exchange
4243 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4247 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4248 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4250 ; -O0: subs w10, w10, w8, sxth
4251 ; -O0: csel w8, w9, w8, gt
4252 ; -O0: bl __atomic_compare_exchange
4254 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4256 ; -O1: cmp w8, w20, sxth
4257 ; -O1: csel w8, w0, w20, gt
4258 ; -O1: bl __atomic_compare_exchange
4259 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4263 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4264 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4266 ; -O0: subs w10, w10, w8, sxth
4267 ; -O0: csel w8, w9, w8, gt
4268 ; -O0: bl __atomic_compare_exchange
4270 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4272 ; -O1: cmp w8, w20, sxth
4273 ; -O1: csel w8, w0, w20, gt
4274 ; -O1: bl __atomic_compare_exchange
4275 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4279 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4280 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4282 ; -O0: subs w10, w10, w8, sxth
4283 ; -O0: csel w8, w9, w8, gt
4284 ; -O0: bl __atomic_compare_exchange
4286 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4288 ; -O1: cmp w8, w20, sxth
4289 ; -O1: csel w8, w0, w20, gt
4290 ; -O1: bl __atomic_compare_exchange
4291 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
4295 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4296 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4298 ; -O0: subs w10, w10, w8, sxth
4299 ; -O0: csel w8, w9, w8, gt
4300 ; -O0: bl __atomic_compare_exchange
4302 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4304 ; -O1: cmp w8, w20, sxth
4305 ; -O1: csel w8, w0, w20, gt
4306 ; -O1: bl __atomic_compare_exchange
4307 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4311 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4312 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4313 ; -O0: subs w10, w9, w8
4314 ; -O0: csel w8, w9, w8, gt
4315 ; -O0: bl __atomic_compare_exchange
4317 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4319 ; -O1: csel w8, w0, w20, gt
4320 ; -O1: bl __atomic_compare_exchange
4321 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4325 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4326 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4327 ; -O0: subs w10, w9, w8
4328 ; -O0: csel w8, w9, w8, gt
4329 ; -O0: bl __atomic_compare_exchange
4331 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4333 ; -O1: csel w8, w0, w20, gt
4334 ; -O1: bl __atomic_compare_exchange
4335 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4339 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4340 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4341 ; -O0: subs w10, w9, w8
4342 ; -O0: csel w8, w9, w8, gt
4343 ; -O0: bl __atomic_compare_exchange
4345 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4347 ; -O1: csel w8, w0, w20, gt
4348 ; -O1: bl __atomic_compare_exchange
4349 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4353 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4354 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4355 ; -O0: subs w10, w9, w8
4356 ; -O0: csel w8, w9, w8, gt
4357 ; -O0: bl __atomic_compare_exchange
4359 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4361 ; -O1: csel w8, w0, w20, gt
4362 ; -O1: bl __atomic_compare_exchange
4363 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4367 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4368 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4369 ; -O0: subs w10, w9, w8
4370 ; -O0: csel w8, w9, w8, gt
4371 ; -O0: bl __atomic_compare_exchange
4373 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4375 ; -O1: csel w8, w0, w20, gt
4376 ; -O1: bl __atomic_compare_exchange
4377 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4381 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4382 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4383 ; -O0: subs x10, x9, x8
4384 ; -O0: csel x8, x9, x8, gt
4385 ; -O0: bl __atomic_compare_exchange
4387 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4389 ; -O1: csel x8, x0, x20, gt
4390 ; -O1: bl __atomic_compare_exchange
4391 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4395 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4396 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4397 ; -O0: subs x10, x9, x8
4398 ; -O0: csel x8, x9, x8, gt
4399 ; -O0: bl __atomic_compare_exchange
4401 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4403 ; -O1: csel x8, x0, x20, gt
4404 ; -O1: bl __atomic_compare_exchange
4405 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4409 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4410 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4411 ; -O0: subs x10, x9, x8
4412 ; -O0: csel x8, x9, x8, gt
4413 ; -O0: bl __atomic_compare_exchange
4415 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4417 ; -O1: csel x8, x0, x20, gt
4418 ; -O1: bl __atomic_compare_exchange
4419 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4423 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4424 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4425 ; -O0: subs x10, x9, x8
4426 ; -O0: csel x8, x9, x8, gt
4427 ; -O0: bl __atomic_compare_exchange
4429 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4431 ; -O1: csel x8, x0, x20, gt
4432 ; -O1: bl __atomic_compare_exchange
4433 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4437 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4438 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4439 ; -O0: subs x10, x9, x8
4440 ; -O0: csel x8, x9, x8, gt
4441 ; -O0: bl __atomic_compare_exchange
4443 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4445 ; -O1: csel x8, x0, x20, gt
4446 ; -O1: bl __atomic_compare_exchange
4447 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4451 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4452 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4453 ; -O0: subs x12, x9, x10
4454 ; -O0: csel x8, x11, x8, lt
4455 ; -O0: csel x9, x10, x9, lt
4456 ; -O0: bl __atomic_compare_exchange
4458 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4459 ; -O1: ldp x0, x1, [x0]
4461 ; -O1: csel x8, x1, x19, lt
4462 ; -O1: csel x9, x0, x21, lt
4463 ; -O1: bl __atomic_compare_exchange
4464 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4468 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4469 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4470 ; -O0: subs x12, x9, x10
4471 ; -O0: csel x8, x11, x8, lt
4472 ; -O0: csel x9, x10, x9, lt
4473 ; -O0: bl __atomic_compare_exchange
4475 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4476 ; -O1: ldp x0, x1, [x0]
4478 ; -O1: csel x8, x1, x19, lt
4479 ; -O1: csel x9, x0, x21, lt
4480 ; -O1: bl __atomic_compare_exchange
4481 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4485 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4486 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4487 ; -O0: subs x12, x9, x10
4488 ; -O0: csel x8, x11, x8, lt
4489 ; -O0: csel x9, x10, x9, lt
4490 ; -O0: bl __atomic_compare_exchange
4492 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4493 ; -O1: ldp x0, x1, [x0]
4495 ; -O1: csel x8, x1, x19, lt
4496 ; -O1: csel x9, x0, x21, lt
4497 ; -O1: bl __atomic_compare_exchange
4498 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4502 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4503 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4504 ; -O0: subs x12, x9, x10
4505 ; -O0: csel x8, x11, x8, lt
4506 ; -O0: csel x9, x10, x9, lt
4507 ; -O0: bl __atomic_compare_exchange
4509 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4510 ; -O1: ldp x0, x1, [x0]
4512 ; -O1: csel x8, x1, x19, lt
4513 ; -O1: csel x9, x0, x21, lt
4514 ; -O1: bl __atomic_compare_exchange
4515 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4519 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4520 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4521 ; -O0: subs x12, x9, x10
4522 ; -O0: csel x8, x11, x8, lt
4523 ; -O0: csel x9, x10, x9, lt
4524 ; -O0: bl __atomic_compare_exchange
4526 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4527 ; -O1: ldp x0, x1, [x0]
4529 ; -O1: csel x8, x1, x19, lt
4530 ; -O1: csel x9, x0, x21, lt
4531 ; -O1: bl __atomic_compare_exchange
4532 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4536 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4537 ; CHECK-LABEL: atomicrmw_min_i8_aligned_monotonic:
4538 ; CHECK: ldsminb w1, w0, [x0]
4539 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4543 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4544 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acquire:
4545 ; CHECK: ldsminab w1, w0, [x0]
4546 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4550 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4551 ; CHECK-LABEL: atomicrmw_min_i8_aligned_release:
4552 ; CHECK: ldsminlb w1, w0, [x0]
4553 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4557 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4558 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4559 ; CHECK: ldsminalb w1, w0, [x0]
4560 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4564 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4565 ; CHECK-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4566 ; CHECK: ldsminalb w1, w0, [x0]
4567 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4571 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4572 ; CHECK-LABEL: atomicrmw_min_i16_aligned_monotonic:
4573 ; CHECK: ldsminh w1, w0, [x0]
4574 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
4578 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
4579 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acquire:
4580 ; CHECK: ldsminah w1, w0, [x0]
4581 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
4585 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
4586 ; CHECK-LABEL: atomicrmw_min_i16_aligned_release:
4587 ; CHECK: ldsminlh w1, w0, [x0]
4588 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
4592 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4593 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4594 ; CHECK: ldsminalh w1, w0, [x0]
4595 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
4599 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4600 ; CHECK-LABEL: atomicrmw_min_i16_aligned_seq_cst:
4601 ; CHECK: ldsminalh w1, w0, [x0]
4602 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
4606 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4607 ; CHECK-LABEL: atomicrmw_min_i32_aligned_monotonic:
4608 ; CHECK: ldsmin w1, w0, [x0]
4609 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
4613 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
4614 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acquire:
4615 ; CHECK: ldsmina w1, w0, [x0]
4616 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
4620 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
4621 ; CHECK-LABEL: atomicrmw_min_i32_aligned_release:
4622 ; CHECK: ldsminl w1, w0, [x0]
4623 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
4627 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4628 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acq_rel:
4629 ; CHECK: ldsminal w1, w0, [x0]
4630 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
4634 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4635 ; CHECK-LABEL: atomicrmw_min_i32_aligned_seq_cst:
4636 ; CHECK: ldsminal w1, w0, [x0]
4637 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
4641 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4642 ; CHECK-LABEL: atomicrmw_min_i64_aligned_monotonic:
4643 ; CHECK: ldsmin x1, x0, [x0]
4644 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
4648 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
4649 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acquire:
4650 ; CHECK: ldsmina x1, x0, [x0]
4651 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
4655 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
4656 ; CHECK-LABEL: atomicrmw_min_i64_aligned_release:
4657 ; CHECK: ldsminl x1, x0, [x0]
4658 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
4662 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4663 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acq_rel:
4664 ; CHECK: ldsminal x1, x0, [x0]
4665 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
4669 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4670 ; CHECK-LABEL: atomicrmw_min_i64_aligned_seq_cst:
4671 ; CHECK: ldsminal x1, x0, [x0]
4672 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
4676 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4677 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
4678 ; -O0: subs x13, x9, x10
4679 ; -O0: csel x9, x10, x9, ge
4680 ; -O0: csel x2, x11, x12, ge
4681 ; -O0: casp x0, x1, x2, x3, [x8]
4682 ; -O0: subs x11, x9, x11
4683 ; -O0: ccmp x8, x10, #0, eq
4685 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
4686 ; -O1: ldp x4, x5, [x0]
4688 ; -O1: csel x9, x7, x3, ge
4689 ; -O1: csel x8, x4, x2, ge
4690 ; -O1: casp x4, x5, x8, x9, [x0]
4692 ; -O1: ccmp x5, x7, #0, eq
4693 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
4697 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
4698 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
4699 ; -O0: subs x13, x9, x10
4700 ; -O0: csel x9, x10, x9, ge
4701 ; -O0: csel x2, x11, x12, ge
4702 ; -O0: caspa x0, x1, x2, x3, [x8]
4703 ; -O0: subs x11, x9, x11
4704 ; -O0: ccmp x8, x10, #0, eq
4706 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
4707 ; -O1: ldp x4, x5, [x0]
4709 ; -O1: csel x9, x7, x3, ge
4710 ; -O1: csel x8, x4, x2, ge
4711 ; -O1: caspa x4, x5, x8, x9, [x0]
4713 ; -O1: ccmp x5, x7, #0, eq
4714 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
4718 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
4719 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
4720 ; -O0: subs x13, x9, x10
4721 ; -O0: csel x9, x10, x9, ge
4722 ; -O0: csel x2, x11, x12, ge
4723 ; -O0: caspl x0, x1, x2, x3, [x8]
4724 ; -O0: subs x11, x9, x11
4725 ; -O0: ccmp x8, x10, #0, eq
4727 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
4728 ; -O1: ldp x4, x5, [x0]
4730 ; -O1: csel x9, x7, x3, ge
4731 ; -O1: csel x8, x4, x2, ge
4732 ; -O1: caspl x4, x5, x8, x9, [x0]
4734 ; -O1: ccmp x5, x7, #0, eq
4735 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
4739 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4740 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4741 ; -O0: subs x13, x9, x10
4742 ; -O0: csel x9, x10, x9, ge
4743 ; -O0: csel x2, x11, x12, ge
4744 ; -O0: caspal x0, x1, x2, x3, [x8]
4745 ; -O0: subs x11, x9, x11
4746 ; -O0: ccmp x8, x10, #0, eq
4748 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4749 ; -O1: ldp x4, x5, [x0]
4751 ; -O1: csel x9, x7, x3, ge
4752 ; -O1: csel x8, x4, x2, ge
4753 ; -O1: caspal x4, x5, x8, x9, [x0]
4755 ; -O1: ccmp x5, x7, #0, eq
4756 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
4760 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4761 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4762 ; -O0: subs x13, x9, x10
4763 ; -O0: csel x9, x10, x9, ge
4764 ; -O0: csel x2, x11, x12, ge
4765 ; -O0: caspal x0, x1, x2, x3, [x8]
4766 ; -O0: subs x11, x9, x11
4767 ; -O0: ccmp x8, x10, #0, eq
4769 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4770 ; -O1: ldp x4, x5, [x0]
4772 ; -O1: csel x9, x7, x3, ge
4773 ; -O1: csel x8, x4, x2, ge
4774 ; -O1: caspal x4, x5, x8, x9, [x0]
4776 ; -O1: ccmp x5, x7, #0, eq
4777 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
4781 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4782 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_monotonic:
4783 ; CHECK: ldsminb w1, w0, [x0]
4784 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4788 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4789 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acquire:
4790 ; CHECK: ldsminab w1, w0, [x0]
4791 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4795 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
4796 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_release:
4797 ; CHECK: ldsminlb w1, w0, [x0]
4798 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4802 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4803 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
4804 ; CHECK: ldsminalb w1, w0, [x0]
4805 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4809 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4810 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
4811 ; CHECK: ldsminalb w1, w0, [x0]
4812 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4816 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4817 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4819 ; -O0: subs w10, w10, w8, sxth
4820 ; -O0: csel w8, w9, w8, le
4821 ; -O0: bl __atomic_compare_exchange
4823 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4825 ; -O1: cmp w8, w20, sxth
4826 ; -O1: csel w8, w0, w20, le
4827 ; -O1: bl __atomic_compare_exchange
4828 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
4832 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4833 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
4835 ; -O0: subs w10, w10, w8, sxth
4836 ; -O0: csel w8, w9, w8, le
4837 ; -O0: bl __atomic_compare_exchange
4839 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
4841 ; -O1: cmp w8, w20, sxth
4842 ; -O1: csel w8, w0, w20, le
4843 ; -O1: bl __atomic_compare_exchange
4844 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
4848 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
4849 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
4851 ; -O0: subs w10, w10, w8, sxth
4852 ; -O0: csel w8, w9, w8, le
4853 ; -O0: bl __atomic_compare_exchange
4855 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
4857 ; -O1: cmp w8, w20, sxth
4858 ; -O1: csel w8, w0, w20, le
4859 ; -O1: bl __atomic_compare_exchange
4860 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
4864 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4865 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4867 ; -O0: subs w10, w10, w8, sxth
4868 ; -O0: csel w8, w9, w8, le
4869 ; -O0: bl __atomic_compare_exchange
4871 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4873 ; -O1: cmp w8, w20, sxth
4874 ; -O1: csel w8, w0, w20, le
4875 ; -O1: bl __atomic_compare_exchange
4876 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
4880 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4881 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4883 ; -O0: subs w10, w10, w8, sxth
4884 ; -O0: csel w8, w9, w8, le
4885 ; -O0: bl __atomic_compare_exchange
4887 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4889 ; -O1: cmp w8, w20, sxth
4890 ; -O1: csel w8, w0, w20, le
4891 ; -O1: bl __atomic_compare_exchange
4892 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
4896 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4897 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4898 ; -O0: subs w10, w9, w8
4899 ; -O0: csel w8, w9, w8, le
4900 ; -O0: bl __atomic_compare_exchange
4902 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4904 ; -O1: csel w8, w0, w20, le
4905 ; -O1: bl __atomic_compare_exchange
4906 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
4910 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4911 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
4912 ; -O0: subs w10, w9, w8
4913 ; -O0: csel w8, w9, w8, le
4914 ; -O0: bl __atomic_compare_exchange
4916 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
4918 ; -O1: csel w8, w0, w20, le
4919 ; -O1: bl __atomic_compare_exchange
4920 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
4924 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
4925 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
4926 ; -O0: subs w10, w9, w8
4927 ; -O0: csel w8, w9, w8, le
4928 ; -O0: bl __atomic_compare_exchange
4930 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
4932 ; -O1: csel w8, w0, w20, le
4933 ; -O1: bl __atomic_compare_exchange
4934 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
4938 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4939 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
4940 ; -O0: subs w10, w9, w8
4941 ; -O0: csel w8, w9, w8, le
4942 ; -O0: bl __atomic_compare_exchange
4944 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
4946 ; -O1: csel w8, w0, w20, le
4947 ; -O1: bl __atomic_compare_exchange
4948 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
4952 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4953 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
4954 ; -O0: subs w10, w9, w8
4955 ; -O0: csel w8, w9, w8, le
4956 ; -O0: bl __atomic_compare_exchange
4958 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
4960 ; -O1: csel w8, w0, w20, le
4961 ; -O1: bl __atomic_compare_exchange
4962 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
4966 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4967 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
4968 ; -O0: subs x10, x9, x8
4969 ; -O0: csel x8, x9, x8, le
4970 ; -O0: bl __atomic_compare_exchange
4972 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
4974 ; -O1: csel x8, x0, x20, le
4975 ; -O1: bl __atomic_compare_exchange
4976 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
4980 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4981 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
4982 ; -O0: subs x10, x9, x8
4983 ; -O0: csel x8, x9, x8, le
4984 ; -O0: bl __atomic_compare_exchange
4986 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
4988 ; -O1: csel x8, x0, x20, le
4989 ; -O1: bl __atomic_compare_exchange
4990 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
4994 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
4995 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
4996 ; -O0: subs x10, x9, x8
4997 ; -O0: csel x8, x9, x8, le
4998 ; -O0: bl __atomic_compare_exchange
5000 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
5002 ; -O1: csel x8, x0, x20, le
5003 ; -O1: bl __atomic_compare_exchange
5004 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
5008 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5009 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5010 ; -O0: subs x10, x9, x8
5011 ; -O0: csel x8, x9, x8, le
5012 ; -O0: bl __atomic_compare_exchange
5014 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5016 ; -O1: csel x8, x0, x20, le
5017 ; -O1: bl __atomic_compare_exchange
5018 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
5022 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5023 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5024 ; -O0: subs x10, x9, x8
5025 ; -O0: csel x8, x9, x8, le
5026 ; -O0: bl __atomic_compare_exchange
5028 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5030 ; -O1: csel x8, x0, x20, le
5031 ; -O1: bl __atomic_compare_exchange
5032 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
5036 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5037 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5038 ; -O0: subs x12, x9, x10
5039 ; -O0: csel x8, x11, x8, ge
5040 ; -O0: csel x9, x10, x9, ge
5041 ; -O0: bl __atomic_compare_exchange
5043 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5044 ; -O1: ldp x0, x1, [x0]
5046 ; -O1: csel x8, x1, x19, ge
5047 ; -O1: csel x9, x0, x21, ge
5048 ; -O1: bl __atomic_compare_exchange
5049 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
5053 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5054 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
5055 ; -O0: subs x12, x9, x10
5056 ; -O0: csel x8, x11, x8, ge
5057 ; -O0: csel x9, x10, x9, ge
5058 ; -O0: bl __atomic_compare_exchange
5060 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
5061 ; -O1: ldp x0, x1, [x0]
5063 ; -O1: csel x8, x1, x19, ge
5064 ; -O1: csel x9, x0, x21, ge
5065 ; -O1: bl __atomic_compare_exchange
5066 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
5070 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
5071 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
5072 ; -O0: subs x12, x9, x10
5073 ; -O0: csel x8, x11, x8, ge
5074 ; -O0: csel x9, x10, x9, ge
5075 ; -O0: bl __atomic_compare_exchange
5077 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
5078 ; -O1: ldp x0, x1, [x0]
5080 ; -O1: csel x8, x1, x19, ge
5081 ; -O1: csel x9, x0, x21, ge
5082 ; -O1: bl __atomic_compare_exchange
5083 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
5087 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5088 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5089 ; -O0: subs x12, x9, x10
5090 ; -O0: csel x8, x11, x8, ge
5091 ; -O0: csel x9, x10, x9, ge
5092 ; -O0: bl __atomic_compare_exchange
5094 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5095 ; -O1: ldp x0, x1, [x0]
5097 ; -O1: csel x8, x1, x19, ge
5098 ; -O1: csel x9, x0, x21, ge
5099 ; -O1: bl __atomic_compare_exchange
5100 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5104 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5105 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5106 ; -O0: subs x12, x9, x10
5107 ; -O0: csel x8, x11, x8, ge
5108 ; -O0: csel x9, x10, x9, ge
5109 ; -O0: bl __atomic_compare_exchange
5111 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5112 ; -O1: ldp x0, x1, [x0]
5114 ; -O1: csel x8, x1, x19, ge
5115 ; -O1: csel x9, x0, x21, ge
5116 ; -O1: bl __atomic_compare_exchange
5117 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5121 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5122 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5123 ; CHECK: ldumaxb w1, w0, [x0]
5124 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5128 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5129 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acquire:
5130 ; CHECK: ldumaxab w1, w0, [x0]
5131 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5135 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5136 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_release:
5137 ; CHECK: ldumaxlb w1, w0, [x0]
5138 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5142 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5143 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5144 ; CHECK: ldumaxalb w1, w0, [x0]
5145 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5149 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5150 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5151 ; CHECK: ldumaxalb w1, w0, [x0]
5152 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5156 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5157 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5158 ; CHECK: ldumaxh w1, w0, [x0]
5159 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5163 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5164 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acquire:
5165 ; CHECK: ldumaxah w1, w0, [x0]
5166 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5170 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5171 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_release:
5172 ; CHECK: ldumaxlh w1, w0, [x0]
5173 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5177 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5178 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5179 ; CHECK: ldumaxalh w1, w0, [x0]
5180 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
5184 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5185 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5186 ; CHECK: ldumaxalh w1, w0, [x0]
5187 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
5191 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5192 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5193 ; CHECK: ldumax w1, w0, [x0]
5194 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
5198 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
5199 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acquire:
5200 ; CHECK: ldumaxa w1, w0, [x0]
5201 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
5205 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
5206 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_release:
5207 ; CHECK: ldumaxl w1, w0, [x0]
5208 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
5212 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5213 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5214 ; CHECK: ldumaxal w1, w0, [x0]
5215 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
5219 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5220 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5221 ; CHECK: ldumaxal w1, w0, [x0]
5222 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
5226 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5227 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5228 ; CHECK: ldumax x1, x0, [x0]
5229 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
5233 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
5234 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acquire:
5235 ; CHECK: ldumaxa x1, x0, [x0]
5236 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
5240 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
5241 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_release:
5242 ; CHECK: ldumaxl x1, x0, [x0]
5243 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
5247 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5248 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
5249 ; CHECK: ldumaxal x1, x0, [x0]
5250 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
5254 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5255 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
5256 ; CHECK: ldumaxal x1, x0, [x0]
5257 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
5261 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5262 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5263 ; -O0: subs x13, x9, x10
5264 ; -O0: csel x9, x10, x9, lo
5265 ; -O0: csel x2, x11, x12, lo
5266 ; -O0: casp x0, x1, x2, x3, [x8]
5267 ; -O0: subs x11, x9, x11
5268 ; -O0: ccmp x8, x10, #0, eq
5270 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5271 ; -O1: ldp x4, x5, [x0]
5273 ; -O1: csel x9, x7, x3, lo
5274 ; -O1: csel x8, x4, x2, lo
5275 ; -O1: casp x4, x5, x8, x9, [x0]
5277 ; -O1: ccmp x5, x7, #0, eq
5278 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
5282 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
5283 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
5284 ; -O0: subs x13, x9, x10
5285 ; -O0: csel x9, x10, x9, lo
5286 ; -O0: csel x2, x11, x12, lo
5287 ; -O0: caspa x0, x1, x2, x3, [x8]
5288 ; -O0: subs x11, x9, x11
5289 ; -O0: ccmp x8, x10, #0, eq
5291 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
5292 ; -O1: ldp x4, x5, [x0]
5294 ; -O1: csel x9, x7, x3, lo
5295 ; -O1: csel x8, x4, x2, lo
5296 ; -O1: caspa x4, x5, x8, x9, [x0]
5298 ; -O1: ccmp x5, x7, #0, eq
5299 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
5303 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
5304 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
5305 ; -O0: subs x13, x9, x10
5306 ; -O0: csel x9, x10, x9, lo
5307 ; -O0: csel x2, x11, x12, lo
5308 ; -O0: caspl x0, x1, x2, x3, [x8]
5309 ; -O0: subs x11, x9, x11
5310 ; -O0: ccmp x8, x10, #0, eq
5312 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
5313 ; -O1: ldp x4, x5, [x0]
5315 ; -O1: csel x9, x7, x3, lo
5316 ; -O1: csel x8, x4, x2, lo
5317 ; -O1: caspl x4, x5, x8, x9, [x0]
5319 ; -O1: ccmp x5, x7, #0, eq
5320 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
5324 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5325 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5326 ; -O0: subs x13, x9, x10
5327 ; -O0: csel x9, x10, x9, lo
5328 ; -O0: csel x2, x11, x12, lo
5329 ; -O0: caspal x0, x1, x2, x3, [x8]
5330 ; -O0: subs x11, x9, x11
5331 ; -O0: ccmp x8, x10, #0, eq
5333 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5334 ; -O1: ldp x4, x5, [x0]
5336 ; -O1: csel x9, x7, x3, lo
5337 ; -O1: csel x8, x4, x2, lo
5338 ; -O1: caspal x4, x5, x8, x9, [x0]
5340 ; -O1: ccmp x5, x7, #0, eq
5341 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
5345 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5346 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5347 ; -O0: subs x13, x9, x10
5348 ; -O0: csel x9, x10, x9, lo
5349 ; -O0: csel x2, x11, x12, lo
5350 ; -O0: caspal x0, x1, x2, x3, [x8]
5351 ; -O0: subs x11, x9, x11
5352 ; -O0: ccmp x8, x10, #0, eq
5354 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5355 ; -O1: ldp x4, x5, [x0]
5357 ; -O1: csel x9, x7, x3, lo
5358 ; -O1: csel x8, x4, x2, lo
5359 ; -O1: caspal x4, x5, x8, x9, [x0]
5361 ; -O1: ccmp x5, x7, #0, eq
5362 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
5366 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5367 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
5368 ; CHECK: ldumaxb w1, w0, [x0]
5369 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5373 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5374 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acquire:
5375 ; CHECK: ldumaxab w1, w0, [x0]
5376 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5380 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
5381 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_release:
5382 ; CHECK: ldumaxlb w1, w0, [x0]
5383 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5387 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5388 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
5389 ; CHECK: ldumaxalb w1, w0, [x0]
5390 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5394 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5395 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
5396 ; CHECK: ldumaxalb w1, w0, [x0]
5397 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5401 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5402 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5403 ; -O0: and w10, w9, #0xffff
5404 ; -O0: subs w10, w10, w8, uxth
5405 ; -O0: csel w8, w9, w8, hi
5406 ; -O0: bl __atomic_compare_exchange
5408 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5409 ; -O1: and w8, w0, #0xffff
5410 ; -O1: cmp w8, w20, uxth
5411 ; -O1: csel w8, w0, w20, hi
5412 ; -O1: bl __atomic_compare_exchange
5413 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
5417 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5418 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5419 ; -O0: and w10, w9, #0xffff
5420 ; -O0: subs w10, w10, w8, uxth
5421 ; -O0: csel w8, w9, w8, hi
5422 ; -O0: bl __atomic_compare_exchange
5424 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5425 ; -O1: and w8, w0, #0xffff
5426 ; -O1: cmp w8, w20, uxth
5427 ; -O1: csel w8, w0, w20, hi
5428 ; -O1: bl __atomic_compare_exchange
5429 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
5433 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
5434 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
5435 ; -O0: and w10, w9, #0xffff
5436 ; -O0: subs w10, w10, w8, uxth
5437 ; -O0: csel w8, w9, w8, hi
5438 ; -O0: bl __atomic_compare_exchange
5440 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
5441 ; -O1: and w8, w0, #0xffff
5442 ; -O1: cmp w8, w20, uxth
5443 ; -O1: csel w8, w0, w20, hi
5444 ; -O1: bl __atomic_compare_exchange
5445 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
5449 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5450 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5451 ; -O0: and w10, w9, #0xffff
5452 ; -O0: subs w10, w10, w8, uxth
5453 ; -O0: csel w8, w9, w8, hi
5454 ; -O0: bl __atomic_compare_exchange
5456 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5457 ; -O1: and w8, w0, #0xffff
5458 ; -O1: cmp w8, w20, uxth
5459 ; -O1: csel w8, w0, w20, hi
5460 ; -O1: bl __atomic_compare_exchange
5461 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
5465 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5466 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5467 ; -O0: and w10, w9, #0xffff
5468 ; -O0: subs w10, w10, w8, uxth
5469 ; -O0: csel w8, w9, w8, hi
5470 ; -O0: bl __atomic_compare_exchange
5472 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5473 ; -O1: and w8, w0, #0xffff
5474 ; -O1: cmp w8, w20, uxth
5475 ; -O1: csel w8, w0, w20, hi
5476 ; -O1: bl __atomic_compare_exchange
5477 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
5481 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5482 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5483 ; -O0: subs w10, w9, w8
5484 ; -O0: csel w8, w9, w8, hi
5485 ; -O0: bl __atomic_compare_exchange
5487 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5489 ; -O1: csel w8, w0, w20, hi
5490 ; -O1: bl __atomic_compare_exchange
5491 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
5495 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5496 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5497 ; -O0: subs w10, w9, w8
5498 ; -O0: csel w8, w9, w8, hi
5499 ; -O0: bl __atomic_compare_exchange
5501 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5503 ; -O1: csel w8, w0, w20, hi
5504 ; -O1: bl __atomic_compare_exchange
5505 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
5509 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
5510 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
5511 ; -O0: subs w10, w9, w8
5512 ; -O0: csel w8, w9, w8, hi
5513 ; -O0: bl __atomic_compare_exchange
5515 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
5517 ; -O1: csel w8, w0, w20, hi
5518 ; -O1: bl __atomic_compare_exchange
5519 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
5523 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5524 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5525 ; -O0: subs w10, w9, w8
5526 ; -O0: csel w8, w9, w8, hi
5527 ; -O0: bl __atomic_compare_exchange
5529 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5531 ; -O1: csel w8, w0, w20, hi
5532 ; -O1: bl __atomic_compare_exchange
5533 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
5537 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5538 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5539 ; -O0: subs w10, w9, w8
5540 ; -O0: csel w8, w9, w8, hi
5541 ; -O0: bl __atomic_compare_exchange
5543 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5545 ; -O1: csel w8, w0, w20, hi
5546 ; -O1: bl __atomic_compare_exchange
5547 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
5551 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5552 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5553 ; -O0: subs x10, x9, x8
5554 ; -O0: csel x8, x9, x8, hi
5555 ; -O0: bl __atomic_compare_exchange
5557 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5559 ; -O1: csel x8, x0, x20, hi
5560 ; -O1: bl __atomic_compare_exchange
5561 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
5565 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5566 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5567 ; -O0: subs x10, x9, x8
5568 ; -O0: csel x8, x9, x8, hi
5569 ; -O0: bl __atomic_compare_exchange
5571 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5573 ; -O1: csel x8, x0, x20, hi
5574 ; -O1: bl __atomic_compare_exchange
5575 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
5579 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
5580 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
5581 ; -O0: subs x10, x9, x8
5582 ; -O0: csel x8, x9, x8, hi
5583 ; -O0: bl __atomic_compare_exchange
5585 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
5587 ; -O1: csel x8, x0, x20, hi
5588 ; -O1: bl __atomic_compare_exchange
5589 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
5593 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5594 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5595 ; -O0: subs x10, x9, x8
5596 ; -O0: csel x8, x9, x8, hi
5597 ; -O0: bl __atomic_compare_exchange
5599 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5601 ; -O1: csel x8, x0, x20, hi
5602 ; -O1: bl __atomic_compare_exchange
5603 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
5607 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5608 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5609 ; -O0: subs x10, x9, x8
5610 ; -O0: csel x8, x9, x8, hi
5611 ; -O0: bl __atomic_compare_exchange
5613 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5615 ; -O1: csel x8, x0, x20, hi
5616 ; -O1: bl __atomic_compare_exchange
5617 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
5621 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5622 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5623 ; -O0: subs x12, x9, x10
5624 ; -O0: csel x8, x11, x8, lo
5625 ; -O0: csel x9, x10, x9, lo
5626 ; -O0: bl __atomic_compare_exchange
5628 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5629 ; -O1: ldp x0, x1, [x0]
5631 ; -O1: csel x8, x1, x19, lo
5632 ; -O1: csel x9, x0, x21, lo
5633 ; -O1: bl __atomic_compare_exchange
5634 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
5638 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5639 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5640 ; -O0: subs x12, x9, x10
5641 ; -O0: csel x8, x11, x8, lo
5642 ; -O0: csel x9, x10, x9, lo
5643 ; -O0: bl __atomic_compare_exchange
5645 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5646 ; -O1: ldp x0, x1, [x0]
5648 ; -O1: csel x8, x1, x19, lo
5649 ; -O1: csel x9, x0, x21, lo
5650 ; -O1: bl __atomic_compare_exchange
5651 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
5655 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
5656 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
5657 ; -O0: subs x12, x9, x10
5658 ; -O0: csel x8, x11, x8, lo
5659 ; -O0: csel x9, x10, x9, lo
5660 ; -O0: bl __atomic_compare_exchange
5662 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
5663 ; -O1: ldp x0, x1, [x0]
5665 ; -O1: csel x8, x1, x19, lo
5666 ; -O1: csel x9, x0, x21, lo
5667 ; -O1: bl __atomic_compare_exchange
5668 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
5672 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5673 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5674 ; -O0: subs x12, x9, x10
5675 ; -O0: csel x8, x11, x8, lo
5676 ; -O0: csel x9, x10, x9, lo
5677 ; -O0: bl __atomic_compare_exchange
5679 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5680 ; -O1: ldp x0, x1, [x0]
5682 ; -O1: csel x8, x1, x19, lo
5683 ; -O1: csel x9, x0, x21, lo
5684 ; -O1: bl __atomic_compare_exchange
5685 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
5689 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5690 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5691 ; -O0: subs x12, x9, x10
5692 ; -O0: csel x8, x11, x8, lo
5693 ; -O0: csel x9, x10, x9, lo
5694 ; -O0: bl __atomic_compare_exchange
5696 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5697 ; -O1: ldp x0, x1, [x0]
5699 ; -O1: csel x8, x1, x19, lo
5700 ; -O1: csel x9, x0, x21, lo
5701 ; -O1: bl __atomic_compare_exchange
5702 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
5706 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5707 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_monotonic:
5708 ; CHECK: lduminb w1, w0, [x0]
5709 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
5713 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
5714 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acquire:
5715 ; CHECK: lduminab w1, w0, [x0]
5716 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
5720 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
5721 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_release:
5722 ; CHECK: lduminlb w1, w0, [x0]
5723 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
5727 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5728 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
5729 ; CHECK: lduminalb w1, w0, [x0]
5730 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
5734 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5735 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
5736 ; CHECK: lduminalb w1, w0, [x0]
5737 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
5741 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5742 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_monotonic:
5743 ; CHECK: lduminh w1, w0, [x0]
5744 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
5748 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
5749 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acquire:
5750 ; CHECK: lduminah w1, w0, [x0]
5751 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
5755 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
5756 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_release:
5757 ; CHECK: lduminlh w1, w0, [x0]
5758 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
5762 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5763 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
5764 ; CHECK: lduminalh w1, w0, [x0]
5765 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
5769 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5770 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
5771 ; CHECK: lduminalh w1, w0, [x0]
5772 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
5776 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5777 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_monotonic:
5778 ; CHECK: ldumin w1, w0, [x0]
5779 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
5783 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
5784 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acquire:
5785 ; CHECK: ldumina w1, w0, [x0]
5786 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
5790 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
5791 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_release:
5792 ; CHECK: lduminl w1, w0, [x0]
5793 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
5797 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5798 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
5799 ; CHECK: lduminal w1, w0, [x0]
5800 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
5804 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5805 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
5806 ; CHECK: lduminal w1, w0, [x0]
5807 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
5811 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5812 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_monotonic:
5813 ; CHECK: ldumin x1, x0, [x0]
5814 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
5818 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
5819 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acquire:
5820 ; CHECK: ldumina x1, x0, [x0]
5821 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
5825 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
5826 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_release:
5827 ; CHECK: lduminl x1, x0, [x0]
5828 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
5832 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5833 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
5834 ; CHECK: lduminal x1, x0, [x0]
5835 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
5839 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5840 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
5841 ; CHECK: lduminal x1, x0, [x0]
5842 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
5846 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5847 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
5848 ; -O0: subs x13, x9, x10
5849 ; -O0: csel x9, x10, x9, hs
5850 ; -O0: csel x2, x11, x12, hs
5851 ; -O0: casp x0, x1, x2, x3, [x8]
5852 ; -O0: subs x11, x9, x11
5853 ; -O0: ccmp x8, x10, #0, eq
5855 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
5856 ; -O1: ldp x4, x5, [x0]
5858 ; -O1: csel x9, x7, x3, hs
5859 ; -O1: csel x8, x4, x2, hs
5860 ; -O1: casp x4, x5, x8, x9, [x0]
5862 ; -O1: ccmp x5, x7, #0, eq
5863 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
5867 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
5868 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
5869 ; -O0: subs x13, x9, x10
5870 ; -O0: csel x9, x10, x9, hs
5871 ; -O0: csel x2, x11, x12, hs
5872 ; -O0: caspa x0, x1, x2, x3, [x8]
5873 ; -O0: subs x11, x9, x11
5874 ; -O0: ccmp x8, x10, #0, eq
5876 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
5877 ; -O1: ldp x4, x5, [x0]
5879 ; -O1: csel x9, x7, x3, hs
5880 ; -O1: csel x8, x4, x2, hs
5881 ; -O1: caspa x4, x5, x8, x9, [x0]
5883 ; -O1: ccmp x5, x7, #0, eq
5884 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
5888 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
5889 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
5890 ; -O0: subs x13, x9, x10
5891 ; -O0: csel x9, x10, x9, hs
5892 ; -O0: csel x2, x11, x12, hs
5893 ; -O0: caspl x0, x1, x2, x3, [x8]
5894 ; -O0: subs x11, x9, x11
5895 ; -O0: ccmp x8, x10, #0, eq
5897 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
5898 ; -O1: ldp x4, x5, [x0]
5900 ; -O1: csel x9, x7, x3, hs
5901 ; -O1: csel x8, x4, x2, hs
5902 ; -O1: caspl x4, x5, x8, x9, [x0]
5904 ; -O1: ccmp x5, x7, #0, eq
5905 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
5909 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5910 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
5911 ; -O0: subs x13, x9, x10
5912 ; -O0: csel x9, x10, x9, hs
5913 ; -O0: csel x2, x11, x12, hs
5914 ; -O0: caspal x0, x1, x2, x3, [x8]
5915 ; -O0: subs x11, x9, x11
5916 ; -O0: ccmp x8, x10, #0, eq
5918 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
5919 ; -O1: ldp x4, x5, [x0]
5921 ; -O1: csel x9, x7, x3, hs
5922 ; -O1: csel x8, x4, x2, hs
5923 ; -O1: caspal x4, x5, x8, x9, [x0]
5925 ; -O1: ccmp x5, x7, #0, eq
5926 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
5930 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5931 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
5932 ; -O0: subs x13, x9, x10
5933 ; -O0: csel x9, x10, x9, hs
5934 ; -O0: csel x2, x11, x12, hs
5935 ; -O0: caspal x0, x1, x2, x3, [x8]
5936 ; -O0: subs x11, x9, x11
5937 ; -O0: ccmp x8, x10, #0, eq
5939 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
5940 ; -O1: ldp x4, x5, [x0]
5942 ; -O1: csel x9, x7, x3, hs
5943 ; -O1: csel x8, x4, x2, hs
5944 ; -O1: caspal x4, x5, x8, x9, [x0]
5946 ; -O1: ccmp x5, x7, #0, eq
5947 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
5951 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5952 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
5953 ; CHECK: lduminb w1, w0, [x0]
5954 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
5958 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5959 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acquire:
5960 ; CHECK: lduminab w1, w0, [x0]
5961 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
5965 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
5966 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_release:
5967 ; CHECK: lduminlb w1, w0, [x0]
5968 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
5972 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5973 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
5974 ; CHECK: lduminalb w1, w0, [x0]
5975 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
5979 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5980 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
5981 ; CHECK: lduminalb w1, w0, [x0]
5982 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
5986 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5987 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
5988 ; -O0: and w10, w9, #0xffff
5989 ; -O0: subs w10, w10, w8, uxth
5990 ; -O0: csel w8, w9, w8, ls
5991 ; -O0: bl __atomic_compare_exchange
5993 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
5994 ; -O1: and w8, w0, #0xffff
5995 ; -O1: cmp w8, w20, uxth
5996 ; -O1: csel w8, w0, w20, ls
5997 ; -O1: bl __atomic_compare_exchange
5998 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
6002 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6003 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6004 ; -O0: and w10, w9, #0xffff
6005 ; -O0: subs w10, w10, w8, uxth
6006 ; -O0: csel w8, w9, w8, ls
6007 ; -O0: bl __atomic_compare_exchange
6009 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6010 ; -O1: and w8, w0, #0xffff
6011 ; -O1: cmp w8, w20, uxth
6012 ; -O1: csel w8, w0, w20, ls
6013 ; -O1: bl __atomic_compare_exchange
6014 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
6018 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
6019 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
6020 ; -O0: and w10, w9, #0xffff
6021 ; -O0: subs w10, w10, w8, uxth
6022 ; -O0: csel w8, w9, w8, ls
6023 ; -O0: bl __atomic_compare_exchange
6025 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
6026 ; -O1: and w8, w0, #0xffff
6027 ; -O1: cmp w8, w20, uxth
6028 ; -O1: csel w8, w0, w20, ls
6029 ; -O1: bl __atomic_compare_exchange
6030 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
6034 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6035 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6036 ; -O0: and w10, w9, #0xffff
6037 ; -O0: subs w10, w10, w8, uxth
6038 ; -O0: csel w8, w9, w8, ls
6039 ; -O0: bl __atomic_compare_exchange
6041 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6042 ; -O1: and w8, w0, #0xffff
6043 ; -O1: cmp w8, w20, uxth
6044 ; -O1: csel w8, w0, w20, ls
6045 ; -O1: bl __atomic_compare_exchange
6046 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
6050 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6051 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6052 ; -O0: and w10, w9, #0xffff
6053 ; -O0: subs w10, w10, w8, uxth
6054 ; -O0: csel w8, w9, w8, ls
6055 ; -O0: bl __atomic_compare_exchange
6057 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6058 ; -O1: and w8, w0, #0xffff
6059 ; -O1: cmp w8, w20, uxth
6060 ; -O1: csel w8, w0, w20, ls
6061 ; -O1: bl __atomic_compare_exchange
6062 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
6066 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6067 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6068 ; -O0: subs w10, w9, w8
6069 ; -O0: csel w8, w9, w8, ls
6070 ; -O0: bl __atomic_compare_exchange
6072 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6074 ; -O1: csel w8, w0, w20, ls
6075 ; -O1: bl __atomic_compare_exchange
6076 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
6080 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6081 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6082 ; -O0: subs w10, w9, w8
6083 ; -O0: csel w8, w9, w8, ls
6084 ; -O0: bl __atomic_compare_exchange
6086 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6088 ; -O1: csel w8, w0, w20, ls
6089 ; -O1: bl __atomic_compare_exchange
6090 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
6094 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
6095 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
6096 ; -O0: subs w10, w9, w8
6097 ; -O0: csel w8, w9, w8, ls
6098 ; -O0: bl __atomic_compare_exchange
6100 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
6102 ; -O1: csel w8, w0, w20, ls
6103 ; -O1: bl __atomic_compare_exchange
6104 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
6108 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6109 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6110 ; -O0: subs w10, w9, w8
6111 ; -O0: csel w8, w9, w8, ls
6112 ; -O0: bl __atomic_compare_exchange
6114 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6116 ; -O1: csel w8, w0, w20, ls
6117 ; -O1: bl __atomic_compare_exchange
6118 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
6122 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6123 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6124 ; -O0: subs w10, w9, w8
6125 ; -O0: csel w8, w9, w8, ls
6126 ; -O0: bl __atomic_compare_exchange
6128 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6130 ; -O1: csel w8, w0, w20, ls
6131 ; -O1: bl __atomic_compare_exchange
6132 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
6136 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6137 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6138 ; -O0: subs x10, x9, x8
6139 ; -O0: csel x8, x9, x8, ls
6140 ; -O0: bl __atomic_compare_exchange
6142 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6144 ; -O1: csel x8, x0, x20, ls
6145 ; -O1: bl __atomic_compare_exchange
6146 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
6150 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6151 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6152 ; -O0: subs x10, x9, x8
6153 ; -O0: csel x8, x9, x8, ls
6154 ; -O0: bl __atomic_compare_exchange
6156 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6158 ; -O1: csel x8, x0, x20, ls
6159 ; -O1: bl __atomic_compare_exchange
6160 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
6164 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
6165 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
6166 ; -O0: subs x10, x9, x8
6167 ; -O0: csel x8, x9, x8, ls
6168 ; -O0: bl __atomic_compare_exchange
6170 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
6172 ; -O1: csel x8, x0, x20, ls
6173 ; -O1: bl __atomic_compare_exchange
6174 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
6178 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6179 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6180 ; -O0: subs x10, x9, x8
6181 ; -O0: csel x8, x9, x8, ls
6182 ; -O0: bl __atomic_compare_exchange
6184 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6186 ; -O1: csel x8, x0, x20, ls
6187 ; -O1: bl __atomic_compare_exchange
6188 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
6192 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6193 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6194 ; -O0: subs x10, x9, x8
6195 ; -O0: csel x8, x9, x8, ls
6196 ; -O0: bl __atomic_compare_exchange
6198 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6200 ; -O1: csel x8, x0, x20, ls
6201 ; -O1: bl __atomic_compare_exchange
6202 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
6206 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6207 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6208 ; -O0: subs x12, x9, x10
6209 ; -O0: csel x8, x11, x8, hs
6210 ; -O0: csel x9, x10, x9, hs
6211 ; -O0: bl __atomic_compare_exchange
6213 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6214 ; -O1: ldp x0, x1, [x0]
6216 ; -O1: csel x8, x1, x19, hs
6217 ; -O1: csel x9, x0, x21, hs
6218 ; -O1: bl __atomic_compare_exchange
6219 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
6223 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6224 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6225 ; -O0: subs x12, x9, x10
6226 ; -O0: csel x8, x11, x8, hs
6227 ; -O0: csel x9, x10, x9, hs
6228 ; -O0: bl __atomic_compare_exchange
6230 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6231 ; -O1: ldp x0, x1, [x0]
6233 ; -O1: csel x8, x1, x19, hs
6234 ; -O1: csel x9, x0, x21, hs
6235 ; -O1: bl __atomic_compare_exchange
6236 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
6240 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
6241 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
6242 ; -O0: subs x12, x9, x10
6243 ; -O0: csel x8, x11, x8, hs
6244 ; -O0: csel x9, x10, x9, hs
6245 ; -O0: bl __atomic_compare_exchange
6247 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
6248 ; -O1: ldp x0, x1, [x0]
6250 ; -O1: csel x8, x1, x19, hs
6251 ; -O1: csel x9, x0, x21, hs
6252 ; -O1: bl __atomic_compare_exchange
6253 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
6257 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6258 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6259 ; -O0: subs x12, x9, x10
6260 ; -O0: csel x8, x11, x8, hs
6261 ; -O0: csel x9, x10, x9, hs
6262 ; -O0: bl __atomic_compare_exchange
6264 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6265 ; -O1: ldp x0, x1, [x0]
6267 ; -O1: csel x8, x1, x19, hs
6268 ; -O1: csel x9, x0, x21, hs
6269 ; -O1: bl __atomic_compare_exchange
6270 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
6274 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6275 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6276 ; -O0: subs x12, x9, x10
6277 ; -O0: csel x8, x11, x8, hs
6278 ; -O0: csel x9, x10, x9, hs
6279 ; -O0: bl __atomic_compare_exchange
6281 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6282 ; -O1: ldp x0, x1, [x0]
6284 ; -O1: csel x8, x1, x19, hs
6285 ; -O1: csel x9, x0, x21, hs
6286 ; -O1: bl __atomic_compare_exchange
6287 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1