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 -mattr=+lse2,+lse128 -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+lse2,+lse128 -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: swpp x0, x1, [x8]
150 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
151 ; -O1: swpp x2, x1, [x0]
152 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
156 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
157 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
158 ; -O0: swppa x0, x1, [x8]
160 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
161 ; -O1: swppa x2, x1, [x0]
162 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
166 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
167 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
168 ; -O0: swppl x0, x1, [x8]
170 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
171 ; -O1: swppl x2, x1, [x0]
172 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
176 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
177 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
178 ; -O0: swppal x0, x1, [x8]
180 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
181 ; -O1: swppal x2, x1, [x0]
182 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
186 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
187 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
188 ; -O0: swppal x0, x1, [x8]
190 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
191 ; -O1: swppal x2, x1, [x0]
192 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
196 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
197 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
198 ; CHECK: swpb w1, w0, [x0]
199 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
203 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
204 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
205 ; CHECK: swpab w1, w0, [x0]
206 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
210 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
211 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_release:
212 ; CHECK: swplb w1, w0, [x0]
213 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
217 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
218 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
219 ; CHECK: swpalb w1, w0, [x0]
220 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
224 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
225 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
226 ; CHECK: swpalb w1, w0, [x0]
227 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
231 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
232 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
233 ; CHECK: bl __atomic_exchange
234 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
238 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
239 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
240 ; CHECK: bl __atomic_exchange
241 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
245 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
246 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
247 ; CHECK: bl __atomic_exchange
248 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
252 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
253 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
254 ; CHECK: bl __atomic_exchange
255 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
259 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
260 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
261 ; CHECK: bl __atomic_exchange
262 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
266 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
267 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
268 ; CHECK: bl __atomic_exchange
269 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
273 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
274 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
275 ; CHECK: bl __atomic_exchange
276 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
280 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
281 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
282 ; CHECK: bl __atomic_exchange
283 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
287 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
288 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
289 ; CHECK: bl __atomic_exchange
290 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
294 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
295 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
296 ; CHECK: bl __atomic_exchange
297 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
301 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
302 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
303 ; CHECK: bl __atomic_exchange
304 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
308 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
309 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
310 ; CHECK: bl __atomic_exchange
311 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
315 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
316 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
317 ; CHECK: bl __atomic_exchange
318 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
322 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
323 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
324 ; CHECK: bl __atomic_exchange
325 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
329 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
330 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
331 ; CHECK: bl __atomic_exchange
332 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
336 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
337 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
338 ; CHECK: bl __atomic_exchange
339 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
343 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
344 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
345 ; CHECK: bl __atomic_exchange
346 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
350 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
351 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
352 ; CHECK: bl __atomic_exchange
353 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
357 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
358 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
359 ; CHECK: bl __atomic_exchange
360 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
364 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
365 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
366 ; CHECK: bl __atomic_exchange
367 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
371 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
372 ; CHECK-LABEL: atomicrmw_add_i8_aligned_monotonic:
373 ; CHECK: ldaddb w1, w0, [x0]
374 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
378 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
379 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acquire:
380 ; CHECK: ldaddab w1, w0, [x0]
381 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
385 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
386 ; CHECK-LABEL: atomicrmw_add_i8_aligned_release:
387 ; CHECK: ldaddlb w1, w0, [x0]
388 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
392 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
393 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acq_rel:
394 ; CHECK: ldaddalb w1, w0, [x0]
395 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
399 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
400 ; CHECK-LABEL: atomicrmw_add_i8_aligned_seq_cst:
401 ; CHECK: ldaddalb w1, w0, [x0]
402 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
406 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
407 ; CHECK-LABEL: atomicrmw_add_i16_aligned_monotonic:
408 ; CHECK: ldaddh w1, w0, [x0]
409 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
413 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
414 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acquire:
415 ; CHECK: ldaddah w1, w0, [x0]
416 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
420 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
421 ; CHECK-LABEL: atomicrmw_add_i16_aligned_release:
422 ; CHECK: ldaddlh w1, w0, [x0]
423 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
427 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
428 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acq_rel:
429 ; CHECK: ldaddalh w1, w0, [x0]
430 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
434 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
435 ; CHECK-LABEL: atomicrmw_add_i16_aligned_seq_cst:
436 ; CHECK: ldaddalh w1, w0, [x0]
437 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
441 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
442 ; CHECK-LABEL: atomicrmw_add_i32_aligned_monotonic:
443 ; CHECK: ldadd w1, w0, [x0]
444 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
448 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
449 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acquire:
450 ; CHECK: ldadda w1, w0, [x0]
451 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
455 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
456 ; CHECK-LABEL: atomicrmw_add_i32_aligned_release:
457 ; CHECK: ldaddl w1, w0, [x0]
458 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
462 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
463 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acq_rel:
464 ; CHECK: ldaddal w1, w0, [x0]
465 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
469 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
470 ; CHECK-LABEL: atomicrmw_add_i32_aligned_seq_cst:
471 ; CHECK: ldaddal w1, w0, [x0]
472 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
476 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
477 ; CHECK-LABEL: atomicrmw_add_i64_aligned_monotonic:
478 ; CHECK: ldadd x1, x0, [x0]
479 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
483 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
484 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acquire:
485 ; CHECK: ldadda x1, x0, [x0]
486 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
490 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
491 ; CHECK-LABEL: atomicrmw_add_i64_aligned_release:
492 ; CHECK: ldaddl x1, x0, [x0]
493 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
497 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
498 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acq_rel:
499 ; CHECK: ldaddal x1, x0, [x0]
500 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
504 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
505 ; CHECK-LABEL: atomicrmw_add_i64_aligned_seq_cst:
506 ; CHECK: ldaddal x1, x0, [x0]
507 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
511 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
512 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
513 ; -O0: adds x2, x9, x11
514 ; -O0: subs w11, w11, #1
515 ; -O0: casp x0, x1, x2, x3, [x8]
516 ; -O0: eor x8, x10, x8
517 ; -O0: eor x11, x9, x11
518 ; -O0: orr x8, x8, x11
519 ; -O0: subs x8, x8, #0
521 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
522 ; -O1: ldp x4, x5, [x0]
523 ; -O1: adds x8, x4, x2
524 ; -O1: casp x4, x5, x8, x9, [x0]
526 ; -O1: ccmp x4, x6, #0, eq
527 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
531 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
532 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
533 ; -O0: adds x2, x9, x11
534 ; -O0: subs w11, w11, #1
535 ; -O0: caspa x0, x1, x2, x3, [x8]
536 ; -O0: eor x8, x10, x8
537 ; -O0: eor x11, x9, x11
538 ; -O0: orr x8, x8, x11
539 ; -O0: subs x8, x8, #0
541 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
542 ; -O1: ldp x4, x5, [x0]
543 ; -O1: adds x8, x4, x2
544 ; -O1: caspa x4, x5, x8, x9, [x0]
546 ; -O1: ccmp x4, x6, #0, eq
547 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
551 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
552 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
553 ; -O0: adds x2, x9, x11
554 ; -O0: subs w11, w11, #1
555 ; -O0: caspl x0, x1, x2, x3, [x8]
556 ; -O0: eor x8, x10, x8
557 ; -O0: eor x11, x9, x11
558 ; -O0: orr x8, x8, x11
559 ; -O0: subs x8, x8, #0
561 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
562 ; -O1: ldp x4, x5, [x0]
563 ; -O1: adds x8, x4, x2
564 ; -O1: caspl x4, x5, x8, x9, [x0]
566 ; -O1: ccmp x4, x6, #0, eq
567 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
571 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
572 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
573 ; -O0: adds x2, x9, x11
574 ; -O0: subs w11, w11, #1
575 ; -O0: caspal x0, x1, x2, x3, [x8]
576 ; -O0: eor x8, x10, x8
577 ; -O0: eor x11, x9, x11
578 ; -O0: orr x8, x8, x11
579 ; -O0: subs x8, x8, #0
581 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
582 ; -O1: ldp x4, x5, [x0]
583 ; -O1: adds x8, x4, x2
584 ; -O1: caspal x4, x5, x8, x9, [x0]
586 ; -O1: ccmp x4, x6, #0, eq
587 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
591 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
592 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
593 ; -O0: adds x2, x9, x11
594 ; -O0: subs w11, w11, #1
595 ; -O0: caspal x0, x1, x2, x3, [x8]
596 ; -O0: eor x8, x10, x8
597 ; -O0: eor x11, x9, x11
598 ; -O0: orr x8, x8, x11
599 ; -O0: subs x8, x8, #0
601 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
602 ; -O1: ldp x4, x5, [x0]
603 ; -O1: adds x8, x4, x2
604 ; -O1: caspal x4, x5, x8, x9, [x0]
606 ; -O1: ccmp x4, x6, #0, eq
607 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
611 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
612 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
613 ; CHECK: ldaddb w1, w0, [x0]
614 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
618 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
619 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
620 ; CHECK: ldaddab w1, w0, [x0]
621 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
625 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
626 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
627 ; CHECK: ldaddlb w1, w0, [x0]
628 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
632 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
633 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
634 ; CHECK: ldaddalb w1, w0, [x0]
635 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
639 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
640 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
641 ; CHECK: ldaddalb w1, w0, [x0]
642 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
646 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
647 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
648 ; -O0: add w8, w8, w9, uxth
649 ; -O0: bl __atomic_compare_exchange
651 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
652 ; -O1: add w8, w0, w20
653 ; -O1: bl __atomic_compare_exchange
654 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
658 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
659 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
660 ; -O0: add w8, w8, w9, uxth
661 ; -O0: bl __atomic_compare_exchange
663 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
664 ; -O1: add w8, w0, w20
665 ; -O1: bl __atomic_compare_exchange
666 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
670 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
671 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
672 ; -O0: add w8, w8, w9, uxth
673 ; -O0: bl __atomic_compare_exchange
675 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
676 ; -O1: add w8, w0, w20
677 ; -O1: bl __atomic_compare_exchange
678 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
682 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
683 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
684 ; -O0: add w8, w8, w9, uxth
685 ; -O0: bl __atomic_compare_exchange
687 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
688 ; -O1: add w8, w0, w20
689 ; -O1: bl __atomic_compare_exchange
690 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
694 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
695 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
696 ; -O0: add w8, w8, w9, uxth
697 ; -O0: bl __atomic_compare_exchange
699 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
700 ; -O1: add w8, w0, w20
701 ; -O1: bl __atomic_compare_exchange
702 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
706 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
707 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
708 ; -O0: add w8, w9, w8
709 ; -O0: bl __atomic_compare_exchange
711 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
712 ; -O1: add w8, w0, w20
713 ; -O1: bl __atomic_compare_exchange
714 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
718 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
719 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
720 ; -O0: add w8, w9, w8
721 ; -O0: bl __atomic_compare_exchange
723 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
724 ; -O1: add w8, w0, w20
725 ; -O1: bl __atomic_compare_exchange
726 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
730 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
731 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
732 ; -O0: add w8, w9, w8
733 ; -O0: bl __atomic_compare_exchange
735 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
736 ; -O1: add w8, w0, w20
737 ; -O1: bl __atomic_compare_exchange
738 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
742 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
743 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
744 ; -O0: add w8, w9, w8
745 ; -O0: bl __atomic_compare_exchange
747 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
748 ; -O1: add w8, w0, w20
749 ; -O1: bl __atomic_compare_exchange
750 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
754 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
755 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
756 ; -O0: add w8, w9, w8
757 ; -O0: bl __atomic_compare_exchange
759 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
760 ; -O1: add w8, w0, w20
761 ; -O1: bl __atomic_compare_exchange
762 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
766 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
767 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
768 ; -O0: add x8, x9, x8
769 ; -O0: bl __atomic_compare_exchange
771 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
772 ; -O1: add x8, x0, x20
773 ; -O1: bl __atomic_compare_exchange
774 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
778 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
779 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
780 ; -O0: add x8, x9, x8
781 ; -O0: bl __atomic_compare_exchange
783 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
784 ; -O1: add x8, x0, x20
785 ; -O1: bl __atomic_compare_exchange
786 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
790 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
791 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
792 ; -O0: add x8, x9, x8
793 ; -O0: bl __atomic_compare_exchange
795 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
796 ; -O1: add x8, x0, x20
797 ; -O1: bl __atomic_compare_exchange
798 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
802 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
803 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
804 ; -O0: add x8, x9, x8
805 ; -O0: bl __atomic_compare_exchange
807 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
808 ; -O1: add x8, x0, x20
809 ; -O1: bl __atomic_compare_exchange
810 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
814 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
815 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
816 ; -O0: add x8, x9, x8
817 ; -O0: bl __atomic_compare_exchange
819 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
820 ; -O1: add x8, x0, x20
821 ; -O1: bl __atomic_compare_exchange
822 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
826 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
827 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
828 ; -O0: adds x9, x8, x9
829 ; -O0: subs w11, w11, #1
830 ; -O0: bl __atomic_compare_exchange
832 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
833 ; -O1: ldp x0, x1, [x0]
834 ; -O1: adds x8, x0, x21
835 ; -O1: bl __atomic_compare_exchange
836 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
840 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
841 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
842 ; -O0: adds x9, x8, x9
843 ; -O0: subs w11, w11, #1
844 ; -O0: bl __atomic_compare_exchange
846 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
847 ; -O1: ldp x0, x1, [x0]
848 ; -O1: adds x8, x0, x21
849 ; -O1: bl __atomic_compare_exchange
850 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
854 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
855 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
856 ; -O0: adds x9, x8, x9
857 ; -O0: subs w11, w11, #1
858 ; -O0: bl __atomic_compare_exchange
860 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
861 ; -O1: ldp x0, x1, [x0]
862 ; -O1: adds x8, x0, x21
863 ; -O1: bl __atomic_compare_exchange
864 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
868 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
869 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
870 ; -O0: adds x9, x8, x9
871 ; -O0: subs w11, w11, #1
872 ; -O0: bl __atomic_compare_exchange
874 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
875 ; -O1: ldp x0, x1, [x0]
876 ; -O1: adds x8, x0, x21
877 ; -O1: bl __atomic_compare_exchange
878 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
882 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
883 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
884 ; -O0: adds x9, x8, x9
885 ; -O0: subs w11, w11, #1
886 ; -O0: bl __atomic_compare_exchange
888 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
889 ; -O1: ldp x0, x1, [x0]
890 ; -O1: adds x8, x0, x21
891 ; -O1: bl __atomic_compare_exchange
892 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
896 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
897 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_monotonic:
898 ; CHECK: ldaddb w8, w0, [x0]
899 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
903 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
904 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acquire:
905 ; CHECK: ldaddab w8, w0, [x0]
906 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
910 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
911 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_release:
912 ; CHECK: ldaddlb w8, w0, [x0]
913 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
917 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
918 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
919 ; CHECK: ldaddalb w8, w0, [x0]
920 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
924 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
925 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
926 ; CHECK: ldaddalb w8, w0, [x0]
927 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
931 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
932 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_monotonic:
933 ; CHECK: ldaddh w8, w0, [x0]
934 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
938 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
939 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acquire:
940 ; CHECK: ldaddah w8, w0, [x0]
941 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
945 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
946 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_release:
947 ; CHECK: ldaddlh w8, w0, [x0]
948 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
952 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
953 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
954 ; CHECK: ldaddalh w8, w0, [x0]
955 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
959 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
960 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
961 ; CHECK: ldaddalh w8, w0, [x0]
962 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
966 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
967 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_monotonic:
968 ; CHECK: ldadd w8, w0, [x0]
969 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
973 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
974 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acquire:
975 ; CHECK: ldadda w8, w0, [x0]
976 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
980 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
981 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_release:
982 ; CHECK: ldaddl w8, w0, [x0]
983 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
987 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
988 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
989 ; CHECK: ldaddal w8, w0, [x0]
990 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
994 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
995 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
996 ; CHECK: ldaddal w8, w0, [x0]
997 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1001 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1002 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1003 ; CHECK: ldadd x8, x0, [x0]
1004 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1008 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1009 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acquire:
1010 ; CHECK: ldadda x8, x0, [x0]
1011 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1015 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1016 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_release:
1017 ; CHECK: ldaddl x8, x0, [x0]
1018 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1022 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1023 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1024 ; CHECK: ldaddal x8, x0, [x0]
1025 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1029 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1030 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1031 ; CHECK: ldaddal x8, x0, [x0]
1032 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1036 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1037 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1038 ; -O0: subs x2, x9, x11
1039 ; -O0: casp x0, x1, x2, x3, [x8]
1040 ; -O0: eor x8, x10, x8
1041 ; -O0: eor x11, x9, x11
1042 ; -O0: orr x8, x8, x11
1043 ; -O0: subs x8, x8, #0
1045 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1046 ; -O1: ldp x4, x5, [x0]
1047 ; -O1: subs x8, x4, x2
1048 ; -O1: casp x4, x5, x8, x9, [x0]
1050 ; -O1: ccmp x4, x6, #0, eq
1051 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1055 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1056 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1057 ; -O0: subs x2, x9, x11
1058 ; -O0: caspa x0, x1, x2, x3, [x8]
1059 ; -O0: eor x8, x10, x8
1060 ; -O0: eor x11, x9, x11
1061 ; -O0: orr x8, x8, x11
1062 ; -O0: subs x8, x8, #0
1064 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1065 ; -O1: ldp x4, x5, [x0]
1066 ; -O1: subs x8, x4, x2
1067 ; -O1: caspa x4, x5, x8, x9, [x0]
1069 ; -O1: ccmp x4, x6, #0, eq
1070 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1074 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1075 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1076 ; -O0: subs x2, x9, x11
1077 ; -O0: caspl x0, x1, x2, x3, [x8]
1078 ; -O0: eor x8, x10, x8
1079 ; -O0: eor x11, x9, x11
1080 ; -O0: orr x8, x8, x11
1081 ; -O0: subs x8, x8, #0
1083 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1084 ; -O1: ldp x4, x5, [x0]
1085 ; -O1: subs x8, x4, x2
1086 ; -O1: caspl x4, x5, x8, x9, [x0]
1088 ; -O1: ccmp x4, x6, #0, eq
1089 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1093 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1094 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1095 ; -O0: subs x2, x9, x11
1096 ; -O0: caspal x0, x1, x2, x3, [x8]
1097 ; -O0: eor x8, x10, x8
1098 ; -O0: eor x11, x9, x11
1099 ; -O0: orr x8, x8, x11
1100 ; -O0: subs x8, x8, #0
1102 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1103 ; -O1: ldp x4, x5, [x0]
1104 ; -O1: subs x8, x4, x2
1105 ; -O1: caspal x4, x5, x8, x9, [x0]
1107 ; -O1: ccmp x4, x6, #0, eq
1108 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1112 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1113 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1114 ; -O0: subs x2, x9, x11
1115 ; -O0: caspal x0, x1, x2, x3, [x8]
1116 ; -O0: eor x8, x10, x8
1117 ; -O0: eor x11, x9, x11
1118 ; -O0: orr x8, x8, x11
1119 ; -O0: subs x8, x8, #0
1121 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1122 ; -O1: ldp x4, x5, [x0]
1123 ; -O1: subs x8, x4, x2
1124 ; -O1: caspal x4, x5, x8, x9, [x0]
1126 ; -O1: ccmp x4, x6, #0, eq
1127 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1131 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1132 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1133 ; CHECK: ldaddb w8, w0, [x0]
1134 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1138 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1139 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1140 ; CHECK: ldaddab w8, w0, [x0]
1141 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1145 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1146 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_release:
1147 ; CHECK: ldaddlb w8, w0, [x0]
1148 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1152 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1153 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1154 ; CHECK: ldaddalb w8, w0, [x0]
1155 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1159 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1160 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1161 ; CHECK: ldaddalb w8, w0, [x0]
1162 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1166 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1167 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1168 ; -O0: subs w8, w9, w8
1169 ; -O0: bl __atomic_compare_exchange
1171 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1172 ; -O1: sub w8, w0, w20
1173 ; -O1: bl __atomic_compare_exchange
1174 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1178 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1179 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1180 ; -O0: subs w8, w9, w8
1181 ; -O0: bl __atomic_compare_exchange
1183 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1184 ; -O1: sub w8, w0, w20
1185 ; -O1: bl __atomic_compare_exchange
1186 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1190 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1191 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1192 ; -O0: subs w8, w9, w8
1193 ; -O0: bl __atomic_compare_exchange
1195 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1196 ; -O1: sub w8, w0, w20
1197 ; -O1: bl __atomic_compare_exchange
1198 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1202 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1203 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1204 ; -O0: subs w8, w9, w8
1205 ; -O0: bl __atomic_compare_exchange
1207 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1208 ; -O1: sub w8, w0, w20
1209 ; -O1: bl __atomic_compare_exchange
1210 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1214 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1215 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1216 ; -O0: subs w8, w9, w8
1217 ; -O0: bl __atomic_compare_exchange
1219 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1220 ; -O1: sub w8, w0, w20
1221 ; -O1: bl __atomic_compare_exchange
1222 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1226 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1227 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1228 ; -O0: subs w8, w9, w8
1229 ; -O0: bl __atomic_compare_exchange
1231 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1232 ; -O1: sub w8, w0, w20
1233 ; -O1: bl __atomic_compare_exchange
1234 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1238 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1239 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1240 ; -O0: subs w8, w9, w8
1241 ; -O0: bl __atomic_compare_exchange
1243 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1244 ; -O1: sub w8, w0, w20
1245 ; -O1: bl __atomic_compare_exchange
1246 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1250 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1251 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1252 ; -O0: subs w8, w9, w8
1253 ; -O0: bl __atomic_compare_exchange
1255 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1256 ; -O1: sub w8, w0, w20
1257 ; -O1: bl __atomic_compare_exchange
1258 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1262 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1263 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1264 ; -O0: subs w8, w9, w8
1265 ; -O0: bl __atomic_compare_exchange
1267 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1268 ; -O1: sub w8, w0, w20
1269 ; -O1: bl __atomic_compare_exchange
1270 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1274 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1275 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1276 ; -O0: subs w8, w9, w8
1277 ; -O0: bl __atomic_compare_exchange
1279 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1280 ; -O1: sub w8, w0, w20
1281 ; -O1: bl __atomic_compare_exchange
1282 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1286 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1287 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1288 ; -O0: subs x8, x9, x8
1289 ; -O0: bl __atomic_compare_exchange
1291 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1292 ; -O1: sub x8, x0, x20
1293 ; -O1: bl __atomic_compare_exchange
1294 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1298 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1299 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1300 ; -O0: subs x8, x9, x8
1301 ; -O0: bl __atomic_compare_exchange
1303 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1304 ; -O1: sub x8, x0, x20
1305 ; -O1: bl __atomic_compare_exchange
1306 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1310 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1311 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1312 ; -O0: subs x8, x9, x8
1313 ; -O0: bl __atomic_compare_exchange
1315 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1316 ; -O1: sub x8, x0, x20
1317 ; -O1: bl __atomic_compare_exchange
1318 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1322 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1323 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1324 ; -O0: subs x8, x9, x8
1325 ; -O0: bl __atomic_compare_exchange
1327 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1328 ; -O1: sub x8, x0, x20
1329 ; -O1: bl __atomic_compare_exchange
1330 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1334 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1335 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1336 ; -O0: subs x8, x9, x8
1337 ; -O0: bl __atomic_compare_exchange
1339 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1340 ; -O1: sub x8, x0, x20
1341 ; -O1: bl __atomic_compare_exchange
1342 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1346 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1347 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1348 ; -O0: subs x9, x8, x9
1349 ; -O0: bl __atomic_compare_exchange
1351 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1352 ; -O1: ldp x0, x1, [x0]
1353 ; -O1: subs x8, x0, x21
1354 ; -O1: bl __atomic_compare_exchange
1355 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1359 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1360 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1361 ; -O0: subs x9, x8, x9
1362 ; -O0: bl __atomic_compare_exchange
1364 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1365 ; -O1: ldp x0, x1, [x0]
1366 ; -O1: subs x8, x0, x21
1367 ; -O1: bl __atomic_compare_exchange
1368 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1372 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1373 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1374 ; -O0: subs x9, x8, x9
1375 ; -O0: bl __atomic_compare_exchange
1377 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1378 ; -O1: ldp x0, x1, [x0]
1379 ; -O1: subs x8, x0, x21
1380 ; -O1: bl __atomic_compare_exchange
1381 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1385 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1386 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1387 ; -O0: subs x9, x8, x9
1388 ; -O0: bl __atomic_compare_exchange
1390 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1391 ; -O1: ldp x0, x1, [x0]
1392 ; -O1: subs x8, x0, x21
1393 ; -O1: bl __atomic_compare_exchange
1394 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1398 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1399 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1400 ; -O0: subs x9, x8, x9
1401 ; -O0: bl __atomic_compare_exchange
1403 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1404 ; -O1: ldp x0, x1, [x0]
1405 ; -O1: subs x8, x0, x21
1406 ; -O1: bl __atomic_compare_exchange
1407 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1411 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1412 ; CHECK-LABEL: atomicrmw_and_i8_aligned_monotonic:
1414 ; CHECK: ldclrb w8, w0, [x0]
1415 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1419 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1420 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acquire:
1422 ; CHECK: ldclrab w8, w0, [x0]
1423 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1427 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1428 ; CHECK-LABEL: atomicrmw_and_i8_aligned_release:
1430 ; CHECK: ldclrlb w8, w0, [x0]
1431 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1435 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1436 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1438 ; CHECK: ldclralb w8, w0, [x0]
1439 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1443 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1444 ; CHECK-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1446 ; CHECK: ldclralb w8, w0, [x0]
1447 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1451 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1452 ; CHECK-LABEL: atomicrmw_and_i16_aligned_monotonic:
1454 ; CHECK: ldclrh w8, w0, [x0]
1455 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1459 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1460 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acquire:
1462 ; CHECK: ldclrah w8, w0, [x0]
1463 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1467 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1468 ; CHECK-LABEL: atomicrmw_and_i16_aligned_release:
1470 ; CHECK: ldclrlh w8, w0, [x0]
1471 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1475 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1476 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1478 ; CHECK: ldclralh w8, w0, [x0]
1479 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1483 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1484 ; CHECK-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1486 ; CHECK: ldclralh w8, w0, [x0]
1487 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1491 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1492 ; CHECK-LABEL: atomicrmw_and_i32_aligned_monotonic:
1494 ; CHECK: ldclr w8, w0, [x0]
1495 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1499 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1500 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acquire:
1502 ; CHECK: ldclra w8, w0, [x0]
1503 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1507 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1508 ; CHECK-LABEL: atomicrmw_and_i32_aligned_release:
1510 ; CHECK: ldclrl w8, w0, [x0]
1511 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1515 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1516 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1518 ; CHECK: ldclral w8, w0, [x0]
1519 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1523 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1524 ; CHECK-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1526 ; CHECK: ldclral w8, w0, [x0]
1527 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1531 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1532 ; CHECK-LABEL: atomicrmw_and_i64_aligned_monotonic:
1534 ; CHECK: ldclr x8, x0, [x0]
1535 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1539 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1540 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acquire:
1542 ; CHECK: ldclra x8, x0, [x0]
1543 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1547 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1548 ; CHECK-LABEL: atomicrmw_and_i64_aligned_release:
1550 ; CHECK: ldclrl x8, x0, [x0]
1551 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1555 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1556 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1558 ; CHECK: ldclral x8, x0, [x0]
1559 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1563 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1564 ; CHECK-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1566 ; CHECK: ldclral x8, x0, [x0]
1567 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1571 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1572 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1575 ; -O0: ldclrp x0, x1, [x8]
1577 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1580 ; -O1: ldclrp x8, x1, [x0]
1581 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1585 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1586 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1589 ; -O0: ldclrpa x0, x1, [x8]
1591 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1594 ; -O1: ldclrpa x8, x1, [x0]
1595 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1599 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1600 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1603 ; -O0: ldclrpl x0, x1, [x8]
1605 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1608 ; -O1: ldclrpl x8, x1, [x0]
1609 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1613 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1614 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1617 ; -O0: ldclrpal x0, x1, [x8]
1619 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1622 ; -O1: ldclrpal x8, x1, [x0]
1623 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1627 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1628 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1631 ; -O0: ldclrpal x0, x1, [x8]
1633 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1636 ; -O1: ldclrpal x8, x1, [x0]
1637 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1641 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1642 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1644 ; CHECK: ldclrb w8, w0, [x0]
1645 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1649 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1650 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acquire:
1652 ; CHECK: ldclrab w8, w0, [x0]
1653 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1657 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1658 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_release:
1660 ; CHECK: ldclrlb w8, w0, [x0]
1661 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1665 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1666 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1668 ; CHECK: ldclralb w8, w0, [x0]
1669 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1673 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1674 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1676 ; CHECK: ldclralb w8, w0, [x0]
1677 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1681 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1682 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1683 ; -O0: and w8, w9, w8
1684 ; -O0: bl __atomic_compare_exchange
1686 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1687 ; -O1: and w8, w0, w20
1688 ; -O1: bl __atomic_compare_exchange
1689 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1693 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1694 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1695 ; -O0: and w8, w9, w8
1696 ; -O0: bl __atomic_compare_exchange
1698 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1699 ; -O1: and w8, w0, w20
1700 ; -O1: bl __atomic_compare_exchange
1701 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1705 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1706 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1707 ; -O0: and w8, w9, w8
1708 ; -O0: bl __atomic_compare_exchange
1710 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1711 ; -O1: and w8, w0, w20
1712 ; -O1: bl __atomic_compare_exchange
1713 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1717 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1718 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1719 ; -O0: and w8, w9, w8
1720 ; -O0: bl __atomic_compare_exchange
1722 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1723 ; -O1: and w8, w0, w20
1724 ; -O1: bl __atomic_compare_exchange
1725 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1729 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1730 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1731 ; -O0: and w8, w9, w8
1732 ; -O0: bl __atomic_compare_exchange
1734 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1735 ; -O1: and w8, w0, w20
1736 ; -O1: bl __atomic_compare_exchange
1737 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1741 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1742 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1743 ; -O0: and w8, w9, w8
1744 ; -O0: bl __atomic_compare_exchange
1746 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1747 ; -O1: and w8, w0, w20
1748 ; -O1: bl __atomic_compare_exchange
1749 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1753 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1754 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1755 ; -O0: and w8, w9, w8
1756 ; -O0: bl __atomic_compare_exchange
1758 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1759 ; -O1: and w8, w0, w20
1760 ; -O1: bl __atomic_compare_exchange
1761 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1765 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1766 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1767 ; -O0: and w8, w9, w8
1768 ; -O0: bl __atomic_compare_exchange
1770 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
1771 ; -O1: and w8, w0, w20
1772 ; -O1: bl __atomic_compare_exchange
1773 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
1777 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1778 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1779 ; -O0: and w8, w9, w8
1780 ; -O0: bl __atomic_compare_exchange
1782 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1783 ; -O1: and w8, w0, w20
1784 ; -O1: bl __atomic_compare_exchange
1785 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
1789 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1790 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1791 ; -O0: and w8, w9, w8
1792 ; -O0: bl __atomic_compare_exchange
1794 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1795 ; -O1: and w8, w0, w20
1796 ; -O1: bl __atomic_compare_exchange
1797 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
1801 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1802 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1803 ; -O0: and x8, x9, x8
1804 ; -O0: bl __atomic_compare_exchange
1806 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1807 ; -O1: and x8, x0, x20
1808 ; -O1: bl __atomic_compare_exchange
1809 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
1813 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1814 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
1815 ; -O0: and x8, x9, x8
1816 ; -O0: bl __atomic_compare_exchange
1818 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
1819 ; -O1: and x8, x0, x20
1820 ; -O1: bl __atomic_compare_exchange
1821 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
1825 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
1826 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
1827 ; -O0: and x8, x9, x8
1828 ; -O0: bl __atomic_compare_exchange
1830 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
1831 ; -O1: and x8, x0, x20
1832 ; -O1: bl __atomic_compare_exchange
1833 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
1837 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1838 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1839 ; -O0: and x8, x9, x8
1840 ; -O0: bl __atomic_compare_exchange
1842 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1843 ; -O1: and x8, x0, x20
1844 ; -O1: bl __atomic_compare_exchange
1845 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
1849 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1850 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1851 ; -O0: and x8, x9, x8
1852 ; -O0: bl __atomic_compare_exchange
1854 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1855 ; -O1: and x8, x0, x20
1856 ; -O1: bl __atomic_compare_exchange
1857 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
1861 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1862 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1863 ; -O0: and x9, x8, x9
1864 ; -O0: and x8, x8, x10
1865 ; -O0: bl __atomic_compare_exchange
1867 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1868 ; -O1: ldp x0, x1, [x0]
1869 ; -O1: and x8, x1, x19
1870 ; -O1: and x9, x0, x21
1871 ; -O1: bl __atomic_compare_exchange
1872 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
1876 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1877 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
1878 ; -O0: and x9, x8, x9
1879 ; -O0: and x8, x8, x10
1880 ; -O0: bl __atomic_compare_exchange
1882 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
1883 ; -O1: ldp x0, x1, [x0]
1884 ; -O1: and x8, x1, x19
1885 ; -O1: and x9, x0, x21
1886 ; -O1: bl __atomic_compare_exchange
1887 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
1891 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
1892 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
1893 ; -O0: and x9, x8, x9
1894 ; -O0: and x8, x8, x10
1895 ; -O0: bl __atomic_compare_exchange
1897 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
1898 ; -O1: ldp x0, x1, [x0]
1899 ; -O1: and x8, x1, x19
1900 ; -O1: and x9, x0, x21
1901 ; -O1: bl __atomic_compare_exchange
1902 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
1906 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1907 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1908 ; -O0: and x9, x8, x9
1909 ; -O0: and x8, x8, x10
1910 ; -O0: bl __atomic_compare_exchange
1912 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1913 ; -O1: ldp x0, x1, [x0]
1914 ; -O1: and x8, x1, x19
1915 ; -O1: and x9, x0, x21
1916 ; -O1: bl __atomic_compare_exchange
1917 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
1921 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1922 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1923 ; -O0: and x9, x8, x9
1924 ; -O0: and x8, x8, x10
1925 ; -O0: bl __atomic_compare_exchange
1927 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1928 ; -O1: ldp x0, x1, [x0]
1929 ; -O1: and x8, x1, x19
1930 ; -O1: and x9, x0, x21
1931 ; -O1: bl __atomic_compare_exchange
1932 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
1936 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1937 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
1938 ; -O0: and w8, w10, w8
1940 ; -O0: casb w9, w8, [x11]
1941 ; -O0: and w8, w9, #0xff
1942 ; -O0: subs w8, w8, w10, uxtb
1944 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
1945 ; -O1: and w10, w8, w1
1947 ; -O1: casb w9, w10, [x0]
1948 ; -O1: cmp w9, w8, uxtb
1949 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
1953 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
1954 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
1955 ; -O0: and w8, w10, w8
1957 ; -O0: casab w9, w8, [x11]
1958 ; -O0: and w8, w9, #0xff
1959 ; -O0: subs w8, w8, w10, uxtb
1961 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
1962 ; -O1: and w10, w8, w1
1964 ; -O1: casab w9, w10, [x0]
1965 ; -O1: cmp w9, w8, uxtb
1966 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
1970 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
1971 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
1972 ; -O0: and w8, w10, w8
1974 ; -O0: caslb w9, w8, [x11]
1975 ; -O0: and w8, w9, #0xff
1976 ; -O0: subs w8, w8, w10, uxtb
1978 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
1979 ; -O1: and w10, w8, w1
1981 ; -O1: caslb w9, w10, [x0]
1982 ; -O1: cmp w9, w8, uxtb
1983 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
1987 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1988 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
1989 ; -O0: and w8, w10, w8
1991 ; -O0: casalb w9, w8, [x11]
1992 ; -O0: and w8, w9, #0xff
1993 ; -O0: subs w8, w8, w10, uxtb
1995 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
1996 ; -O1: and w10, w8, w1
1998 ; -O1: casalb w9, w10, [x0]
1999 ; -O1: cmp w9, w8, uxtb
2000 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2004 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2005 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2006 ; -O0: and w8, w10, w8
2008 ; -O0: casalb w9, w8, [x11]
2009 ; -O0: and w8, w9, #0xff
2010 ; -O0: subs w8, w8, w10, uxtb
2012 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2013 ; -O1: and w10, w8, w1
2015 ; -O1: casalb w9, w10, [x0]
2016 ; -O1: cmp w9, w8, uxtb
2017 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2021 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2022 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2023 ; -O0: and w9, w8, w9
2025 ; -O0: cash w9, w10, [x11]
2026 ; -O0: subs w8, w8, w9, uxth
2028 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2029 ; -O1: and w10, w8, w1
2031 ; -O1: cash w9, w10, [x0]
2032 ; -O1: cmp w9, w8, uxth
2033 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2037 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2038 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2039 ; -O0: and w9, w8, w9
2041 ; -O0: casah w9, w10, [x11]
2042 ; -O0: subs w8, w8, w9, uxth
2044 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2045 ; -O1: and w10, w8, w1
2047 ; -O1: casah w9, w10, [x0]
2048 ; -O1: cmp w9, w8, uxth
2049 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2053 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2054 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2055 ; -O0: and w9, w8, w9
2057 ; -O0: caslh w9, w10, [x11]
2058 ; -O0: subs w8, w8, w9, uxth
2060 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2061 ; -O1: and w10, w8, w1
2063 ; -O1: caslh w9, w10, [x0]
2064 ; -O1: cmp w9, w8, uxth
2065 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2069 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2070 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2071 ; -O0: and w9, w8, w9
2073 ; -O0: casalh w9, w10, [x11]
2074 ; -O0: subs w8, w8, w9, uxth
2076 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2077 ; -O1: and w10, w8, w1
2079 ; -O1: casalh w9, w10, [x0]
2080 ; -O1: cmp w9, w8, uxth
2081 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2085 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2086 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2087 ; -O0: and w9, w8, w9
2089 ; -O0: casalh w9, w10, [x11]
2090 ; -O0: subs w8, w8, w9, uxth
2092 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2093 ; -O1: and w10, w8, w1
2095 ; -O1: casalh w9, w10, [x0]
2096 ; -O1: cmp w9, w8, uxth
2097 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2101 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2102 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2103 ; -O0: and w9, w8, w9
2105 ; -O0: cas w9, w10, [x11]
2106 ; -O0: subs w8, w9, w8
2108 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2109 ; -O1: and w10, w8, w1
2111 ; -O1: cas w9, w10, [x0]
2113 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2117 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2118 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2119 ; -O0: and w9, w8, w9
2121 ; -O0: casa w9, w10, [x11]
2122 ; -O0: subs w8, w9, w8
2124 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2125 ; -O1: and w10, w8, w1
2127 ; -O1: casa w9, w10, [x0]
2129 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2133 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2134 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2135 ; -O0: and w9, w8, w9
2137 ; -O0: casl w9, w10, [x11]
2138 ; -O0: subs w8, w9, w8
2140 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2141 ; -O1: and w10, w8, w1
2143 ; -O1: casl w9, w10, [x0]
2145 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2149 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2150 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2151 ; -O0: and w9, w8, w9
2153 ; -O0: casal w9, w10, [x11]
2154 ; -O0: subs w8, w9, w8
2156 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2157 ; -O1: and w10, w8, w1
2159 ; -O1: casal w9, w10, [x0]
2161 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2165 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2166 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2167 ; -O0: and w9, w8, w9
2169 ; -O0: casal w9, w10, [x11]
2170 ; -O0: subs w8, w9, w8
2172 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2173 ; -O1: and w10, w8, w1
2175 ; -O1: casal w9, w10, [x0]
2177 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2181 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2182 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2183 ; -O0: and x9, x8, x9
2185 ; -O0: cas x9, x10, [x11]
2186 ; -O0: subs x8, x9, x8
2188 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2189 ; -O1: and x10, x8, x1
2191 ; -O1: cas x9, x10, [x0]
2193 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2197 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2198 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2199 ; -O0: and x9, x8, x9
2201 ; -O0: casa x9, x10, [x11]
2202 ; -O0: subs x8, x9, x8
2204 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2205 ; -O1: and x10, x8, x1
2207 ; -O1: casa x9, x10, [x0]
2209 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2213 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2214 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2215 ; -O0: and x9, x8, x9
2217 ; -O0: casl x9, x10, [x11]
2218 ; -O0: subs x8, x9, x8
2220 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2221 ; -O1: and x10, x8, x1
2223 ; -O1: casl x9, x10, [x0]
2225 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2229 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2230 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2231 ; -O0: and x9, x8, x9
2233 ; -O0: casal x9, x10, [x11]
2234 ; -O0: subs x8, x9, x8
2236 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2237 ; -O1: and x10, x8, x1
2239 ; -O1: casal x9, x10, [x0]
2241 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2245 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2246 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2247 ; -O0: and x9, x8, x9
2249 ; -O0: casal x9, x10, [x11]
2250 ; -O0: subs x8, x9, x8
2252 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2253 ; -O1: and x10, x8, x1
2255 ; -O1: casal x9, x10, [x0]
2257 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2261 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2262 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2263 ; -O0: and x10, x9, x10
2264 ; -O0: and x9, x9, x11
2267 ; -O0: casp x0, x1, x2, x3, [x8]
2268 ; -O0: eor x8, x10, x8
2269 ; -O0: eor x11, x9, x11
2270 ; -O0: orr x8, x8, x11
2271 ; -O0: subs x8, x8, #0
2273 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2274 ; -O1: ldp x4, x5, [x0]
2275 ; -O1: and x8, x4, x2
2276 ; -O1: and x9, x7, x3
2279 ; -O1: casp x4, x5, x10, x11, [x0]
2281 ; -O1: ccmp x4, x6, #0, eq
2282 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2286 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2287 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2288 ; -O0: and x10, x9, x10
2289 ; -O0: and x9, x9, x11
2292 ; -O0: caspa x0, x1, x2, x3, [x8]
2293 ; -O0: eor x8, x10, x8
2294 ; -O0: eor x11, x9, x11
2295 ; -O0: orr x8, x8, x11
2296 ; -O0: subs x8, x8, #0
2298 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2299 ; -O1: ldp x4, x5, [x0]
2300 ; -O1: and x8, x4, x2
2301 ; -O1: and x9, x7, x3
2304 ; -O1: caspa x4, x5, x10, x11, [x0]
2306 ; -O1: ccmp x4, x6, #0, eq
2307 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2311 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2312 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2313 ; -O0: and x10, x9, x10
2314 ; -O0: and x9, x9, x11
2317 ; -O0: caspl x0, x1, x2, x3, [x8]
2318 ; -O0: eor x8, x10, x8
2319 ; -O0: eor x11, x9, x11
2320 ; -O0: orr x8, x8, x11
2321 ; -O0: subs x8, x8, #0
2323 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2324 ; -O1: ldp x4, x5, [x0]
2325 ; -O1: and x8, x4, x2
2326 ; -O1: and x9, x7, x3
2329 ; -O1: caspl x4, x5, x10, x11, [x0]
2331 ; -O1: ccmp x4, x6, #0, eq
2332 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2336 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2337 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2338 ; -O0: and x10, x9, x10
2339 ; -O0: and x9, x9, x11
2342 ; -O0: caspal x0, x1, x2, x3, [x8]
2343 ; -O0: eor x8, x10, x8
2344 ; -O0: eor x11, x9, x11
2345 ; -O0: orr x8, x8, x11
2346 ; -O0: subs x8, x8, #0
2348 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2349 ; -O1: ldp x4, x5, [x0]
2350 ; -O1: and x8, x4, x2
2351 ; -O1: and x9, x7, x3
2354 ; -O1: caspal x4, x5, x10, x11, [x0]
2356 ; -O1: ccmp x4, x6, #0, eq
2357 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2361 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2362 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2363 ; -O0: and x10, x9, x10
2364 ; -O0: and x9, x9, x11
2367 ; -O0: caspal x0, x1, x2, x3, [x8]
2368 ; -O0: eor x8, x10, x8
2369 ; -O0: eor x11, x9, x11
2370 ; -O0: orr x8, x8, x11
2371 ; -O0: subs x8, x8, #0
2373 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2374 ; -O1: ldp x4, x5, [x0]
2375 ; -O1: and x8, x4, x2
2376 ; -O1: and x9, x7, x3
2379 ; -O1: caspal x4, x5, x10, x11, [x0]
2381 ; -O1: ccmp x4, x6, #0, eq
2382 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2386 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2387 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2388 ; -O0: and w8, w10, w8
2390 ; -O0: casb w9, w8, [x11]
2391 ; -O0: and w8, w9, #0xff
2392 ; -O0: subs w8, w8, w10, uxtb
2394 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2395 ; -O1: and w10, w8, w1
2397 ; -O1: casb w9, w10, [x0]
2398 ; -O1: cmp w9, w8, uxtb
2399 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2403 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2404 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2405 ; -O0: and w8, w10, w8
2407 ; -O0: casab w9, w8, [x11]
2408 ; -O0: and w8, w9, #0xff
2409 ; -O0: subs w8, w8, w10, uxtb
2411 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2412 ; -O1: and w10, w8, w1
2414 ; -O1: casab w9, w10, [x0]
2415 ; -O1: cmp w9, w8, uxtb
2416 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2420 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2421 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2422 ; -O0: and w8, w10, w8
2424 ; -O0: caslb w9, w8, [x11]
2425 ; -O0: and w8, w9, #0xff
2426 ; -O0: subs w8, w8, w10, uxtb
2428 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2429 ; -O1: and w10, w8, w1
2431 ; -O1: caslb w9, w10, [x0]
2432 ; -O1: cmp w9, w8, uxtb
2433 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2437 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2438 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2439 ; -O0: and w8, w10, w8
2441 ; -O0: casalb w9, w8, [x11]
2442 ; -O0: and w8, w9, #0xff
2443 ; -O0: subs w8, w8, w10, uxtb
2445 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2446 ; -O1: and w10, w8, w1
2448 ; -O1: casalb w9, w10, [x0]
2449 ; -O1: cmp w9, w8, uxtb
2450 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2454 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2455 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2456 ; -O0: and w8, w10, w8
2458 ; -O0: casalb w9, w8, [x11]
2459 ; -O0: and w8, w9, #0xff
2460 ; -O0: subs w8, w8, w10, uxtb
2462 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2463 ; -O1: and w10, w8, w1
2465 ; -O1: casalb w9, w10, [x0]
2466 ; -O1: cmp w9, w8, uxtb
2467 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2471 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2472 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2473 ; -O0: and w8, w9, w8
2475 ; -O0: bl __atomic_compare_exchange
2477 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2478 ; -O1: and w8, w0, w20
2480 ; -O1: bl __atomic_compare_exchange
2481 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2485 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2486 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2487 ; -O0: and w8, w9, w8
2489 ; -O0: bl __atomic_compare_exchange
2491 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2492 ; -O1: and w8, w0, w20
2494 ; -O1: bl __atomic_compare_exchange
2495 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2499 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2500 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2501 ; -O0: and w8, w9, w8
2503 ; -O0: bl __atomic_compare_exchange
2505 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2506 ; -O1: and w8, w0, w20
2508 ; -O1: bl __atomic_compare_exchange
2509 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2513 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2514 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2515 ; -O0: and w8, w9, w8
2517 ; -O0: bl __atomic_compare_exchange
2519 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2520 ; -O1: and w8, w0, w20
2522 ; -O1: bl __atomic_compare_exchange
2523 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2527 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2528 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2529 ; -O0: and w8, w9, w8
2531 ; -O0: bl __atomic_compare_exchange
2533 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2534 ; -O1: and w8, w0, w20
2536 ; -O1: bl __atomic_compare_exchange
2537 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2541 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2542 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2543 ; -O0: and w8, w9, w8
2545 ; -O0: bl __atomic_compare_exchange
2547 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2548 ; -O1: and w8, w0, w20
2550 ; -O1: bl __atomic_compare_exchange
2551 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2555 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2556 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2557 ; -O0: and w8, w9, w8
2559 ; -O0: bl __atomic_compare_exchange
2561 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2562 ; -O1: and w8, w0, w20
2564 ; -O1: bl __atomic_compare_exchange
2565 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2569 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2570 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2571 ; -O0: and w8, w9, w8
2573 ; -O0: bl __atomic_compare_exchange
2575 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2576 ; -O1: and w8, w0, w20
2578 ; -O1: bl __atomic_compare_exchange
2579 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2583 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2584 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2585 ; -O0: and w8, w9, w8
2587 ; -O0: bl __atomic_compare_exchange
2589 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2590 ; -O1: and w8, w0, w20
2592 ; -O1: bl __atomic_compare_exchange
2593 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2597 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2598 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2599 ; -O0: and w8, w9, w8
2601 ; -O0: bl __atomic_compare_exchange
2603 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2604 ; -O1: and w8, w0, w20
2606 ; -O1: bl __atomic_compare_exchange
2607 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2611 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2612 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2613 ; -O0: and x8, x9, x8
2615 ; -O0: bl __atomic_compare_exchange
2617 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2618 ; -O1: and x8, x0, x20
2620 ; -O1: bl __atomic_compare_exchange
2621 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2625 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2626 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2627 ; -O0: and x8, x9, x8
2629 ; -O0: bl __atomic_compare_exchange
2631 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2632 ; -O1: and x8, x0, x20
2634 ; -O1: bl __atomic_compare_exchange
2635 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2639 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2640 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2641 ; -O0: and x8, x9, x8
2643 ; -O0: bl __atomic_compare_exchange
2645 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2646 ; -O1: and x8, x0, x20
2648 ; -O1: bl __atomic_compare_exchange
2649 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2653 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2654 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2655 ; -O0: and x8, x9, x8
2657 ; -O0: bl __atomic_compare_exchange
2659 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2660 ; -O1: and x8, x0, x20
2662 ; -O1: bl __atomic_compare_exchange
2663 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2667 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2668 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2669 ; -O0: and x8, x9, x8
2671 ; -O0: bl __atomic_compare_exchange
2673 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2674 ; -O1: and x8, x0, x20
2676 ; -O1: bl __atomic_compare_exchange
2677 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2681 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2682 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2683 ; -O0: and x9, x8, x9
2684 ; -O0: and x8, x8, x10
2687 ; -O0: bl __atomic_compare_exchange
2689 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2690 ; -O1: ldp x0, x1, [x0]
2691 ; -O1: and x8, x1, x19
2692 ; -O1: and x9, x0, x21
2695 ; -O1: bl __atomic_compare_exchange
2696 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2700 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2701 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2702 ; -O0: and x9, x8, x9
2703 ; -O0: and x8, x8, x10
2706 ; -O0: bl __atomic_compare_exchange
2708 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2709 ; -O1: ldp x0, x1, [x0]
2710 ; -O1: and x8, x1, x19
2711 ; -O1: and x9, x0, x21
2714 ; -O1: bl __atomic_compare_exchange
2715 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2719 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2720 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2721 ; -O0: and x9, x8, x9
2722 ; -O0: and x8, x8, x10
2725 ; -O0: bl __atomic_compare_exchange
2727 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2728 ; -O1: ldp x0, x1, [x0]
2729 ; -O1: and x8, x1, x19
2730 ; -O1: and x9, x0, x21
2733 ; -O1: bl __atomic_compare_exchange
2734 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2738 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2739 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2740 ; -O0: and x9, x8, x9
2741 ; -O0: and x8, x8, x10
2744 ; -O0: bl __atomic_compare_exchange
2746 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2747 ; -O1: ldp x0, x1, [x0]
2748 ; -O1: and x8, x1, x19
2749 ; -O1: and x9, x0, x21
2752 ; -O1: bl __atomic_compare_exchange
2753 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2757 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2758 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2759 ; -O0: and x9, x8, x9
2760 ; -O0: and x8, x8, x10
2763 ; -O0: bl __atomic_compare_exchange
2765 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2766 ; -O1: ldp x0, x1, [x0]
2767 ; -O1: and x8, x1, x19
2768 ; -O1: and x9, x0, x21
2771 ; -O1: bl __atomic_compare_exchange
2772 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2776 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2777 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2778 ; CHECK: ldsetb w1, w0, [x0]
2779 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2783 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
2784 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
2785 ; CHECK: ldsetab w1, w0, [x0]
2786 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2790 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
2791 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
2792 ; CHECK: ldsetlb w1, w0, [x0]
2793 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2797 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2798 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
2799 ; CHECK: ldsetalb w1, w0, [x0]
2800 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2804 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2805 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
2806 ; CHECK: ldsetalb w1, w0, [x0]
2807 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
2811 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2812 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
2813 ; CHECK: ldseth w1, w0, [x0]
2814 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
2818 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
2819 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
2820 ; CHECK: ldsetah w1, w0, [x0]
2821 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
2825 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
2826 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
2827 ; CHECK: ldsetlh w1, w0, [x0]
2828 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
2832 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2833 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
2834 ; CHECK: ldsetalh w1, w0, [x0]
2835 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
2839 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2840 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
2841 ; CHECK: ldsetalh w1, w0, [x0]
2842 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
2846 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2847 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
2848 ; CHECK: ldset w1, w0, [x0]
2849 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
2853 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
2854 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
2855 ; CHECK: ldseta w1, w0, [x0]
2856 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
2860 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
2861 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
2862 ; CHECK: ldsetl w1, w0, [x0]
2863 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
2867 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2868 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
2869 ; CHECK: ldsetal w1, w0, [x0]
2870 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
2874 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2875 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
2876 ; CHECK: ldsetal w1, w0, [x0]
2877 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
2881 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2882 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
2883 ; CHECK: ldset x1, x0, [x0]
2884 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
2888 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
2889 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
2890 ; CHECK: ldseta x1, x0, [x0]
2891 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
2895 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
2896 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
2897 ; CHECK: ldsetl x1, x0, [x0]
2898 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
2902 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2903 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
2904 ; CHECK: ldsetal x1, x0, [x0]
2905 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
2909 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2910 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
2911 ; CHECK: ldsetal x1, x0, [x0]
2912 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
2916 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2917 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
2918 ; -O0: ldsetp x0, x1, [x8]
2920 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
2921 ; -O1: ldsetp x2, x1, [x0]
2922 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
2926 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
2927 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
2928 ; -O0: ldsetpa x0, x1, [x8]
2930 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
2931 ; -O1: ldsetpa x2, x1, [x0]
2932 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
2936 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
2937 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
2938 ; -O0: ldsetpl x0, x1, [x8]
2940 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
2941 ; -O1: ldsetpl x2, x1, [x0]
2942 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
2946 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2947 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
2948 ; -O0: ldsetpal x0, x1, [x8]
2950 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
2951 ; -O1: ldsetpal x2, x1, [x0]
2952 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
2956 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2957 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
2958 ; -O0: ldsetpal x0, x1, [x8]
2960 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
2961 ; -O1: ldsetpal x2, x1, [x0]
2962 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
2966 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2967 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
2968 ; CHECK: ldsetb w1, w0, [x0]
2969 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2973 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2974 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
2975 ; CHECK: ldsetab w1, w0, [x0]
2976 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2980 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
2981 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
2982 ; CHECK: ldsetlb w1, w0, [x0]
2983 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2987 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2988 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
2989 ; CHECK: ldsetalb w1, w0, [x0]
2990 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2994 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2995 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
2996 ; CHECK: ldsetalb w1, w0, [x0]
2997 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3001 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3002 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3003 ; -O0: orr w8, w9, w8
3004 ; -O0: bl __atomic_compare_exchange
3006 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3007 ; -O1: orr w8, w0, w20
3008 ; -O1: bl __atomic_compare_exchange
3009 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3013 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3014 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3015 ; -O0: orr w8, w9, w8
3016 ; -O0: bl __atomic_compare_exchange
3018 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3019 ; -O1: orr w8, w0, w20
3020 ; -O1: bl __atomic_compare_exchange
3021 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3025 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3026 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3027 ; -O0: orr w8, w9, w8
3028 ; -O0: bl __atomic_compare_exchange
3030 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3031 ; -O1: orr w8, w0, w20
3032 ; -O1: bl __atomic_compare_exchange
3033 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3037 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3038 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3039 ; -O0: orr w8, w9, w8
3040 ; -O0: bl __atomic_compare_exchange
3042 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3043 ; -O1: orr w8, w0, w20
3044 ; -O1: bl __atomic_compare_exchange
3045 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3049 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3050 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3051 ; -O0: orr w8, w9, w8
3052 ; -O0: bl __atomic_compare_exchange
3054 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3055 ; -O1: orr w8, w0, w20
3056 ; -O1: bl __atomic_compare_exchange
3057 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3061 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3062 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3063 ; -O0: orr w8, w9, w8
3064 ; -O0: bl __atomic_compare_exchange
3066 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3067 ; -O1: orr w8, w0, w20
3068 ; -O1: bl __atomic_compare_exchange
3069 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3073 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3074 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3075 ; -O0: orr w8, w9, w8
3076 ; -O0: bl __atomic_compare_exchange
3078 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3079 ; -O1: orr w8, w0, w20
3080 ; -O1: bl __atomic_compare_exchange
3081 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3085 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3086 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3087 ; -O0: orr w8, w9, w8
3088 ; -O0: bl __atomic_compare_exchange
3090 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3091 ; -O1: orr w8, w0, w20
3092 ; -O1: bl __atomic_compare_exchange
3093 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3097 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3098 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3099 ; -O0: orr w8, w9, w8
3100 ; -O0: bl __atomic_compare_exchange
3102 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3103 ; -O1: orr w8, w0, w20
3104 ; -O1: bl __atomic_compare_exchange
3105 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3109 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3110 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3111 ; -O0: orr w8, w9, w8
3112 ; -O0: bl __atomic_compare_exchange
3114 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3115 ; -O1: orr w8, w0, w20
3116 ; -O1: bl __atomic_compare_exchange
3117 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3121 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3122 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3123 ; -O0: orr x8, x9, x8
3124 ; -O0: bl __atomic_compare_exchange
3126 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3127 ; -O1: orr x8, x0, x20
3128 ; -O1: bl __atomic_compare_exchange
3129 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3133 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3134 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3135 ; -O0: orr x8, x9, x8
3136 ; -O0: bl __atomic_compare_exchange
3138 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3139 ; -O1: orr x8, x0, x20
3140 ; -O1: bl __atomic_compare_exchange
3141 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3145 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3146 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3147 ; -O0: orr x8, x9, x8
3148 ; -O0: bl __atomic_compare_exchange
3150 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3151 ; -O1: orr x8, x0, x20
3152 ; -O1: bl __atomic_compare_exchange
3153 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3157 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3158 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3159 ; -O0: orr x8, x9, x8
3160 ; -O0: bl __atomic_compare_exchange
3162 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3163 ; -O1: orr x8, x0, x20
3164 ; -O1: bl __atomic_compare_exchange
3165 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3169 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3170 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3171 ; -O0: orr x8, x9, x8
3172 ; -O0: bl __atomic_compare_exchange
3174 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3175 ; -O1: orr x8, x0, x20
3176 ; -O1: bl __atomic_compare_exchange
3177 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3181 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3182 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3183 ; -O0: orr x9, x8, x9
3184 ; -O0: orr x8, x8, x10
3185 ; -O0: bl __atomic_compare_exchange
3187 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3188 ; -O1: ldp x0, x1, [x0]
3189 ; -O1: orr x8, x1, x19
3190 ; -O1: orr x9, x0, x21
3191 ; -O1: bl __atomic_compare_exchange
3192 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3196 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3197 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3198 ; -O0: orr x9, x8, x9
3199 ; -O0: orr x8, x8, x10
3200 ; -O0: bl __atomic_compare_exchange
3202 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3203 ; -O1: ldp x0, x1, [x0]
3204 ; -O1: orr x8, x1, x19
3205 ; -O1: orr x9, x0, x21
3206 ; -O1: bl __atomic_compare_exchange
3207 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3211 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3212 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3213 ; -O0: orr x9, x8, x9
3214 ; -O0: orr x8, x8, x10
3215 ; -O0: bl __atomic_compare_exchange
3217 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3218 ; -O1: ldp x0, x1, [x0]
3219 ; -O1: orr x8, x1, x19
3220 ; -O1: orr x9, x0, x21
3221 ; -O1: bl __atomic_compare_exchange
3222 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3226 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3227 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3228 ; -O0: orr x9, x8, x9
3229 ; -O0: orr x8, x8, x10
3230 ; -O0: bl __atomic_compare_exchange
3232 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3233 ; -O1: ldp x0, x1, [x0]
3234 ; -O1: orr x8, x1, x19
3235 ; -O1: orr x9, x0, x21
3236 ; -O1: bl __atomic_compare_exchange
3237 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3241 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3242 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3243 ; -O0: orr x9, x8, x9
3244 ; -O0: orr x8, x8, x10
3245 ; -O0: bl __atomic_compare_exchange
3247 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3248 ; -O1: ldp x0, x1, [x0]
3249 ; -O1: orr x8, x1, x19
3250 ; -O1: orr x9, x0, x21
3251 ; -O1: bl __atomic_compare_exchange
3252 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3256 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3257 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3258 ; CHECK: ldeorb w1, w0, [x0]
3259 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3263 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3264 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3265 ; CHECK: ldeorab w1, w0, [x0]
3266 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3270 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3271 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3272 ; CHECK: ldeorlb w1, w0, [x0]
3273 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3277 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3278 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3279 ; CHECK: ldeoralb w1, w0, [x0]
3280 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3284 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3285 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3286 ; CHECK: ldeoralb w1, w0, [x0]
3287 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3291 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3292 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3293 ; CHECK: ldeorh w1, w0, [x0]
3294 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3298 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3299 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3300 ; CHECK: ldeorah w1, w0, [x0]
3301 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3305 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3306 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3307 ; CHECK: ldeorlh w1, w0, [x0]
3308 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3312 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3313 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3314 ; CHECK: ldeoralh w1, w0, [x0]
3315 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3319 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3320 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3321 ; CHECK: ldeoralh w1, w0, [x0]
3322 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3326 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3327 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3328 ; CHECK: ldeor w1, w0, [x0]
3329 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3333 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3334 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3335 ; CHECK: ldeora w1, w0, [x0]
3336 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3340 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3341 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3342 ; CHECK: ldeorl w1, w0, [x0]
3343 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3347 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3348 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3349 ; CHECK: ldeoral w1, w0, [x0]
3350 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3354 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3355 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3356 ; CHECK: ldeoral w1, w0, [x0]
3357 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3361 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3362 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3363 ; CHECK: ldeor x1, x0, [x0]
3364 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3368 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3369 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3370 ; CHECK: ldeora x1, x0, [x0]
3371 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3375 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3376 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3377 ; CHECK: ldeorl x1, x0, [x0]
3378 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3382 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3383 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3384 ; CHECK: ldeoral x1, x0, [x0]
3385 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3389 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3390 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3391 ; CHECK: ldeoral x1, x0, [x0]
3392 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3396 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3397 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3398 ; -O0: eor x2, x9, x11
3399 ; -O0: eor x9, x9, x10
3400 ; -O0: casp x0, x1, x2, x3, [x8]
3401 ; -O0: eor x8, x10, x8
3402 ; -O0: eor x11, x9, x11
3403 ; -O0: orr x8, x8, x11
3404 ; -O0: subs x8, x8, #0
3406 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3407 ; -O1: ldp x4, x5, [x0]
3408 ; -O1: eor x8, x4, x2
3409 ; -O1: eor x9, x7, x3
3410 ; -O1: casp x4, x5, x8, x9, [x0]
3412 ; -O1: ccmp x4, x6, #0, eq
3413 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3417 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3418 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3419 ; -O0: eor x2, x9, x11
3420 ; -O0: eor x9, x9, x10
3421 ; -O0: caspa x0, x1, x2, x3, [x8]
3422 ; -O0: eor x8, x10, x8
3423 ; -O0: eor x11, x9, x11
3424 ; -O0: orr x8, x8, x11
3425 ; -O0: subs x8, x8, #0
3427 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3428 ; -O1: ldp x4, x5, [x0]
3429 ; -O1: eor x8, x4, x2
3430 ; -O1: eor x9, x7, x3
3431 ; -O1: caspa x4, x5, x8, x9, [x0]
3433 ; -O1: ccmp x4, x6, #0, eq
3434 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3438 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3439 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3440 ; -O0: eor x2, x9, x11
3441 ; -O0: eor x9, x9, x10
3442 ; -O0: caspl x0, x1, x2, x3, [x8]
3443 ; -O0: eor x8, x10, x8
3444 ; -O0: eor x11, x9, x11
3445 ; -O0: orr x8, x8, x11
3446 ; -O0: subs x8, x8, #0
3448 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3449 ; -O1: ldp x4, x5, [x0]
3450 ; -O1: eor x8, x4, x2
3451 ; -O1: eor x9, x7, x3
3452 ; -O1: caspl x4, x5, x8, x9, [x0]
3454 ; -O1: ccmp x4, x6, #0, eq
3455 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3459 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3460 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3461 ; -O0: eor x2, x9, x11
3462 ; -O0: eor x9, x9, x10
3463 ; -O0: caspal x0, x1, x2, x3, [x8]
3464 ; -O0: eor x8, x10, x8
3465 ; -O0: eor x11, x9, x11
3466 ; -O0: orr x8, x8, x11
3467 ; -O0: subs x8, x8, #0
3469 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3470 ; -O1: ldp x4, x5, [x0]
3471 ; -O1: eor x8, x4, x2
3472 ; -O1: eor x9, x7, x3
3473 ; -O1: caspal x4, x5, x8, x9, [x0]
3475 ; -O1: ccmp x4, x6, #0, eq
3476 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3480 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3481 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3482 ; -O0: eor x2, x9, x11
3483 ; -O0: eor x9, x9, x10
3484 ; -O0: caspal x0, x1, x2, x3, [x8]
3485 ; -O0: eor x8, x10, x8
3486 ; -O0: eor x11, x9, x11
3487 ; -O0: orr x8, x8, x11
3488 ; -O0: subs x8, x8, #0
3490 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3491 ; -O1: ldp x4, x5, [x0]
3492 ; -O1: eor x8, x4, x2
3493 ; -O1: eor x9, x7, x3
3494 ; -O1: caspal x4, x5, x8, x9, [x0]
3496 ; -O1: ccmp x4, x6, #0, eq
3497 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3501 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3502 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3503 ; CHECK: ldeorb w1, w0, [x0]
3504 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3508 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3509 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3510 ; CHECK: ldeorab w1, w0, [x0]
3511 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3515 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3516 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3517 ; CHECK: ldeorlb w1, w0, [x0]
3518 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3522 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3523 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3524 ; CHECK: ldeoralb w1, w0, [x0]
3525 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3529 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3530 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3531 ; CHECK: ldeoralb w1, w0, [x0]
3532 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3536 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3537 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3538 ; -O0: eor w8, w9, w8
3539 ; -O0: bl __atomic_compare_exchange
3541 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3542 ; -O1: eor w8, w0, w20
3543 ; -O1: bl __atomic_compare_exchange
3544 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3548 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3549 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3550 ; -O0: eor w8, w9, w8
3551 ; -O0: bl __atomic_compare_exchange
3553 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3554 ; -O1: eor w8, w0, w20
3555 ; -O1: bl __atomic_compare_exchange
3556 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3560 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3561 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3562 ; -O0: eor w8, w9, w8
3563 ; -O0: bl __atomic_compare_exchange
3565 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3566 ; -O1: eor w8, w0, w20
3567 ; -O1: bl __atomic_compare_exchange
3568 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3572 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3573 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3574 ; -O0: eor w8, w9, w8
3575 ; -O0: bl __atomic_compare_exchange
3577 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3578 ; -O1: eor w8, w0, w20
3579 ; -O1: bl __atomic_compare_exchange
3580 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3584 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3585 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3586 ; -O0: eor w8, w9, w8
3587 ; -O0: bl __atomic_compare_exchange
3589 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3590 ; -O1: eor w8, w0, w20
3591 ; -O1: bl __atomic_compare_exchange
3592 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3596 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3597 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3598 ; -O0: eor w8, w9, w8
3599 ; -O0: bl __atomic_compare_exchange
3601 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3602 ; -O1: eor w8, w0, w20
3603 ; -O1: bl __atomic_compare_exchange
3604 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3608 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3609 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3610 ; -O0: eor w8, w9, w8
3611 ; -O0: bl __atomic_compare_exchange
3613 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3614 ; -O1: eor w8, w0, w20
3615 ; -O1: bl __atomic_compare_exchange
3616 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3620 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3621 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3622 ; -O0: eor w8, w9, w8
3623 ; -O0: bl __atomic_compare_exchange
3625 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3626 ; -O1: eor w8, w0, w20
3627 ; -O1: bl __atomic_compare_exchange
3628 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3632 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3633 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3634 ; -O0: eor w8, w9, w8
3635 ; -O0: bl __atomic_compare_exchange
3637 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3638 ; -O1: eor w8, w0, w20
3639 ; -O1: bl __atomic_compare_exchange
3640 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3644 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3645 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3646 ; -O0: eor w8, w9, w8
3647 ; -O0: bl __atomic_compare_exchange
3649 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3650 ; -O1: eor w8, w0, w20
3651 ; -O1: bl __atomic_compare_exchange
3652 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3656 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3657 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3658 ; -O0: eor x8, x9, x8
3659 ; -O0: bl __atomic_compare_exchange
3661 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3662 ; -O1: eor x8, x0, x20
3663 ; -O1: bl __atomic_compare_exchange
3664 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3668 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3669 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3670 ; -O0: eor x8, x9, x8
3671 ; -O0: bl __atomic_compare_exchange
3673 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3674 ; -O1: eor x8, x0, x20
3675 ; -O1: bl __atomic_compare_exchange
3676 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3680 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3681 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3682 ; -O0: eor x8, x9, x8
3683 ; -O0: bl __atomic_compare_exchange
3685 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3686 ; -O1: eor x8, x0, x20
3687 ; -O1: bl __atomic_compare_exchange
3688 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3692 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3693 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3694 ; -O0: eor x8, x9, x8
3695 ; -O0: bl __atomic_compare_exchange
3697 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3698 ; -O1: eor x8, x0, x20
3699 ; -O1: bl __atomic_compare_exchange
3700 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3704 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3705 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3706 ; -O0: eor x8, x9, x8
3707 ; -O0: bl __atomic_compare_exchange
3709 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3710 ; -O1: eor x8, x0, x20
3711 ; -O1: bl __atomic_compare_exchange
3712 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3716 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3717 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3718 ; -O0: eor x9, x8, x9
3719 ; -O0: eor x8, x8, x10
3720 ; -O0: bl __atomic_compare_exchange
3722 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3723 ; -O1: ldp x0, x1, [x0]
3724 ; -O1: eor x8, x1, x19
3725 ; -O1: eor x9, x0, x21
3726 ; -O1: bl __atomic_compare_exchange
3727 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
3731 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3732 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3733 ; -O0: eor x9, x8, x9
3734 ; -O0: eor x8, x8, x10
3735 ; -O0: bl __atomic_compare_exchange
3737 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3738 ; -O1: ldp x0, x1, [x0]
3739 ; -O1: eor x8, x1, x19
3740 ; -O1: eor x9, x0, x21
3741 ; -O1: bl __atomic_compare_exchange
3742 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
3746 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
3747 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
3748 ; -O0: eor x9, x8, x9
3749 ; -O0: eor x8, x8, x10
3750 ; -O0: bl __atomic_compare_exchange
3752 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
3753 ; -O1: ldp x0, x1, [x0]
3754 ; -O1: eor x8, x1, x19
3755 ; -O1: eor x9, x0, x21
3756 ; -O1: bl __atomic_compare_exchange
3757 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
3761 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3762 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3763 ; -O0: eor x9, x8, x9
3764 ; -O0: eor x8, x8, x10
3765 ; -O0: bl __atomic_compare_exchange
3767 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3768 ; -O1: ldp x0, x1, [x0]
3769 ; -O1: eor x8, x1, x19
3770 ; -O1: eor x9, x0, x21
3771 ; -O1: bl __atomic_compare_exchange
3772 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
3776 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3777 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3778 ; -O0: eor x9, x8, x9
3779 ; -O0: eor x8, x8, x10
3780 ; -O0: bl __atomic_compare_exchange
3782 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3783 ; -O1: ldp x0, x1, [x0]
3784 ; -O1: eor x8, x1, x19
3785 ; -O1: eor x9, x0, x21
3786 ; -O1: bl __atomic_compare_exchange
3787 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
3791 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3792 ; CHECK-LABEL: atomicrmw_max_i8_aligned_monotonic:
3793 ; CHECK: ldsmaxb w1, w0, [x0]
3794 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
3798 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
3799 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acquire:
3800 ; CHECK: ldsmaxab w1, w0, [x0]
3801 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
3805 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
3806 ; CHECK-LABEL: atomicrmw_max_i8_aligned_release:
3807 ; CHECK: ldsmaxlb w1, w0, [x0]
3808 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
3812 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3813 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acq_rel:
3814 ; CHECK: ldsmaxalb w1, w0, [x0]
3815 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
3819 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3820 ; CHECK-LABEL: atomicrmw_max_i8_aligned_seq_cst:
3821 ; CHECK: ldsmaxalb w1, w0, [x0]
3822 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
3826 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3827 ; CHECK-LABEL: atomicrmw_max_i16_aligned_monotonic:
3828 ; CHECK: ldsmaxh w1, w0, [x0]
3829 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
3833 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
3834 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acquire:
3835 ; CHECK: ldsmaxah w1, w0, [x0]
3836 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
3840 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
3841 ; CHECK-LABEL: atomicrmw_max_i16_aligned_release:
3842 ; CHECK: ldsmaxlh w1, w0, [x0]
3843 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
3847 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3848 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acq_rel:
3849 ; CHECK: ldsmaxalh w1, w0, [x0]
3850 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
3854 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3855 ; CHECK-LABEL: atomicrmw_max_i16_aligned_seq_cst:
3856 ; CHECK: ldsmaxalh w1, w0, [x0]
3857 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
3861 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3862 ; CHECK-LABEL: atomicrmw_max_i32_aligned_monotonic:
3863 ; CHECK: ldsmax w1, w0, [x0]
3864 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
3868 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
3869 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acquire:
3870 ; CHECK: ldsmaxa w1, w0, [x0]
3871 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
3875 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
3876 ; CHECK-LABEL: atomicrmw_max_i32_aligned_release:
3877 ; CHECK: ldsmaxl w1, w0, [x0]
3878 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
3882 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3883 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acq_rel:
3884 ; CHECK: ldsmaxal w1, w0, [x0]
3885 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
3889 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3890 ; CHECK-LABEL: atomicrmw_max_i32_aligned_seq_cst:
3891 ; CHECK: ldsmaxal w1, w0, [x0]
3892 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
3896 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3897 ; CHECK-LABEL: atomicrmw_max_i64_aligned_monotonic:
3898 ; CHECK: ldsmax x1, x0, [x0]
3899 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
3903 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
3904 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acquire:
3905 ; CHECK: ldsmaxa x1, x0, [x0]
3906 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
3910 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
3911 ; CHECK-LABEL: atomicrmw_max_i64_aligned_release:
3912 ; CHECK: ldsmaxl x1, x0, [x0]
3913 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
3917 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3918 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acq_rel:
3919 ; CHECK: ldsmaxal x1, x0, [x0]
3920 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
3924 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3925 ; CHECK-LABEL: atomicrmw_max_i64_aligned_seq_cst:
3926 ; CHECK: ldsmaxal x1, x0, [x0]
3927 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
3931 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3932 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
3933 ; -O0: subs x9, x9, x12
3934 ; -O0: subs x11, x11, x10
3935 ; -O0: subs x13, x13, x10
3936 ; -O0: csel w11, w9, w11, eq
3937 ; -O0: ands w13, w11, #0x1
3938 ; -O0: csel x2, x9, x12, ne
3939 ; -O0: ands w11, w11, #0x1
3940 ; -O0: csel x9, x9, x10, ne
3941 ; -O0: casp x0, x1, x2, x3, [x8]
3942 ; -O0: eor x8, x10, x8
3943 ; -O0: eor x11, x9, x11
3944 ; -O0: orr x8, x8, x11
3945 ; -O0: subs x8, x8, #0
3947 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
3948 ; -O1: ldp x4, x5, [x0]
3950 ; -O1: csel x9, x7, x3, lt
3951 ; -O1: csel x8, x4, x2, lt
3952 ; -O1: casp x4, x5, x8, x9, [x0]
3954 ; -O1: ccmp x4, x6, #0, eq
3955 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
3959 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
3960 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
3961 ; -O0: subs x9, x9, x12
3962 ; -O0: subs x11, x11, x10
3963 ; -O0: subs x13, x13, x10
3964 ; -O0: csel w11, w9, w11, eq
3965 ; -O0: ands w13, w11, #0x1
3966 ; -O0: csel x2, x9, x12, ne
3967 ; -O0: ands w11, w11, #0x1
3968 ; -O0: csel x9, x9, x10, ne
3969 ; -O0: caspa x0, x1, x2, x3, [x8]
3970 ; -O0: eor x8, x10, x8
3971 ; -O0: eor x11, x9, x11
3972 ; -O0: orr x8, x8, x11
3973 ; -O0: subs x8, x8, #0
3975 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
3976 ; -O1: ldp x4, x5, [x0]
3978 ; -O1: csel x9, x7, x3, lt
3979 ; -O1: csel x8, x4, x2, lt
3980 ; -O1: caspa x4, x5, x8, x9, [x0]
3982 ; -O1: ccmp x4, x6, #0, eq
3983 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
3987 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
3988 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
3989 ; -O0: subs x9, x9, x12
3990 ; -O0: subs x11, x11, x10
3991 ; -O0: subs x13, x13, x10
3992 ; -O0: csel w11, w9, w11, eq
3993 ; -O0: ands w13, w11, #0x1
3994 ; -O0: csel x2, x9, x12, ne
3995 ; -O0: ands w11, w11, #0x1
3996 ; -O0: csel x9, x9, x10, ne
3997 ; -O0: caspl x0, x1, x2, x3, [x8]
3998 ; -O0: eor x8, x10, x8
3999 ; -O0: eor x11, x9, x11
4000 ; -O0: orr x8, x8, x11
4001 ; -O0: subs x8, x8, #0
4003 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
4004 ; -O1: ldp x4, x5, [x0]
4006 ; -O1: csel x9, x7, x3, lt
4007 ; -O1: csel x8, x4, x2, lt
4008 ; -O1: caspl x4, x5, x8, x9, [x0]
4010 ; -O1: ccmp x4, x6, #0, eq
4011 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4015 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4016 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4017 ; -O0: subs x9, x9, x12
4018 ; -O0: subs x11, x11, x10
4019 ; -O0: subs x13, x13, x10
4020 ; -O0: csel w11, w9, w11, eq
4021 ; -O0: ands w13, w11, #0x1
4022 ; -O0: csel x2, x9, x12, ne
4023 ; -O0: ands w11, w11, #0x1
4024 ; -O0: csel x9, x9, x10, ne
4025 ; -O0: caspal x0, x1, x2, x3, [x8]
4026 ; -O0: eor x8, x10, x8
4027 ; -O0: eor x11, x9, x11
4028 ; -O0: orr x8, x8, x11
4029 ; -O0: subs x8, x8, #0
4031 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4032 ; -O1: ldp x4, x5, [x0]
4034 ; -O1: csel x9, x7, x3, lt
4035 ; -O1: csel x8, x4, x2, lt
4036 ; -O1: caspal x4, x5, x8, x9, [x0]
4038 ; -O1: ccmp x4, x6, #0, eq
4039 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4043 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4044 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4045 ; -O0: subs x9, x9, x12
4046 ; -O0: subs x11, x11, x10
4047 ; -O0: subs x13, x13, x10
4048 ; -O0: csel w11, w9, w11, eq
4049 ; -O0: ands w13, w11, #0x1
4050 ; -O0: csel x2, x9, x12, ne
4051 ; -O0: ands w11, w11, #0x1
4052 ; -O0: csel x9, x9, x10, ne
4053 ; -O0: caspal x0, x1, x2, x3, [x8]
4054 ; -O0: eor x8, x10, x8
4055 ; -O0: eor x11, x9, x11
4056 ; -O0: orr x8, x8, x11
4057 ; -O0: subs x8, x8, #0
4059 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4060 ; -O1: ldp x4, x5, [x0]
4062 ; -O1: csel x9, x7, x3, lt
4063 ; -O1: csel x8, x4, x2, lt
4064 ; -O1: caspal x4, x5, x8, x9, [x0]
4066 ; -O1: ccmp x4, x6, #0, eq
4067 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4071 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4072 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4073 ; CHECK: ldsmaxb w1, w0, [x0]
4074 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4078 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4079 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acquire:
4080 ; CHECK: ldsmaxab w1, w0, [x0]
4081 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4085 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4086 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_release:
4087 ; CHECK: ldsmaxlb w1, w0, [x0]
4088 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4092 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4093 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4094 ; CHECK: ldsmaxalb w1, w0, [x0]
4095 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4099 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4100 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4101 ; CHECK: ldsmaxalb w1, w0, [x0]
4102 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4106 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4107 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4109 ; -O0: subs w10, w10, w8, sxth
4110 ; -O0: csel w8, w9, w8, gt
4111 ; -O0: bl __atomic_compare_exchange
4113 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4115 ; -O1: cmp w8, w20, sxth
4116 ; -O1: csel w8, w0, w20, gt
4117 ; -O1: bl __atomic_compare_exchange
4118 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4122 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4123 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4125 ; -O0: subs w10, w10, w8, sxth
4126 ; -O0: csel w8, w9, w8, gt
4127 ; -O0: bl __atomic_compare_exchange
4129 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4131 ; -O1: cmp w8, w20, sxth
4132 ; -O1: csel w8, w0, w20, gt
4133 ; -O1: bl __atomic_compare_exchange
4134 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4138 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4139 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4141 ; -O0: subs w10, w10, w8, sxth
4142 ; -O0: csel w8, w9, w8, gt
4143 ; -O0: bl __atomic_compare_exchange
4145 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4147 ; -O1: cmp w8, w20, sxth
4148 ; -O1: csel w8, w0, w20, gt
4149 ; -O1: bl __atomic_compare_exchange
4150 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4154 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4155 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4157 ; -O0: subs w10, w10, w8, sxth
4158 ; -O0: csel w8, w9, w8, gt
4159 ; -O0: bl __atomic_compare_exchange
4161 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4163 ; -O1: cmp w8, w20, sxth
4164 ; -O1: csel w8, w0, w20, gt
4165 ; -O1: bl __atomic_compare_exchange
4166 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
4170 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4171 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4173 ; -O0: subs w10, w10, w8, sxth
4174 ; -O0: csel w8, w9, w8, gt
4175 ; -O0: bl __atomic_compare_exchange
4177 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4179 ; -O1: cmp w8, w20, sxth
4180 ; -O1: csel w8, w0, w20, gt
4181 ; -O1: bl __atomic_compare_exchange
4182 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4186 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4187 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4188 ; -O0: subs w10, w9, w8
4189 ; -O0: csel w8, w9, w8, gt
4190 ; -O0: bl __atomic_compare_exchange
4192 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4194 ; -O1: csel w8, w0, w20, gt
4195 ; -O1: bl __atomic_compare_exchange
4196 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4200 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4201 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4202 ; -O0: subs w10, w9, w8
4203 ; -O0: csel w8, w9, w8, gt
4204 ; -O0: bl __atomic_compare_exchange
4206 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4208 ; -O1: csel w8, w0, w20, gt
4209 ; -O1: bl __atomic_compare_exchange
4210 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4214 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4215 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4216 ; -O0: subs w10, w9, w8
4217 ; -O0: csel w8, w9, w8, gt
4218 ; -O0: bl __atomic_compare_exchange
4220 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4222 ; -O1: csel w8, w0, w20, gt
4223 ; -O1: bl __atomic_compare_exchange
4224 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4228 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4229 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4230 ; -O0: subs w10, w9, w8
4231 ; -O0: csel w8, w9, w8, gt
4232 ; -O0: bl __atomic_compare_exchange
4234 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4236 ; -O1: csel w8, w0, w20, gt
4237 ; -O1: bl __atomic_compare_exchange
4238 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4242 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4243 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4244 ; -O0: subs w10, w9, w8
4245 ; -O0: csel w8, w9, w8, gt
4246 ; -O0: bl __atomic_compare_exchange
4248 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4250 ; -O1: csel w8, w0, w20, gt
4251 ; -O1: bl __atomic_compare_exchange
4252 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4256 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4257 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4258 ; -O0: subs x10, x9, x8
4259 ; -O0: csel x8, x9, x8, gt
4260 ; -O0: bl __atomic_compare_exchange
4262 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4264 ; -O1: csel x8, x0, x20, gt
4265 ; -O1: bl __atomic_compare_exchange
4266 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4270 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4271 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4272 ; -O0: subs x10, x9, x8
4273 ; -O0: csel x8, x9, x8, gt
4274 ; -O0: bl __atomic_compare_exchange
4276 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4278 ; -O1: csel x8, x0, x20, gt
4279 ; -O1: bl __atomic_compare_exchange
4280 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4284 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4285 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4286 ; -O0: subs x10, x9, x8
4287 ; -O0: csel x8, x9, x8, gt
4288 ; -O0: bl __atomic_compare_exchange
4290 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4292 ; -O1: csel x8, x0, x20, gt
4293 ; -O1: bl __atomic_compare_exchange
4294 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4298 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4299 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4300 ; -O0: subs x10, x9, x8
4301 ; -O0: csel x8, x9, x8, gt
4302 ; -O0: bl __atomic_compare_exchange
4304 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4306 ; -O1: csel x8, x0, x20, gt
4307 ; -O1: bl __atomic_compare_exchange
4308 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4312 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4313 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4314 ; -O0: subs x10, x9, x8
4315 ; -O0: csel x8, x9, x8, gt
4316 ; -O0: bl __atomic_compare_exchange
4318 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4320 ; -O1: csel x8, x0, x20, gt
4321 ; -O1: bl __atomic_compare_exchange
4322 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4326 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4327 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4328 ; -O0: subs x8, x8, x9
4329 ; -O0: subs x11, x11, x10
4330 ; -O0: subs x12, x12, x10
4331 ; -O0: csel w11, w8, w11, eq
4332 ; -O0: ands w12, w11, #0x1
4333 ; -O0: csel x9, x8, x9, ne
4334 ; -O0: ands w11, w11, #0x1
4335 ; -O0: csel x8, x8, x10, ne
4336 ; -O0: bl __atomic_compare_exchange
4338 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4339 ; -O1: ldp x0, x1, [x0]
4341 ; -O1: csel x8, x1, x19, lt
4342 ; -O1: csel x9, x0, x21, lt
4343 ; -O1: bl __atomic_compare_exchange
4344 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4348 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4349 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4350 ; -O0: subs x8, x8, x9
4351 ; -O0: subs x11, x11, x10
4352 ; -O0: subs x12, x12, x10
4353 ; -O0: csel w11, w8, w11, eq
4354 ; -O0: ands w12, w11, #0x1
4355 ; -O0: csel x9, x8, x9, ne
4356 ; -O0: ands w11, w11, #0x1
4357 ; -O0: csel x8, x8, x10, ne
4358 ; -O0: bl __atomic_compare_exchange
4360 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4361 ; -O1: ldp x0, x1, [x0]
4363 ; -O1: csel x8, x1, x19, lt
4364 ; -O1: csel x9, x0, x21, lt
4365 ; -O1: bl __atomic_compare_exchange
4366 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4370 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4371 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4372 ; -O0: subs x8, x8, x9
4373 ; -O0: subs x11, x11, x10
4374 ; -O0: subs x12, x12, x10
4375 ; -O0: csel w11, w8, w11, eq
4376 ; -O0: ands w12, w11, #0x1
4377 ; -O0: csel x9, x8, x9, ne
4378 ; -O0: ands w11, w11, #0x1
4379 ; -O0: csel x8, x8, x10, ne
4380 ; -O0: bl __atomic_compare_exchange
4382 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4383 ; -O1: ldp x0, x1, [x0]
4385 ; -O1: csel x8, x1, x19, lt
4386 ; -O1: csel x9, x0, x21, lt
4387 ; -O1: bl __atomic_compare_exchange
4388 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4392 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4393 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4394 ; -O0: subs x8, x8, x9
4395 ; -O0: subs x11, x11, x10
4396 ; -O0: subs x12, x12, x10
4397 ; -O0: csel w11, w8, w11, eq
4398 ; -O0: ands w12, w11, #0x1
4399 ; -O0: csel x9, x8, x9, ne
4400 ; -O0: ands w11, w11, #0x1
4401 ; -O0: csel x8, x8, x10, ne
4402 ; -O0: bl __atomic_compare_exchange
4404 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4405 ; -O1: ldp x0, x1, [x0]
4407 ; -O1: csel x8, x1, x19, lt
4408 ; -O1: csel x9, x0, x21, lt
4409 ; -O1: bl __atomic_compare_exchange
4410 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4414 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4415 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4416 ; -O0: subs x8, x8, x9
4417 ; -O0: subs x11, x11, x10
4418 ; -O0: subs x12, x12, x10
4419 ; -O0: csel w11, w8, w11, eq
4420 ; -O0: ands w12, w11, #0x1
4421 ; -O0: csel x9, x8, x9, ne
4422 ; -O0: ands w11, w11, #0x1
4423 ; -O0: csel x8, x8, x10, ne
4424 ; -O0: bl __atomic_compare_exchange
4426 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4427 ; -O1: ldp x0, x1, [x0]
4429 ; -O1: csel x8, x1, x19, lt
4430 ; -O1: csel x9, x0, x21, lt
4431 ; -O1: bl __atomic_compare_exchange
4432 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4436 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4437 ; CHECK-LABEL: atomicrmw_min_i8_aligned_monotonic:
4438 ; CHECK: ldsminb w1, w0, [x0]
4439 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4443 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4444 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acquire:
4445 ; CHECK: ldsminab w1, w0, [x0]
4446 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4450 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4451 ; CHECK-LABEL: atomicrmw_min_i8_aligned_release:
4452 ; CHECK: ldsminlb w1, w0, [x0]
4453 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4457 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4458 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4459 ; CHECK: ldsminalb w1, w0, [x0]
4460 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4464 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4465 ; CHECK-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4466 ; CHECK: ldsminalb w1, w0, [x0]
4467 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4471 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4472 ; CHECK-LABEL: atomicrmw_min_i16_aligned_monotonic:
4473 ; CHECK: ldsminh w1, w0, [x0]
4474 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
4478 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
4479 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acquire:
4480 ; CHECK: ldsminah w1, w0, [x0]
4481 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
4485 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
4486 ; CHECK-LABEL: atomicrmw_min_i16_aligned_release:
4487 ; CHECK: ldsminlh w1, w0, [x0]
4488 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
4492 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4493 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4494 ; CHECK: ldsminalh w1, w0, [x0]
4495 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
4499 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4500 ; CHECK-LABEL: atomicrmw_min_i16_aligned_seq_cst:
4501 ; CHECK: ldsminalh w1, w0, [x0]
4502 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
4506 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4507 ; CHECK-LABEL: atomicrmw_min_i32_aligned_monotonic:
4508 ; CHECK: ldsmin w1, w0, [x0]
4509 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
4513 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
4514 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acquire:
4515 ; CHECK: ldsmina w1, w0, [x0]
4516 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
4520 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
4521 ; CHECK-LABEL: atomicrmw_min_i32_aligned_release:
4522 ; CHECK: ldsminl w1, w0, [x0]
4523 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
4527 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4528 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acq_rel:
4529 ; CHECK: ldsminal w1, w0, [x0]
4530 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
4534 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4535 ; CHECK-LABEL: atomicrmw_min_i32_aligned_seq_cst:
4536 ; CHECK: ldsminal w1, w0, [x0]
4537 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
4541 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4542 ; CHECK-LABEL: atomicrmw_min_i64_aligned_monotonic:
4543 ; CHECK: ldsmin x1, x0, [x0]
4544 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
4548 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
4549 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acquire:
4550 ; CHECK: ldsmina x1, x0, [x0]
4551 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
4555 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
4556 ; CHECK-LABEL: atomicrmw_min_i64_aligned_release:
4557 ; CHECK: ldsminl x1, x0, [x0]
4558 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
4562 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4563 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acq_rel:
4564 ; CHECK: ldsminal x1, x0, [x0]
4565 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
4569 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4570 ; CHECK-LABEL: atomicrmw_min_i64_aligned_seq_cst:
4571 ; CHECK: ldsminal x1, x0, [x0]
4572 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
4576 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4577 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
4578 ; -O0: subs x9, x9, x12
4579 ; -O0: subs x11, x11, x10
4580 ; -O0: subs x13, x13, x10
4581 ; -O0: csel w11, w9, w11, eq
4582 ; -O0: ands w13, w11, #0x1
4583 ; -O0: csel x2, x9, x12, ne
4584 ; -O0: ands w11, w11, #0x1
4585 ; -O0: csel x9, x9, x10, ne
4586 ; -O0: casp x0, x1, x2, x3, [x8]
4587 ; -O0: eor x8, x10, x8
4588 ; -O0: eor x11, x9, x11
4589 ; -O0: orr x8, x8, x11
4590 ; -O0: subs x8, x8, #0
4592 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
4593 ; -O1: ldp x4, x5, [x0]
4595 ; -O1: csel x9, x7, x3, ge
4596 ; -O1: csel x8, x4, x2, ge
4597 ; -O1: casp x4, x5, x8, x9, [x0]
4599 ; -O1: ccmp x4, x6, #0, eq
4600 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
4604 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
4605 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
4606 ; -O0: subs x9, x9, x12
4607 ; -O0: subs x11, x11, x10
4608 ; -O0: subs x13, x13, x10
4609 ; -O0: csel w11, w9, w11, eq
4610 ; -O0: ands w13, w11, #0x1
4611 ; -O0: csel x2, x9, x12, ne
4612 ; -O0: ands w11, w11, #0x1
4613 ; -O0: csel x9, x9, x10, ne
4614 ; -O0: caspa x0, x1, x2, x3, [x8]
4615 ; -O0: eor x8, x10, x8
4616 ; -O0: eor x11, x9, x11
4617 ; -O0: orr x8, x8, x11
4618 ; -O0: subs x8, x8, #0
4620 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
4621 ; -O1: ldp x4, x5, [x0]
4623 ; -O1: csel x9, x7, x3, ge
4624 ; -O1: csel x8, x4, x2, ge
4625 ; -O1: caspa x4, x5, x8, x9, [x0]
4627 ; -O1: ccmp x4, x6, #0, eq
4628 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
4632 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
4633 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
4634 ; -O0: subs x9, x9, x12
4635 ; -O0: subs x11, x11, x10
4636 ; -O0: subs x13, x13, x10
4637 ; -O0: csel w11, w9, w11, eq
4638 ; -O0: ands w13, w11, #0x1
4639 ; -O0: csel x2, x9, x12, ne
4640 ; -O0: ands w11, w11, #0x1
4641 ; -O0: csel x9, x9, x10, ne
4642 ; -O0: caspl x0, x1, x2, x3, [x8]
4643 ; -O0: eor x8, x10, x8
4644 ; -O0: eor x11, x9, x11
4645 ; -O0: orr x8, x8, x11
4646 ; -O0: subs x8, x8, #0
4648 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
4649 ; -O1: ldp x4, x5, [x0]
4651 ; -O1: csel x9, x7, x3, ge
4652 ; -O1: csel x8, x4, x2, ge
4653 ; -O1: caspl x4, x5, x8, x9, [x0]
4655 ; -O1: ccmp x4, x6, #0, eq
4656 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
4660 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4661 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4662 ; -O0: subs x9, x9, x12
4663 ; -O0: subs x11, x11, x10
4664 ; -O0: subs x13, x13, x10
4665 ; -O0: csel w11, w9, w11, eq
4666 ; -O0: ands w13, w11, #0x1
4667 ; -O0: csel x2, x9, x12, ne
4668 ; -O0: ands w11, w11, #0x1
4669 ; -O0: csel x9, x9, x10, ne
4670 ; -O0: caspal x0, x1, x2, x3, [x8]
4671 ; -O0: eor x8, x10, x8
4672 ; -O0: eor x11, x9, x11
4673 ; -O0: orr x8, x8, x11
4674 ; -O0: subs x8, x8, #0
4676 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4677 ; -O1: ldp x4, x5, [x0]
4679 ; -O1: csel x9, x7, x3, ge
4680 ; -O1: csel x8, x4, x2, ge
4681 ; -O1: caspal x4, x5, x8, x9, [x0]
4683 ; -O1: ccmp x4, x6, #0, eq
4684 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
4688 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4689 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4690 ; -O0: subs x9, x9, x12
4691 ; -O0: subs x11, x11, x10
4692 ; -O0: subs x13, x13, x10
4693 ; -O0: csel w11, w9, w11, eq
4694 ; -O0: ands w13, w11, #0x1
4695 ; -O0: csel x2, x9, x12, ne
4696 ; -O0: ands w11, w11, #0x1
4697 ; -O0: csel x9, x9, x10, ne
4698 ; -O0: caspal x0, x1, x2, x3, [x8]
4699 ; -O0: eor x8, x10, x8
4700 ; -O0: eor x11, x9, x11
4701 ; -O0: orr x8, x8, x11
4702 ; -O0: subs x8, x8, #0
4704 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4705 ; -O1: ldp x4, x5, [x0]
4707 ; -O1: csel x9, x7, x3, ge
4708 ; -O1: csel x8, x4, x2, ge
4709 ; -O1: caspal x4, x5, x8, x9, [x0]
4711 ; -O1: ccmp x4, x6, #0, eq
4712 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
4716 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4717 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_monotonic:
4718 ; CHECK: ldsminb w1, w0, [x0]
4719 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4723 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4724 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acquire:
4725 ; CHECK: ldsminab w1, w0, [x0]
4726 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4730 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
4731 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_release:
4732 ; CHECK: ldsminlb w1, w0, [x0]
4733 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4737 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4738 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
4739 ; CHECK: ldsminalb w1, w0, [x0]
4740 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4744 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4745 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
4746 ; CHECK: ldsminalb w1, w0, [x0]
4747 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4751 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4752 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4754 ; -O0: subs w10, w10, w8, sxth
4755 ; -O0: csel w8, w9, w8, le
4756 ; -O0: bl __atomic_compare_exchange
4758 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4760 ; -O1: cmp w8, w20, sxth
4761 ; -O1: csel w8, w0, w20, le
4762 ; -O1: bl __atomic_compare_exchange
4763 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
4767 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4768 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
4770 ; -O0: subs w10, w10, w8, sxth
4771 ; -O0: csel w8, w9, w8, le
4772 ; -O0: bl __atomic_compare_exchange
4774 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
4776 ; -O1: cmp w8, w20, sxth
4777 ; -O1: csel w8, w0, w20, le
4778 ; -O1: bl __atomic_compare_exchange
4779 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
4783 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
4784 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
4786 ; -O0: subs w10, w10, w8, sxth
4787 ; -O0: csel w8, w9, w8, le
4788 ; -O0: bl __atomic_compare_exchange
4790 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
4792 ; -O1: cmp w8, w20, sxth
4793 ; -O1: csel w8, w0, w20, le
4794 ; -O1: bl __atomic_compare_exchange
4795 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
4799 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4800 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4802 ; -O0: subs w10, w10, w8, sxth
4803 ; -O0: csel w8, w9, w8, le
4804 ; -O0: bl __atomic_compare_exchange
4806 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4808 ; -O1: cmp w8, w20, sxth
4809 ; -O1: csel w8, w0, w20, le
4810 ; -O1: bl __atomic_compare_exchange
4811 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
4815 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4816 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4818 ; -O0: subs w10, w10, w8, sxth
4819 ; -O0: csel w8, w9, w8, le
4820 ; -O0: bl __atomic_compare_exchange
4822 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4824 ; -O1: cmp w8, w20, sxth
4825 ; -O1: csel w8, w0, w20, le
4826 ; -O1: bl __atomic_compare_exchange
4827 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
4831 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4832 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4833 ; -O0: subs w10, w9, w8
4834 ; -O0: csel w8, w9, w8, le
4835 ; -O0: bl __atomic_compare_exchange
4837 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4839 ; -O1: csel w8, w0, w20, le
4840 ; -O1: bl __atomic_compare_exchange
4841 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
4845 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4846 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
4847 ; -O0: subs w10, w9, w8
4848 ; -O0: csel w8, w9, w8, le
4849 ; -O0: bl __atomic_compare_exchange
4851 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
4853 ; -O1: csel w8, w0, w20, le
4854 ; -O1: bl __atomic_compare_exchange
4855 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
4859 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
4860 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
4861 ; -O0: subs w10, w9, w8
4862 ; -O0: csel w8, w9, w8, le
4863 ; -O0: bl __atomic_compare_exchange
4865 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
4867 ; -O1: csel w8, w0, w20, le
4868 ; -O1: bl __atomic_compare_exchange
4869 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
4873 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4874 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
4875 ; -O0: subs w10, w9, w8
4876 ; -O0: csel w8, w9, w8, le
4877 ; -O0: bl __atomic_compare_exchange
4879 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
4881 ; -O1: csel w8, w0, w20, le
4882 ; -O1: bl __atomic_compare_exchange
4883 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
4887 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4888 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
4889 ; -O0: subs w10, w9, w8
4890 ; -O0: csel w8, w9, w8, le
4891 ; -O0: bl __atomic_compare_exchange
4893 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
4895 ; -O1: csel w8, w0, w20, le
4896 ; -O1: bl __atomic_compare_exchange
4897 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
4901 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4902 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
4903 ; -O0: subs x10, x9, x8
4904 ; -O0: csel x8, x9, x8, le
4905 ; -O0: bl __atomic_compare_exchange
4907 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
4909 ; -O1: csel x8, x0, x20, le
4910 ; -O1: bl __atomic_compare_exchange
4911 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
4915 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4916 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
4917 ; -O0: subs x10, x9, x8
4918 ; -O0: csel x8, x9, x8, le
4919 ; -O0: bl __atomic_compare_exchange
4921 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
4923 ; -O1: csel x8, x0, x20, le
4924 ; -O1: bl __atomic_compare_exchange
4925 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
4929 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
4930 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
4931 ; -O0: subs x10, x9, x8
4932 ; -O0: csel x8, x9, x8, le
4933 ; -O0: bl __atomic_compare_exchange
4935 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
4937 ; -O1: csel x8, x0, x20, le
4938 ; -O1: bl __atomic_compare_exchange
4939 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
4943 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4944 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
4945 ; -O0: subs x10, x9, x8
4946 ; -O0: csel x8, x9, x8, le
4947 ; -O0: bl __atomic_compare_exchange
4949 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
4951 ; -O1: csel x8, x0, x20, le
4952 ; -O1: bl __atomic_compare_exchange
4953 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
4957 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4958 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
4959 ; -O0: subs x10, x9, x8
4960 ; -O0: csel x8, x9, x8, le
4961 ; -O0: bl __atomic_compare_exchange
4963 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
4965 ; -O1: csel x8, x0, x20, le
4966 ; -O1: bl __atomic_compare_exchange
4967 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
4971 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4972 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
4973 ; -O0: subs x8, x8, x9
4974 ; -O0: subs x11, x11, x10
4975 ; -O0: subs x12, x12, x10
4976 ; -O0: csel w11, w8, w11, eq
4977 ; -O0: ands w12, w11, #0x1
4978 ; -O0: csel x9, x8, x9, ne
4979 ; -O0: ands w11, w11, #0x1
4980 ; -O0: csel x8, x8, x10, ne
4981 ; -O0: bl __atomic_compare_exchange
4983 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
4984 ; -O1: ldp x0, x1, [x0]
4986 ; -O1: csel x8, x1, x19, ge
4987 ; -O1: csel x9, x0, x21, ge
4988 ; -O1: bl __atomic_compare_exchange
4989 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
4993 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4994 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
4995 ; -O0: subs x8, x8, x9
4996 ; -O0: subs x11, x11, x10
4997 ; -O0: subs x12, x12, x10
4998 ; -O0: csel w11, w8, w11, eq
4999 ; -O0: ands w12, w11, #0x1
5000 ; -O0: csel x9, x8, x9, ne
5001 ; -O0: ands w11, w11, #0x1
5002 ; -O0: csel x8, x8, x10, ne
5003 ; -O0: bl __atomic_compare_exchange
5005 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
5006 ; -O1: ldp x0, x1, [x0]
5008 ; -O1: csel x8, x1, x19, ge
5009 ; -O1: csel x9, x0, x21, ge
5010 ; -O1: bl __atomic_compare_exchange
5011 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
5015 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
5016 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
5017 ; -O0: subs x8, x8, x9
5018 ; -O0: subs x11, x11, x10
5019 ; -O0: subs x12, x12, x10
5020 ; -O0: csel w11, w8, w11, eq
5021 ; -O0: ands w12, w11, #0x1
5022 ; -O0: csel x9, x8, x9, ne
5023 ; -O0: ands w11, w11, #0x1
5024 ; -O0: csel x8, x8, x10, ne
5025 ; -O0: bl __atomic_compare_exchange
5027 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
5028 ; -O1: ldp x0, x1, [x0]
5030 ; -O1: csel x8, x1, x19, ge
5031 ; -O1: csel x9, x0, x21, ge
5032 ; -O1: bl __atomic_compare_exchange
5033 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
5037 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5038 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5039 ; -O0: subs x8, x8, x9
5040 ; -O0: subs x11, x11, x10
5041 ; -O0: subs x12, x12, x10
5042 ; -O0: csel w11, w8, w11, eq
5043 ; -O0: ands w12, w11, #0x1
5044 ; -O0: csel x9, x8, x9, ne
5045 ; -O0: ands w11, w11, #0x1
5046 ; -O0: csel x8, x8, x10, ne
5047 ; -O0: bl __atomic_compare_exchange
5049 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5050 ; -O1: ldp x0, x1, [x0]
5052 ; -O1: csel x8, x1, x19, ge
5053 ; -O1: csel x9, x0, x21, ge
5054 ; -O1: bl __atomic_compare_exchange
5055 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5059 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5060 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5061 ; -O0: subs x8, x8, x9
5062 ; -O0: subs x11, x11, x10
5063 ; -O0: subs x12, x12, x10
5064 ; -O0: csel w11, w8, w11, eq
5065 ; -O0: ands w12, w11, #0x1
5066 ; -O0: csel x9, x8, x9, ne
5067 ; -O0: ands w11, w11, #0x1
5068 ; -O0: csel x8, x8, x10, ne
5069 ; -O0: bl __atomic_compare_exchange
5071 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5072 ; -O1: ldp x0, x1, [x0]
5074 ; -O1: csel x8, x1, x19, ge
5075 ; -O1: csel x9, x0, x21, ge
5076 ; -O1: bl __atomic_compare_exchange
5077 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5081 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5082 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5083 ; CHECK: ldumaxb w1, w0, [x0]
5084 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5088 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5089 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acquire:
5090 ; CHECK: ldumaxab w1, w0, [x0]
5091 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5095 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5096 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_release:
5097 ; CHECK: ldumaxlb w1, w0, [x0]
5098 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5102 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5103 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5104 ; CHECK: ldumaxalb w1, w0, [x0]
5105 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5109 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5110 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5111 ; CHECK: ldumaxalb w1, w0, [x0]
5112 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5116 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5117 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5118 ; CHECK: ldumaxh w1, w0, [x0]
5119 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5123 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5124 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acquire:
5125 ; CHECK: ldumaxah w1, w0, [x0]
5126 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5130 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5131 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_release:
5132 ; CHECK: ldumaxlh w1, w0, [x0]
5133 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5137 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5138 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5139 ; CHECK: ldumaxalh w1, w0, [x0]
5140 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
5144 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5145 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5146 ; CHECK: ldumaxalh w1, w0, [x0]
5147 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
5151 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5152 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5153 ; CHECK: ldumax w1, w0, [x0]
5154 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
5158 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
5159 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acquire:
5160 ; CHECK: ldumaxa w1, w0, [x0]
5161 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
5165 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
5166 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_release:
5167 ; CHECK: ldumaxl w1, w0, [x0]
5168 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
5172 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5173 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5174 ; CHECK: ldumaxal w1, w0, [x0]
5175 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
5179 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5180 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5181 ; CHECK: ldumaxal w1, w0, [x0]
5182 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
5186 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5187 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5188 ; CHECK: ldumax x1, x0, [x0]
5189 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
5193 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
5194 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acquire:
5195 ; CHECK: ldumaxa x1, x0, [x0]
5196 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
5200 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
5201 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_release:
5202 ; CHECK: ldumaxl x1, x0, [x0]
5203 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
5207 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5208 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
5209 ; CHECK: ldumaxal x1, x0, [x0]
5210 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
5214 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5215 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
5216 ; CHECK: ldumaxal x1, x0, [x0]
5217 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
5221 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5222 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5223 ; -O0: subs x9, x9, x12
5224 ; -O0: subs x11, x11, x10
5225 ; -O0: subs x13, x13, x10
5226 ; -O0: csel w11, w9, w11, eq
5227 ; -O0: ands w13, w11, #0x1
5228 ; -O0: csel x2, x9, x12, ne
5229 ; -O0: ands w11, w11, #0x1
5230 ; -O0: csel x9, x9, x10, ne
5231 ; -O0: casp x0, x1, x2, x3, [x8]
5232 ; -O0: eor x8, x10, x8
5233 ; -O0: eor x11, x9, x11
5234 ; -O0: orr x8, x8, x11
5235 ; -O0: subs x8, x8, #0
5237 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5238 ; -O1: ldp x4, x5, [x0]
5240 ; -O1: csel x9, x7, x3, lo
5241 ; -O1: csel x8, x4, x2, lo
5242 ; -O1: casp x4, x5, x8, x9, [x0]
5244 ; -O1: ccmp x4, x6, #0, eq
5245 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
5249 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
5250 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
5251 ; -O0: subs x9, x9, x12
5252 ; -O0: subs x11, x11, x10
5253 ; -O0: subs x13, x13, x10
5254 ; -O0: csel w11, w9, w11, eq
5255 ; -O0: ands w13, w11, #0x1
5256 ; -O0: csel x2, x9, x12, ne
5257 ; -O0: ands w11, w11, #0x1
5258 ; -O0: csel x9, x9, x10, ne
5259 ; -O0: caspa x0, x1, x2, x3, [x8]
5260 ; -O0: eor x8, x10, x8
5261 ; -O0: eor x11, x9, x11
5262 ; -O0: orr x8, x8, x11
5263 ; -O0: subs x8, x8, #0
5265 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
5266 ; -O1: ldp x4, x5, [x0]
5268 ; -O1: csel x9, x7, x3, lo
5269 ; -O1: csel x8, x4, x2, lo
5270 ; -O1: caspa x4, x5, x8, x9, [x0]
5272 ; -O1: ccmp x4, x6, #0, eq
5273 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
5277 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
5278 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
5279 ; -O0: subs x9, x9, x12
5280 ; -O0: subs x11, x11, x10
5281 ; -O0: subs x13, x13, x10
5282 ; -O0: csel w11, w9, w11, eq
5283 ; -O0: ands w13, w11, #0x1
5284 ; -O0: csel x2, x9, x12, ne
5285 ; -O0: ands w11, w11, #0x1
5286 ; -O0: csel x9, x9, x10, ne
5287 ; -O0: caspl x0, x1, x2, x3, [x8]
5288 ; -O0: eor x8, x10, x8
5289 ; -O0: eor x11, x9, x11
5290 ; -O0: orr x8, x8, x11
5291 ; -O0: subs x8, x8, #0
5293 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
5294 ; -O1: ldp x4, x5, [x0]
5296 ; -O1: csel x9, x7, x3, lo
5297 ; -O1: csel x8, x4, x2, lo
5298 ; -O1: caspl x4, x5, x8, x9, [x0]
5300 ; -O1: ccmp x4, x6, #0, eq
5301 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
5305 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5306 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5307 ; -O0: subs x9, x9, x12
5308 ; -O0: subs x11, x11, x10
5309 ; -O0: subs x13, x13, x10
5310 ; -O0: csel w11, w9, w11, eq
5311 ; -O0: ands w13, w11, #0x1
5312 ; -O0: csel x2, x9, x12, ne
5313 ; -O0: ands w11, w11, #0x1
5314 ; -O0: csel x9, x9, x10, ne
5315 ; -O0: caspal x0, x1, x2, x3, [x8]
5316 ; -O0: eor x8, x10, x8
5317 ; -O0: eor x11, x9, x11
5318 ; -O0: orr x8, x8, x11
5319 ; -O0: subs x8, x8, #0
5321 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5322 ; -O1: ldp x4, x5, [x0]
5324 ; -O1: csel x9, x7, x3, lo
5325 ; -O1: csel x8, x4, x2, lo
5326 ; -O1: caspal x4, x5, x8, x9, [x0]
5328 ; -O1: ccmp x4, x6, #0, eq
5329 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
5333 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5334 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5335 ; -O0: subs x9, x9, x12
5336 ; -O0: subs x11, x11, x10
5337 ; -O0: subs x13, x13, x10
5338 ; -O0: csel w11, w9, w11, eq
5339 ; -O0: ands w13, w11, #0x1
5340 ; -O0: csel x2, x9, x12, ne
5341 ; -O0: ands w11, w11, #0x1
5342 ; -O0: csel x9, x9, x10, ne
5343 ; -O0: caspal x0, x1, x2, x3, [x8]
5344 ; -O0: eor x8, x10, x8
5345 ; -O0: eor x11, x9, x11
5346 ; -O0: orr x8, x8, x11
5347 ; -O0: subs x8, x8, #0
5349 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5350 ; -O1: ldp x4, x5, [x0]
5352 ; -O1: csel x9, x7, x3, lo
5353 ; -O1: csel x8, x4, x2, lo
5354 ; -O1: caspal x4, x5, x8, x9, [x0]
5356 ; -O1: ccmp x4, x6, #0, eq
5357 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
5361 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5362 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
5363 ; CHECK: ldumaxb w1, w0, [x0]
5364 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5368 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5369 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acquire:
5370 ; CHECK: ldumaxab w1, w0, [x0]
5371 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5375 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
5376 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_release:
5377 ; CHECK: ldumaxlb w1, w0, [x0]
5378 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5382 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5383 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
5384 ; CHECK: ldumaxalb w1, w0, [x0]
5385 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5389 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5390 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
5391 ; CHECK: ldumaxalb w1, w0, [x0]
5392 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5396 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5397 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5398 ; -O0: subs w10, w10, w8, uxth
5399 ; -O0: csel w8, w9, w8, hi
5400 ; -O0: bl __atomic_compare_exchange
5402 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5403 ; -O1: and w8, w0, #0xffff
5404 ; -O1: cmp w8, w20, uxth
5405 ; -O1: csel w8, w0, w20, hi
5406 ; -O1: bl __atomic_compare_exchange
5407 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
5411 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5412 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5413 ; -O0: subs w10, w10, w8, uxth
5414 ; -O0: csel w8, w9, w8, hi
5415 ; -O0: bl __atomic_compare_exchange
5417 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5418 ; -O1: and w8, w0, #0xffff
5419 ; -O1: cmp w8, w20, uxth
5420 ; -O1: csel w8, w0, w20, hi
5421 ; -O1: bl __atomic_compare_exchange
5422 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
5426 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
5427 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
5428 ; -O0: subs w10, w10, w8, uxth
5429 ; -O0: csel w8, w9, w8, hi
5430 ; -O0: bl __atomic_compare_exchange
5432 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
5433 ; -O1: and w8, w0, #0xffff
5434 ; -O1: cmp w8, w20, uxth
5435 ; -O1: csel w8, w0, w20, hi
5436 ; -O1: bl __atomic_compare_exchange
5437 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
5441 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5442 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5443 ; -O0: subs w10, w10, w8, uxth
5444 ; -O0: csel w8, w9, w8, hi
5445 ; -O0: bl __atomic_compare_exchange
5447 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5448 ; -O1: and w8, w0, #0xffff
5449 ; -O1: cmp w8, w20, uxth
5450 ; -O1: csel w8, w0, w20, hi
5451 ; -O1: bl __atomic_compare_exchange
5452 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
5456 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5457 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5458 ; -O0: subs w10, w10, w8, uxth
5459 ; -O0: csel w8, w9, w8, hi
5460 ; -O0: bl __atomic_compare_exchange
5462 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5463 ; -O1: and w8, w0, #0xffff
5464 ; -O1: cmp w8, w20, uxth
5465 ; -O1: csel w8, w0, w20, hi
5466 ; -O1: bl __atomic_compare_exchange
5467 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
5471 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5472 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5473 ; -O0: subs w10, w9, w8
5474 ; -O0: csel w8, w9, w8, hi
5475 ; -O0: bl __atomic_compare_exchange
5477 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5479 ; -O1: csel w8, w0, w20, hi
5480 ; -O1: bl __atomic_compare_exchange
5481 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
5485 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5486 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5487 ; -O0: subs w10, w9, w8
5488 ; -O0: csel w8, w9, w8, hi
5489 ; -O0: bl __atomic_compare_exchange
5491 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5493 ; -O1: csel w8, w0, w20, hi
5494 ; -O1: bl __atomic_compare_exchange
5495 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
5499 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
5500 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
5501 ; -O0: subs w10, w9, w8
5502 ; -O0: csel w8, w9, w8, hi
5503 ; -O0: bl __atomic_compare_exchange
5505 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
5507 ; -O1: csel w8, w0, w20, hi
5508 ; -O1: bl __atomic_compare_exchange
5509 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
5513 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5514 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5515 ; -O0: subs w10, w9, w8
5516 ; -O0: csel w8, w9, w8, hi
5517 ; -O0: bl __atomic_compare_exchange
5519 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5521 ; -O1: csel w8, w0, w20, hi
5522 ; -O1: bl __atomic_compare_exchange
5523 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
5527 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5528 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5529 ; -O0: subs w10, w9, w8
5530 ; -O0: csel w8, w9, w8, hi
5531 ; -O0: bl __atomic_compare_exchange
5533 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5535 ; -O1: csel w8, w0, w20, hi
5536 ; -O1: bl __atomic_compare_exchange
5537 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
5541 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5542 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5543 ; -O0: subs x10, x9, x8
5544 ; -O0: csel x8, x9, x8, hi
5545 ; -O0: bl __atomic_compare_exchange
5547 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5549 ; -O1: csel x8, x0, x20, hi
5550 ; -O1: bl __atomic_compare_exchange
5551 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
5555 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5556 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5557 ; -O0: subs x10, x9, x8
5558 ; -O0: csel x8, x9, x8, hi
5559 ; -O0: bl __atomic_compare_exchange
5561 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5563 ; -O1: csel x8, x0, x20, hi
5564 ; -O1: bl __atomic_compare_exchange
5565 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
5569 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
5570 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
5571 ; -O0: subs x10, x9, x8
5572 ; -O0: csel x8, x9, x8, hi
5573 ; -O0: bl __atomic_compare_exchange
5575 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
5577 ; -O1: csel x8, x0, x20, hi
5578 ; -O1: bl __atomic_compare_exchange
5579 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
5583 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5584 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5585 ; -O0: subs x10, x9, x8
5586 ; -O0: csel x8, x9, x8, hi
5587 ; -O0: bl __atomic_compare_exchange
5589 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5591 ; -O1: csel x8, x0, x20, hi
5592 ; -O1: bl __atomic_compare_exchange
5593 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
5597 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5598 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5599 ; -O0: subs x10, x9, x8
5600 ; -O0: csel x8, x9, x8, hi
5601 ; -O0: bl __atomic_compare_exchange
5603 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5605 ; -O1: csel x8, x0, x20, hi
5606 ; -O1: bl __atomic_compare_exchange
5607 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
5611 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5612 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5613 ; -O0: subs x8, x8, x9
5614 ; -O0: subs x11, x11, x10
5615 ; -O0: subs x12, x12, x10
5616 ; -O0: csel w11, w8, w11, eq
5617 ; -O0: ands w12, w11, #0x1
5618 ; -O0: csel x9, x8, x9, ne
5619 ; -O0: ands w11, w11, #0x1
5620 ; -O0: csel x8, x8, x10, ne
5621 ; -O0: bl __atomic_compare_exchange
5623 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5624 ; -O1: ldp x0, x1, [x0]
5626 ; -O1: csel x8, x1, x19, lo
5627 ; -O1: csel x9, x0, x21, lo
5628 ; -O1: bl __atomic_compare_exchange
5629 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
5633 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5634 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5635 ; -O0: subs x8, x8, x9
5636 ; -O0: subs x11, x11, x10
5637 ; -O0: subs x12, x12, x10
5638 ; -O0: csel w11, w8, w11, eq
5639 ; -O0: ands w12, w11, #0x1
5640 ; -O0: csel x9, x8, x9, ne
5641 ; -O0: ands w11, w11, #0x1
5642 ; -O0: csel x8, x8, x10, ne
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 x8, x8, x9
5658 ; -O0: subs x11, x11, x10
5659 ; -O0: subs x12, x12, x10
5660 ; -O0: csel w11, w8, w11, eq
5661 ; -O0: ands w12, w11, #0x1
5662 ; -O0: csel x9, x8, x9, ne
5663 ; -O0: ands w11, w11, #0x1
5664 ; -O0: csel x8, x8, x10, ne
5665 ; -O0: bl __atomic_compare_exchange
5667 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
5668 ; -O1: ldp x0, x1, [x0]
5670 ; -O1: csel x8, x1, x19, lo
5671 ; -O1: csel x9, x0, x21, lo
5672 ; -O1: bl __atomic_compare_exchange
5673 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
5677 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5678 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5679 ; -O0: subs x8, x8, x9
5680 ; -O0: subs x11, x11, x10
5681 ; -O0: subs x12, x12, x10
5682 ; -O0: csel w11, w8, w11, eq
5683 ; -O0: ands w12, w11, #0x1
5684 ; -O0: csel x9, x8, x9, ne
5685 ; -O0: ands w11, w11, #0x1
5686 ; -O0: csel x8, x8, x10, ne
5687 ; -O0: bl __atomic_compare_exchange
5689 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5690 ; -O1: ldp x0, x1, [x0]
5692 ; -O1: csel x8, x1, x19, lo
5693 ; -O1: csel x9, x0, x21, lo
5694 ; -O1: bl __atomic_compare_exchange
5695 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
5699 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5700 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5701 ; -O0: subs x8, x8, x9
5702 ; -O0: subs x11, x11, x10
5703 ; -O0: subs x12, x12, x10
5704 ; -O0: csel w11, w8, w11, eq
5705 ; -O0: ands w12, w11, #0x1
5706 ; -O0: csel x9, x8, x9, ne
5707 ; -O0: ands w11, w11, #0x1
5708 ; -O0: csel x8, x8, x10, ne
5709 ; -O0: bl __atomic_compare_exchange
5711 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5712 ; -O1: ldp x0, x1, [x0]
5714 ; -O1: csel x8, x1, x19, lo
5715 ; -O1: csel x9, x0, x21, lo
5716 ; -O1: bl __atomic_compare_exchange
5717 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
5721 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5722 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_monotonic:
5723 ; CHECK: lduminb w1, w0, [x0]
5724 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
5728 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
5729 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acquire:
5730 ; CHECK: lduminab w1, w0, [x0]
5731 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
5735 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
5736 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_release:
5737 ; CHECK: lduminlb w1, w0, [x0]
5738 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
5742 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5743 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
5744 ; CHECK: lduminalb w1, w0, [x0]
5745 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
5749 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5750 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
5751 ; CHECK: lduminalb w1, w0, [x0]
5752 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
5756 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5757 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_monotonic:
5758 ; CHECK: lduminh w1, w0, [x0]
5759 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
5763 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
5764 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acquire:
5765 ; CHECK: lduminah w1, w0, [x0]
5766 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
5770 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
5771 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_release:
5772 ; CHECK: lduminlh w1, w0, [x0]
5773 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
5777 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5778 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
5779 ; CHECK: lduminalh w1, w0, [x0]
5780 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
5784 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5785 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
5786 ; CHECK: lduminalh w1, w0, [x0]
5787 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
5791 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5792 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_monotonic:
5793 ; CHECK: ldumin w1, w0, [x0]
5794 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
5798 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
5799 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acquire:
5800 ; CHECK: ldumina w1, w0, [x0]
5801 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
5805 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
5806 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_release:
5807 ; CHECK: lduminl w1, w0, [x0]
5808 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
5812 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5813 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
5814 ; CHECK: lduminal w1, w0, [x0]
5815 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
5819 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5820 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
5821 ; CHECK: lduminal w1, w0, [x0]
5822 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
5826 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5827 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_monotonic:
5828 ; CHECK: ldumin x1, x0, [x0]
5829 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
5833 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
5834 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acquire:
5835 ; CHECK: ldumina x1, x0, [x0]
5836 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
5840 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
5841 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_release:
5842 ; CHECK: lduminl x1, x0, [x0]
5843 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
5847 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5848 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
5849 ; CHECK: lduminal x1, x0, [x0]
5850 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
5854 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5855 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
5856 ; CHECK: lduminal x1, x0, [x0]
5857 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
5861 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5862 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
5863 ; -O0: subs x9, x9, x12
5864 ; -O0: subs x11, x11, x10
5865 ; -O0: subs x13, x13, x10
5866 ; -O0: csel w11, w9, w11, eq
5867 ; -O0: ands w13, w11, #0x1
5868 ; -O0: csel x2, x9, x12, ne
5869 ; -O0: ands w11, w11, #0x1
5870 ; -O0: csel x9, x9, x10, ne
5871 ; -O0: casp x0, x1, x2, x3, [x8]
5872 ; -O0: eor x8, x10, x8
5873 ; -O0: eor x11, x9, x11
5874 ; -O0: orr x8, x8, x11
5875 ; -O0: subs x8, x8, #0
5877 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
5878 ; -O1: ldp x4, x5, [x0]
5880 ; -O1: csel x9, x7, x3, hs
5881 ; -O1: csel x8, x4, x2, hs
5882 ; -O1: casp x4, x5, x8, x9, [x0]
5884 ; -O1: ccmp x4, x6, #0, eq
5885 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
5889 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
5890 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
5891 ; -O0: subs x9, x9, x12
5892 ; -O0: subs x11, x11, x10
5893 ; -O0: subs x13, x13, x10
5894 ; -O0: csel w11, w9, w11, eq
5895 ; -O0: ands w13, w11, #0x1
5896 ; -O0: csel x2, x9, x12, ne
5897 ; -O0: ands w11, w11, #0x1
5898 ; -O0: csel x9, x9, x10, ne
5899 ; -O0: caspa x0, x1, x2, x3, [x8]
5900 ; -O0: eor x8, x10, x8
5901 ; -O0: eor x11, x9, x11
5902 ; -O0: orr x8, x8, x11
5903 ; -O0: subs x8, x8, #0
5905 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
5906 ; -O1: ldp x4, x5, [x0]
5908 ; -O1: csel x9, x7, x3, hs
5909 ; -O1: csel x8, x4, x2, hs
5910 ; -O1: caspa x4, x5, x8, x9, [x0]
5912 ; -O1: ccmp x4, x6, #0, eq
5913 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
5917 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
5918 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
5919 ; -O0: subs x9, x9, x12
5920 ; -O0: subs x11, x11, x10
5921 ; -O0: subs x13, x13, x10
5922 ; -O0: csel w11, w9, w11, eq
5923 ; -O0: ands w13, w11, #0x1
5924 ; -O0: csel x2, x9, x12, ne
5925 ; -O0: ands w11, w11, #0x1
5926 ; -O0: csel x9, x9, x10, ne
5927 ; -O0: caspl x0, x1, x2, x3, [x8]
5928 ; -O0: eor x8, x10, x8
5929 ; -O0: eor x11, x9, x11
5930 ; -O0: orr x8, x8, x11
5931 ; -O0: subs x8, x8, #0
5933 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
5934 ; -O1: ldp x4, x5, [x0]
5936 ; -O1: csel x9, x7, x3, hs
5937 ; -O1: csel x8, x4, x2, hs
5938 ; -O1: caspl x4, x5, x8, x9, [x0]
5940 ; -O1: ccmp x4, x6, #0, eq
5941 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
5945 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5946 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
5947 ; -O0: subs x9, x9, x12
5948 ; -O0: subs x11, x11, x10
5949 ; -O0: subs x13, x13, x10
5950 ; -O0: csel w11, w9, w11, eq
5951 ; -O0: ands w13, w11, #0x1
5952 ; -O0: csel x2, x9, x12, ne
5953 ; -O0: ands w11, w11, #0x1
5954 ; -O0: csel x9, x9, x10, ne
5955 ; -O0: caspal x0, x1, x2, x3, [x8]
5956 ; -O0: eor x8, x10, x8
5957 ; -O0: eor x11, x9, x11
5958 ; -O0: orr x8, x8, x11
5959 ; -O0: subs x8, x8, #0
5961 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
5962 ; -O1: ldp x4, x5, [x0]
5964 ; -O1: csel x9, x7, x3, hs
5965 ; -O1: csel x8, x4, x2, hs
5966 ; -O1: caspal x4, x5, x8, x9, [x0]
5968 ; -O1: ccmp x4, x6, #0, eq
5969 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
5973 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5974 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
5975 ; -O0: subs x9, x9, x12
5976 ; -O0: subs x11, x11, x10
5977 ; -O0: subs x13, x13, x10
5978 ; -O0: csel w11, w9, w11, eq
5979 ; -O0: ands w13, w11, #0x1
5980 ; -O0: csel x2, x9, x12, ne
5981 ; -O0: ands w11, w11, #0x1
5982 ; -O0: csel x9, x9, x10, ne
5983 ; -O0: caspal x0, x1, x2, x3, [x8]
5984 ; -O0: eor x8, x10, x8
5985 ; -O0: eor x11, x9, x11
5986 ; -O0: orr x8, x8, x11
5987 ; -O0: subs x8, x8, #0
5989 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
5990 ; -O1: ldp x4, x5, [x0]
5992 ; -O1: csel x9, x7, x3, hs
5993 ; -O1: csel x8, x4, x2, hs
5994 ; -O1: caspal x4, x5, x8, x9, [x0]
5996 ; -O1: ccmp x4, x6, #0, eq
5997 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
6001 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6002 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
6003 ; CHECK: lduminb w1, w0, [x0]
6004 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
6008 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6009 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acquire:
6010 ; CHECK: lduminab w1, w0, [x0]
6011 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
6015 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
6016 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_release:
6017 ; CHECK: lduminlb w1, w0, [x0]
6018 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
6022 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6023 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
6024 ; CHECK: lduminalb w1, w0, [x0]
6025 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
6029 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6030 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
6031 ; CHECK: lduminalb w1, w0, [x0]
6032 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
6036 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6037 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6038 ; -O0: subs w10, w10, w8, uxth
6039 ; -O0: csel w8, w9, w8, ls
6040 ; -O0: bl __atomic_compare_exchange
6042 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6043 ; -O1: and w8, w0, #0xffff
6044 ; -O1: cmp w8, w20, uxth
6045 ; -O1: csel w8, w0, w20, ls
6046 ; -O1: bl __atomic_compare_exchange
6047 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
6051 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6052 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
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_acquire:
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 acquire, align 1
6066 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
6067 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
6068 ; -O0: subs w10, w10, w8, uxth
6069 ; -O0: csel w8, w9, w8, ls
6070 ; -O0: bl __atomic_compare_exchange
6072 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
6073 ; -O1: and w8, w0, #0xffff
6074 ; -O1: cmp w8, w20, uxth
6075 ; -O1: csel w8, w0, w20, ls
6076 ; -O1: bl __atomic_compare_exchange
6077 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
6081 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6082 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6083 ; -O0: subs w10, w10, w8, uxth
6084 ; -O0: csel w8, w9, w8, ls
6085 ; -O0: bl __atomic_compare_exchange
6087 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6088 ; -O1: and w8, w0, #0xffff
6089 ; -O1: cmp w8, w20, uxth
6090 ; -O1: csel w8, w0, w20, ls
6091 ; -O1: bl __atomic_compare_exchange
6092 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
6096 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6097 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6098 ; -O0: subs w10, w10, w8, uxth
6099 ; -O0: csel w8, w9, w8, ls
6100 ; -O0: bl __atomic_compare_exchange
6102 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6103 ; -O1: and w8, w0, #0xffff
6104 ; -O1: cmp w8, w20, uxth
6105 ; -O1: csel w8, w0, w20, ls
6106 ; -O1: bl __atomic_compare_exchange
6107 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
6111 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6112 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6113 ; -O0: subs w10, w9, w8
6114 ; -O0: csel w8, w9, w8, ls
6115 ; -O0: bl __atomic_compare_exchange
6117 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6119 ; -O1: csel w8, w0, w20, ls
6120 ; -O1: bl __atomic_compare_exchange
6121 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
6125 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6126 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6127 ; -O0: subs w10, w9, w8
6128 ; -O0: csel w8, w9, w8, ls
6129 ; -O0: bl __atomic_compare_exchange
6131 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6133 ; -O1: csel w8, w0, w20, ls
6134 ; -O1: bl __atomic_compare_exchange
6135 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
6139 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
6140 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
6141 ; -O0: subs w10, w9, w8
6142 ; -O0: csel w8, w9, w8, ls
6143 ; -O0: bl __atomic_compare_exchange
6145 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
6147 ; -O1: csel w8, w0, w20, ls
6148 ; -O1: bl __atomic_compare_exchange
6149 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
6153 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6154 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6155 ; -O0: subs w10, w9, w8
6156 ; -O0: csel w8, w9, w8, ls
6157 ; -O0: bl __atomic_compare_exchange
6159 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6161 ; -O1: csel w8, w0, w20, ls
6162 ; -O1: bl __atomic_compare_exchange
6163 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
6167 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6168 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6169 ; -O0: subs w10, w9, w8
6170 ; -O0: csel w8, w9, w8, ls
6171 ; -O0: bl __atomic_compare_exchange
6173 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6175 ; -O1: csel w8, w0, w20, ls
6176 ; -O1: bl __atomic_compare_exchange
6177 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
6181 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6182 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6183 ; -O0: subs x10, x9, x8
6184 ; -O0: csel x8, x9, x8, ls
6185 ; -O0: bl __atomic_compare_exchange
6187 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6189 ; -O1: csel x8, x0, x20, ls
6190 ; -O1: bl __atomic_compare_exchange
6191 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
6195 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6196 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6197 ; -O0: subs x10, x9, x8
6198 ; -O0: csel x8, x9, x8, ls
6199 ; -O0: bl __atomic_compare_exchange
6201 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6203 ; -O1: csel x8, x0, x20, ls
6204 ; -O1: bl __atomic_compare_exchange
6205 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
6209 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
6210 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
6211 ; -O0: subs x10, x9, x8
6212 ; -O0: csel x8, x9, x8, ls
6213 ; -O0: bl __atomic_compare_exchange
6215 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
6217 ; -O1: csel x8, x0, x20, ls
6218 ; -O1: bl __atomic_compare_exchange
6219 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
6223 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6224 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6225 ; -O0: subs x10, x9, x8
6226 ; -O0: csel x8, x9, x8, ls
6227 ; -O0: bl __atomic_compare_exchange
6229 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6231 ; -O1: csel x8, x0, x20, ls
6232 ; -O1: bl __atomic_compare_exchange
6233 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
6237 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6238 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6239 ; -O0: subs x10, x9, x8
6240 ; -O0: csel x8, x9, x8, ls
6241 ; -O0: bl __atomic_compare_exchange
6243 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6245 ; -O1: csel x8, x0, x20, ls
6246 ; -O1: bl __atomic_compare_exchange
6247 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
6251 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6252 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6253 ; -O0: subs x8, x8, x9
6254 ; -O0: subs x11, x11, x10
6255 ; -O0: subs x12, x12, x10
6256 ; -O0: csel w11, w8, w11, eq
6257 ; -O0: ands w12, w11, #0x1
6258 ; -O0: csel x9, x8, x9, ne
6259 ; -O0: ands w11, w11, #0x1
6260 ; -O0: csel x8, x8, x10, ne
6261 ; -O0: bl __atomic_compare_exchange
6263 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6264 ; -O1: ldp x0, x1, [x0]
6266 ; -O1: csel x8, x1, x19, hs
6267 ; -O1: csel x9, x0, x21, hs
6268 ; -O1: bl __atomic_compare_exchange
6269 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
6273 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6274 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6275 ; -O0: subs x8, x8, x9
6276 ; -O0: subs x11, x11, x10
6277 ; -O0: subs x12, x12, x10
6278 ; -O0: csel w11, w8, w11, eq
6279 ; -O0: ands w12, w11, #0x1
6280 ; -O0: csel x9, x8, x9, ne
6281 ; -O0: ands w11, w11, #0x1
6282 ; -O0: csel x8, x8, x10, ne
6283 ; -O0: bl __atomic_compare_exchange
6285 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6286 ; -O1: ldp x0, x1, [x0]
6288 ; -O1: csel x8, x1, x19, hs
6289 ; -O1: csel x9, x0, x21, hs
6290 ; -O1: bl __atomic_compare_exchange
6291 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
6295 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
6296 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
6297 ; -O0: subs x8, x8, x9
6298 ; -O0: subs x11, x11, x10
6299 ; -O0: subs x12, x12, x10
6300 ; -O0: csel w11, w8, w11, eq
6301 ; -O0: ands w12, w11, #0x1
6302 ; -O0: csel x9, x8, x9, ne
6303 ; -O0: ands w11, w11, #0x1
6304 ; -O0: csel x8, x8, x10, ne
6305 ; -O0: bl __atomic_compare_exchange
6307 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
6308 ; -O1: ldp x0, x1, [x0]
6310 ; -O1: csel x8, x1, x19, hs
6311 ; -O1: csel x9, x0, x21, hs
6312 ; -O1: bl __atomic_compare_exchange
6313 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
6317 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6318 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6319 ; -O0: subs x8, x8, x9
6320 ; -O0: subs x11, x11, x10
6321 ; -O0: subs x12, x12, x10
6322 ; -O0: csel w11, w8, w11, eq
6323 ; -O0: ands w12, w11, #0x1
6324 ; -O0: csel x9, x8, x9, ne
6325 ; -O0: ands w11, w11, #0x1
6326 ; -O0: csel x8, x8, x10, ne
6327 ; -O0: bl __atomic_compare_exchange
6329 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6330 ; -O1: ldp x0, x1, [x0]
6332 ; -O1: csel x8, x1, x19, hs
6333 ; -O1: csel x9, x0, x21, hs
6334 ; -O1: bl __atomic_compare_exchange
6335 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
6339 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6340 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6341 ; -O0: subs x8, x8, x9
6342 ; -O0: subs x11, x11, x10
6343 ; -O0: subs x12, x12, x10
6344 ; -O0: csel w11, w8, w11, eq
6345 ; -O0: ands w12, w11, #0x1
6346 ; -O0: csel x9, x8, x9, ne
6347 ; -O0: ands w11, w11, #0x1
6348 ; -O0: csel x8, x8, x10, ne
6349 ; -O0: bl __atomic_compare_exchange
6351 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6352 ; -O1: ldp x0, x1, [x0]
6354 ; -O1: csel x8, x1, x19, hs
6355 ; -O1: csel x9, x0, x21, hs
6356 ; -O1: bl __atomic_compare_exchange
6357 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1