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: and w11, w9, #0x1
515 ; -O0: subs w11, w11, #1
516 ; -O0: casp x0, x1, x2, x3, [x8]
517 ; -O0: eor x8, x10, x8
518 ; -O0: eor x11, x9, x11
519 ; -O0: orr x8, x8, x11
520 ; -O0: subs x8, x8, #0
522 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
523 ; -O1: ldp x4, x5, [x0]
524 ; -O1: adds x8, x4, x2
525 ; -O1: casp x4, x5, x8, x9, [x0]
527 ; -O1: ccmp x4, x6, #0, eq
528 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
532 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
533 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
534 ; -O0: adds x2, x9, x11
535 ; -O0: and w11, w9, #0x1
536 ; -O0: subs w11, w11, #1
537 ; -O0: caspa x0, x1, x2, x3, [x8]
538 ; -O0: eor x8, x10, x8
539 ; -O0: eor x11, x9, x11
540 ; -O0: orr x8, x8, x11
541 ; -O0: subs x8, x8, #0
543 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
544 ; -O1: ldp x4, x5, [x0]
545 ; -O1: adds x8, x4, x2
546 ; -O1: caspa x4, x5, x8, x9, [x0]
548 ; -O1: ccmp x4, x6, #0, eq
549 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
553 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
554 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
555 ; -O0: adds x2, x9, x11
556 ; -O0: and w11, w9, #0x1
557 ; -O0: subs w11, w11, #1
558 ; -O0: caspl x0, x1, x2, x3, [x8]
559 ; -O0: eor x8, x10, x8
560 ; -O0: eor x11, x9, x11
561 ; -O0: orr x8, x8, x11
562 ; -O0: subs x8, x8, #0
564 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
565 ; -O1: ldp x4, x5, [x0]
566 ; -O1: adds x8, x4, x2
567 ; -O1: caspl x4, x5, x8, x9, [x0]
569 ; -O1: ccmp x4, x6, #0, eq
570 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
574 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
575 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
576 ; -O0: adds x2, x9, x11
577 ; -O0: and w11, w9, #0x1
578 ; -O0: subs w11, w11, #1
579 ; -O0: caspal x0, x1, x2, x3, [x8]
580 ; -O0: eor x8, x10, x8
581 ; -O0: eor x11, x9, x11
582 ; -O0: orr x8, x8, x11
583 ; -O0: subs x8, x8, #0
585 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
586 ; -O1: ldp x4, x5, [x0]
587 ; -O1: adds x8, x4, x2
588 ; -O1: caspal x4, x5, x8, x9, [x0]
590 ; -O1: ccmp x4, x6, #0, eq
591 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
595 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
596 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
597 ; -O0: adds x2, x9, x11
598 ; -O0: and w11, w9, #0x1
599 ; -O0: subs w11, w11, #1
600 ; -O0: caspal x0, x1, x2, x3, [x8]
601 ; -O0: eor x8, x10, x8
602 ; -O0: eor x11, x9, x11
603 ; -O0: orr x8, x8, x11
604 ; -O0: subs x8, x8, #0
606 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
607 ; -O1: ldp x4, x5, [x0]
608 ; -O1: adds x8, x4, x2
609 ; -O1: caspal x4, x5, x8, x9, [x0]
611 ; -O1: ccmp x4, x6, #0, eq
612 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
616 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
617 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
618 ; CHECK: ldaddb w1, w0, [x0]
619 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
623 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
624 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
625 ; CHECK: ldaddab w1, w0, [x0]
626 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
630 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
631 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
632 ; CHECK: ldaddlb w1, w0, [x0]
633 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
637 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
638 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
639 ; CHECK: ldaddalb w1, w0, [x0]
640 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
644 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
645 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
646 ; CHECK: ldaddalb w1, w0, [x0]
647 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
651 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
652 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
653 ; -O0: add w8, w8, w9, uxth
654 ; -O0: bl __atomic_compare_exchange
656 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
657 ; -O1: add w8, w0, w20
658 ; -O1: bl __atomic_compare_exchange
659 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
663 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
664 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
665 ; -O0: add w8, w8, w9, uxth
666 ; -O0: bl __atomic_compare_exchange
668 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
669 ; -O1: add w8, w0, w20
670 ; -O1: bl __atomic_compare_exchange
671 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
675 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
676 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
677 ; -O0: add w8, w8, w9, uxth
678 ; -O0: bl __atomic_compare_exchange
680 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
681 ; -O1: add w8, w0, w20
682 ; -O1: bl __atomic_compare_exchange
683 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
687 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
688 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
689 ; -O0: add w8, w8, w9, uxth
690 ; -O0: bl __atomic_compare_exchange
692 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
693 ; -O1: add w8, w0, w20
694 ; -O1: bl __atomic_compare_exchange
695 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
699 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
700 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
701 ; -O0: add w8, w8, w9, uxth
702 ; -O0: bl __atomic_compare_exchange
704 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
705 ; -O1: add w8, w0, w20
706 ; -O1: bl __atomic_compare_exchange
707 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
711 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
712 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
713 ; -O0: add w8, w9, w8
714 ; -O0: bl __atomic_compare_exchange
716 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
717 ; -O1: add w8, w0, w20
718 ; -O1: bl __atomic_compare_exchange
719 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
723 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
724 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
725 ; -O0: add w8, w9, w8
726 ; -O0: bl __atomic_compare_exchange
728 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
729 ; -O1: add w8, w0, w20
730 ; -O1: bl __atomic_compare_exchange
731 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
735 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
736 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
737 ; -O0: add w8, w9, w8
738 ; -O0: bl __atomic_compare_exchange
740 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
741 ; -O1: add w8, w0, w20
742 ; -O1: bl __atomic_compare_exchange
743 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
747 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
748 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
749 ; -O0: add w8, w9, w8
750 ; -O0: bl __atomic_compare_exchange
752 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
753 ; -O1: add w8, w0, w20
754 ; -O1: bl __atomic_compare_exchange
755 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
759 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
760 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
761 ; -O0: add w8, w9, w8
762 ; -O0: bl __atomic_compare_exchange
764 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
765 ; -O1: add w8, w0, w20
766 ; -O1: bl __atomic_compare_exchange
767 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
771 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
772 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
773 ; -O0: add x8, x9, x8
774 ; -O0: bl __atomic_compare_exchange
776 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
777 ; -O1: add x8, x0, x20
778 ; -O1: bl __atomic_compare_exchange
779 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
783 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
784 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
785 ; -O0: add x8, x9, x8
786 ; -O0: bl __atomic_compare_exchange
788 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
789 ; -O1: add x8, x0, x20
790 ; -O1: bl __atomic_compare_exchange
791 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
795 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
796 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
797 ; -O0: add x8, x9, x8
798 ; -O0: bl __atomic_compare_exchange
800 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
801 ; -O1: add x8, x0, x20
802 ; -O1: bl __atomic_compare_exchange
803 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
807 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
808 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
809 ; -O0: add x8, x9, x8
810 ; -O0: bl __atomic_compare_exchange
812 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
813 ; -O1: add x8, x0, x20
814 ; -O1: bl __atomic_compare_exchange
815 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
819 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
820 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
821 ; -O0: add x8, x9, x8
822 ; -O0: bl __atomic_compare_exchange
824 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
825 ; -O1: add x8, x0, x20
826 ; -O1: bl __atomic_compare_exchange
827 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
831 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
832 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
833 ; -O0: adds x9, x8, x9
834 ; -O0: and w11, w8, #0x1
835 ; -O0: subs w11, w11, #1
836 ; -O0: bl __atomic_compare_exchange
838 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
839 ; -O1: ldp x0, x1, [x0]
840 ; -O1: adds x8, x0, x21
841 ; -O1: bl __atomic_compare_exchange
842 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
846 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
847 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
848 ; -O0: adds x9, x8, x9
849 ; -O0: and w11, w8, #0x1
850 ; -O0: subs w11, w11, #1
851 ; -O0: bl __atomic_compare_exchange
853 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
854 ; -O1: ldp x0, x1, [x0]
855 ; -O1: adds x8, x0, x21
856 ; -O1: bl __atomic_compare_exchange
857 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
861 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
862 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
863 ; -O0: adds x9, x8, x9
864 ; -O0: and w11, w8, #0x1
865 ; -O0: subs w11, w11, #1
866 ; -O0: bl __atomic_compare_exchange
868 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
869 ; -O1: ldp x0, x1, [x0]
870 ; -O1: adds x8, x0, x21
871 ; -O1: bl __atomic_compare_exchange
872 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
876 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
877 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
878 ; -O0: adds x9, x8, x9
879 ; -O0: and w11, w8, #0x1
880 ; -O0: subs w11, w11, #1
881 ; -O0: bl __atomic_compare_exchange
883 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
884 ; -O1: ldp x0, x1, [x0]
885 ; -O1: adds x8, x0, x21
886 ; -O1: bl __atomic_compare_exchange
887 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
891 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
892 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
893 ; -O0: adds x9, x8, x9
894 ; -O0: and w11, w8, #0x1
895 ; -O0: subs w11, w11, #1
896 ; -O0: bl __atomic_compare_exchange
898 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
899 ; -O1: ldp x0, x1, [x0]
900 ; -O1: adds x8, x0, x21
901 ; -O1: bl __atomic_compare_exchange
902 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
906 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
907 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_monotonic:
908 ; CHECK: ldaddb w8, w0, [x0]
909 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
913 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
914 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acquire:
915 ; CHECK: ldaddab w8, w0, [x0]
916 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
920 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
921 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_release:
922 ; CHECK: ldaddlb w8, w0, [x0]
923 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
927 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
928 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
929 ; CHECK: ldaddalb w8, w0, [x0]
930 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
934 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
935 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
936 ; CHECK: ldaddalb w8, w0, [x0]
937 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
941 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
942 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_monotonic:
943 ; CHECK: ldaddh w8, w0, [x0]
944 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
948 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
949 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acquire:
950 ; CHECK: ldaddah w8, w0, [x0]
951 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
955 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
956 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_release:
957 ; CHECK: ldaddlh w8, w0, [x0]
958 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
962 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
963 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
964 ; CHECK: ldaddalh w8, w0, [x0]
965 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
969 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
970 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
971 ; CHECK: ldaddalh w8, w0, [x0]
972 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
976 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
977 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_monotonic:
978 ; CHECK: ldadd w8, w0, [x0]
979 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
983 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
984 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acquire:
985 ; CHECK: ldadda w8, w0, [x0]
986 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
990 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
991 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_release:
992 ; CHECK: ldaddl w8, w0, [x0]
993 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
997 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
998 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
999 ; CHECK: ldaddal w8, w0, [x0]
1000 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1004 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1005 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1006 ; CHECK: ldaddal w8, w0, [x0]
1007 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1011 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1012 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1013 ; CHECK: ldadd x8, x0, [x0]
1014 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1018 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1019 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acquire:
1020 ; CHECK: ldadda x8, x0, [x0]
1021 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1025 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1026 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_release:
1027 ; CHECK: ldaddl x8, x0, [x0]
1028 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1032 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1033 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1034 ; CHECK: ldaddal x8, x0, [x0]
1035 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1039 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1040 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1041 ; CHECK: ldaddal x8, x0, [x0]
1042 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1046 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1047 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1048 ; -O0: subs x2, x9, x11
1049 ; -O0: and w11, w9, #0x1
1050 ; -O0: casp x0, x1, x2, x3, [x8]
1051 ; -O0: eor x8, x10, x8
1052 ; -O0: eor x11, x9, x11
1053 ; -O0: orr x8, x8, x11
1054 ; -O0: subs x8, x8, #0
1056 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1057 ; -O1: ldp x4, x5, [x0]
1058 ; -O1: subs x8, x4, x2
1059 ; -O1: casp x4, x5, x8, x9, [x0]
1061 ; -O1: ccmp x4, x6, #0, eq
1062 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1066 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1067 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1068 ; -O0: subs x2, x9, x11
1069 ; -O0: and w11, w9, #0x1
1070 ; -O0: caspa x0, x1, x2, x3, [x8]
1071 ; -O0: eor x8, x10, x8
1072 ; -O0: eor x11, x9, x11
1073 ; -O0: orr x8, x8, x11
1074 ; -O0: subs x8, x8, #0
1076 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1077 ; -O1: ldp x4, x5, [x0]
1078 ; -O1: subs x8, x4, x2
1079 ; -O1: caspa x4, x5, x8, x9, [x0]
1081 ; -O1: ccmp x4, x6, #0, eq
1082 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1086 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1087 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1088 ; -O0: subs x2, x9, x11
1089 ; -O0: and w11, w9, #0x1
1090 ; -O0: caspl x0, x1, x2, x3, [x8]
1091 ; -O0: eor x8, x10, x8
1092 ; -O0: eor x11, x9, x11
1093 ; -O0: orr x8, x8, x11
1094 ; -O0: subs x8, x8, #0
1096 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1097 ; -O1: ldp x4, x5, [x0]
1098 ; -O1: subs x8, x4, x2
1099 ; -O1: caspl x4, x5, x8, x9, [x0]
1101 ; -O1: ccmp x4, x6, #0, eq
1102 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1106 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1107 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1108 ; -O0: subs x2, x9, x11
1109 ; -O0: and w11, w9, #0x1
1110 ; -O0: caspal x0, x1, x2, x3, [x8]
1111 ; -O0: eor x8, x10, x8
1112 ; -O0: eor x11, x9, x11
1113 ; -O0: orr x8, x8, x11
1114 ; -O0: subs x8, x8, #0
1116 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1117 ; -O1: ldp x4, x5, [x0]
1118 ; -O1: subs x8, x4, x2
1119 ; -O1: caspal x4, x5, x8, x9, [x0]
1121 ; -O1: ccmp x4, x6, #0, eq
1122 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1126 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1127 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1128 ; -O0: subs x2, x9, x11
1129 ; -O0: and w11, w9, #0x1
1130 ; -O0: caspal x0, x1, x2, x3, [x8]
1131 ; -O0: eor x8, x10, x8
1132 ; -O0: eor x11, x9, x11
1133 ; -O0: orr x8, x8, x11
1134 ; -O0: subs x8, x8, #0
1136 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1137 ; -O1: ldp x4, x5, [x0]
1138 ; -O1: subs x8, x4, x2
1139 ; -O1: caspal x4, x5, x8, x9, [x0]
1141 ; -O1: ccmp x4, x6, #0, eq
1142 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1146 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1147 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1148 ; CHECK: ldaddb w8, w0, [x0]
1149 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1153 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1154 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1155 ; CHECK: ldaddab w8, w0, [x0]
1156 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1160 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1161 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_release:
1162 ; CHECK: ldaddlb w8, w0, [x0]
1163 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1167 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1168 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1169 ; CHECK: ldaddalb w8, w0, [x0]
1170 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1174 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1175 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1176 ; CHECK: ldaddalb w8, w0, [x0]
1177 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1181 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1182 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1183 ; -O0: subs w8, w9, w8
1184 ; -O0: bl __atomic_compare_exchange
1186 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1187 ; -O1: sub w8, w0, w20
1188 ; -O1: bl __atomic_compare_exchange
1189 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1193 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1194 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1195 ; -O0: subs w8, w9, w8
1196 ; -O0: bl __atomic_compare_exchange
1198 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1199 ; -O1: sub w8, w0, w20
1200 ; -O1: bl __atomic_compare_exchange
1201 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1205 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1206 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1207 ; -O0: subs w8, w9, w8
1208 ; -O0: bl __atomic_compare_exchange
1210 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1211 ; -O1: sub w8, w0, w20
1212 ; -O1: bl __atomic_compare_exchange
1213 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1217 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1218 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1219 ; -O0: subs w8, w9, w8
1220 ; -O0: bl __atomic_compare_exchange
1222 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1223 ; -O1: sub w8, w0, w20
1224 ; -O1: bl __atomic_compare_exchange
1225 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1229 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1230 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1231 ; -O0: subs w8, w9, w8
1232 ; -O0: bl __atomic_compare_exchange
1234 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1235 ; -O1: sub w8, w0, w20
1236 ; -O1: bl __atomic_compare_exchange
1237 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1241 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1242 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1243 ; -O0: subs w8, w9, w8
1244 ; -O0: bl __atomic_compare_exchange
1246 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1247 ; -O1: sub w8, w0, w20
1248 ; -O1: bl __atomic_compare_exchange
1249 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1253 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1254 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1255 ; -O0: subs w8, w9, w8
1256 ; -O0: bl __atomic_compare_exchange
1258 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1259 ; -O1: sub w8, w0, w20
1260 ; -O1: bl __atomic_compare_exchange
1261 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1265 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1266 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1267 ; -O0: subs w8, w9, w8
1268 ; -O0: bl __atomic_compare_exchange
1270 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1271 ; -O1: sub w8, w0, w20
1272 ; -O1: bl __atomic_compare_exchange
1273 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1277 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1278 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1279 ; -O0: subs w8, w9, w8
1280 ; -O0: bl __atomic_compare_exchange
1282 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1283 ; -O1: sub w8, w0, w20
1284 ; -O1: bl __atomic_compare_exchange
1285 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1289 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1290 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1291 ; -O0: subs w8, w9, w8
1292 ; -O0: bl __atomic_compare_exchange
1294 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1295 ; -O1: sub w8, w0, w20
1296 ; -O1: bl __atomic_compare_exchange
1297 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1301 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1302 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1303 ; -O0: subs x8, x9, x8
1304 ; -O0: bl __atomic_compare_exchange
1306 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1307 ; -O1: sub x8, x0, x20
1308 ; -O1: bl __atomic_compare_exchange
1309 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1313 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1314 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1315 ; -O0: subs x8, x9, x8
1316 ; -O0: bl __atomic_compare_exchange
1318 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1319 ; -O1: sub x8, x0, x20
1320 ; -O1: bl __atomic_compare_exchange
1321 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1325 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1326 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1327 ; -O0: subs x8, x9, x8
1328 ; -O0: bl __atomic_compare_exchange
1330 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1331 ; -O1: sub x8, x0, x20
1332 ; -O1: bl __atomic_compare_exchange
1333 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1337 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1338 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1339 ; -O0: subs x8, x9, x8
1340 ; -O0: bl __atomic_compare_exchange
1342 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1343 ; -O1: sub x8, x0, x20
1344 ; -O1: bl __atomic_compare_exchange
1345 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1349 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1350 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1351 ; -O0: subs x8, x9, x8
1352 ; -O0: bl __atomic_compare_exchange
1354 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1355 ; -O1: sub x8, x0, x20
1356 ; -O1: bl __atomic_compare_exchange
1357 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1361 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1362 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1363 ; -O0: subs x9, x8, x9
1364 ; -O0: and w11, w8, #0x1
1365 ; -O0: bl __atomic_compare_exchange
1367 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1368 ; -O1: ldp x0, x1, [x0]
1369 ; -O1: subs x8, x0, x21
1370 ; -O1: bl __atomic_compare_exchange
1371 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1375 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1376 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1377 ; -O0: subs x9, x8, x9
1378 ; -O0: and w11, w8, #0x1
1379 ; -O0: bl __atomic_compare_exchange
1381 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1382 ; -O1: ldp x0, x1, [x0]
1383 ; -O1: subs x8, x0, x21
1384 ; -O1: bl __atomic_compare_exchange
1385 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1389 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1390 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1391 ; -O0: subs x9, x8, x9
1392 ; -O0: and w11, w8, #0x1
1393 ; -O0: bl __atomic_compare_exchange
1395 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1396 ; -O1: ldp x0, x1, [x0]
1397 ; -O1: subs x8, x0, x21
1398 ; -O1: bl __atomic_compare_exchange
1399 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1403 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1404 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1405 ; -O0: subs x9, x8, x9
1406 ; -O0: and w11, w8, #0x1
1407 ; -O0: bl __atomic_compare_exchange
1409 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1410 ; -O1: ldp x0, x1, [x0]
1411 ; -O1: subs x8, x0, x21
1412 ; -O1: bl __atomic_compare_exchange
1413 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1417 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1418 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1419 ; -O0: subs x9, x8, x9
1420 ; -O0: and w11, w8, #0x1
1421 ; -O0: bl __atomic_compare_exchange
1423 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1424 ; -O1: ldp x0, x1, [x0]
1425 ; -O1: subs x8, x0, x21
1426 ; -O1: bl __atomic_compare_exchange
1427 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1431 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1432 ; CHECK-LABEL: atomicrmw_and_i8_aligned_monotonic:
1434 ; CHECK: ldclrb w8, w0, [x0]
1435 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1439 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1440 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acquire:
1442 ; CHECK: ldclrab w8, w0, [x0]
1443 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1447 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1448 ; CHECK-LABEL: atomicrmw_and_i8_aligned_release:
1450 ; CHECK: ldclrlb w8, w0, [x0]
1451 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1455 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1456 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1458 ; CHECK: ldclralb w8, w0, [x0]
1459 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1463 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1464 ; CHECK-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1466 ; CHECK: ldclralb w8, w0, [x0]
1467 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1471 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1472 ; CHECK-LABEL: atomicrmw_and_i16_aligned_monotonic:
1474 ; CHECK: ldclrh w8, w0, [x0]
1475 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1479 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1480 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acquire:
1482 ; CHECK: ldclrah w8, w0, [x0]
1483 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1487 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1488 ; CHECK-LABEL: atomicrmw_and_i16_aligned_release:
1490 ; CHECK: ldclrlh w8, w0, [x0]
1491 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1495 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1496 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1498 ; CHECK: ldclralh w8, w0, [x0]
1499 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1503 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1504 ; CHECK-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1506 ; CHECK: ldclralh w8, w0, [x0]
1507 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1511 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1512 ; CHECK-LABEL: atomicrmw_and_i32_aligned_monotonic:
1514 ; CHECK: ldclr w8, w0, [x0]
1515 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1519 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1520 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acquire:
1522 ; CHECK: ldclra w8, w0, [x0]
1523 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1527 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1528 ; CHECK-LABEL: atomicrmw_and_i32_aligned_release:
1530 ; CHECK: ldclrl w8, w0, [x0]
1531 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1535 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1536 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1538 ; CHECK: ldclral w8, w0, [x0]
1539 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1543 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1544 ; CHECK-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1546 ; CHECK: ldclral w8, w0, [x0]
1547 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1551 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1552 ; CHECK-LABEL: atomicrmw_and_i64_aligned_monotonic:
1554 ; CHECK: ldclr x8, x0, [x0]
1555 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1559 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1560 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acquire:
1562 ; CHECK: ldclra x8, x0, [x0]
1563 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1567 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1568 ; CHECK-LABEL: atomicrmw_and_i64_aligned_release:
1570 ; CHECK: ldclrl x8, x0, [x0]
1571 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1575 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1576 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1578 ; CHECK: ldclral x8, x0, [x0]
1579 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1583 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1584 ; CHECK-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1586 ; CHECK: ldclral x8, x0, [x0]
1587 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1591 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1592 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1595 ; -O0: ldclrp x0, x1, [x8]
1597 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1600 ; -O1: ldclrp x8, x1, [x0]
1601 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1605 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1606 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1609 ; -O0: ldclrpa x0, x1, [x8]
1611 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1614 ; -O1: ldclrpa x8, x1, [x0]
1615 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1619 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1620 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1623 ; -O0: ldclrpl x0, x1, [x8]
1625 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1628 ; -O1: ldclrpl x8, x1, [x0]
1629 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1633 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1634 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1637 ; -O0: ldclrpal x0, x1, [x8]
1639 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1642 ; -O1: ldclrpal x8, x1, [x0]
1643 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1647 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1648 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1651 ; -O0: ldclrpal x0, x1, [x8]
1653 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1656 ; -O1: ldclrpal x8, x1, [x0]
1657 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1661 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1662 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1664 ; CHECK: ldclrb w8, w0, [x0]
1665 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1669 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1670 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acquire:
1672 ; CHECK: ldclrab w8, w0, [x0]
1673 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1677 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1678 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_release:
1680 ; CHECK: ldclrlb w8, w0, [x0]
1681 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1685 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1686 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1688 ; CHECK: ldclralb w8, w0, [x0]
1689 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1693 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1694 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1696 ; CHECK: ldclralb w8, w0, [x0]
1697 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1701 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1702 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1703 ; -O0: and w8, w9, w8
1704 ; -O0: bl __atomic_compare_exchange
1706 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1707 ; -O1: and w8, w0, w20
1708 ; -O1: bl __atomic_compare_exchange
1709 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1713 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1714 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1715 ; -O0: and w8, w9, w8
1716 ; -O0: bl __atomic_compare_exchange
1718 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1719 ; -O1: and w8, w0, w20
1720 ; -O1: bl __atomic_compare_exchange
1721 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1725 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1726 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1727 ; -O0: and w8, w9, w8
1728 ; -O0: bl __atomic_compare_exchange
1730 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1731 ; -O1: and w8, w0, w20
1732 ; -O1: bl __atomic_compare_exchange
1733 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1737 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1738 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1739 ; -O0: and w8, w9, w8
1740 ; -O0: bl __atomic_compare_exchange
1742 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1743 ; -O1: and w8, w0, w20
1744 ; -O1: bl __atomic_compare_exchange
1745 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1749 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1750 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1751 ; -O0: and w8, w9, w8
1752 ; -O0: bl __atomic_compare_exchange
1754 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1755 ; -O1: and w8, w0, w20
1756 ; -O1: bl __atomic_compare_exchange
1757 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1761 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1762 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1763 ; -O0: and w8, w9, w8
1764 ; -O0: bl __atomic_compare_exchange
1766 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1767 ; -O1: and w8, w0, w20
1768 ; -O1: bl __atomic_compare_exchange
1769 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1773 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1774 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1775 ; -O0: and w8, w9, w8
1776 ; -O0: bl __atomic_compare_exchange
1778 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1779 ; -O1: and w8, w0, w20
1780 ; -O1: bl __atomic_compare_exchange
1781 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1785 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1786 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1787 ; -O0: and w8, w9, w8
1788 ; -O0: bl __atomic_compare_exchange
1790 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
1791 ; -O1: and w8, w0, w20
1792 ; -O1: bl __atomic_compare_exchange
1793 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
1797 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1798 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1799 ; -O0: and w8, w9, w8
1800 ; -O0: bl __atomic_compare_exchange
1802 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1803 ; -O1: and w8, w0, w20
1804 ; -O1: bl __atomic_compare_exchange
1805 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
1809 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1810 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1811 ; -O0: and w8, w9, w8
1812 ; -O0: bl __atomic_compare_exchange
1814 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1815 ; -O1: and w8, w0, w20
1816 ; -O1: bl __atomic_compare_exchange
1817 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
1821 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1822 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1823 ; -O0: and x8, x9, x8
1824 ; -O0: bl __atomic_compare_exchange
1826 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1827 ; -O1: and x8, x0, x20
1828 ; -O1: bl __atomic_compare_exchange
1829 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
1833 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1834 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
1835 ; -O0: and x8, x9, x8
1836 ; -O0: bl __atomic_compare_exchange
1838 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
1839 ; -O1: and x8, x0, x20
1840 ; -O1: bl __atomic_compare_exchange
1841 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
1845 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
1846 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
1847 ; -O0: and x8, x9, x8
1848 ; -O0: bl __atomic_compare_exchange
1850 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
1851 ; -O1: and x8, x0, x20
1852 ; -O1: bl __atomic_compare_exchange
1853 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
1857 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1858 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1859 ; -O0: and x8, x9, x8
1860 ; -O0: bl __atomic_compare_exchange
1862 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1863 ; -O1: and x8, x0, x20
1864 ; -O1: bl __atomic_compare_exchange
1865 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
1869 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1870 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1871 ; -O0: and x8, x9, x8
1872 ; -O0: bl __atomic_compare_exchange
1874 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1875 ; -O1: and x8, x0, x20
1876 ; -O1: bl __atomic_compare_exchange
1877 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
1881 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1882 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1883 ; -O0: and x9, x8, x9
1884 ; -O0: and x8, x8, x10
1885 ; -O0: bl __atomic_compare_exchange
1887 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1888 ; -O1: ldp x0, x1, [x0]
1889 ; -O1: and x8, x1, x19
1890 ; -O1: and x9, x0, x21
1891 ; -O1: bl __atomic_compare_exchange
1892 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
1896 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1897 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
1898 ; -O0: and x9, x8, x9
1899 ; -O0: and x8, x8, x10
1900 ; -O0: bl __atomic_compare_exchange
1902 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
1903 ; -O1: ldp x0, x1, [x0]
1904 ; -O1: and x8, x1, x19
1905 ; -O1: and x9, x0, x21
1906 ; -O1: bl __atomic_compare_exchange
1907 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
1911 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
1912 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
1913 ; -O0: and x9, x8, x9
1914 ; -O0: and x8, x8, x10
1915 ; -O0: bl __atomic_compare_exchange
1917 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
1918 ; -O1: ldp x0, x1, [x0]
1919 ; -O1: and x8, x1, x19
1920 ; -O1: and x9, x0, x21
1921 ; -O1: bl __atomic_compare_exchange
1922 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
1926 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1927 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1928 ; -O0: and x9, x8, x9
1929 ; -O0: and x8, x8, x10
1930 ; -O0: bl __atomic_compare_exchange
1932 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1933 ; -O1: ldp x0, x1, [x0]
1934 ; -O1: and x8, x1, x19
1935 ; -O1: and x9, x0, x21
1936 ; -O1: bl __atomic_compare_exchange
1937 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
1941 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1942 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1943 ; -O0: and x9, x8, x9
1944 ; -O0: and x8, x8, x10
1945 ; -O0: bl __atomic_compare_exchange
1947 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1948 ; -O1: ldp x0, x1, [x0]
1949 ; -O1: and x8, x1, x19
1950 ; -O1: and x9, x0, x21
1951 ; -O1: bl __atomic_compare_exchange
1952 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
1956 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1957 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
1958 ; -O0: and w8, w10, w8
1960 ; -O0: casb w9, w8, [x11]
1961 ; -O0: and w8, w9, #0xff
1962 ; -O0: subs w8, w8, w10, uxtb
1964 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
1965 ; -O1: and w10, w8, w1
1967 ; -O1: casb w9, w10, [x0]
1968 ; -O1: cmp w9, w8, uxtb
1969 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
1973 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
1974 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
1975 ; -O0: and w8, w10, w8
1977 ; -O0: casab w9, w8, [x11]
1978 ; -O0: and w8, w9, #0xff
1979 ; -O0: subs w8, w8, w10, uxtb
1981 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
1982 ; -O1: and w10, w8, w1
1984 ; -O1: casab w9, w10, [x0]
1985 ; -O1: cmp w9, w8, uxtb
1986 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
1990 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
1991 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
1992 ; -O0: and w8, w10, w8
1994 ; -O0: caslb w9, w8, [x11]
1995 ; -O0: and w8, w9, #0xff
1996 ; -O0: subs w8, w8, w10, uxtb
1998 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
1999 ; -O1: and w10, w8, w1
2001 ; -O1: caslb w9, w10, [x0]
2002 ; -O1: cmp w9, w8, uxtb
2003 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2007 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2008 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2009 ; -O0: and w8, w10, w8
2011 ; -O0: casalb w9, w8, [x11]
2012 ; -O0: and w8, w9, #0xff
2013 ; -O0: subs w8, w8, w10, uxtb
2015 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2016 ; -O1: and w10, w8, w1
2018 ; -O1: casalb w9, w10, [x0]
2019 ; -O1: cmp w9, w8, uxtb
2020 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2024 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2025 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2026 ; -O0: and w8, w10, w8
2028 ; -O0: casalb w9, w8, [x11]
2029 ; -O0: and w8, w9, #0xff
2030 ; -O0: subs w8, w8, w10, uxtb
2032 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2033 ; -O1: and w10, w8, w1
2035 ; -O1: casalb w9, w10, [x0]
2036 ; -O1: cmp w9, w8, uxtb
2037 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2041 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2042 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2043 ; -O0: and w9, w8, w9
2045 ; -O0: cash w9, w10, [x11]
2046 ; -O0: subs w8, w8, w9, uxth
2048 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2049 ; -O1: and w10, w8, w1
2051 ; -O1: cash w9, w10, [x0]
2052 ; -O1: cmp w9, w8, uxth
2053 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2057 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2058 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2059 ; -O0: and w9, w8, w9
2061 ; -O0: casah w9, w10, [x11]
2062 ; -O0: subs w8, w8, w9, uxth
2064 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2065 ; -O1: and w10, w8, w1
2067 ; -O1: casah w9, w10, [x0]
2068 ; -O1: cmp w9, w8, uxth
2069 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2073 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2074 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2075 ; -O0: and w9, w8, w9
2077 ; -O0: caslh w9, w10, [x11]
2078 ; -O0: subs w8, w8, w9, uxth
2080 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2081 ; -O1: and w10, w8, w1
2083 ; -O1: caslh w9, w10, [x0]
2084 ; -O1: cmp w9, w8, uxth
2085 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2089 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2090 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2091 ; -O0: and w9, w8, w9
2093 ; -O0: casalh w9, w10, [x11]
2094 ; -O0: subs w8, w8, w9, uxth
2096 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2097 ; -O1: and w10, w8, w1
2099 ; -O1: casalh w9, w10, [x0]
2100 ; -O1: cmp w9, w8, uxth
2101 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2105 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2106 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2107 ; -O0: and w9, w8, w9
2109 ; -O0: casalh w9, w10, [x11]
2110 ; -O0: subs w8, w8, w9, uxth
2112 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2113 ; -O1: and w10, w8, w1
2115 ; -O1: casalh w9, w10, [x0]
2116 ; -O1: cmp w9, w8, uxth
2117 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2121 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2122 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2123 ; -O0: and w9, w8, w9
2125 ; -O0: cas w9, w10, [x11]
2126 ; -O0: subs w8, w9, w8
2128 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2129 ; -O1: and w10, w8, w1
2131 ; -O1: cas w9, w10, [x0]
2133 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2137 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2138 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2139 ; -O0: and w9, w8, w9
2141 ; -O0: casa w9, w10, [x11]
2142 ; -O0: subs w8, w9, w8
2144 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2145 ; -O1: and w10, w8, w1
2147 ; -O1: casa w9, w10, [x0]
2149 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2153 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2154 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2155 ; -O0: and w9, w8, w9
2157 ; -O0: casl w9, w10, [x11]
2158 ; -O0: subs w8, w9, w8
2160 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2161 ; -O1: and w10, w8, w1
2163 ; -O1: casl w9, w10, [x0]
2165 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2169 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2170 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2171 ; -O0: and w9, w8, w9
2173 ; -O0: casal w9, w10, [x11]
2174 ; -O0: subs w8, w9, w8
2176 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2177 ; -O1: and w10, w8, w1
2179 ; -O1: casal w9, w10, [x0]
2181 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2185 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2186 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2187 ; -O0: and w9, w8, w9
2189 ; -O0: casal w9, w10, [x11]
2190 ; -O0: subs w8, w9, w8
2192 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2193 ; -O1: and w10, w8, w1
2195 ; -O1: casal w9, w10, [x0]
2197 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2201 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2202 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2203 ; -O0: and x9, x8, x9
2205 ; -O0: cas x9, x10, [x11]
2206 ; -O0: subs x8, x9, x8
2208 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2209 ; -O1: and x10, x8, x1
2211 ; -O1: cas x9, x10, [x0]
2213 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2217 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2218 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2219 ; -O0: and x9, x8, x9
2221 ; -O0: casa x9, x10, [x11]
2222 ; -O0: subs x8, x9, x8
2224 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2225 ; -O1: and x10, x8, x1
2227 ; -O1: casa x9, x10, [x0]
2229 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2233 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2234 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2235 ; -O0: and x9, x8, x9
2237 ; -O0: casl x9, x10, [x11]
2238 ; -O0: subs x8, x9, x8
2240 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2241 ; -O1: and x10, x8, x1
2243 ; -O1: casl x9, x10, [x0]
2245 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2249 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2250 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2251 ; -O0: and x9, x8, x9
2253 ; -O0: casal x9, x10, [x11]
2254 ; -O0: subs x8, x9, x8
2256 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2257 ; -O1: and x10, x8, x1
2259 ; -O1: casal x9, x10, [x0]
2261 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2265 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2266 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2267 ; -O0: and x9, x8, x9
2269 ; -O0: casal x9, x10, [x11]
2270 ; -O0: subs x8, x9, x8
2272 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2273 ; -O1: and x10, x8, x1
2275 ; -O1: casal x9, x10, [x0]
2277 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2281 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2282 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2283 ; -O0: and x10, x9, x10
2284 ; -O0: and x9, x9, x11
2287 ; -O0: casp x0, x1, x2, x3, [x8]
2288 ; -O0: eor x8, x10, x8
2289 ; -O0: eor x11, x9, x11
2290 ; -O0: orr x8, x8, x11
2291 ; -O0: subs x8, x8, #0
2293 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2294 ; -O1: ldp x4, x5, [x0]
2295 ; -O1: and x8, x4, x2
2296 ; -O1: and x9, x7, x3
2299 ; -O1: casp x4, x5, x10, x11, [x0]
2301 ; -O1: ccmp x4, x6, #0, eq
2302 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2306 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2307 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2308 ; -O0: and x10, x9, x10
2309 ; -O0: and x9, x9, x11
2312 ; -O0: caspa x0, x1, x2, x3, [x8]
2313 ; -O0: eor x8, x10, x8
2314 ; -O0: eor x11, x9, x11
2315 ; -O0: orr x8, x8, x11
2316 ; -O0: subs x8, x8, #0
2318 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2319 ; -O1: ldp x4, x5, [x0]
2320 ; -O1: and x8, x4, x2
2321 ; -O1: and x9, x7, x3
2324 ; -O1: caspa x4, x5, x10, x11, [x0]
2326 ; -O1: ccmp x4, x6, #0, eq
2327 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2331 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2332 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2333 ; -O0: and x10, x9, x10
2334 ; -O0: and x9, x9, x11
2337 ; -O0: caspl x0, x1, x2, x3, [x8]
2338 ; -O0: eor x8, x10, x8
2339 ; -O0: eor x11, x9, x11
2340 ; -O0: orr x8, x8, x11
2341 ; -O0: subs x8, x8, #0
2343 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2344 ; -O1: ldp x4, x5, [x0]
2345 ; -O1: and x8, x4, x2
2346 ; -O1: and x9, x7, x3
2349 ; -O1: caspl x4, x5, x10, x11, [x0]
2351 ; -O1: ccmp x4, x6, #0, eq
2352 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2356 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2357 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2358 ; -O0: and x10, x9, x10
2359 ; -O0: and x9, x9, x11
2362 ; -O0: caspal x0, x1, x2, x3, [x8]
2363 ; -O0: eor x8, x10, x8
2364 ; -O0: eor x11, x9, x11
2365 ; -O0: orr x8, x8, x11
2366 ; -O0: subs x8, x8, #0
2368 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2369 ; -O1: ldp x4, x5, [x0]
2370 ; -O1: and x8, x4, x2
2371 ; -O1: and x9, x7, x3
2374 ; -O1: caspal x4, x5, x10, x11, [x0]
2376 ; -O1: ccmp x4, x6, #0, eq
2377 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2381 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2382 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2383 ; -O0: and x10, x9, x10
2384 ; -O0: and x9, x9, x11
2387 ; -O0: caspal x0, x1, x2, x3, [x8]
2388 ; -O0: eor x8, x10, x8
2389 ; -O0: eor x11, x9, x11
2390 ; -O0: orr x8, x8, x11
2391 ; -O0: subs x8, x8, #0
2393 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2394 ; -O1: ldp x4, x5, [x0]
2395 ; -O1: and x8, x4, x2
2396 ; -O1: and x9, x7, x3
2399 ; -O1: caspal x4, x5, x10, x11, [x0]
2401 ; -O1: ccmp x4, x6, #0, eq
2402 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2406 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2407 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2408 ; -O0: and w8, w10, w8
2410 ; -O0: casb w9, w8, [x11]
2411 ; -O0: and w8, w9, #0xff
2412 ; -O0: subs w8, w8, w10, uxtb
2414 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2415 ; -O1: and w10, w8, w1
2417 ; -O1: casb w9, w10, [x0]
2418 ; -O1: cmp w9, w8, uxtb
2419 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2423 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2424 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2425 ; -O0: and w8, w10, w8
2427 ; -O0: casab w9, w8, [x11]
2428 ; -O0: and w8, w9, #0xff
2429 ; -O0: subs w8, w8, w10, uxtb
2431 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2432 ; -O1: and w10, w8, w1
2434 ; -O1: casab w9, w10, [x0]
2435 ; -O1: cmp w9, w8, uxtb
2436 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2440 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2441 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2442 ; -O0: and w8, w10, w8
2444 ; -O0: caslb w9, w8, [x11]
2445 ; -O0: and w8, w9, #0xff
2446 ; -O0: subs w8, w8, w10, uxtb
2448 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2449 ; -O1: and w10, w8, w1
2451 ; -O1: caslb w9, w10, [x0]
2452 ; -O1: cmp w9, w8, uxtb
2453 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2457 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2458 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2459 ; -O0: and w8, w10, w8
2461 ; -O0: casalb w9, w8, [x11]
2462 ; -O0: and w8, w9, #0xff
2463 ; -O0: subs w8, w8, w10, uxtb
2465 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2466 ; -O1: and w10, w8, w1
2468 ; -O1: casalb w9, w10, [x0]
2469 ; -O1: cmp w9, w8, uxtb
2470 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2474 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2475 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2476 ; -O0: and w8, w10, w8
2478 ; -O0: casalb w9, w8, [x11]
2479 ; -O0: and w8, w9, #0xff
2480 ; -O0: subs w8, w8, w10, uxtb
2482 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2483 ; -O1: and w10, w8, w1
2485 ; -O1: casalb w9, w10, [x0]
2486 ; -O1: cmp w9, w8, uxtb
2487 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2491 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2492 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2493 ; -O0: and w8, w9, w8
2495 ; -O0: bl __atomic_compare_exchange
2497 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2498 ; -O1: and w8, w0, w20
2500 ; -O1: bl __atomic_compare_exchange
2501 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2505 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2506 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2507 ; -O0: and w8, w9, w8
2509 ; -O0: bl __atomic_compare_exchange
2511 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2512 ; -O1: and w8, w0, w20
2514 ; -O1: bl __atomic_compare_exchange
2515 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2519 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2520 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2521 ; -O0: and w8, w9, w8
2523 ; -O0: bl __atomic_compare_exchange
2525 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2526 ; -O1: and w8, w0, w20
2528 ; -O1: bl __atomic_compare_exchange
2529 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2533 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2534 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2535 ; -O0: and w8, w9, w8
2537 ; -O0: bl __atomic_compare_exchange
2539 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2540 ; -O1: and w8, w0, w20
2542 ; -O1: bl __atomic_compare_exchange
2543 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2547 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2548 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2549 ; -O0: and w8, w9, w8
2551 ; -O0: bl __atomic_compare_exchange
2553 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2554 ; -O1: and w8, w0, w20
2556 ; -O1: bl __atomic_compare_exchange
2557 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2561 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2562 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2563 ; -O0: and w8, w9, w8
2565 ; -O0: bl __atomic_compare_exchange
2567 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2568 ; -O1: and w8, w0, w20
2570 ; -O1: bl __atomic_compare_exchange
2571 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2575 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2576 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2577 ; -O0: and w8, w9, w8
2579 ; -O0: bl __atomic_compare_exchange
2581 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2582 ; -O1: and w8, w0, w20
2584 ; -O1: bl __atomic_compare_exchange
2585 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2589 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2590 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2591 ; -O0: and w8, w9, w8
2593 ; -O0: bl __atomic_compare_exchange
2595 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2596 ; -O1: and w8, w0, w20
2598 ; -O1: bl __atomic_compare_exchange
2599 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2603 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2604 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2605 ; -O0: and w8, w9, w8
2607 ; -O0: bl __atomic_compare_exchange
2609 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2610 ; -O1: and w8, w0, w20
2612 ; -O1: bl __atomic_compare_exchange
2613 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2617 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2618 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2619 ; -O0: and w8, w9, w8
2621 ; -O0: bl __atomic_compare_exchange
2623 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2624 ; -O1: and w8, w0, w20
2626 ; -O1: bl __atomic_compare_exchange
2627 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2631 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2632 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2633 ; -O0: and x8, x9, x8
2635 ; -O0: bl __atomic_compare_exchange
2637 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2638 ; -O1: and x8, x0, x20
2640 ; -O1: bl __atomic_compare_exchange
2641 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2645 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2646 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2647 ; -O0: and x8, x9, x8
2649 ; -O0: bl __atomic_compare_exchange
2651 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2652 ; -O1: and x8, x0, x20
2654 ; -O1: bl __atomic_compare_exchange
2655 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2659 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2660 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2661 ; -O0: and x8, x9, x8
2663 ; -O0: bl __atomic_compare_exchange
2665 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2666 ; -O1: and x8, x0, x20
2668 ; -O1: bl __atomic_compare_exchange
2669 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2673 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2674 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2675 ; -O0: and x8, x9, x8
2677 ; -O0: bl __atomic_compare_exchange
2679 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2680 ; -O1: and x8, x0, x20
2682 ; -O1: bl __atomic_compare_exchange
2683 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2687 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2688 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2689 ; -O0: and x8, x9, x8
2691 ; -O0: bl __atomic_compare_exchange
2693 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2694 ; -O1: and x8, x0, x20
2696 ; -O1: bl __atomic_compare_exchange
2697 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2701 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2702 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2703 ; -O0: and x9, x8, x9
2704 ; -O0: and x8, x8, x10
2707 ; -O0: bl __atomic_compare_exchange
2709 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2710 ; -O1: ldp x0, x1, [x0]
2711 ; -O1: and x8, x1, x19
2712 ; -O1: and x9, x0, x21
2715 ; -O1: bl __atomic_compare_exchange
2716 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2720 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2721 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2722 ; -O0: and x9, x8, x9
2723 ; -O0: and x8, x8, x10
2726 ; -O0: bl __atomic_compare_exchange
2728 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2729 ; -O1: ldp x0, x1, [x0]
2730 ; -O1: and x8, x1, x19
2731 ; -O1: and x9, x0, x21
2734 ; -O1: bl __atomic_compare_exchange
2735 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2739 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2740 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2741 ; -O0: and x9, x8, x9
2742 ; -O0: and x8, x8, x10
2745 ; -O0: bl __atomic_compare_exchange
2747 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2748 ; -O1: ldp x0, x1, [x0]
2749 ; -O1: and x8, x1, x19
2750 ; -O1: and x9, x0, x21
2753 ; -O1: bl __atomic_compare_exchange
2754 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2758 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2759 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2760 ; -O0: and x9, x8, x9
2761 ; -O0: and x8, x8, x10
2764 ; -O0: bl __atomic_compare_exchange
2766 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2767 ; -O1: ldp x0, x1, [x0]
2768 ; -O1: and x8, x1, x19
2769 ; -O1: and x9, x0, x21
2772 ; -O1: bl __atomic_compare_exchange
2773 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2777 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2778 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2779 ; -O0: and x9, x8, x9
2780 ; -O0: and x8, x8, x10
2783 ; -O0: bl __atomic_compare_exchange
2785 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2786 ; -O1: ldp x0, x1, [x0]
2787 ; -O1: and x8, x1, x19
2788 ; -O1: and x9, x0, x21
2791 ; -O1: bl __atomic_compare_exchange
2792 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2796 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2797 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2798 ; CHECK: ldsetb w1, w0, [x0]
2799 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2803 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
2804 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
2805 ; CHECK: ldsetab w1, w0, [x0]
2806 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2810 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
2811 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
2812 ; CHECK: ldsetlb w1, w0, [x0]
2813 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2817 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2818 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
2819 ; CHECK: ldsetalb w1, w0, [x0]
2820 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2824 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2825 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
2826 ; CHECK: ldsetalb w1, w0, [x0]
2827 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
2831 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2832 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
2833 ; CHECK: ldseth w1, w0, [x0]
2834 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
2838 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
2839 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
2840 ; CHECK: ldsetah w1, w0, [x0]
2841 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
2845 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
2846 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
2847 ; CHECK: ldsetlh w1, w0, [x0]
2848 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
2852 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2853 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
2854 ; CHECK: ldsetalh w1, w0, [x0]
2855 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
2859 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2860 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
2861 ; CHECK: ldsetalh w1, w0, [x0]
2862 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
2866 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2867 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
2868 ; CHECK: ldset w1, w0, [x0]
2869 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
2873 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
2874 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
2875 ; CHECK: ldseta w1, w0, [x0]
2876 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
2880 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
2881 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
2882 ; CHECK: ldsetl w1, w0, [x0]
2883 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
2887 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2888 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
2889 ; CHECK: ldsetal w1, w0, [x0]
2890 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
2894 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2895 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
2896 ; CHECK: ldsetal w1, w0, [x0]
2897 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
2901 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2902 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
2903 ; CHECK: ldset x1, x0, [x0]
2904 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
2908 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
2909 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
2910 ; CHECK: ldseta x1, x0, [x0]
2911 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
2915 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
2916 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
2917 ; CHECK: ldsetl x1, x0, [x0]
2918 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
2922 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2923 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
2924 ; CHECK: ldsetal x1, x0, [x0]
2925 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
2929 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2930 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
2931 ; CHECK: ldsetal x1, x0, [x0]
2932 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
2936 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2937 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
2938 ; -O0: ldsetp x0, x1, [x8]
2940 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
2941 ; -O1: ldsetp x2, x1, [x0]
2942 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
2946 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
2947 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
2948 ; -O0: ldsetpa x0, x1, [x8]
2950 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
2951 ; -O1: ldsetpa x2, x1, [x0]
2952 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
2956 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
2957 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
2958 ; -O0: ldsetpl x0, x1, [x8]
2960 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
2961 ; -O1: ldsetpl x2, x1, [x0]
2962 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
2966 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2967 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
2968 ; -O0: ldsetpal x0, x1, [x8]
2970 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
2971 ; -O1: ldsetpal x2, x1, [x0]
2972 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
2976 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2977 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
2978 ; -O0: ldsetpal x0, x1, [x8]
2980 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
2981 ; -O1: ldsetpal x2, x1, [x0]
2982 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
2986 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2987 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
2988 ; CHECK: ldsetb w1, w0, [x0]
2989 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2993 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2994 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
2995 ; CHECK: ldsetab w1, w0, [x0]
2996 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3000 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3001 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3002 ; CHECK: ldsetlb w1, w0, [x0]
3003 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3007 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3008 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3009 ; CHECK: ldsetalb w1, w0, [x0]
3010 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3014 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3015 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3016 ; CHECK: ldsetalb w1, w0, [x0]
3017 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3021 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3022 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3023 ; -O0: orr w8, w9, w8
3024 ; -O0: bl __atomic_compare_exchange
3026 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3027 ; -O1: orr w8, w0, w20
3028 ; -O1: bl __atomic_compare_exchange
3029 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3033 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3034 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3035 ; -O0: orr w8, w9, w8
3036 ; -O0: bl __atomic_compare_exchange
3038 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3039 ; -O1: orr w8, w0, w20
3040 ; -O1: bl __atomic_compare_exchange
3041 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3045 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3046 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3047 ; -O0: orr w8, w9, w8
3048 ; -O0: bl __atomic_compare_exchange
3050 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3051 ; -O1: orr w8, w0, w20
3052 ; -O1: bl __atomic_compare_exchange
3053 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3057 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3058 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3059 ; -O0: orr w8, w9, w8
3060 ; -O0: bl __atomic_compare_exchange
3062 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3063 ; -O1: orr w8, w0, w20
3064 ; -O1: bl __atomic_compare_exchange
3065 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3069 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3070 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3071 ; -O0: orr w8, w9, w8
3072 ; -O0: bl __atomic_compare_exchange
3074 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3075 ; -O1: orr w8, w0, w20
3076 ; -O1: bl __atomic_compare_exchange
3077 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3081 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3082 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3083 ; -O0: orr w8, w9, w8
3084 ; -O0: bl __atomic_compare_exchange
3086 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3087 ; -O1: orr w8, w0, w20
3088 ; -O1: bl __atomic_compare_exchange
3089 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3093 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3094 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3095 ; -O0: orr w8, w9, w8
3096 ; -O0: bl __atomic_compare_exchange
3098 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3099 ; -O1: orr w8, w0, w20
3100 ; -O1: bl __atomic_compare_exchange
3101 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3105 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3106 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3107 ; -O0: orr w8, w9, w8
3108 ; -O0: bl __atomic_compare_exchange
3110 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3111 ; -O1: orr w8, w0, w20
3112 ; -O1: bl __atomic_compare_exchange
3113 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3117 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3118 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3119 ; -O0: orr w8, w9, w8
3120 ; -O0: bl __atomic_compare_exchange
3122 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3123 ; -O1: orr w8, w0, w20
3124 ; -O1: bl __atomic_compare_exchange
3125 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3129 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3130 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3131 ; -O0: orr w8, w9, w8
3132 ; -O0: bl __atomic_compare_exchange
3134 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3135 ; -O1: orr w8, w0, w20
3136 ; -O1: bl __atomic_compare_exchange
3137 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3141 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3142 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3143 ; -O0: orr x8, x9, x8
3144 ; -O0: bl __atomic_compare_exchange
3146 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3147 ; -O1: orr x8, x0, x20
3148 ; -O1: bl __atomic_compare_exchange
3149 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3153 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3154 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3155 ; -O0: orr x8, x9, x8
3156 ; -O0: bl __atomic_compare_exchange
3158 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3159 ; -O1: orr x8, x0, x20
3160 ; -O1: bl __atomic_compare_exchange
3161 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3165 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3166 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3167 ; -O0: orr x8, x9, x8
3168 ; -O0: bl __atomic_compare_exchange
3170 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3171 ; -O1: orr x8, x0, x20
3172 ; -O1: bl __atomic_compare_exchange
3173 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3177 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3178 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3179 ; -O0: orr x8, x9, x8
3180 ; -O0: bl __atomic_compare_exchange
3182 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3183 ; -O1: orr x8, x0, x20
3184 ; -O1: bl __atomic_compare_exchange
3185 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3189 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3190 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3191 ; -O0: orr x8, x9, x8
3192 ; -O0: bl __atomic_compare_exchange
3194 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3195 ; -O1: orr x8, x0, x20
3196 ; -O1: bl __atomic_compare_exchange
3197 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3201 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3202 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3203 ; -O0: orr x9, x8, x9
3204 ; -O0: orr x8, x8, x10
3205 ; -O0: bl __atomic_compare_exchange
3207 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3208 ; -O1: ldp x0, x1, [x0]
3209 ; -O1: orr x8, x1, x19
3210 ; -O1: orr x9, x0, x21
3211 ; -O1: bl __atomic_compare_exchange
3212 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3216 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3217 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3218 ; -O0: orr x9, x8, x9
3219 ; -O0: orr x8, x8, x10
3220 ; -O0: bl __atomic_compare_exchange
3222 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3223 ; -O1: ldp x0, x1, [x0]
3224 ; -O1: orr x8, x1, x19
3225 ; -O1: orr x9, x0, x21
3226 ; -O1: bl __atomic_compare_exchange
3227 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3231 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3232 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3233 ; -O0: orr x9, x8, x9
3234 ; -O0: orr x8, x8, x10
3235 ; -O0: bl __atomic_compare_exchange
3237 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3238 ; -O1: ldp x0, x1, [x0]
3239 ; -O1: orr x8, x1, x19
3240 ; -O1: orr x9, x0, x21
3241 ; -O1: bl __atomic_compare_exchange
3242 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3246 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3247 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3248 ; -O0: orr x9, x8, x9
3249 ; -O0: orr x8, x8, x10
3250 ; -O0: bl __atomic_compare_exchange
3252 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3253 ; -O1: ldp x0, x1, [x0]
3254 ; -O1: orr x8, x1, x19
3255 ; -O1: orr x9, x0, x21
3256 ; -O1: bl __atomic_compare_exchange
3257 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3261 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3262 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3263 ; -O0: orr x9, x8, x9
3264 ; -O0: orr x8, x8, x10
3265 ; -O0: bl __atomic_compare_exchange
3267 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3268 ; -O1: ldp x0, x1, [x0]
3269 ; -O1: orr x8, x1, x19
3270 ; -O1: orr x9, x0, x21
3271 ; -O1: bl __atomic_compare_exchange
3272 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3276 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3277 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3278 ; CHECK: ldeorb w1, w0, [x0]
3279 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3283 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3284 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3285 ; CHECK: ldeorab w1, w0, [x0]
3286 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3290 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3291 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3292 ; CHECK: ldeorlb w1, w0, [x0]
3293 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3297 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3298 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3299 ; CHECK: ldeoralb w1, w0, [x0]
3300 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3304 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3305 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3306 ; CHECK: ldeoralb w1, w0, [x0]
3307 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3311 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3312 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3313 ; CHECK: ldeorh w1, w0, [x0]
3314 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3318 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3319 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3320 ; CHECK: ldeorah w1, w0, [x0]
3321 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3325 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3326 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3327 ; CHECK: ldeorlh w1, w0, [x0]
3328 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3332 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3333 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3334 ; CHECK: ldeoralh w1, w0, [x0]
3335 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3339 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3340 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3341 ; CHECK: ldeoralh w1, w0, [x0]
3342 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3346 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3347 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3348 ; CHECK: ldeor w1, w0, [x0]
3349 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3353 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3354 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3355 ; CHECK: ldeora w1, w0, [x0]
3356 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3360 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3361 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3362 ; CHECK: ldeorl w1, w0, [x0]
3363 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3367 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3368 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3369 ; CHECK: ldeoral w1, w0, [x0]
3370 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3374 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3375 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3376 ; CHECK: ldeoral w1, w0, [x0]
3377 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3381 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3382 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3383 ; CHECK: ldeor x1, x0, [x0]
3384 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3388 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3389 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3390 ; CHECK: ldeora x1, x0, [x0]
3391 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3395 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3396 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3397 ; CHECK: ldeorl x1, x0, [x0]
3398 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3402 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3403 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3404 ; CHECK: ldeoral x1, x0, [x0]
3405 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3409 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3410 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3411 ; CHECK: ldeoral x1, x0, [x0]
3412 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3416 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3417 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3418 ; -O0: eor x2, x9, x11
3419 ; -O0: eor x9, x9, x10
3420 ; -O0: casp x0, x1, x2, x3, [x8]
3421 ; -O0: eor x8, x10, x8
3422 ; -O0: eor x11, x9, x11
3423 ; -O0: orr x8, x8, x11
3424 ; -O0: subs x8, x8, #0
3426 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3427 ; -O1: ldp x4, x5, [x0]
3428 ; -O1: eor x8, x4, x2
3429 ; -O1: eor x9, x7, x3
3430 ; -O1: casp x4, x5, x8, x9, [x0]
3432 ; -O1: ccmp x4, x6, #0, eq
3433 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3437 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3438 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3439 ; -O0: eor x2, x9, x11
3440 ; -O0: eor x9, x9, x10
3441 ; -O0: caspa x0, x1, x2, x3, [x8]
3442 ; -O0: eor x8, x10, x8
3443 ; -O0: eor x11, x9, x11
3444 ; -O0: orr x8, x8, x11
3445 ; -O0: subs x8, x8, #0
3447 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3448 ; -O1: ldp x4, x5, [x0]
3449 ; -O1: eor x8, x4, x2
3450 ; -O1: eor x9, x7, x3
3451 ; -O1: caspa x4, x5, x8, x9, [x0]
3453 ; -O1: ccmp x4, x6, #0, eq
3454 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3458 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3459 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3460 ; -O0: eor x2, x9, x11
3461 ; -O0: eor x9, x9, x10
3462 ; -O0: caspl x0, x1, x2, x3, [x8]
3463 ; -O0: eor x8, x10, x8
3464 ; -O0: eor x11, x9, x11
3465 ; -O0: orr x8, x8, x11
3466 ; -O0: subs x8, x8, #0
3468 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3469 ; -O1: ldp x4, x5, [x0]
3470 ; -O1: eor x8, x4, x2
3471 ; -O1: eor x9, x7, x3
3472 ; -O1: caspl x4, x5, x8, x9, [x0]
3474 ; -O1: ccmp x4, x6, #0, eq
3475 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3479 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3480 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3481 ; -O0: eor x2, x9, x11
3482 ; -O0: eor x9, x9, x10
3483 ; -O0: caspal x0, x1, x2, x3, [x8]
3484 ; -O0: eor x8, x10, x8
3485 ; -O0: eor x11, x9, x11
3486 ; -O0: orr x8, x8, x11
3487 ; -O0: subs x8, x8, #0
3489 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3490 ; -O1: ldp x4, x5, [x0]
3491 ; -O1: eor x8, x4, x2
3492 ; -O1: eor x9, x7, x3
3493 ; -O1: caspal x4, x5, x8, x9, [x0]
3495 ; -O1: ccmp x4, x6, #0, eq
3496 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3500 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3501 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3502 ; -O0: eor x2, x9, x11
3503 ; -O0: eor x9, x9, x10
3504 ; -O0: caspal x0, x1, x2, x3, [x8]
3505 ; -O0: eor x8, x10, x8
3506 ; -O0: eor x11, x9, x11
3507 ; -O0: orr x8, x8, x11
3508 ; -O0: subs x8, x8, #0
3510 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3511 ; -O1: ldp x4, x5, [x0]
3512 ; -O1: eor x8, x4, x2
3513 ; -O1: eor x9, x7, x3
3514 ; -O1: caspal x4, x5, x8, x9, [x0]
3516 ; -O1: ccmp x4, x6, #0, eq
3517 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3521 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3522 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3523 ; CHECK: ldeorb w1, w0, [x0]
3524 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3528 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3529 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3530 ; CHECK: ldeorab w1, w0, [x0]
3531 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3535 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3536 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3537 ; CHECK: ldeorlb w1, w0, [x0]
3538 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3542 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3543 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3544 ; CHECK: ldeoralb w1, w0, [x0]
3545 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3549 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3550 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3551 ; CHECK: ldeoralb w1, w0, [x0]
3552 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3556 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3557 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3558 ; -O0: eor w8, w9, w8
3559 ; -O0: bl __atomic_compare_exchange
3561 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3562 ; -O1: eor w8, w0, w20
3563 ; -O1: bl __atomic_compare_exchange
3564 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3568 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3569 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3570 ; -O0: eor w8, w9, w8
3571 ; -O0: bl __atomic_compare_exchange
3573 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3574 ; -O1: eor w8, w0, w20
3575 ; -O1: bl __atomic_compare_exchange
3576 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3580 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3581 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3582 ; -O0: eor w8, w9, w8
3583 ; -O0: bl __atomic_compare_exchange
3585 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3586 ; -O1: eor w8, w0, w20
3587 ; -O1: bl __atomic_compare_exchange
3588 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3592 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3593 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3594 ; -O0: eor w8, w9, w8
3595 ; -O0: bl __atomic_compare_exchange
3597 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3598 ; -O1: eor w8, w0, w20
3599 ; -O1: bl __atomic_compare_exchange
3600 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3604 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3605 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3606 ; -O0: eor w8, w9, w8
3607 ; -O0: bl __atomic_compare_exchange
3609 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3610 ; -O1: eor w8, w0, w20
3611 ; -O1: bl __atomic_compare_exchange
3612 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3616 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3617 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3618 ; -O0: eor w8, w9, w8
3619 ; -O0: bl __atomic_compare_exchange
3621 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3622 ; -O1: eor w8, w0, w20
3623 ; -O1: bl __atomic_compare_exchange
3624 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3628 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3629 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3630 ; -O0: eor w8, w9, w8
3631 ; -O0: bl __atomic_compare_exchange
3633 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3634 ; -O1: eor w8, w0, w20
3635 ; -O1: bl __atomic_compare_exchange
3636 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3640 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3641 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3642 ; -O0: eor w8, w9, w8
3643 ; -O0: bl __atomic_compare_exchange
3645 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3646 ; -O1: eor w8, w0, w20
3647 ; -O1: bl __atomic_compare_exchange
3648 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3652 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3653 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3654 ; -O0: eor w8, w9, w8
3655 ; -O0: bl __atomic_compare_exchange
3657 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3658 ; -O1: eor w8, w0, w20
3659 ; -O1: bl __atomic_compare_exchange
3660 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3664 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3665 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3666 ; -O0: eor w8, w9, w8
3667 ; -O0: bl __atomic_compare_exchange
3669 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3670 ; -O1: eor w8, w0, w20
3671 ; -O1: bl __atomic_compare_exchange
3672 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3676 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3677 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3678 ; -O0: eor x8, x9, x8
3679 ; -O0: bl __atomic_compare_exchange
3681 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3682 ; -O1: eor x8, x0, x20
3683 ; -O1: bl __atomic_compare_exchange
3684 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3688 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3689 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3690 ; -O0: eor x8, x9, x8
3691 ; -O0: bl __atomic_compare_exchange
3693 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3694 ; -O1: eor x8, x0, x20
3695 ; -O1: bl __atomic_compare_exchange
3696 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3700 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3701 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3702 ; -O0: eor x8, x9, x8
3703 ; -O0: bl __atomic_compare_exchange
3705 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3706 ; -O1: eor x8, x0, x20
3707 ; -O1: bl __atomic_compare_exchange
3708 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3712 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3713 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3714 ; -O0: eor x8, x9, x8
3715 ; -O0: bl __atomic_compare_exchange
3717 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3718 ; -O1: eor x8, x0, x20
3719 ; -O1: bl __atomic_compare_exchange
3720 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3724 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3725 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3726 ; -O0: eor x8, x9, x8
3727 ; -O0: bl __atomic_compare_exchange
3729 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3730 ; -O1: eor x8, x0, x20
3731 ; -O1: bl __atomic_compare_exchange
3732 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3736 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3737 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3738 ; -O0: eor x9, x8, x9
3739 ; -O0: eor x8, x8, x10
3740 ; -O0: bl __atomic_compare_exchange
3742 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3743 ; -O1: ldp x0, x1, [x0]
3744 ; -O1: eor x8, x1, x19
3745 ; -O1: eor x9, x0, x21
3746 ; -O1: bl __atomic_compare_exchange
3747 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
3751 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3752 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3753 ; -O0: eor x9, x8, x9
3754 ; -O0: eor x8, x8, x10
3755 ; -O0: bl __atomic_compare_exchange
3757 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3758 ; -O1: ldp x0, x1, [x0]
3759 ; -O1: eor x8, x1, x19
3760 ; -O1: eor x9, x0, x21
3761 ; -O1: bl __atomic_compare_exchange
3762 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
3766 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
3767 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
3768 ; -O0: eor x9, x8, x9
3769 ; -O0: eor x8, x8, x10
3770 ; -O0: bl __atomic_compare_exchange
3772 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
3773 ; -O1: ldp x0, x1, [x0]
3774 ; -O1: eor x8, x1, x19
3775 ; -O1: eor x9, x0, x21
3776 ; -O1: bl __atomic_compare_exchange
3777 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
3781 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3782 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3783 ; -O0: eor x9, x8, x9
3784 ; -O0: eor x8, x8, x10
3785 ; -O0: bl __atomic_compare_exchange
3787 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3788 ; -O1: ldp x0, x1, [x0]
3789 ; -O1: eor x8, x1, x19
3790 ; -O1: eor x9, x0, x21
3791 ; -O1: bl __atomic_compare_exchange
3792 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
3796 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3797 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3798 ; -O0: eor x9, x8, x9
3799 ; -O0: eor x8, x8, x10
3800 ; -O0: bl __atomic_compare_exchange
3802 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3803 ; -O1: ldp x0, x1, [x0]
3804 ; -O1: eor x8, x1, x19
3805 ; -O1: eor x9, x0, x21
3806 ; -O1: bl __atomic_compare_exchange
3807 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
3811 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3812 ; CHECK-LABEL: atomicrmw_max_i8_aligned_monotonic:
3813 ; CHECK: ldsmaxb w1, w0, [x0]
3814 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
3818 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
3819 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acquire:
3820 ; CHECK: ldsmaxab w1, w0, [x0]
3821 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
3825 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
3826 ; CHECK-LABEL: atomicrmw_max_i8_aligned_release:
3827 ; CHECK: ldsmaxlb w1, w0, [x0]
3828 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
3832 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3833 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acq_rel:
3834 ; CHECK: ldsmaxalb w1, w0, [x0]
3835 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
3839 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3840 ; CHECK-LABEL: atomicrmw_max_i8_aligned_seq_cst:
3841 ; CHECK: ldsmaxalb w1, w0, [x0]
3842 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
3846 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3847 ; CHECK-LABEL: atomicrmw_max_i16_aligned_monotonic:
3848 ; CHECK: ldsmaxh w1, w0, [x0]
3849 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
3853 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
3854 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acquire:
3855 ; CHECK: ldsmaxah w1, w0, [x0]
3856 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
3860 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
3861 ; CHECK-LABEL: atomicrmw_max_i16_aligned_release:
3862 ; CHECK: ldsmaxlh w1, w0, [x0]
3863 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
3867 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3868 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acq_rel:
3869 ; CHECK: ldsmaxalh w1, w0, [x0]
3870 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
3874 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3875 ; CHECK-LABEL: atomicrmw_max_i16_aligned_seq_cst:
3876 ; CHECK: ldsmaxalh w1, w0, [x0]
3877 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
3881 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3882 ; CHECK-LABEL: atomicrmw_max_i32_aligned_monotonic:
3883 ; CHECK: ldsmax w1, w0, [x0]
3884 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
3888 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
3889 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acquire:
3890 ; CHECK: ldsmaxa w1, w0, [x0]
3891 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
3895 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
3896 ; CHECK-LABEL: atomicrmw_max_i32_aligned_release:
3897 ; CHECK: ldsmaxl w1, w0, [x0]
3898 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
3902 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3903 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acq_rel:
3904 ; CHECK: ldsmaxal w1, w0, [x0]
3905 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
3909 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3910 ; CHECK-LABEL: atomicrmw_max_i32_aligned_seq_cst:
3911 ; CHECK: ldsmaxal w1, w0, [x0]
3912 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
3916 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3917 ; CHECK-LABEL: atomicrmw_max_i64_aligned_monotonic:
3918 ; CHECK: ldsmax x1, x0, [x0]
3919 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
3923 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
3924 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acquire:
3925 ; CHECK: ldsmaxa x1, x0, [x0]
3926 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
3930 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
3931 ; CHECK-LABEL: atomicrmw_max_i64_aligned_release:
3932 ; CHECK: ldsmaxl x1, x0, [x0]
3933 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
3937 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3938 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acq_rel:
3939 ; CHECK: ldsmaxal x1, x0, [x0]
3940 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
3944 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3945 ; CHECK-LABEL: atomicrmw_max_i64_aligned_seq_cst:
3946 ; CHECK: ldsmaxal x1, x0, [x0]
3947 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
3951 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3952 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
3953 ; -O0: subs x9, x9, x10
3954 ; -O0: subs x9, x9, x10
3955 ; -O0: subs x9, x9, x12
3956 ; -O0: and w13, w13, #0x1
3957 ; -O0: ands w13, w13, #0x1
3958 ; -O0: csel w9, w9, w11, ne
3959 ; -O0: and w13, w9, #0x1
3960 ; -O0: ands w13, w13, #0x1
3961 ; -O0: csel x2, x11, x12, ne
3962 ; -O0: and w11, w9, #0x1
3963 ; -O0: ands w11, w11, #0x1
3964 ; -O0: csel x9, x9, x10, ne
3965 ; -O0: casp x0, x1, x2, x3, [x8]
3966 ; -O0: eor x8, x10, x8
3967 ; -O0: eor x11, x9, x11
3968 ; -O0: orr x8, x8, x11
3969 ; -O0: subs x8, x8, #0
3971 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
3972 ; -O1: ldp x4, x5, [x0]
3974 ; -O1: csel x9, x7, x3, lt
3975 ; -O1: csel x8, x4, x2, lt
3976 ; -O1: casp x4, x5, x8, x9, [x0]
3978 ; -O1: ccmp x4, x6, #0, eq
3979 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
3983 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
3984 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
3985 ; -O0: subs x9, x9, x10
3986 ; -O0: subs x9, x9, x10
3987 ; -O0: subs x9, x9, x12
3988 ; -O0: and w13, w13, #0x1
3989 ; -O0: ands w13, w13, #0x1
3990 ; -O0: csel w9, w9, w11, ne
3991 ; -O0: and w13, w9, #0x1
3992 ; -O0: ands w13, w13, #0x1
3993 ; -O0: csel x2, x11, x12, ne
3994 ; -O0: and w11, w9, #0x1
3995 ; -O0: ands w11, w11, #0x1
3996 ; -O0: csel x9, x9, x10, ne
3997 ; -O0: caspa 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_acquire:
4004 ; -O1: ldp x4, x5, [x0]
4006 ; -O1: csel x9, x7, x3, lt
4007 ; -O1: csel x8, x4, x2, lt
4008 ; -O1: caspa x4, x5, x8, x9, [x0]
4010 ; -O1: ccmp x4, x6, #0, eq
4011 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4015 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4016 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4017 ; -O0: subs x9, x9, x10
4018 ; -O0: subs x9, x9, x10
4019 ; -O0: subs x9, x9, x12
4020 ; -O0: and w13, w13, #0x1
4021 ; -O0: ands w13, w13, #0x1
4022 ; -O0: csel w9, w9, w11, ne
4023 ; -O0: and w13, w9, #0x1
4024 ; -O0: ands w13, w13, #0x1
4025 ; -O0: csel x2, x11, x12, ne
4026 ; -O0: and w11, w9, #0x1
4027 ; -O0: ands w11, w11, #0x1
4028 ; -O0: csel x9, x9, x10, ne
4029 ; -O0: caspl x0, x1, x2, x3, [x8]
4030 ; -O0: eor x8, x10, x8
4031 ; -O0: eor x11, x9, x11
4032 ; -O0: orr x8, x8, x11
4033 ; -O0: subs x8, x8, #0
4035 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
4036 ; -O1: ldp x4, x5, [x0]
4038 ; -O1: csel x9, x7, x3, lt
4039 ; -O1: csel x8, x4, x2, lt
4040 ; -O1: caspl x4, x5, x8, x9, [x0]
4042 ; -O1: ccmp x4, x6, #0, eq
4043 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4047 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4048 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4049 ; -O0: subs x9, x9, x10
4050 ; -O0: subs x9, x9, x10
4051 ; -O0: subs x9, x9, x12
4052 ; -O0: and w13, w13, #0x1
4053 ; -O0: ands w13, w13, #0x1
4054 ; -O0: csel w9, w9, w11, ne
4055 ; -O0: and w13, w9, #0x1
4056 ; -O0: ands w13, w13, #0x1
4057 ; -O0: csel x2, x11, x12, ne
4058 ; -O0: and w11, w9, #0x1
4059 ; -O0: ands w11, w11, #0x1
4060 ; -O0: csel x9, x9, x10, ne
4061 ; -O0: caspal x0, x1, x2, x3, [x8]
4062 ; -O0: eor x8, x10, x8
4063 ; -O0: eor x11, x9, x11
4064 ; -O0: orr x8, x8, x11
4065 ; -O0: subs x8, x8, #0
4067 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4068 ; -O1: ldp x4, x5, [x0]
4070 ; -O1: csel x9, x7, x3, lt
4071 ; -O1: csel x8, x4, x2, lt
4072 ; -O1: caspal x4, x5, x8, x9, [x0]
4074 ; -O1: ccmp x4, x6, #0, eq
4075 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4079 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4080 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4081 ; -O0: subs x9, x9, x10
4082 ; -O0: subs x9, x9, x10
4083 ; -O0: subs x9, x9, x12
4084 ; -O0: and w13, w13, #0x1
4085 ; -O0: ands w13, w13, #0x1
4086 ; -O0: csel w9, w9, w11, ne
4087 ; -O0: and w13, w9, #0x1
4088 ; -O0: ands w13, w13, #0x1
4089 ; -O0: csel x2, x11, x12, ne
4090 ; -O0: and w11, w9, #0x1
4091 ; -O0: ands w11, w11, #0x1
4092 ; -O0: csel x9, x9, x10, ne
4093 ; -O0: caspal x0, x1, x2, x3, [x8]
4094 ; -O0: eor x8, x10, x8
4095 ; -O0: eor x11, x9, x11
4096 ; -O0: orr x8, x8, x11
4097 ; -O0: subs x8, x8, #0
4099 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4100 ; -O1: ldp x4, x5, [x0]
4102 ; -O1: csel x9, x7, x3, lt
4103 ; -O1: csel x8, x4, x2, lt
4104 ; -O1: caspal x4, x5, x8, x9, [x0]
4106 ; -O1: ccmp x4, x6, #0, eq
4107 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4111 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4112 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4113 ; CHECK: ldsmaxb w1, w0, [x0]
4114 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4118 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4119 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acquire:
4120 ; CHECK: ldsmaxab w1, w0, [x0]
4121 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4125 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4126 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_release:
4127 ; CHECK: ldsmaxlb w1, w0, [x0]
4128 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4132 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4133 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4134 ; CHECK: ldsmaxalb w1, w0, [x0]
4135 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4139 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4140 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4141 ; CHECK: ldsmaxalb w1, w0, [x0]
4142 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4146 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4147 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4149 ; -O0: subs w10, w10, w8, sxth
4150 ; -O0: and w10, w10, #0x1
4151 ; -O0: ands w10, w10, #0x1
4152 ; -O0: csel w8, w9, w8, ne
4153 ; -O0: bl __atomic_compare_exchange
4155 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4157 ; -O1: cmp w8, w20, sxth
4158 ; -O1: csel w8, w0, w20, gt
4159 ; -O1: bl __atomic_compare_exchange
4160 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4164 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4165 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4167 ; -O0: subs w10, w10, w8, sxth
4168 ; -O0: and w10, w10, #0x1
4169 ; -O0: ands w10, w10, #0x1
4170 ; -O0: csel w8, w9, w8, ne
4171 ; -O0: bl __atomic_compare_exchange
4173 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4175 ; -O1: cmp w8, w20, sxth
4176 ; -O1: csel w8, w0, w20, gt
4177 ; -O1: bl __atomic_compare_exchange
4178 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4182 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4183 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4185 ; -O0: subs w10, w10, w8, sxth
4186 ; -O0: and w10, w10, #0x1
4187 ; -O0: ands w10, w10, #0x1
4188 ; -O0: csel w8, w9, w8, ne
4189 ; -O0: bl __atomic_compare_exchange
4191 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4193 ; -O1: cmp w8, w20, sxth
4194 ; -O1: csel w8, w0, w20, gt
4195 ; -O1: bl __atomic_compare_exchange
4196 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4200 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4201 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4203 ; -O0: subs w10, w10, w8, sxth
4204 ; -O0: and w10, w10, #0x1
4205 ; -O0: ands w10, w10, #0x1
4206 ; -O0: csel w8, w9, w8, ne
4207 ; -O0: bl __atomic_compare_exchange
4209 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4211 ; -O1: cmp w8, w20, sxth
4212 ; -O1: csel w8, w0, w20, gt
4213 ; -O1: bl __atomic_compare_exchange
4214 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
4218 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4219 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4221 ; -O0: subs w10, w10, w8, sxth
4222 ; -O0: and w10, w10, #0x1
4223 ; -O0: ands w10, w10, #0x1
4224 ; -O0: csel w8, w9, w8, ne
4225 ; -O0: bl __atomic_compare_exchange
4227 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4229 ; -O1: cmp w8, w20, sxth
4230 ; -O1: csel w8, w0, w20, gt
4231 ; -O1: bl __atomic_compare_exchange
4232 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4236 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4237 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4238 ; -O0: subs w10, w9, w8
4239 ; -O0: and w10, w10, #0x1
4240 ; -O0: ands w10, w10, #0x1
4241 ; -O0: csel w8, w9, w8, ne
4242 ; -O0: bl __atomic_compare_exchange
4244 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4246 ; -O1: csel w8, w0, w20, gt
4247 ; -O1: bl __atomic_compare_exchange
4248 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4252 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4253 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4254 ; -O0: subs w10, w9, w8
4255 ; -O0: and w10, w10, #0x1
4256 ; -O0: ands w10, w10, #0x1
4257 ; -O0: csel w8, w9, w8, ne
4258 ; -O0: bl __atomic_compare_exchange
4260 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4262 ; -O1: csel w8, w0, w20, gt
4263 ; -O1: bl __atomic_compare_exchange
4264 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4268 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4269 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4270 ; -O0: subs w10, w9, w8
4271 ; -O0: and w10, w10, #0x1
4272 ; -O0: ands w10, w10, #0x1
4273 ; -O0: csel w8, w9, w8, ne
4274 ; -O0: bl __atomic_compare_exchange
4276 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4278 ; -O1: csel w8, w0, w20, gt
4279 ; -O1: bl __atomic_compare_exchange
4280 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4284 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4285 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4286 ; -O0: subs w10, w9, w8
4287 ; -O0: and w10, w10, #0x1
4288 ; -O0: ands w10, w10, #0x1
4289 ; -O0: csel w8, w9, w8, ne
4290 ; -O0: bl __atomic_compare_exchange
4292 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4294 ; -O1: csel w8, w0, w20, gt
4295 ; -O1: bl __atomic_compare_exchange
4296 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4300 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4301 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4302 ; -O0: subs w10, w9, w8
4303 ; -O0: and w10, w10, #0x1
4304 ; -O0: ands w10, w10, #0x1
4305 ; -O0: csel w8, w9, w8, ne
4306 ; -O0: bl __atomic_compare_exchange
4308 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4310 ; -O1: csel w8, w0, w20, gt
4311 ; -O1: bl __atomic_compare_exchange
4312 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4316 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4317 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4318 ; -O0: subs x10, x9, x8
4319 ; -O0: and w10, w10, #0x1
4320 ; -O0: ands w10, w10, #0x1
4321 ; -O0: csel x8, x9, x8, ne
4322 ; -O0: bl __atomic_compare_exchange
4324 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4326 ; -O1: csel x8, x0, x20, gt
4327 ; -O1: bl __atomic_compare_exchange
4328 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4332 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4333 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4334 ; -O0: subs x10, x9, x8
4335 ; -O0: and w10, w10, #0x1
4336 ; -O0: ands w10, w10, #0x1
4337 ; -O0: csel x8, x9, x8, ne
4338 ; -O0: bl __atomic_compare_exchange
4340 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4342 ; -O1: csel x8, x0, x20, gt
4343 ; -O1: bl __atomic_compare_exchange
4344 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4348 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4349 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4350 ; -O0: subs x10, x9, x8
4351 ; -O0: and w10, w10, #0x1
4352 ; -O0: ands w10, w10, #0x1
4353 ; -O0: csel x8, x9, x8, ne
4354 ; -O0: bl __atomic_compare_exchange
4356 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4358 ; -O1: csel x8, x0, x20, gt
4359 ; -O1: bl __atomic_compare_exchange
4360 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4364 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4365 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4366 ; -O0: subs x10, x9, x8
4367 ; -O0: and w10, w10, #0x1
4368 ; -O0: ands w10, w10, #0x1
4369 ; -O0: csel x8, x9, x8, ne
4370 ; -O0: bl __atomic_compare_exchange
4372 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4374 ; -O1: csel x8, x0, x20, gt
4375 ; -O1: bl __atomic_compare_exchange
4376 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4380 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4381 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4382 ; -O0: subs x10, x9, x8
4383 ; -O0: and w10, w10, #0x1
4384 ; -O0: ands w10, w10, #0x1
4385 ; -O0: csel x8, x9, x8, ne
4386 ; -O0: bl __atomic_compare_exchange
4388 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4390 ; -O1: csel x8, x0, x20, gt
4391 ; -O1: bl __atomic_compare_exchange
4392 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4396 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4397 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4398 ; -O0: subs x8, x8, x10
4399 ; -O0: subs x8, x8, x10
4400 ; -O0: subs x8, x8, x11
4401 ; -O0: and w12, w12, #0x1
4402 ; -O0: ands w12, w12, #0x1
4403 ; -O0: csel w8, w8, w9, ne
4404 ; -O0: and w12, w8, #0x1
4405 ; -O0: ands w12, w12, #0x1
4406 ; -O0: csel x9, x9, x11, ne
4407 ; -O0: and w11, w8, #0x1
4408 ; -O0: ands w11, w11, #0x1
4409 ; -O0: csel x8, x8, x10, ne
4410 ; -O0: bl __atomic_compare_exchange
4412 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4413 ; -O1: ldp x0, x1, [x0]
4415 ; -O1: csel x8, x1, x19, lt
4416 ; -O1: csel x9, x0, x21, lt
4417 ; -O1: bl __atomic_compare_exchange
4418 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4422 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4423 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4424 ; -O0: subs x8, x8, x10
4425 ; -O0: subs x8, x8, x10
4426 ; -O0: subs x8, x8, x11
4427 ; -O0: and w12, w12, #0x1
4428 ; -O0: ands w12, w12, #0x1
4429 ; -O0: csel w8, w8, w9, ne
4430 ; -O0: and w12, w8, #0x1
4431 ; -O0: ands w12, w12, #0x1
4432 ; -O0: csel x9, x9, x11, ne
4433 ; -O0: and w11, w8, #0x1
4434 ; -O0: ands w11, w11, #0x1
4435 ; -O0: csel x8, x8, x10, ne
4436 ; -O0: bl __atomic_compare_exchange
4438 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4439 ; -O1: ldp x0, x1, [x0]
4441 ; -O1: csel x8, x1, x19, lt
4442 ; -O1: csel x9, x0, x21, lt
4443 ; -O1: bl __atomic_compare_exchange
4444 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4448 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4449 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4450 ; -O0: subs x8, x8, x10
4451 ; -O0: subs x8, x8, x10
4452 ; -O0: subs x8, x8, x11
4453 ; -O0: and w12, w12, #0x1
4454 ; -O0: ands w12, w12, #0x1
4455 ; -O0: csel w8, w8, w9, ne
4456 ; -O0: and w12, w8, #0x1
4457 ; -O0: ands w12, w12, #0x1
4458 ; -O0: csel x9, x9, x11, ne
4459 ; -O0: and w11, w8, #0x1
4460 ; -O0: ands w11, w11, #0x1
4461 ; -O0: csel x8, x8, x10, ne
4462 ; -O0: bl __atomic_compare_exchange
4464 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4465 ; -O1: ldp x0, x1, [x0]
4467 ; -O1: csel x8, x1, x19, lt
4468 ; -O1: csel x9, x0, x21, lt
4469 ; -O1: bl __atomic_compare_exchange
4470 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4474 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4475 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4476 ; -O0: subs x8, x8, x10
4477 ; -O0: subs x8, x8, x10
4478 ; -O0: subs x8, x8, x11
4479 ; -O0: and w12, w12, #0x1
4480 ; -O0: ands w12, w12, #0x1
4481 ; -O0: csel w8, w8, w9, ne
4482 ; -O0: and w12, w8, #0x1
4483 ; -O0: ands w12, w12, #0x1
4484 ; -O0: csel x9, x9, x11, ne
4485 ; -O0: and w11, w8, #0x1
4486 ; -O0: ands w11, w11, #0x1
4487 ; -O0: csel x8, x8, x10, ne
4488 ; -O0: bl __atomic_compare_exchange
4490 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4491 ; -O1: ldp x0, x1, [x0]
4493 ; -O1: csel x8, x1, x19, lt
4494 ; -O1: csel x9, x0, x21, lt
4495 ; -O1: bl __atomic_compare_exchange
4496 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4500 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4501 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4502 ; -O0: subs x8, x8, x10
4503 ; -O0: subs x8, x8, x10
4504 ; -O0: subs x8, x8, x11
4505 ; -O0: and w12, w12, #0x1
4506 ; -O0: ands w12, w12, #0x1
4507 ; -O0: csel w8, w8, w9, ne
4508 ; -O0: and w12, w8, #0x1
4509 ; -O0: ands w12, w12, #0x1
4510 ; -O0: csel x9, x9, x11, ne
4511 ; -O0: and w11, w8, #0x1
4512 ; -O0: ands w11, w11, #0x1
4513 ; -O0: csel x8, x8, x10, ne
4514 ; -O0: bl __atomic_compare_exchange
4516 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4517 ; -O1: ldp x0, x1, [x0]
4519 ; -O1: csel x8, x1, x19, lt
4520 ; -O1: csel x9, x0, x21, lt
4521 ; -O1: bl __atomic_compare_exchange
4522 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4526 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4527 ; CHECK-LABEL: atomicrmw_min_i8_aligned_monotonic:
4528 ; CHECK: ldsminb w1, w0, [x0]
4529 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4533 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4534 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acquire:
4535 ; CHECK: ldsminab w1, w0, [x0]
4536 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4540 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4541 ; CHECK-LABEL: atomicrmw_min_i8_aligned_release:
4542 ; CHECK: ldsminlb w1, w0, [x0]
4543 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4547 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4548 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4549 ; CHECK: ldsminalb w1, w0, [x0]
4550 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4554 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4555 ; CHECK-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4556 ; CHECK: ldsminalb w1, w0, [x0]
4557 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4561 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4562 ; CHECK-LABEL: atomicrmw_min_i16_aligned_monotonic:
4563 ; CHECK: ldsminh w1, w0, [x0]
4564 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
4568 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
4569 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acquire:
4570 ; CHECK: ldsminah w1, w0, [x0]
4571 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
4575 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
4576 ; CHECK-LABEL: atomicrmw_min_i16_aligned_release:
4577 ; CHECK: ldsminlh w1, w0, [x0]
4578 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
4582 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4583 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4584 ; CHECK: ldsminalh w1, w0, [x0]
4585 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
4589 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4590 ; CHECK-LABEL: atomicrmw_min_i16_aligned_seq_cst:
4591 ; CHECK: ldsminalh w1, w0, [x0]
4592 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
4596 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4597 ; CHECK-LABEL: atomicrmw_min_i32_aligned_monotonic:
4598 ; CHECK: ldsmin w1, w0, [x0]
4599 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
4603 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
4604 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acquire:
4605 ; CHECK: ldsmina w1, w0, [x0]
4606 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
4610 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
4611 ; CHECK-LABEL: atomicrmw_min_i32_aligned_release:
4612 ; CHECK: ldsminl w1, w0, [x0]
4613 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
4617 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4618 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acq_rel:
4619 ; CHECK: ldsminal w1, w0, [x0]
4620 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
4624 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4625 ; CHECK-LABEL: atomicrmw_min_i32_aligned_seq_cst:
4626 ; CHECK: ldsminal w1, w0, [x0]
4627 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
4631 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4632 ; CHECK-LABEL: atomicrmw_min_i64_aligned_monotonic:
4633 ; CHECK: ldsmin x1, x0, [x0]
4634 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
4638 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
4639 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acquire:
4640 ; CHECK: ldsmina x1, x0, [x0]
4641 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
4645 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
4646 ; CHECK-LABEL: atomicrmw_min_i64_aligned_release:
4647 ; CHECK: ldsminl x1, x0, [x0]
4648 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
4652 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4653 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acq_rel:
4654 ; CHECK: ldsminal x1, x0, [x0]
4655 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
4659 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4660 ; CHECK-LABEL: atomicrmw_min_i64_aligned_seq_cst:
4661 ; CHECK: ldsminal x1, x0, [x0]
4662 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
4666 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4667 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
4668 ; -O0: subs x9, x9, x10
4669 ; -O0: subs x9, x9, x10
4670 ; -O0: subs x9, x9, x12
4671 ; -O0: and w13, w13, #0x1
4672 ; -O0: ands w13, w13, #0x1
4673 ; -O0: csel w9, w9, w11, ne
4674 ; -O0: and w13, w9, #0x1
4675 ; -O0: ands w13, w13, #0x1
4676 ; -O0: csel x2, x11, x12, ne
4677 ; -O0: and w11, w9, #0x1
4678 ; -O0: ands w11, w11, #0x1
4679 ; -O0: csel x9, x9, x10, ne
4680 ; -O0: casp x0, x1, x2, x3, [x8]
4681 ; -O0: eor x8, x10, x8
4682 ; -O0: eor x11, x9, x11
4683 ; -O0: orr x8, x8, x11
4684 ; -O0: subs x8, x8, #0
4686 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
4687 ; -O1: ldp x4, x5, [x0]
4689 ; -O1: csel x9, x7, x3, ge
4690 ; -O1: csel x8, x4, x2, ge
4691 ; -O1: casp x4, x5, x8, x9, [x0]
4693 ; -O1: ccmp x4, x6, #0, eq
4694 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
4698 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
4699 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
4700 ; -O0: subs x9, x9, x10
4701 ; -O0: subs x9, x9, x10
4702 ; -O0: subs x9, x9, x12
4703 ; -O0: and w13, w13, #0x1
4704 ; -O0: ands w13, w13, #0x1
4705 ; -O0: csel w9, w9, w11, ne
4706 ; -O0: and w13, w9, #0x1
4707 ; -O0: ands w13, w13, #0x1
4708 ; -O0: csel x2, x11, x12, ne
4709 ; -O0: and w11, w9, #0x1
4710 ; -O0: ands w11, w11, #0x1
4711 ; -O0: csel x9, x9, x10, ne
4712 ; -O0: caspa x0, x1, x2, x3, [x8]
4713 ; -O0: eor x8, x10, x8
4714 ; -O0: eor x11, x9, x11
4715 ; -O0: orr x8, x8, x11
4716 ; -O0: subs x8, x8, #0
4718 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
4719 ; -O1: ldp x4, x5, [x0]
4721 ; -O1: csel x9, x7, x3, ge
4722 ; -O1: csel x8, x4, x2, ge
4723 ; -O1: caspa x4, x5, x8, x9, [x0]
4725 ; -O1: ccmp x4, x6, #0, eq
4726 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
4730 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
4731 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
4732 ; -O0: subs x9, x9, x10
4733 ; -O0: subs x9, x9, x10
4734 ; -O0: subs x9, x9, x12
4735 ; -O0: and w13, w13, #0x1
4736 ; -O0: ands w13, w13, #0x1
4737 ; -O0: csel w9, w9, w11, ne
4738 ; -O0: and w13, w9, #0x1
4739 ; -O0: ands w13, w13, #0x1
4740 ; -O0: csel x2, x11, x12, ne
4741 ; -O0: and w11, w9, #0x1
4742 ; -O0: ands w11, w11, #0x1
4743 ; -O0: csel x9, x9, x10, ne
4744 ; -O0: caspl x0, x1, x2, x3, [x8]
4745 ; -O0: eor x8, x10, x8
4746 ; -O0: eor x11, x9, x11
4747 ; -O0: orr x8, x8, x11
4748 ; -O0: subs x8, x8, #0
4750 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
4751 ; -O1: ldp x4, x5, [x0]
4753 ; -O1: csel x9, x7, x3, ge
4754 ; -O1: csel x8, x4, x2, ge
4755 ; -O1: caspl x4, x5, x8, x9, [x0]
4757 ; -O1: ccmp x4, x6, #0, eq
4758 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
4762 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4763 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4764 ; -O0: subs x9, x9, x10
4765 ; -O0: subs x9, x9, x10
4766 ; -O0: subs x9, x9, x12
4767 ; -O0: and w13, w13, #0x1
4768 ; -O0: ands w13, w13, #0x1
4769 ; -O0: csel w9, w9, w11, ne
4770 ; -O0: and w13, w9, #0x1
4771 ; -O0: ands w13, w13, #0x1
4772 ; -O0: csel x2, x11, x12, ne
4773 ; -O0: and w11, w9, #0x1
4774 ; -O0: ands w11, w11, #0x1
4775 ; -O0: csel x9, x9, x10, ne
4776 ; -O0: caspal x0, x1, x2, x3, [x8]
4777 ; -O0: eor x8, x10, x8
4778 ; -O0: eor x11, x9, x11
4779 ; -O0: orr x8, x8, x11
4780 ; -O0: subs x8, x8, #0
4782 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4783 ; -O1: ldp x4, x5, [x0]
4785 ; -O1: csel x9, x7, x3, ge
4786 ; -O1: csel x8, x4, x2, ge
4787 ; -O1: caspal x4, x5, x8, x9, [x0]
4789 ; -O1: ccmp x4, x6, #0, eq
4790 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
4794 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4795 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4796 ; -O0: subs x9, x9, x10
4797 ; -O0: subs x9, x9, x10
4798 ; -O0: subs x9, x9, x12
4799 ; -O0: and w13, w13, #0x1
4800 ; -O0: ands w13, w13, #0x1
4801 ; -O0: csel w9, w9, w11, ne
4802 ; -O0: and w13, w9, #0x1
4803 ; -O0: ands w13, w13, #0x1
4804 ; -O0: csel x2, x11, x12, ne
4805 ; -O0: and w11, w9, #0x1
4806 ; -O0: ands w11, w11, #0x1
4807 ; -O0: csel x9, x9, x10, ne
4808 ; -O0: caspal x0, x1, x2, x3, [x8]
4809 ; -O0: eor x8, x10, x8
4810 ; -O0: eor x11, x9, x11
4811 ; -O0: orr x8, x8, x11
4812 ; -O0: subs x8, x8, #0
4814 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4815 ; -O1: ldp x4, x5, [x0]
4817 ; -O1: csel x9, x7, x3, ge
4818 ; -O1: csel x8, x4, x2, ge
4819 ; -O1: caspal x4, x5, x8, x9, [x0]
4821 ; -O1: ccmp x4, x6, #0, eq
4822 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
4826 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4827 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_monotonic:
4828 ; CHECK: ldsminb w1, w0, [x0]
4829 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4833 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4834 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acquire:
4835 ; CHECK: ldsminab w1, w0, [x0]
4836 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4840 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
4841 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_release:
4842 ; CHECK: ldsminlb w1, w0, [x0]
4843 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4847 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4848 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
4849 ; CHECK: ldsminalb w1, w0, [x0]
4850 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4854 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4855 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
4856 ; CHECK: ldsminalb w1, w0, [x0]
4857 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4861 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4862 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4864 ; -O0: subs w10, w10, w8, sxth
4865 ; -O0: and w10, w10, #0x1
4866 ; -O0: ands w10, w10, #0x1
4867 ; -O0: csel w8, w9, w8, ne
4868 ; -O0: bl __atomic_compare_exchange
4870 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4872 ; -O1: cmp w8, w20, sxth
4873 ; -O1: csel w8, w0, w20, le
4874 ; -O1: bl __atomic_compare_exchange
4875 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
4879 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4880 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
4882 ; -O0: subs w10, w10, w8, sxth
4883 ; -O0: and w10, w10, #0x1
4884 ; -O0: ands w10, w10, #0x1
4885 ; -O0: csel w8, w9, w8, ne
4886 ; -O0: bl __atomic_compare_exchange
4888 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
4890 ; -O1: cmp w8, w20, sxth
4891 ; -O1: csel w8, w0, w20, le
4892 ; -O1: bl __atomic_compare_exchange
4893 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
4897 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
4898 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
4900 ; -O0: subs w10, w10, w8, sxth
4901 ; -O0: and w10, w10, #0x1
4902 ; -O0: ands w10, w10, #0x1
4903 ; -O0: csel w8, w9, w8, ne
4904 ; -O0: bl __atomic_compare_exchange
4906 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
4908 ; -O1: cmp w8, w20, sxth
4909 ; -O1: csel w8, w0, w20, le
4910 ; -O1: bl __atomic_compare_exchange
4911 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
4915 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4916 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4918 ; -O0: subs w10, w10, w8, sxth
4919 ; -O0: and w10, w10, #0x1
4920 ; -O0: ands w10, w10, #0x1
4921 ; -O0: csel w8, w9, w8, ne
4922 ; -O0: bl __atomic_compare_exchange
4924 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4926 ; -O1: cmp w8, w20, sxth
4927 ; -O1: csel w8, w0, w20, le
4928 ; -O1: bl __atomic_compare_exchange
4929 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
4933 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4934 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4936 ; -O0: subs w10, w10, w8, sxth
4937 ; -O0: and w10, w10, #0x1
4938 ; -O0: ands w10, w10, #0x1
4939 ; -O0: csel w8, w9, w8, ne
4940 ; -O0: bl __atomic_compare_exchange
4942 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4944 ; -O1: cmp w8, w20, sxth
4945 ; -O1: csel w8, w0, w20, le
4946 ; -O1: bl __atomic_compare_exchange
4947 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
4951 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4952 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4953 ; -O0: subs w10, w9, w8
4954 ; -O0: and w10, w10, #0x1
4955 ; -O0: ands w10, w10, #0x1
4956 ; -O0: csel w8, w9, w8, ne
4957 ; -O0: bl __atomic_compare_exchange
4959 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4961 ; -O1: csel w8, w0, w20, le
4962 ; -O1: bl __atomic_compare_exchange
4963 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
4967 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4968 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
4969 ; -O0: subs w10, w9, w8
4970 ; -O0: and w10, w10, #0x1
4971 ; -O0: ands w10, w10, #0x1
4972 ; -O0: csel w8, w9, w8, ne
4973 ; -O0: bl __atomic_compare_exchange
4975 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
4977 ; -O1: csel w8, w0, w20, le
4978 ; -O1: bl __atomic_compare_exchange
4979 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
4983 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
4984 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
4985 ; -O0: subs w10, w9, w8
4986 ; -O0: and w10, w10, #0x1
4987 ; -O0: ands w10, w10, #0x1
4988 ; -O0: csel w8, w9, w8, ne
4989 ; -O0: bl __atomic_compare_exchange
4991 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
4993 ; -O1: csel w8, w0, w20, le
4994 ; -O1: bl __atomic_compare_exchange
4995 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
4999 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5000 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5001 ; -O0: subs w10, w9, w8
5002 ; -O0: and w10, w10, #0x1
5003 ; -O0: ands w10, w10, #0x1
5004 ; -O0: csel w8, w9, w8, ne
5005 ; -O0: bl __atomic_compare_exchange
5007 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5009 ; -O1: csel w8, w0, w20, le
5010 ; -O1: bl __atomic_compare_exchange
5011 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
5015 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5016 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5017 ; -O0: subs w10, w9, w8
5018 ; -O0: and w10, w10, #0x1
5019 ; -O0: ands w10, w10, #0x1
5020 ; -O0: csel w8, w9, w8, ne
5021 ; -O0: bl __atomic_compare_exchange
5023 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5025 ; -O1: csel w8, w0, w20, le
5026 ; -O1: bl __atomic_compare_exchange
5027 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
5031 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5032 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5033 ; -O0: subs x10, x9, x8
5034 ; -O0: and w10, w10, #0x1
5035 ; -O0: ands w10, w10, #0x1
5036 ; -O0: csel x8, x9, x8, ne
5037 ; -O0: bl __atomic_compare_exchange
5039 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5041 ; -O1: csel x8, x0, x20, le
5042 ; -O1: bl __atomic_compare_exchange
5043 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
5047 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5048 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
5049 ; -O0: subs x10, x9, x8
5050 ; -O0: and w10, w10, #0x1
5051 ; -O0: ands w10, w10, #0x1
5052 ; -O0: csel x8, x9, x8, ne
5053 ; -O0: bl __atomic_compare_exchange
5055 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
5057 ; -O1: csel x8, x0, x20, le
5058 ; -O1: bl __atomic_compare_exchange
5059 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
5063 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
5064 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
5065 ; -O0: subs x10, x9, x8
5066 ; -O0: and w10, w10, #0x1
5067 ; -O0: ands w10, w10, #0x1
5068 ; -O0: csel x8, x9, x8, ne
5069 ; -O0: bl __atomic_compare_exchange
5071 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
5073 ; -O1: csel x8, x0, x20, le
5074 ; -O1: bl __atomic_compare_exchange
5075 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
5079 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5080 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5081 ; -O0: subs x10, x9, x8
5082 ; -O0: and w10, w10, #0x1
5083 ; -O0: ands w10, w10, #0x1
5084 ; -O0: csel x8, x9, x8, ne
5085 ; -O0: bl __atomic_compare_exchange
5087 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5089 ; -O1: csel x8, x0, x20, le
5090 ; -O1: bl __atomic_compare_exchange
5091 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
5095 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5096 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5097 ; -O0: subs x10, x9, x8
5098 ; -O0: and w10, w10, #0x1
5099 ; -O0: ands w10, w10, #0x1
5100 ; -O0: csel x8, x9, x8, ne
5101 ; -O0: bl __atomic_compare_exchange
5103 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5105 ; -O1: csel x8, x0, x20, le
5106 ; -O1: bl __atomic_compare_exchange
5107 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
5111 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5112 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5113 ; -O0: subs x8, x8, x10
5114 ; -O0: subs x8, x8, x10
5115 ; -O0: subs x8, x8, x11
5116 ; -O0: and w12, w12, #0x1
5117 ; -O0: ands w12, w12, #0x1
5118 ; -O0: csel w8, w8, w9, ne
5119 ; -O0: and w12, w8, #0x1
5120 ; -O0: ands w12, w12, #0x1
5121 ; -O0: csel x9, x9, x11, ne
5122 ; -O0: and w11, w8, #0x1
5123 ; -O0: ands w11, w11, #0x1
5124 ; -O0: csel x8, x8, x10, ne
5125 ; -O0: bl __atomic_compare_exchange
5127 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5128 ; -O1: ldp x0, x1, [x0]
5130 ; -O1: csel x8, x1, x19, ge
5131 ; -O1: csel x9, x0, x21, ge
5132 ; -O1: bl __atomic_compare_exchange
5133 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
5137 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5138 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
5139 ; -O0: subs x8, x8, x10
5140 ; -O0: subs x8, x8, x10
5141 ; -O0: subs x8, x8, x11
5142 ; -O0: and w12, w12, #0x1
5143 ; -O0: ands w12, w12, #0x1
5144 ; -O0: csel w8, w8, w9, ne
5145 ; -O0: and w12, w8, #0x1
5146 ; -O0: ands w12, w12, #0x1
5147 ; -O0: csel x9, x9, x11, ne
5148 ; -O0: and w11, w8, #0x1
5149 ; -O0: ands w11, w11, #0x1
5150 ; -O0: csel x8, x8, x10, ne
5151 ; -O0: bl __atomic_compare_exchange
5153 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
5154 ; -O1: ldp x0, x1, [x0]
5156 ; -O1: csel x8, x1, x19, ge
5157 ; -O1: csel x9, x0, x21, ge
5158 ; -O1: bl __atomic_compare_exchange
5159 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
5163 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
5164 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
5165 ; -O0: subs x8, x8, x10
5166 ; -O0: subs x8, x8, x10
5167 ; -O0: subs x8, x8, x11
5168 ; -O0: and w12, w12, #0x1
5169 ; -O0: ands w12, w12, #0x1
5170 ; -O0: csel w8, w8, w9, ne
5171 ; -O0: and w12, w8, #0x1
5172 ; -O0: ands w12, w12, #0x1
5173 ; -O0: csel x9, x9, x11, ne
5174 ; -O0: and w11, w8, #0x1
5175 ; -O0: ands w11, w11, #0x1
5176 ; -O0: csel x8, x8, x10, ne
5177 ; -O0: bl __atomic_compare_exchange
5179 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
5180 ; -O1: ldp x0, x1, [x0]
5182 ; -O1: csel x8, x1, x19, ge
5183 ; -O1: csel x9, x0, x21, ge
5184 ; -O1: bl __atomic_compare_exchange
5185 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
5189 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5190 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5191 ; -O0: subs x8, x8, x10
5192 ; -O0: subs x8, x8, x10
5193 ; -O0: subs x8, x8, x11
5194 ; -O0: and w12, w12, #0x1
5195 ; -O0: ands w12, w12, #0x1
5196 ; -O0: csel w8, w8, w9, ne
5197 ; -O0: and w12, w8, #0x1
5198 ; -O0: ands w12, w12, #0x1
5199 ; -O0: csel x9, x9, x11, ne
5200 ; -O0: and w11, w8, #0x1
5201 ; -O0: ands w11, w11, #0x1
5202 ; -O0: csel x8, x8, x10, ne
5203 ; -O0: bl __atomic_compare_exchange
5205 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5206 ; -O1: ldp x0, x1, [x0]
5208 ; -O1: csel x8, x1, x19, ge
5209 ; -O1: csel x9, x0, x21, ge
5210 ; -O1: bl __atomic_compare_exchange
5211 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5215 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5216 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5217 ; -O0: subs x8, x8, x10
5218 ; -O0: subs x8, x8, x10
5219 ; -O0: subs x8, x8, x11
5220 ; -O0: and w12, w12, #0x1
5221 ; -O0: ands w12, w12, #0x1
5222 ; -O0: csel w8, w8, w9, ne
5223 ; -O0: and w12, w8, #0x1
5224 ; -O0: ands w12, w12, #0x1
5225 ; -O0: csel x9, x9, x11, ne
5226 ; -O0: and w11, w8, #0x1
5227 ; -O0: ands w11, w11, #0x1
5228 ; -O0: csel x8, x8, x10, ne
5229 ; -O0: bl __atomic_compare_exchange
5231 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5232 ; -O1: ldp x0, x1, [x0]
5234 ; -O1: csel x8, x1, x19, ge
5235 ; -O1: csel x9, x0, x21, ge
5236 ; -O1: bl __atomic_compare_exchange
5237 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5241 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5242 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5243 ; CHECK: ldumaxb w1, w0, [x0]
5244 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5248 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5249 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acquire:
5250 ; CHECK: ldumaxab w1, w0, [x0]
5251 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5255 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5256 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_release:
5257 ; CHECK: ldumaxlb w1, w0, [x0]
5258 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5262 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5263 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5264 ; CHECK: ldumaxalb w1, w0, [x0]
5265 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5269 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5270 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5271 ; CHECK: ldumaxalb w1, w0, [x0]
5272 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5276 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5277 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5278 ; CHECK: ldumaxh w1, w0, [x0]
5279 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5283 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5284 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acquire:
5285 ; CHECK: ldumaxah w1, w0, [x0]
5286 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5290 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5291 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_release:
5292 ; CHECK: ldumaxlh w1, w0, [x0]
5293 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5297 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5298 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5299 ; CHECK: ldumaxalh w1, w0, [x0]
5300 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
5304 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5305 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5306 ; CHECK: ldumaxalh w1, w0, [x0]
5307 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
5311 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5312 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5313 ; CHECK: ldumax w1, w0, [x0]
5314 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
5318 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
5319 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acquire:
5320 ; CHECK: ldumaxa w1, w0, [x0]
5321 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
5325 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
5326 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_release:
5327 ; CHECK: ldumaxl w1, w0, [x0]
5328 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
5332 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5333 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5334 ; CHECK: ldumaxal w1, w0, [x0]
5335 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
5339 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5340 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5341 ; CHECK: ldumaxal w1, w0, [x0]
5342 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
5346 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5347 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5348 ; CHECK: ldumax x1, x0, [x0]
5349 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
5353 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
5354 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acquire:
5355 ; CHECK: ldumaxa x1, x0, [x0]
5356 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
5360 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
5361 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_release:
5362 ; CHECK: ldumaxl x1, x0, [x0]
5363 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
5367 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5368 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
5369 ; CHECK: ldumaxal x1, x0, [x0]
5370 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
5374 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5375 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
5376 ; CHECK: ldumaxal x1, x0, [x0]
5377 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
5381 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5382 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5383 ; -O0: subs x9, x9, x10
5384 ; -O0: subs x9, x9, x10
5385 ; -O0: subs x9, x9, x12
5386 ; -O0: and w13, w13, #0x1
5387 ; -O0: ands w13, w13, #0x1
5388 ; -O0: csel w9, w9, w11, ne
5389 ; -O0: and w13, w9, #0x1
5390 ; -O0: ands w13, w13, #0x1
5391 ; -O0: csel x2, x11, x12, ne
5392 ; -O0: and w11, w9, #0x1
5393 ; -O0: ands w11, w11, #0x1
5394 ; -O0: csel x9, x9, x10, ne
5395 ; -O0: casp x0, x1, x2, x3, [x8]
5396 ; -O0: eor x8, x10, x8
5397 ; -O0: eor x11, x9, x11
5398 ; -O0: orr x8, x8, x11
5399 ; -O0: subs x8, x8, #0
5401 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5402 ; -O1: ldp x4, x5, [x0]
5404 ; -O1: csel x9, x7, x3, lo
5405 ; -O1: csel x8, x4, x2, lo
5406 ; -O1: casp x4, x5, x8, x9, [x0]
5408 ; -O1: ccmp x4, x6, #0, eq
5409 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
5413 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
5414 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
5415 ; -O0: subs x9, x9, x10
5416 ; -O0: subs x9, x9, x10
5417 ; -O0: subs x9, x9, x12
5418 ; -O0: and w13, w13, #0x1
5419 ; -O0: ands w13, w13, #0x1
5420 ; -O0: csel w9, w9, w11, ne
5421 ; -O0: and w13, w9, #0x1
5422 ; -O0: ands w13, w13, #0x1
5423 ; -O0: csel x2, x11, x12, ne
5424 ; -O0: and w11, w9, #0x1
5425 ; -O0: ands w11, w11, #0x1
5426 ; -O0: csel x9, x9, x10, ne
5427 ; -O0: caspa x0, x1, x2, x3, [x8]
5428 ; -O0: eor x8, x10, x8
5429 ; -O0: eor x11, x9, x11
5430 ; -O0: orr x8, x8, x11
5431 ; -O0: subs x8, x8, #0
5433 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
5434 ; -O1: ldp x4, x5, [x0]
5436 ; -O1: csel x9, x7, x3, lo
5437 ; -O1: csel x8, x4, x2, lo
5438 ; -O1: caspa x4, x5, x8, x9, [x0]
5440 ; -O1: ccmp x4, x6, #0, eq
5441 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
5445 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
5446 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
5447 ; -O0: subs x9, x9, x10
5448 ; -O0: subs x9, x9, x10
5449 ; -O0: subs x9, x9, x12
5450 ; -O0: and w13, w13, #0x1
5451 ; -O0: ands w13, w13, #0x1
5452 ; -O0: csel w9, w9, w11, ne
5453 ; -O0: and w13, w9, #0x1
5454 ; -O0: ands w13, w13, #0x1
5455 ; -O0: csel x2, x11, x12, ne
5456 ; -O0: and w11, w9, #0x1
5457 ; -O0: ands w11, w11, #0x1
5458 ; -O0: csel x9, x9, x10, ne
5459 ; -O0: caspl x0, x1, x2, x3, [x8]
5460 ; -O0: eor x8, x10, x8
5461 ; -O0: eor x11, x9, x11
5462 ; -O0: orr x8, x8, x11
5463 ; -O0: subs x8, x8, #0
5465 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
5466 ; -O1: ldp x4, x5, [x0]
5468 ; -O1: csel x9, x7, x3, lo
5469 ; -O1: csel x8, x4, x2, lo
5470 ; -O1: caspl x4, x5, x8, x9, [x0]
5472 ; -O1: ccmp x4, x6, #0, eq
5473 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
5477 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5478 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5479 ; -O0: subs x9, x9, x10
5480 ; -O0: subs x9, x9, x10
5481 ; -O0: subs x9, x9, x12
5482 ; -O0: and w13, w13, #0x1
5483 ; -O0: ands w13, w13, #0x1
5484 ; -O0: csel w9, w9, w11, ne
5485 ; -O0: and w13, w9, #0x1
5486 ; -O0: ands w13, w13, #0x1
5487 ; -O0: csel x2, x11, x12, ne
5488 ; -O0: and w11, w9, #0x1
5489 ; -O0: ands w11, w11, #0x1
5490 ; -O0: csel x9, x9, x10, ne
5491 ; -O0: caspal x0, x1, x2, x3, [x8]
5492 ; -O0: eor x8, x10, x8
5493 ; -O0: eor x11, x9, x11
5494 ; -O0: orr x8, x8, x11
5495 ; -O0: subs x8, x8, #0
5497 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5498 ; -O1: ldp x4, x5, [x0]
5500 ; -O1: csel x9, x7, x3, lo
5501 ; -O1: csel x8, x4, x2, lo
5502 ; -O1: caspal x4, x5, x8, x9, [x0]
5504 ; -O1: ccmp x4, x6, #0, eq
5505 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
5509 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5510 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5511 ; -O0: subs x9, x9, x10
5512 ; -O0: subs x9, x9, x10
5513 ; -O0: subs x9, x9, x12
5514 ; -O0: and w13, w13, #0x1
5515 ; -O0: ands w13, w13, #0x1
5516 ; -O0: csel w9, w9, w11, ne
5517 ; -O0: and w13, w9, #0x1
5518 ; -O0: ands w13, w13, #0x1
5519 ; -O0: csel x2, x11, x12, ne
5520 ; -O0: and w11, w9, #0x1
5521 ; -O0: ands w11, w11, #0x1
5522 ; -O0: csel x9, x9, x10, ne
5523 ; -O0: caspal x0, x1, x2, x3, [x8]
5524 ; -O0: eor x8, x10, x8
5525 ; -O0: eor x11, x9, x11
5526 ; -O0: orr x8, x8, x11
5527 ; -O0: subs x8, x8, #0
5529 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5530 ; -O1: ldp x4, x5, [x0]
5532 ; -O1: csel x9, x7, x3, lo
5533 ; -O1: csel x8, x4, x2, lo
5534 ; -O1: caspal x4, x5, x8, x9, [x0]
5536 ; -O1: ccmp x4, x6, #0, eq
5537 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
5541 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5542 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
5543 ; CHECK: ldumaxb w1, w0, [x0]
5544 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5548 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5549 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acquire:
5550 ; CHECK: ldumaxab w1, w0, [x0]
5551 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5555 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
5556 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_release:
5557 ; CHECK: ldumaxlb w1, w0, [x0]
5558 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5562 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5563 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
5564 ; CHECK: ldumaxalb w1, w0, [x0]
5565 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5569 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5570 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
5571 ; CHECK: ldumaxalb w1, w0, [x0]
5572 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5576 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5577 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5578 ; -O0: subs w10, w10, w8, uxth
5579 ; -O0: and w10, w10, #0x1
5580 ; -O0: ands w10, w10, #0x1
5581 ; -O0: csel w8, w9, w8, ne
5582 ; -O0: bl __atomic_compare_exchange
5584 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5585 ; -O1: and w8, w0, #0xffff
5586 ; -O1: cmp w8, w20, uxth
5587 ; -O1: csel w8, w0, w20, hi
5588 ; -O1: bl __atomic_compare_exchange
5589 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
5593 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5594 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5595 ; -O0: subs w10, w10, w8, uxth
5596 ; -O0: and w10, w10, #0x1
5597 ; -O0: ands w10, w10, #0x1
5598 ; -O0: csel w8, w9, w8, ne
5599 ; -O0: bl __atomic_compare_exchange
5601 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5602 ; -O1: and w8, w0, #0xffff
5603 ; -O1: cmp w8, w20, uxth
5604 ; -O1: csel w8, w0, w20, hi
5605 ; -O1: bl __atomic_compare_exchange
5606 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
5610 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
5611 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
5612 ; -O0: subs w10, w10, w8, uxth
5613 ; -O0: and w10, w10, #0x1
5614 ; -O0: ands w10, w10, #0x1
5615 ; -O0: csel w8, w9, w8, ne
5616 ; -O0: bl __atomic_compare_exchange
5618 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
5619 ; -O1: and w8, w0, #0xffff
5620 ; -O1: cmp w8, w20, uxth
5621 ; -O1: csel w8, w0, w20, hi
5622 ; -O1: bl __atomic_compare_exchange
5623 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
5627 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5628 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5629 ; -O0: subs w10, w10, w8, uxth
5630 ; -O0: and w10, w10, #0x1
5631 ; -O0: ands w10, w10, #0x1
5632 ; -O0: csel w8, w9, w8, ne
5633 ; -O0: bl __atomic_compare_exchange
5635 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5636 ; -O1: and w8, w0, #0xffff
5637 ; -O1: cmp w8, w20, uxth
5638 ; -O1: csel w8, w0, w20, hi
5639 ; -O1: bl __atomic_compare_exchange
5640 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
5644 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5645 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5646 ; -O0: subs w10, w10, w8, uxth
5647 ; -O0: and w10, w10, #0x1
5648 ; -O0: ands w10, w10, #0x1
5649 ; -O0: csel w8, w9, w8, ne
5650 ; -O0: bl __atomic_compare_exchange
5652 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5653 ; -O1: and w8, w0, #0xffff
5654 ; -O1: cmp w8, w20, uxth
5655 ; -O1: csel w8, w0, w20, hi
5656 ; -O1: bl __atomic_compare_exchange
5657 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
5661 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5662 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5663 ; -O0: subs w10, w9, w8
5664 ; -O0: and w10, w10, #0x1
5665 ; -O0: ands w10, w10, #0x1
5666 ; -O0: csel w8, w9, w8, ne
5667 ; -O0: bl __atomic_compare_exchange
5669 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5671 ; -O1: csel w8, w0, w20, hi
5672 ; -O1: bl __atomic_compare_exchange
5673 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
5677 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5678 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5679 ; -O0: subs w10, w9, w8
5680 ; -O0: and w10, w10, #0x1
5681 ; -O0: ands w10, w10, #0x1
5682 ; -O0: csel w8, w9, w8, ne
5683 ; -O0: bl __atomic_compare_exchange
5685 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5687 ; -O1: csel w8, w0, w20, hi
5688 ; -O1: bl __atomic_compare_exchange
5689 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
5693 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
5694 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
5695 ; -O0: subs w10, w9, w8
5696 ; -O0: and w10, w10, #0x1
5697 ; -O0: ands w10, w10, #0x1
5698 ; -O0: csel w8, w9, w8, ne
5699 ; -O0: bl __atomic_compare_exchange
5701 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
5703 ; -O1: csel w8, w0, w20, hi
5704 ; -O1: bl __atomic_compare_exchange
5705 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
5709 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5710 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5711 ; -O0: subs w10, w9, w8
5712 ; -O0: and w10, w10, #0x1
5713 ; -O0: ands w10, w10, #0x1
5714 ; -O0: csel w8, w9, w8, ne
5715 ; -O0: bl __atomic_compare_exchange
5717 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5719 ; -O1: csel w8, w0, w20, hi
5720 ; -O1: bl __atomic_compare_exchange
5721 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
5725 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5726 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5727 ; -O0: subs w10, w9, w8
5728 ; -O0: and w10, w10, #0x1
5729 ; -O0: ands w10, w10, #0x1
5730 ; -O0: csel w8, w9, w8, ne
5731 ; -O0: bl __atomic_compare_exchange
5733 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5735 ; -O1: csel w8, w0, w20, hi
5736 ; -O1: bl __atomic_compare_exchange
5737 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
5741 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5742 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5743 ; -O0: subs x10, x9, x8
5744 ; -O0: and w10, w10, #0x1
5745 ; -O0: ands w10, w10, #0x1
5746 ; -O0: csel x8, x9, x8, ne
5747 ; -O0: bl __atomic_compare_exchange
5749 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5751 ; -O1: csel x8, x0, x20, hi
5752 ; -O1: bl __atomic_compare_exchange
5753 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
5757 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5758 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5759 ; -O0: subs x10, x9, x8
5760 ; -O0: and w10, w10, #0x1
5761 ; -O0: ands w10, w10, #0x1
5762 ; -O0: csel x8, x9, x8, ne
5763 ; -O0: bl __atomic_compare_exchange
5765 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5767 ; -O1: csel x8, x0, x20, hi
5768 ; -O1: bl __atomic_compare_exchange
5769 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
5773 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
5774 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
5775 ; -O0: subs x10, x9, x8
5776 ; -O0: and w10, w10, #0x1
5777 ; -O0: ands w10, w10, #0x1
5778 ; -O0: csel x8, x9, x8, ne
5779 ; -O0: bl __atomic_compare_exchange
5781 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
5783 ; -O1: csel x8, x0, x20, hi
5784 ; -O1: bl __atomic_compare_exchange
5785 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
5789 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5790 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5791 ; -O0: subs x10, x9, x8
5792 ; -O0: and w10, w10, #0x1
5793 ; -O0: ands w10, w10, #0x1
5794 ; -O0: csel x8, x9, x8, ne
5795 ; -O0: bl __atomic_compare_exchange
5797 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5799 ; -O1: csel x8, x0, x20, hi
5800 ; -O1: bl __atomic_compare_exchange
5801 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
5805 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5806 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5807 ; -O0: subs x10, x9, x8
5808 ; -O0: and w10, w10, #0x1
5809 ; -O0: ands w10, w10, #0x1
5810 ; -O0: csel x8, x9, x8, ne
5811 ; -O0: bl __atomic_compare_exchange
5813 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5815 ; -O1: csel x8, x0, x20, hi
5816 ; -O1: bl __atomic_compare_exchange
5817 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
5821 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5822 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5823 ; -O0: subs x8, x8, x10
5824 ; -O0: subs x8, x8, x10
5825 ; -O0: subs x8, x8, x11
5826 ; -O0: and w12, w12, #0x1
5827 ; -O0: ands w12, w12, #0x1
5828 ; -O0: csel w8, w8, w9, ne
5829 ; -O0: and w12, w8, #0x1
5830 ; -O0: ands w12, w12, #0x1
5831 ; -O0: csel x9, x9, x11, ne
5832 ; -O0: and w11, w8, #0x1
5833 ; -O0: ands w11, w11, #0x1
5834 ; -O0: csel x8, x8, x10, ne
5835 ; -O0: bl __atomic_compare_exchange
5837 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5838 ; -O1: ldp x0, x1, [x0]
5840 ; -O1: csel x8, x1, x19, lo
5841 ; -O1: csel x9, x0, x21, lo
5842 ; -O1: bl __atomic_compare_exchange
5843 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
5847 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5848 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5849 ; -O0: subs x8, x8, x10
5850 ; -O0: subs x8, x8, x10
5851 ; -O0: subs x8, x8, x11
5852 ; -O0: and w12, w12, #0x1
5853 ; -O0: ands w12, w12, #0x1
5854 ; -O0: csel w8, w8, w9, ne
5855 ; -O0: and w12, w8, #0x1
5856 ; -O0: ands w12, w12, #0x1
5857 ; -O0: csel x9, x9, x11, ne
5858 ; -O0: and w11, w8, #0x1
5859 ; -O0: ands w11, w11, #0x1
5860 ; -O0: csel x8, x8, x10, ne
5861 ; -O0: bl __atomic_compare_exchange
5863 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5864 ; -O1: ldp x0, x1, [x0]
5866 ; -O1: csel x8, x1, x19, lo
5867 ; -O1: csel x9, x0, x21, lo
5868 ; -O1: bl __atomic_compare_exchange
5869 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
5873 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
5874 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
5875 ; -O0: subs x8, x8, x10
5876 ; -O0: subs x8, x8, x10
5877 ; -O0: subs x8, x8, x11
5878 ; -O0: and w12, w12, #0x1
5879 ; -O0: ands w12, w12, #0x1
5880 ; -O0: csel w8, w8, w9, ne
5881 ; -O0: and w12, w8, #0x1
5882 ; -O0: ands w12, w12, #0x1
5883 ; -O0: csel x9, x9, x11, ne
5884 ; -O0: and w11, w8, #0x1
5885 ; -O0: ands w11, w11, #0x1
5886 ; -O0: csel x8, x8, x10, ne
5887 ; -O0: bl __atomic_compare_exchange
5889 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
5890 ; -O1: ldp x0, x1, [x0]
5892 ; -O1: csel x8, x1, x19, lo
5893 ; -O1: csel x9, x0, x21, lo
5894 ; -O1: bl __atomic_compare_exchange
5895 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
5899 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5900 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5901 ; -O0: subs x8, x8, x10
5902 ; -O0: subs x8, x8, x10
5903 ; -O0: subs x8, x8, x11
5904 ; -O0: and w12, w12, #0x1
5905 ; -O0: ands w12, w12, #0x1
5906 ; -O0: csel w8, w8, w9, ne
5907 ; -O0: and w12, w8, #0x1
5908 ; -O0: ands w12, w12, #0x1
5909 ; -O0: csel x9, x9, x11, ne
5910 ; -O0: and w11, w8, #0x1
5911 ; -O0: ands w11, w11, #0x1
5912 ; -O0: csel x8, x8, x10, ne
5913 ; -O0: bl __atomic_compare_exchange
5915 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5916 ; -O1: ldp x0, x1, [x0]
5918 ; -O1: csel x8, x1, x19, lo
5919 ; -O1: csel x9, x0, x21, lo
5920 ; -O1: bl __atomic_compare_exchange
5921 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
5925 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5926 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5927 ; -O0: subs x8, x8, x10
5928 ; -O0: subs x8, x8, x10
5929 ; -O0: subs x8, x8, x11
5930 ; -O0: and w12, w12, #0x1
5931 ; -O0: ands w12, w12, #0x1
5932 ; -O0: csel w8, w8, w9, ne
5933 ; -O0: and w12, w8, #0x1
5934 ; -O0: ands w12, w12, #0x1
5935 ; -O0: csel x9, x9, x11, ne
5936 ; -O0: and w11, w8, #0x1
5937 ; -O0: ands w11, w11, #0x1
5938 ; -O0: csel x8, x8, x10, ne
5939 ; -O0: bl __atomic_compare_exchange
5941 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5942 ; -O1: ldp x0, x1, [x0]
5944 ; -O1: csel x8, x1, x19, lo
5945 ; -O1: csel x9, x0, x21, lo
5946 ; -O1: bl __atomic_compare_exchange
5947 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
5951 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5952 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_monotonic:
5953 ; CHECK: lduminb w1, w0, [x0]
5954 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
5958 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
5959 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acquire:
5960 ; CHECK: lduminab w1, w0, [x0]
5961 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
5965 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
5966 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_release:
5967 ; CHECK: lduminlb w1, w0, [x0]
5968 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
5972 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5973 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
5974 ; CHECK: lduminalb w1, w0, [x0]
5975 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
5979 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5980 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
5981 ; CHECK: lduminalb w1, w0, [x0]
5982 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
5986 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5987 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_monotonic:
5988 ; CHECK: lduminh w1, w0, [x0]
5989 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
5993 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
5994 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acquire:
5995 ; CHECK: lduminah w1, w0, [x0]
5996 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
6000 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
6001 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_release:
6002 ; CHECK: lduminlh w1, w0, [x0]
6003 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
6007 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6008 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
6009 ; CHECK: lduminalh w1, w0, [x0]
6010 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
6014 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6015 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
6016 ; CHECK: lduminalh w1, w0, [x0]
6017 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
6021 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6022 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_monotonic:
6023 ; CHECK: ldumin w1, w0, [x0]
6024 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
6028 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
6029 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acquire:
6030 ; CHECK: ldumina w1, w0, [x0]
6031 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
6035 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
6036 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_release:
6037 ; CHECK: lduminl w1, w0, [x0]
6038 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
6042 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6043 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
6044 ; CHECK: lduminal w1, w0, [x0]
6045 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
6049 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6050 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
6051 ; CHECK: lduminal w1, w0, [x0]
6052 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
6056 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6057 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_monotonic:
6058 ; CHECK: ldumin x1, x0, [x0]
6059 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
6063 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
6064 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acquire:
6065 ; CHECK: ldumina x1, x0, [x0]
6066 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
6070 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
6071 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_release:
6072 ; CHECK: lduminl x1, x0, [x0]
6073 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
6077 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6078 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
6079 ; CHECK: lduminal x1, x0, [x0]
6080 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
6084 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6085 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
6086 ; CHECK: lduminal x1, x0, [x0]
6087 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
6091 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6092 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
6093 ; -O0: subs x9, x9, x10
6094 ; -O0: subs x9, x9, x10
6095 ; -O0: subs x9, x9, x12
6096 ; -O0: and w13, w13, #0x1
6097 ; -O0: ands w13, w13, #0x1
6098 ; -O0: csel w9, w9, w11, ne
6099 ; -O0: and w13, w9, #0x1
6100 ; -O0: ands w13, w13, #0x1
6101 ; -O0: csel x2, x11, x12, ne
6102 ; -O0: and w11, w9, #0x1
6103 ; -O0: ands w11, w11, #0x1
6104 ; -O0: csel x9, x9, x10, ne
6105 ; -O0: casp x0, x1, x2, x3, [x8]
6106 ; -O0: eor x8, x10, x8
6107 ; -O0: eor x11, x9, x11
6108 ; -O0: orr x8, x8, x11
6109 ; -O0: subs x8, x8, #0
6111 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
6112 ; -O1: ldp x4, x5, [x0]
6114 ; -O1: csel x9, x7, x3, hs
6115 ; -O1: csel x8, x4, x2, hs
6116 ; -O1: casp x4, x5, x8, x9, [x0]
6118 ; -O1: ccmp x4, x6, #0, eq
6119 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
6123 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
6124 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
6125 ; -O0: subs x9, x9, x10
6126 ; -O0: subs x9, x9, x10
6127 ; -O0: subs x9, x9, x12
6128 ; -O0: and w13, w13, #0x1
6129 ; -O0: ands w13, w13, #0x1
6130 ; -O0: csel w9, w9, w11, ne
6131 ; -O0: and w13, w9, #0x1
6132 ; -O0: ands w13, w13, #0x1
6133 ; -O0: csel x2, x11, x12, ne
6134 ; -O0: and w11, w9, #0x1
6135 ; -O0: ands w11, w11, #0x1
6136 ; -O0: csel x9, x9, x10, ne
6137 ; -O0: caspa x0, x1, x2, x3, [x8]
6138 ; -O0: eor x8, x10, x8
6139 ; -O0: eor x11, x9, x11
6140 ; -O0: orr x8, x8, x11
6141 ; -O0: subs x8, x8, #0
6143 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
6144 ; -O1: ldp x4, x5, [x0]
6146 ; -O1: csel x9, x7, x3, hs
6147 ; -O1: csel x8, x4, x2, hs
6148 ; -O1: caspa x4, x5, x8, x9, [x0]
6150 ; -O1: ccmp x4, x6, #0, eq
6151 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
6155 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
6156 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
6157 ; -O0: subs x9, x9, x10
6158 ; -O0: subs x9, x9, x10
6159 ; -O0: subs x9, x9, x12
6160 ; -O0: and w13, w13, #0x1
6161 ; -O0: ands w13, w13, #0x1
6162 ; -O0: csel w9, w9, w11, ne
6163 ; -O0: and w13, w9, #0x1
6164 ; -O0: ands w13, w13, #0x1
6165 ; -O0: csel x2, x11, x12, ne
6166 ; -O0: and w11, w9, #0x1
6167 ; -O0: ands w11, w11, #0x1
6168 ; -O0: csel x9, x9, x10, ne
6169 ; -O0: caspl x0, x1, x2, x3, [x8]
6170 ; -O0: eor x8, x10, x8
6171 ; -O0: eor x11, x9, x11
6172 ; -O0: orr x8, x8, x11
6173 ; -O0: subs x8, x8, #0
6175 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
6176 ; -O1: ldp x4, x5, [x0]
6178 ; -O1: csel x9, x7, x3, hs
6179 ; -O1: csel x8, x4, x2, hs
6180 ; -O1: caspl x4, x5, x8, x9, [x0]
6182 ; -O1: ccmp x4, x6, #0, eq
6183 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
6187 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6188 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6189 ; -O0: subs x9, x9, x10
6190 ; -O0: subs x9, x9, x10
6191 ; -O0: subs x9, x9, x12
6192 ; -O0: and w13, w13, #0x1
6193 ; -O0: ands w13, w13, #0x1
6194 ; -O0: csel w9, w9, w11, ne
6195 ; -O0: and w13, w9, #0x1
6196 ; -O0: ands w13, w13, #0x1
6197 ; -O0: csel x2, x11, x12, ne
6198 ; -O0: and w11, w9, #0x1
6199 ; -O0: ands w11, w11, #0x1
6200 ; -O0: csel x9, x9, x10, ne
6201 ; -O0: caspal x0, x1, x2, x3, [x8]
6202 ; -O0: eor x8, x10, x8
6203 ; -O0: eor x11, x9, x11
6204 ; -O0: orr x8, x8, x11
6205 ; -O0: subs x8, x8, #0
6207 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6208 ; -O1: ldp x4, x5, [x0]
6210 ; -O1: csel x9, x7, x3, hs
6211 ; -O1: csel x8, x4, x2, hs
6212 ; -O1: caspal x4, x5, x8, x9, [x0]
6214 ; -O1: ccmp x4, x6, #0, eq
6215 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
6219 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6220 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6221 ; -O0: subs x9, x9, x10
6222 ; -O0: subs x9, x9, x10
6223 ; -O0: subs x9, x9, x12
6224 ; -O0: and w13, w13, #0x1
6225 ; -O0: ands w13, w13, #0x1
6226 ; -O0: csel w9, w9, w11, ne
6227 ; -O0: and w13, w9, #0x1
6228 ; -O0: ands w13, w13, #0x1
6229 ; -O0: csel x2, x11, x12, ne
6230 ; -O0: and w11, w9, #0x1
6231 ; -O0: ands w11, w11, #0x1
6232 ; -O0: csel x9, x9, x10, ne
6233 ; -O0: caspal x0, x1, x2, x3, [x8]
6234 ; -O0: eor x8, x10, x8
6235 ; -O0: eor x11, x9, x11
6236 ; -O0: orr x8, x8, x11
6237 ; -O0: subs x8, x8, #0
6239 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6240 ; -O1: ldp x4, x5, [x0]
6242 ; -O1: csel x9, x7, x3, hs
6243 ; -O1: csel x8, x4, x2, hs
6244 ; -O1: caspal x4, x5, x8, x9, [x0]
6246 ; -O1: ccmp x4, x6, #0, eq
6247 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
6251 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6252 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
6253 ; CHECK: lduminb w1, w0, [x0]
6254 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
6258 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6259 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acquire:
6260 ; CHECK: lduminab w1, w0, [x0]
6261 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
6265 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
6266 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_release:
6267 ; CHECK: lduminlb w1, w0, [x0]
6268 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
6272 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6273 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
6274 ; CHECK: lduminalb w1, w0, [x0]
6275 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
6279 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6280 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
6281 ; CHECK: lduminalb w1, w0, [x0]
6282 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
6286 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6287 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6288 ; -O0: subs w10, w10, w8, uxth
6289 ; -O0: and w10, w10, #0x1
6290 ; -O0: ands w10, w10, #0x1
6291 ; -O0: csel w8, w9, w8, ne
6292 ; -O0: bl __atomic_compare_exchange
6294 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6295 ; -O1: and w8, w0, #0xffff
6296 ; -O1: cmp w8, w20, uxth
6297 ; -O1: csel w8, w0, w20, ls
6298 ; -O1: bl __atomic_compare_exchange
6299 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
6303 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6304 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6305 ; -O0: subs w10, w10, w8, uxth
6306 ; -O0: and w10, w10, #0x1
6307 ; -O0: ands w10, w10, #0x1
6308 ; -O0: csel w8, w9, w8, ne
6309 ; -O0: bl __atomic_compare_exchange
6311 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6312 ; -O1: and w8, w0, #0xffff
6313 ; -O1: cmp w8, w20, uxth
6314 ; -O1: csel w8, w0, w20, ls
6315 ; -O1: bl __atomic_compare_exchange
6316 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
6320 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
6321 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
6322 ; -O0: subs w10, w10, w8, uxth
6323 ; -O0: and w10, w10, #0x1
6324 ; -O0: ands w10, w10, #0x1
6325 ; -O0: csel w8, w9, w8, ne
6326 ; -O0: bl __atomic_compare_exchange
6328 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
6329 ; -O1: and w8, w0, #0xffff
6330 ; -O1: cmp w8, w20, uxth
6331 ; -O1: csel w8, w0, w20, ls
6332 ; -O1: bl __atomic_compare_exchange
6333 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
6337 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6338 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6339 ; -O0: subs w10, w10, w8, uxth
6340 ; -O0: and w10, w10, #0x1
6341 ; -O0: ands w10, w10, #0x1
6342 ; -O0: csel w8, w9, w8, ne
6343 ; -O0: bl __atomic_compare_exchange
6345 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6346 ; -O1: and w8, w0, #0xffff
6347 ; -O1: cmp w8, w20, uxth
6348 ; -O1: csel w8, w0, w20, ls
6349 ; -O1: bl __atomic_compare_exchange
6350 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
6354 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6355 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6356 ; -O0: subs w10, w10, w8, uxth
6357 ; -O0: and w10, w10, #0x1
6358 ; -O0: ands w10, w10, #0x1
6359 ; -O0: csel w8, w9, w8, ne
6360 ; -O0: bl __atomic_compare_exchange
6362 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6363 ; -O1: and w8, w0, #0xffff
6364 ; -O1: cmp w8, w20, uxth
6365 ; -O1: csel w8, w0, w20, ls
6366 ; -O1: bl __atomic_compare_exchange
6367 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
6371 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6372 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6373 ; -O0: subs w10, w9, w8
6374 ; -O0: and w10, w10, #0x1
6375 ; -O0: ands w10, w10, #0x1
6376 ; -O0: csel w8, w9, w8, ne
6377 ; -O0: bl __atomic_compare_exchange
6379 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6381 ; -O1: csel w8, w0, w20, ls
6382 ; -O1: bl __atomic_compare_exchange
6383 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
6387 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6388 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6389 ; -O0: subs w10, w9, w8
6390 ; -O0: and w10, w10, #0x1
6391 ; -O0: ands w10, w10, #0x1
6392 ; -O0: csel w8, w9, w8, ne
6393 ; -O0: bl __atomic_compare_exchange
6395 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6397 ; -O1: csel w8, w0, w20, ls
6398 ; -O1: bl __atomic_compare_exchange
6399 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
6403 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
6404 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
6405 ; -O0: subs w10, w9, w8
6406 ; -O0: and w10, w10, #0x1
6407 ; -O0: ands w10, w10, #0x1
6408 ; -O0: csel w8, w9, w8, ne
6409 ; -O0: bl __atomic_compare_exchange
6411 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
6413 ; -O1: csel w8, w0, w20, ls
6414 ; -O1: bl __atomic_compare_exchange
6415 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
6419 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6420 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6421 ; -O0: subs w10, w9, w8
6422 ; -O0: and w10, w10, #0x1
6423 ; -O0: ands w10, w10, #0x1
6424 ; -O0: csel w8, w9, w8, ne
6425 ; -O0: bl __atomic_compare_exchange
6427 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6429 ; -O1: csel w8, w0, w20, ls
6430 ; -O1: bl __atomic_compare_exchange
6431 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
6435 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6436 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6437 ; -O0: subs w10, w9, w8
6438 ; -O0: and w10, w10, #0x1
6439 ; -O0: ands w10, w10, #0x1
6440 ; -O0: csel w8, w9, w8, ne
6441 ; -O0: bl __atomic_compare_exchange
6443 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6445 ; -O1: csel w8, w0, w20, ls
6446 ; -O1: bl __atomic_compare_exchange
6447 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
6451 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6452 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6453 ; -O0: subs x10, x9, x8
6454 ; -O0: and w10, w10, #0x1
6455 ; -O0: ands w10, w10, #0x1
6456 ; -O0: csel x8, x9, x8, ne
6457 ; -O0: bl __atomic_compare_exchange
6459 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6461 ; -O1: csel x8, x0, x20, ls
6462 ; -O1: bl __atomic_compare_exchange
6463 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
6467 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6468 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6469 ; -O0: subs x10, x9, x8
6470 ; -O0: and w10, w10, #0x1
6471 ; -O0: ands w10, w10, #0x1
6472 ; -O0: csel x8, x9, x8, ne
6473 ; -O0: bl __atomic_compare_exchange
6475 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6477 ; -O1: csel x8, x0, x20, ls
6478 ; -O1: bl __atomic_compare_exchange
6479 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
6483 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
6484 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
6485 ; -O0: subs x10, x9, x8
6486 ; -O0: and w10, w10, #0x1
6487 ; -O0: ands w10, w10, #0x1
6488 ; -O0: csel x8, x9, x8, ne
6489 ; -O0: bl __atomic_compare_exchange
6491 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
6493 ; -O1: csel x8, x0, x20, ls
6494 ; -O1: bl __atomic_compare_exchange
6495 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
6499 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6500 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6501 ; -O0: subs x10, x9, x8
6502 ; -O0: and w10, w10, #0x1
6503 ; -O0: ands w10, w10, #0x1
6504 ; -O0: csel x8, x9, x8, ne
6505 ; -O0: bl __atomic_compare_exchange
6507 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6509 ; -O1: csel x8, x0, x20, ls
6510 ; -O1: bl __atomic_compare_exchange
6511 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
6515 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6516 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6517 ; -O0: subs x10, x9, x8
6518 ; -O0: and w10, w10, #0x1
6519 ; -O0: ands w10, w10, #0x1
6520 ; -O0: csel x8, x9, x8, ne
6521 ; -O0: bl __atomic_compare_exchange
6523 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6525 ; -O1: csel x8, x0, x20, ls
6526 ; -O1: bl __atomic_compare_exchange
6527 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
6531 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6532 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6533 ; -O0: subs x8, x8, x10
6534 ; -O0: subs x8, x8, x10
6535 ; -O0: subs x8, x8, x11
6536 ; -O0: and w12, w12, #0x1
6537 ; -O0: ands w12, w12, #0x1
6538 ; -O0: csel w8, w8, w9, ne
6539 ; -O0: and w12, w8, #0x1
6540 ; -O0: ands w12, w12, #0x1
6541 ; -O0: csel x9, x9, x11, ne
6542 ; -O0: and w11, w8, #0x1
6543 ; -O0: ands w11, w11, #0x1
6544 ; -O0: csel x8, x8, x10, ne
6545 ; -O0: bl __atomic_compare_exchange
6547 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6548 ; -O1: ldp x0, x1, [x0]
6550 ; -O1: csel x8, x1, x19, hs
6551 ; -O1: csel x9, x0, x21, hs
6552 ; -O1: bl __atomic_compare_exchange
6553 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
6557 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6558 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6559 ; -O0: subs x8, x8, x10
6560 ; -O0: subs x8, x8, x10
6561 ; -O0: subs x8, x8, x11
6562 ; -O0: and w12, w12, #0x1
6563 ; -O0: ands w12, w12, #0x1
6564 ; -O0: csel w8, w8, w9, ne
6565 ; -O0: and w12, w8, #0x1
6566 ; -O0: ands w12, w12, #0x1
6567 ; -O0: csel x9, x9, x11, ne
6568 ; -O0: and w11, w8, #0x1
6569 ; -O0: ands w11, w11, #0x1
6570 ; -O0: csel x8, x8, x10, ne
6571 ; -O0: bl __atomic_compare_exchange
6573 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6574 ; -O1: ldp x0, x1, [x0]
6576 ; -O1: csel x8, x1, x19, hs
6577 ; -O1: csel x9, x0, x21, hs
6578 ; -O1: bl __atomic_compare_exchange
6579 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
6583 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
6584 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
6585 ; -O0: subs x8, x8, x10
6586 ; -O0: subs x8, x8, x10
6587 ; -O0: subs x8, x8, x11
6588 ; -O0: and w12, w12, #0x1
6589 ; -O0: ands w12, w12, #0x1
6590 ; -O0: csel w8, w8, w9, ne
6591 ; -O0: and w12, w8, #0x1
6592 ; -O0: ands w12, w12, #0x1
6593 ; -O0: csel x9, x9, x11, ne
6594 ; -O0: and w11, w8, #0x1
6595 ; -O0: ands w11, w11, #0x1
6596 ; -O0: csel x8, x8, x10, ne
6597 ; -O0: bl __atomic_compare_exchange
6599 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
6600 ; -O1: ldp x0, x1, [x0]
6602 ; -O1: csel x8, x1, x19, hs
6603 ; -O1: csel x9, x0, x21, hs
6604 ; -O1: bl __atomic_compare_exchange
6605 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
6609 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6610 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6611 ; -O0: subs x8, x8, x10
6612 ; -O0: subs x8, x8, x10
6613 ; -O0: subs x8, x8, x11
6614 ; -O0: and w12, w12, #0x1
6615 ; -O0: ands w12, w12, #0x1
6616 ; -O0: csel w8, w8, w9, ne
6617 ; -O0: and w12, w8, #0x1
6618 ; -O0: ands w12, w12, #0x1
6619 ; -O0: csel x9, x9, x11, ne
6620 ; -O0: and w11, w8, #0x1
6621 ; -O0: ands w11, w11, #0x1
6622 ; -O0: csel x8, x8, x10, ne
6623 ; -O0: bl __atomic_compare_exchange
6625 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6626 ; -O1: ldp x0, x1, [x0]
6628 ; -O1: csel x8, x1, x19, hs
6629 ; -O1: csel x9, x0, x21, hs
6630 ; -O1: bl __atomic_compare_exchange
6631 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
6635 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6636 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6637 ; -O0: subs x8, x8, x10
6638 ; -O0: subs x8, x8, x10
6639 ; -O0: subs x8, x8, x11
6640 ; -O0: and w12, w12, #0x1
6641 ; -O0: ands w12, w12, #0x1
6642 ; -O0: csel w8, w8, w9, ne
6643 ; -O0: and w12, w8, #0x1
6644 ; -O0: ands w12, w12, #0x1
6645 ; -O0: csel x9, x9, x11, ne
6646 ; -O0: and w11, w8, #0x1
6647 ; -O0: ands w11, w11, #0x1
6648 ; -O0: csel x8, x8, x10, ne
6649 ; -O0: bl __atomic_compare_exchange
6651 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6652 ; -O1: ldp x0, x1, [x0]
6654 ; -O1: csel x8, x1, x19, hs
6655 ; -O1: csel x9, x0, x21, hs
6656 ; -O1: bl __atomic_compare_exchange
6657 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1