1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+lse2,+lse128 -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -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 x9, x10, x9
514 ; -O0: casp x0, x1, x2, x3, [x8]
515 ; -O0: subs x11, x9, x11
516 ; -O0: ccmp x8, x10, #0, eq
518 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
519 ; -O1: ldp x4, x5, [x0]
520 ; -O1: adds x9, x7, x3
521 ; -O1: casp x4, x5, x8, x9, [x0]
523 ; -O1: ccmp x5, x7, #0, eq
524 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
528 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
529 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
530 ; -O0: adds x9, x10, x9
531 ; -O0: caspa x0, x1, x2, x3, [x8]
532 ; -O0: subs x11, x9, x11
533 ; -O0: ccmp x8, x10, #0, eq
535 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
536 ; -O1: ldp x4, x5, [x0]
537 ; -O1: adds x9, x7, x3
538 ; -O1: caspa x4, x5, x8, x9, [x0]
540 ; -O1: ccmp x5, x7, #0, eq
541 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
545 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
546 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
547 ; -O0: adds x9, x10, x9
548 ; -O0: caspl x0, x1, x2, x3, [x8]
549 ; -O0: subs x11, x9, x11
550 ; -O0: ccmp x8, x10, #0, eq
552 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
553 ; -O1: ldp x4, x5, [x0]
554 ; -O1: adds x9, x7, x3
555 ; -O1: caspl x4, x5, x8, x9, [x0]
557 ; -O1: ccmp x5, x7, #0, eq
558 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
562 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
563 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
564 ; -O0: adds x9, x10, x9
565 ; -O0: caspal x0, x1, x2, x3, [x8]
566 ; -O0: subs x11, x9, x11
567 ; -O0: ccmp x8, x10, #0, eq
569 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
570 ; -O1: ldp x4, x5, [x0]
571 ; -O1: adds x9, x7, x3
572 ; -O1: caspal x4, x5, x8, x9, [x0]
574 ; -O1: ccmp x5, x7, #0, eq
575 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
579 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
580 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
581 ; -O0: adds x9, x10, x9
582 ; -O0: caspal x0, x1, x2, x3, [x8]
583 ; -O0: subs x11, x9, x11
584 ; -O0: ccmp x8, x10, #0, eq
586 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
587 ; -O1: ldp x4, x5, [x0]
588 ; -O1: adds x9, x7, x3
589 ; -O1: caspal x4, x5, x8, x9, [x0]
591 ; -O1: ccmp x5, x7, #0, eq
592 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
596 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
597 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
598 ; CHECK: ldaddb w1, w0, [x0]
599 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
603 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
604 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
605 ; CHECK: ldaddab w1, w0, [x0]
606 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
610 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
611 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
612 ; CHECK: ldaddlb w1, w0, [x0]
613 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
617 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
618 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
619 ; CHECK: ldaddalb w1, w0, [x0]
620 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
624 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
625 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
626 ; CHECK: ldaddalb w1, w0, [x0]
627 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
631 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
632 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
633 ; -O0: add w8, w9, w8
634 ; -O0: bl __atomic_compare_exchange
636 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
637 ; -O1: add w8, w0, w20
638 ; -O1: bl __atomic_compare_exchange
639 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
643 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
644 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
645 ; -O0: add w8, w9, w8
646 ; -O0: bl __atomic_compare_exchange
648 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
649 ; -O1: add w8, w0, w20
650 ; -O1: bl __atomic_compare_exchange
651 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
655 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
656 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
657 ; -O0: add w8, w9, w8
658 ; -O0: bl __atomic_compare_exchange
660 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
661 ; -O1: add w8, w0, w20
662 ; -O1: bl __atomic_compare_exchange
663 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
667 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
668 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
669 ; -O0: add w8, w9, w8
670 ; -O0: bl __atomic_compare_exchange
672 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
673 ; -O1: add w8, w0, w20
674 ; -O1: bl __atomic_compare_exchange
675 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
679 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
680 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
681 ; -O0: add w8, w9, w8
682 ; -O0: bl __atomic_compare_exchange
684 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
685 ; -O1: add w8, w0, w20
686 ; -O1: bl __atomic_compare_exchange
687 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
691 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
692 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
693 ; -O0: add w8, w9, w8
694 ; -O0: bl __atomic_compare_exchange
696 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
697 ; -O1: add w8, w0, w20
698 ; -O1: bl __atomic_compare_exchange
699 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
703 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
704 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
705 ; -O0: add w8, w9, w8
706 ; -O0: bl __atomic_compare_exchange
708 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
709 ; -O1: add w8, w0, w20
710 ; -O1: bl __atomic_compare_exchange
711 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
715 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
716 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
717 ; -O0: add w8, w9, w8
718 ; -O0: bl __atomic_compare_exchange
720 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
721 ; -O1: add w8, w0, w20
722 ; -O1: bl __atomic_compare_exchange
723 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
727 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
728 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
729 ; -O0: add w8, w9, w8
730 ; -O0: bl __atomic_compare_exchange
732 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
733 ; -O1: add w8, w0, w20
734 ; -O1: bl __atomic_compare_exchange
735 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
739 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
740 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
741 ; -O0: add w8, w9, w8
742 ; -O0: bl __atomic_compare_exchange
744 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
745 ; -O1: add w8, w0, w20
746 ; -O1: bl __atomic_compare_exchange
747 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
751 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
752 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
753 ; -O0: add x8, x9, x8
754 ; -O0: bl __atomic_compare_exchange
756 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
757 ; -O1: add x8, x0, x20
758 ; -O1: bl __atomic_compare_exchange
759 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
763 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
764 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
765 ; -O0: add x8, x9, x8
766 ; -O0: bl __atomic_compare_exchange
768 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
769 ; -O1: add x8, x0, x20
770 ; -O1: bl __atomic_compare_exchange
771 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
775 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
776 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
777 ; -O0: add x8, x9, x8
778 ; -O0: bl __atomic_compare_exchange
780 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
781 ; -O1: add x8, x0, x20
782 ; -O1: bl __atomic_compare_exchange
783 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
787 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
788 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
789 ; -O0: add x8, x9, x8
790 ; -O0: bl __atomic_compare_exchange
792 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
793 ; -O1: add x8, x0, x20
794 ; -O1: bl __atomic_compare_exchange
795 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
799 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
800 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
801 ; -O0: add x8, x9, x8
802 ; -O0: bl __atomic_compare_exchange
804 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
805 ; -O1: add x8, x0, x20
806 ; -O1: bl __atomic_compare_exchange
807 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
811 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
812 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
813 ; -O0: adds x9, x10, x9
814 ; -O0: bl __atomic_compare_exchange
816 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
817 ; -O1: ldp x0, x1, [x0]
818 ; -O1: adds x8, x1, x19
819 ; -O1: bl __atomic_compare_exchange
820 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
824 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
825 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
826 ; -O0: adds x9, x10, x9
827 ; -O0: bl __atomic_compare_exchange
829 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
830 ; -O1: ldp x0, x1, [x0]
831 ; -O1: adds x8, x1, x19
832 ; -O1: bl __atomic_compare_exchange
833 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
837 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
838 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
839 ; -O0: adds x9, x10, x9
840 ; -O0: bl __atomic_compare_exchange
842 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
843 ; -O1: ldp x0, x1, [x0]
844 ; -O1: adds x8, x1, x19
845 ; -O1: bl __atomic_compare_exchange
846 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
850 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
851 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
852 ; -O0: adds x9, x10, x9
853 ; -O0: bl __atomic_compare_exchange
855 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
856 ; -O1: ldp x0, x1, [x0]
857 ; -O1: adds x8, x1, x19
858 ; -O1: bl __atomic_compare_exchange
859 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
863 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
864 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
865 ; -O0: adds x9, x10, x9
866 ; -O0: bl __atomic_compare_exchange
868 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
869 ; -O1: ldp x0, x1, [x0]
870 ; -O1: adds x8, x1, x19
871 ; -O1: bl __atomic_compare_exchange
872 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
876 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
877 ; -O0-LABEL: atomicrmw_sub_i8_aligned_monotonic:
878 ; -O0: subs w8, w8, w1
879 ; -O0: ldaddb w8, w0, [x0]
881 ; -O1-LABEL: atomicrmw_sub_i8_aligned_monotonic:
882 ; -O1: ldaddb w8, w0, [x0]
883 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
887 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
888 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acquire:
889 ; -O0: subs w8, w8, w1
890 ; -O0: ldaddab w8, w0, [x0]
892 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acquire:
893 ; -O1: ldaddab w8, w0, [x0]
894 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
898 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
899 ; -O0-LABEL: atomicrmw_sub_i8_aligned_release:
900 ; -O0: subs w8, w8, w1
901 ; -O0: ldaddlb w8, w0, [x0]
903 ; -O1-LABEL: atomicrmw_sub_i8_aligned_release:
904 ; -O1: ldaddlb w8, w0, [x0]
905 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
909 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
910 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
911 ; -O0: subs w8, w8, w1
912 ; -O0: ldaddalb w8, w0, [x0]
914 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
915 ; -O1: ldaddalb w8, w0, [x0]
916 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
920 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
921 ; -O0-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
922 ; -O0: subs w8, w8, w1
923 ; -O0: ldaddalb w8, w0, [x0]
925 ; -O1-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
926 ; -O1: ldaddalb w8, w0, [x0]
927 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
931 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
932 ; -O0-LABEL: atomicrmw_sub_i16_aligned_monotonic:
933 ; -O0: subs w8, w8, w1
934 ; -O0: ldaddh w8, w0, [x0]
936 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
937 ; -O1: ldaddh w8, w0, [x0]
938 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
942 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
943 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
944 ; -O0: subs w8, w8, w1
945 ; -O0: ldaddah w8, w0, [x0]
947 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
948 ; -O1: ldaddah w8, w0, [x0]
949 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
953 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
954 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
955 ; -O0: subs w8, w8, w1
956 ; -O0: ldaddlh w8, w0, [x0]
958 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
959 ; -O1: ldaddlh w8, w0, [x0]
960 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
964 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
965 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
966 ; -O0: subs w8, w8, w1
967 ; -O0: ldaddalh w8, w0, [x0]
969 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
970 ; -O1: ldaddalh w8, w0, [x0]
971 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
975 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
976 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
977 ; -O0: subs w8, w8, w1
978 ; -O0: ldaddalh w8, w0, [x0]
980 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
981 ; -O1: ldaddalh w8, w0, [x0]
982 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
986 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
987 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
988 ; -O0: subs w8, w8, w1
989 ; -O0: ldadd w8, w0, [x0]
991 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
992 ; -O1: ldadd w8, w0, [x0]
993 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
997 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
998 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
999 ; -O0: subs w8, w8, w1
1000 ; -O0: ldadda w8, w0, [x0]
1002 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1003 ; -O1: ldadda w8, w0, [x0]
1004 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1008 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1009 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1010 ; -O0: subs w8, w8, w1
1011 ; -O0: ldaddl w8, w0, [x0]
1013 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1014 ; -O1: ldaddl w8, w0, [x0]
1015 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1019 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1020 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1021 ; -O0: subs w8, w8, w1
1022 ; -O0: ldaddal w8, w0, [x0]
1024 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1025 ; -O1: ldaddal w8, w0, [x0]
1026 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1030 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1031 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1032 ; -O0: subs w8, w8, w1
1033 ; -O0: ldaddal w8, w0, [x0]
1035 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1036 ; -O1: ldaddal w8, w0, [x0]
1037 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1041 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1042 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1043 ; -O0: subs x8, x8, x1
1044 ; -O0: ldadd x8, x0, [x0]
1046 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1047 ; -O1: ldadd x8, x0, [x0]
1048 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1052 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1053 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1054 ; -O0: subs x8, x8, x1
1055 ; -O0: ldadda x8, x0, [x0]
1057 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1058 ; -O1: ldadda x8, x0, [x0]
1059 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1063 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1064 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1065 ; -O0: subs x8, x8, x1
1066 ; -O0: ldaddl x8, x0, [x0]
1068 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1069 ; -O1: ldaddl x8, x0, [x0]
1070 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1074 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1075 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1076 ; -O0: subs x8, x8, x1
1077 ; -O0: ldaddal x8, x0, [x0]
1079 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1080 ; -O1: ldaddal x8, x0, [x0]
1081 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1085 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1086 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1087 ; -O0: subs x8, x8, x1
1088 ; -O0: ldaddal x8, x0, [x0]
1090 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1091 ; -O1: ldaddal x8, x0, [x0]
1092 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1096 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1097 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1098 ; -O0: subs x9, x10, x9
1099 ; -O0: casp x0, x1, x2, x3, [x8]
1100 ; -O0: subs x11, x9, x11
1101 ; -O0: ccmp x8, x10, #0, eq
1103 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1104 ; -O1: ldp x4, x5, [x0]
1105 ; -O1: subs x9, x7, x3
1106 ; -O1: casp x4, x5, x8, x9, [x0]
1108 ; -O1: ccmp x5, x7, #0, eq
1109 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1113 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1114 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1115 ; -O0: subs x9, x10, x9
1116 ; -O0: caspa x0, x1, x2, x3, [x8]
1117 ; -O0: subs x11, x9, x11
1118 ; -O0: ccmp x8, x10, #0, eq
1120 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1121 ; -O1: ldp x4, x5, [x0]
1122 ; -O1: subs x9, x7, x3
1123 ; -O1: caspa x4, x5, x8, x9, [x0]
1125 ; -O1: ccmp x5, x7, #0, eq
1126 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1130 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1131 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1132 ; -O0: subs x9, x10, x9
1133 ; -O0: caspl x0, x1, x2, x3, [x8]
1134 ; -O0: subs x11, x9, x11
1135 ; -O0: ccmp x8, x10, #0, eq
1137 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1138 ; -O1: ldp x4, x5, [x0]
1139 ; -O1: subs x9, x7, x3
1140 ; -O1: caspl x4, x5, x8, x9, [x0]
1142 ; -O1: ccmp x5, x7, #0, eq
1143 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1147 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1148 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1149 ; -O0: subs x9, x10, x9
1150 ; -O0: caspal x0, x1, x2, x3, [x8]
1151 ; -O0: subs x11, x9, x11
1152 ; -O0: ccmp x8, x10, #0, eq
1154 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1155 ; -O1: ldp x4, x5, [x0]
1156 ; -O1: subs x9, x7, x3
1157 ; -O1: caspal x4, x5, x8, x9, [x0]
1159 ; -O1: ccmp x5, x7, #0, eq
1160 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1164 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1165 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1166 ; -O0: subs x9, x10, x9
1167 ; -O0: caspal x0, x1, x2, x3, [x8]
1168 ; -O0: subs x11, x9, x11
1169 ; -O0: ccmp x8, x10, #0, eq
1171 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1172 ; -O1: ldp x4, x5, [x0]
1173 ; -O1: subs x9, x7, x3
1174 ; -O1: caspal x4, x5, x8, x9, [x0]
1176 ; -O1: ccmp x5, x7, #0, eq
1177 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1181 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1182 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1183 ; -O0: subs w8, w8, w1
1184 ; -O0: ldaddb w8, w0, [x0]
1186 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1187 ; -O1: ldaddb w8, w0, [x0]
1188 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1192 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1193 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1194 ; -O0: subs w8, w8, w1
1195 ; -O0: ldaddab w8, w0, [x0]
1197 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1198 ; -O1: ldaddab w8, w0, [x0]
1199 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1203 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1204 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1205 ; -O0: subs w8, w8, w1
1206 ; -O0: ldaddlb w8, w0, [x0]
1208 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1209 ; -O1: ldaddlb w8, w0, [x0]
1210 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1214 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1215 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1216 ; -O0: subs w8, w8, w1
1217 ; -O0: ldaddalb w8, w0, [x0]
1219 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1220 ; -O1: ldaddalb w8, w0, [x0]
1221 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1225 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1226 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1227 ; -O0: subs w8, w8, w1
1228 ; -O0: ldaddalb w8, w0, [x0]
1230 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1231 ; -O1: ldaddalb w8, w0, [x0]
1232 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1236 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1237 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1238 ; -O0: subs w8, w9, w8
1239 ; -O0: bl __atomic_compare_exchange
1241 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1242 ; -O1: sub w8, w0, w20
1243 ; -O1: bl __atomic_compare_exchange
1244 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1248 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1249 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1250 ; -O0: subs w8, w9, w8
1251 ; -O0: bl __atomic_compare_exchange
1253 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1254 ; -O1: sub w8, w0, w20
1255 ; -O1: bl __atomic_compare_exchange
1256 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1260 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1261 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1262 ; -O0: subs w8, w9, w8
1263 ; -O0: bl __atomic_compare_exchange
1265 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1266 ; -O1: sub w8, w0, w20
1267 ; -O1: bl __atomic_compare_exchange
1268 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1272 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1273 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1274 ; -O0: subs w8, w9, w8
1275 ; -O0: bl __atomic_compare_exchange
1277 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1278 ; -O1: sub w8, w0, w20
1279 ; -O1: bl __atomic_compare_exchange
1280 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1284 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1285 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1286 ; -O0: subs w8, w9, w8
1287 ; -O0: bl __atomic_compare_exchange
1289 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1290 ; -O1: sub w8, w0, w20
1291 ; -O1: bl __atomic_compare_exchange
1292 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1296 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1297 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1298 ; -O0: subs w8, w9, w8
1299 ; -O0: bl __atomic_compare_exchange
1301 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1302 ; -O1: sub w8, w0, w20
1303 ; -O1: bl __atomic_compare_exchange
1304 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1308 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1309 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1310 ; -O0: subs w8, w9, w8
1311 ; -O0: bl __atomic_compare_exchange
1313 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1314 ; -O1: sub w8, w0, w20
1315 ; -O1: bl __atomic_compare_exchange
1316 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1320 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1321 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1322 ; -O0: subs w8, w9, w8
1323 ; -O0: bl __atomic_compare_exchange
1325 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1326 ; -O1: sub w8, w0, w20
1327 ; -O1: bl __atomic_compare_exchange
1328 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1332 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1333 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1334 ; -O0: subs w8, w9, w8
1335 ; -O0: bl __atomic_compare_exchange
1337 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1338 ; -O1: sub w8, w0, w20
1339 ; -O1: bl __atomic_compare_exchange
1340 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1344 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1345 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1346 ; -O0: subs w8, w9, w8
1347 ; -O0: bl __atomic_compare_exchange
1349 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1350 ; -O1: sub w8, w0, w20
1351 ; -O1: bl __atomic_compare_exchange
1352 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1356 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1357 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1358 ; -O0: subs x8, x9, x8
1359 ; -O0: bl __atomic_compare_exchange
1361 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1362 ; -O1: sub x8, x0, x20
1363 ; -O1: bl __atomic_compare_exchange
1364 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1368 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1369 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1370 ; -O0: subs x8, x9, x8
1371 ; -O0: bl __atomic_compare_exchange
1373 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1374 ; -O1: sub x8, x0, x20
1375 ; -O1: bl __atomic_compare_exchange
1376 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1380 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1381 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1382 ; -O0: subs x8, x9, x8
1383 ; -O0: bl __atomic_compare_exchange
1385 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1386 ; -O1: sub x8, x0, x20
1387 ; -O1: bl __atomic_compare_exchange
1388 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1392 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1393 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1394 ; -O0: subs x8, x9, x8
1395 ; -O0: bl __atomic_compare_exchange
1397 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1398 ; -O1: sub x8, x0, x20
1399 ; -O1: bl __atomic_compare_exchange
1400 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1404 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1405 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1406 ; -O0: subs x8, x9, x8
1407 ; -O0: bl __atomic_compare_exchange
1409 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1410 ; -O1: sub x8, x0, x20
1411 ; -O1: bl __atomic_compare_exchange
1412 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1416 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1417 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1418 ; -O0: subs x9, x10, x9
1419 ; -O0: bl __atomic_compare_exchange
1421 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1422 ; -O1: ldp x0, x1, [x0]
1423 ; -O1: subs x8, x1, x19
1424 ; -O1: bl __atomic_compare_exchange
1425 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1429 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1430 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1431 ; -O0: subs x9, x10, x9
1432 ; -O0: bl __atomic_compare_exchange
1434 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1435 ; -O1: ldp x0, x1, [x0]
1436 ; -O1: subs x8, x1, x19
1437 ; -O1: bl __atomic_compare_exchange
1438 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1442 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1443 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1444 ; -O0: subs x9, x10, x9
1445 ; -O0: bl __atomic_compare_exchange
1447 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1448 ; -O1: ldp x0, x1, [x0]
1449 ; -O1: subs x8, x1, x19
1450 ; -O1: bl __atomic_compare_exchange
1451 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1455 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1456 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1457 ; -O0: subs x9, x10, x9
1458 ; -O0: bl __atomic_compare_exchange
1460 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1461 ; -O1: ldp x0, x1, [x0]
1462 ; -O1: subs x8, x1, x19
1463 ; -O1: bl __atomic_compare_exchange
1464 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1468 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1469 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1470 ; -O0: subs x9, x10, x9
1471 ; -O0: bl __atomic_compare_exchange
1473 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1474 ; -O1: ldp x0, x1, [x0]
1475 ; -O1: subs x8, x1, x19
1476 ; -O1: bl __atomic_compare_exchange
1477 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1481 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1482 ; CHECK-LABEL: atomicrmw_and_i8_aligned_monotonic:
1484 ; CHECK: ldclrb w8, w0, [x0]
1485 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1489 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1490 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acquire:
1492 ; CHECK: ldclrab w8, w0, [x0]
1493 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1497 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1498 ; CHECK-LABEL: atomicrmw_and_i8_aligned_release:
1500 ; CHECK: ldclrlb w8, w0, [x0]
1501 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1505 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1506 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1508 ; CHECK: ldclralb w8, w0, [x0]
1509 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1513 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1514 ; CHECK-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1516 ; CHECK: ldclralb w8, w0, [x0]
1517 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1521 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1522 ; CHECK-LABEL: atomicrmw_and_i16_aligned_monotonic:
1524 ; CHECK: ldclrh w8, w0, [x0]
1525 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1529 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1530 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acquire:
1532 ; CHECK: ldclrah w8, w0, [x0]
1533 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1537 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1538 ; CHECK-LABEL: atomicrmw_and_i16_aligned_release:
1540 ; CHECK: ldclrlh w8, w0, [x0]
1541 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1545 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1546 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1548 ; CHECK: ldclralh w8, w0, [x0]
1549 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1553 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1554 ; CHECK-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1556 ; CHECK: ldclralh w8, w0, [x0]
1557 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1561 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1562 ; CHECK-LABEL: atomicrmw_and_i32_aligned_monotonic:
1564 ; CHECK: ldclr w8, w0, [x0]
1565 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1569 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1570 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acquire:
1572 ; CHECK: ldclra w8, w0, [x0]
1573 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1577 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1578 ; CHECK-LABEL: atomicrmw_and_i32_aligned_release:
1580 ; CHECK: ldclrl w8, w0, [x0]
1581 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1585 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1586 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1588 ; CHECK: ldclral w8, w0, [x0]
1589 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1593 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1594 ; CHECK-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1596 ; CHECK: ldclral w8, w0, [x0]
1597 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1601 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1602 ; CHECK-LABEL: atomicrmw_and_i64_aligned_monotonic:
1604 ; CHECK: ldclr x8, x0, [x0]
1605 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1609 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1610 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acquire:
1612 ; CHECK: ldclra x8, x0, [x0]
1613 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1617 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1618 ; CHECK-LABEL: atomicrmw_and_i64_aligned_release:
1620 ; CHECK: ldclrl x8, x0, [x0]
1621 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1625 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1626 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1628 ; CHECK: ldclral x8, x0, [x0]
1629 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1633 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1634 ; CHECK-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1636 ; CHECK: ldclral x8, x0, [x0]
1637 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1641 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1642 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1645 ; -O0: ldclrp x0, x1, [x8]
1647 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1650 ; -O1: ldclrp x8, x1, [x0]
1651 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1655 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1656 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1659 ; -O0: ldclrpa x0, x1, [x8]
1661 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1664 ; -O1: ldclrpa x8, x1, [x0]
1665 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1669 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1670 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1673 ; -O0: ldclrpl x0, x1, [x8]
1675 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1678 ; -O1: ldclrpl x8, x1, [x0]
1679 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1683 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1684 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1687 ; -O0: ldclrpal x0, x1, [x8]
1689 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1692 ; -O1: ldclrpal x8, x1, [x0]
1693 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1697 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1698 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1701 ; -O0: ldclrpal x0, x1, [x8]
1703 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1706 ; -O1: ldclrpal x8, x1, [x0]
1707 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1711 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1712 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1714 ; CHECK: ldclrb w8, w0, [x0]
1715 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1719 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1720 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acquire:
1722 ; CHECK: ldclrab w8, w0, [x0]
1723 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1727 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1728 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_release:
1730 ; CHECK: ldclrlb w8, w0, [x0]
1731 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1735 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1736 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1738 ; CHECK: ldclralb w8, w0, [x0]
1739 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1743 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1744 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1746 ; CHECK: ldclralb w8, w0, [x0]
1747 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1751 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1752 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1753 ; -O0: and w8, w9, w8
1754 ; -O0: bl __atomic_compare_exchange
1756 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1757 ; -O1: and w8, w0, w20
1758 ; -O1: bl __atomic_compare_exchange
1759 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1763 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1764 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1765 ; -O0: and w8, w9, w8
1766 ; -O0: bl __atomic_compare_exchange
1768 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1769 ; -O1: and w8, w0, w20
1770 ; -O1: bl __atomic_compare_exchange
1771 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1775 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1776 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1777 ; -O0: and w8, w9, w8
1778 ; -O0: bl __atomic_compare_exchange
1780 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1781 ; -O1: and w8, w0, w20
1782 ; -O1: bl __atomic_compare_exchange
1783 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1787 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1788 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1789 ; -O0: and w8, w9, w8
1790 ; -O0: bl __atomic_compare_exchange
1792 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1793 ; -O1: and w8, w0, w20
1794 ; -O1: bl __atomic_compare_exchange
1795 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1799 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1800 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1801 ; -O0: and w8, w9, w8
1802 ; -O0: bl __atomic_compare_exchange
1804 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1805 ; -O1: and w8, w0, w20
1806 ; -O1: bl __atomic_compare_exchange
1807 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1811 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1812 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1813 ; -O0: and w8, w9, w8
1814 ; -O0: bl __atomic_compare_exchange
1816 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1817 ; -O1: and w8, w0, w20
1818 ; -O1: bl __atomic_compare_exchange
1819 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1823 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1824 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1825 ; -O0: and w8, w9, w8
1826 ; -O0: bl __atomic_compare_exchange
1828 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1829 ; -O1: and w8, w0, w20
1830 ; -O1: bl __atomic_compare_exchange
1831 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1835 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1836 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1837 ; -O0: and w8, w9, w8
1838 ; -O0: bl __atomic_compare_exchange
1840 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
1841 ; -O1: and w8, w0, w20
1842 ; -O1: bl __atomic_compare_exchange
1843 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
1847 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1848 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1849 ; -O0: and w8, w9, w8
1850 ; -O0: bl __atomic_compare_exchange
1852 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1853 ; -O1: and w8, w0, w20
1854 ; -O1: bl __atomic_compare_exchange
1855 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
1859 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1860 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1861 ; -O0: and w8, w9, w8
1862 ; -O0: bl __atomic_compare_exchange
1864 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1865 ; -O1: and w8, w0, w20
1866 ; -O1: bl __atomic_compare_exchange
1867 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
1871 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1872 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1873 ; -O0: and x8, x9, x8
1874 ; -O0: bl __atomic_compare_exchange
1876 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1877 ; -O1: and x8, x0, x20
1878 ; -O1: bl __atomic_compare_exchange
1879 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
1883 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1884 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
1885 ; -O0: and x8, x9, x8
1886 ; -O0: bl __atomic_compare_exchange
1888 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
1889 ; -O1: and x8, x0, x20
1890 ; -O1: bl __atomic_compare_exchange
1891 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
1895 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
1896 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
1897 ; -O0: and x8, x9, x8
1898 ; -O0: bl __atomic_compare_exchange
1900 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
1901 ; -O1: and x8, x0, x20
1902 ; -O1: bl __atomic_compare_exchange
1903 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
1907 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1908 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1909 ; -O0: and x8, x9, x8
1910 ; -O0: bl __atomic_compare_exchange
1912 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1913 ; -O1: and x8, x0, x20
1914 ; -O1: bl __atomic_compare_exchange
1915 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
1919 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1920 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1921 ; -O0: and x8, x9, x8
1922 ; -O0: bl __atomic_compare_exchange
1924 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1925 ; -O1: and x8, x0, x20
1926 ; -O1: bl __atomic_compare_exchange
1927 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
1931 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1932 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1933 ; -O0: and x8, x11, x8
1934 ; -O0: and x9, x10, x9
1935 ; -O0: bl __atomic_compare_exchange
1937 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1938 ; -O1: ldp x0, x1, [x0]
1939 ; -O1: and x8, x1, x19
1940 ; -O1: and x9, x0, x21
1941 ; -O1: bl __atomic_compare_exchange
1942 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
1946 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1947 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
1948 ; -O0: and x8, x11, x8
1949 ; -O0: and x9, x10, x9
1950 ; -O0: bl __atomic_compare_exchange
1952 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
1953 ; -O1: ldp x0, x1, [x0]
1954 ; -O1: and x8, x1, x19
1955 ; -O1: and x9, x0, x21
1956 ; -O1: bl __atomic_compare_exchange
1957 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
1961 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
1962 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
1963 ; -O0: and x8, x11, x8
1964 ; -O0: and x9, x10, x9
1965 ; -O0: bl __atomic_compare_exchange
1967 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
1968 ; -O1: ldp x0, x1, [x0]
1969 ; -O1: and x8, x1, x19
1970 ; -O1: and x9, x0, x21
1971 ; -O1: bl __atomic_compare_exchange
1972 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
1976 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1977 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1978 ; -O0: and x8, x11, x8
1979 ; -O0: and x9, x10, x9
1980 ; -O0: bl __atomic_compare_exchange
1982 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1983 ; -O1: ldp x0, x1, [x0]
1984 ; -O1: and x8, x1, x19
1985 ; -O1: and x9, x0, x21
1986 ; -O1: bl __atomic_compare_exchange
1987 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
1991 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1992 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1993 ; -O0: and x8, x11, x8
1994 ; -O0: and x9, x10, x9
1995 ; -O0: bl __atomic_compare_exchange
1997 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1998 ; -O1: ldp x0, x1, [x0]
1999 ; -O1: and x8, x1, x19
2000 ; -O1: and x9, x0, x21
2001 ; -O1: bl __atomic_compare_exchange
2002 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2006 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2007 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2008 ; -O0: and w8, w9, w8
2010 ; -O0: casb w8, w10, [x11]
2011 ; -O0: subs w9, w8, w9, uxtb
2012 ; -O0: subs w9, w9, #1
2014 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2015 ; -O1: and w10, w8, w1
2017 ; -O1: casb w9, w10, [x0]
2018 ; -O1: cmp w9, w8, uxtb
2019 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2023 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2024 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2025 ; -O0: and w8, w9, w8
2027 ; -O0: casab w8, w10, [x11]
2028 ; -O0: subs w9, w8, w9, uxtb
2029 ; -O0: subs w9, w9, #1
2031 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2032 ; -O1: and w10, w8, w1
2034 ; -O1: casab w9, w10, [x0]
2035 ; -O1: cmp w9, w8, uxtb
2036 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2040 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2041 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2042 ; -O0: and w8, w9, w8
2044 ; -O0: caslb w8, w10, [x11]
2045 ; -O0: subs w9, w8, w9, uxtb
2046 ; -O0: subs w9, w9, #1
2048 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2049 ; -O1: and w10, w8, w1
2051 ; -O1: caslb w9, w10, [x0]
2052 ; -O1: cmp w9, w8, uxtb
2053 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2057 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2058 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2059 ; -O0: and w8, w9, w8
2061 ; -O0: casalb w8, w10, [x11]
2062 ; -O0: subs w9, w8, w9, uxtb
2063 ; -O0: subs w9, w9, #1
2065 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2066 ; -O1: and w10, w8, w1
2068 ; -O1: casalb w9, w10, [x0]
2069 ; -O1: cmp w9, w8, uxtb
2070 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2074 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2075 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2076 ; -O0: and w8, w9, w8
2078 ; -O0: casalb w8, w10, [x11]
2079 ; -O0: subs w9, w8, w9, uxtb
2080 ; -O0: subs w9, w9, #1
2082 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2083 ; -O1: and w10, w8, w1
2085 ; -O1: casalb w9, w10, [x0]
2086 ; -O1: cmp w9, w8, uxtb
2087 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2091 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2092 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2093 ; -O0: and w8, w9, w8
2095 ; -O0: cash w8, w10, [x11]
2096 ; -O0: subs w9, w8, w9, uxth
2097 ; -O0: subs w9, w9, #1
2099 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2100 ; -O1: and w10, w8, w1
2102 ; -O1: cash w9, w10, [x0]
2103 ; -O1: cmp w9, w8, uxth
2104 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2108 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2109 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2110 ; -O0: and w8, w9, w8
2112 ; -O0: casah w8, w10, [x11]
2113 ; -O0: subs w9, w8, w9, uxth
2114 ; -O0: subs w9, w9, #1
2116 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2117 ; -O1: and w10, w8, w1
2119 ; -O1: casah w9, w10, [x0]
2120 ; -O1: cmp w9, w8, uxth
2121 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2125 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2126 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2127 ; -O0: and w8, w9, w8
2129 ; -O0: caslh w8, w10, [x11]
2130 ; -O0: subs w9, w8, w9, uxth
2131 ; -O0: subs w9, w9, #1
2133 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2134 ; -O1: and w10, w8, w1
2136 ; -O1: caslh w9, w10, [x0]
2137 ; -O1: cmp w9, w8, uxth
2138 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2142 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2143 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2144 ; -O0: and w8, w9, w8
2146 ; -O0: casalh w8, w10, [x11]
2147 ; -O0: subs w9, w8, w9, uxth
2148 ; -O0: subs w9, w9, #1
2150 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2151 ; -O1: and w10, w8, w1
2153 ; -O1: casalh w9, w10, [x0]
2154 ; -O1: cmp w9, w8, uxth
2155 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2159 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2160 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2161 ; -O0: and w8, w9, w8
2163 ; -O0: casalh w8, w10, [x11]
2164 ; -O0: subs w9, w8, w9, uxth
2165 ; -O0: subs w9, w9, #1
2167 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2168 ; -O1: and w10, w8, w1
2170 ; -O1: casalh w9, w10, [x0]
2171 ; -O1: cmp w9, w8, uxth
2172 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2176 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2177 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2178 ; -O0: and w8, w9, w8
2180 ; -O0: cas w8, w10, [x11]
2181 ; -O0: subs w9, w8, w9
2182 ; -O0: subs w9, w9, #1
2184 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2185 ; -O1: and w10, w8, w1
2187 ; -O1: cas w9, w10, [x0]
2189 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2193 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2194 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2195 ; -O0: and w8, w9, w8
2197 ; -O0: casa w8, w10, [x11]
2198 ; -O0: subs w9, w8, w9
2199 ; -O0: subs w9, w9, #1
2201 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2202 ; -O1: and w10, w8, w1
2204 ; -O1: casa w9, w10, [x0]
2206 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2210 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2211 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2212 ; -O0: and w8, w9, w8
2214 ; -O0: casl w8, w10, [x11]
2215 ; -O0: subs w9, w8, w9
2216 ; -O0: subs w9, w9, #1
2218 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2219 ; -O1: and w10, w8, w1
2221 ; -O1: casl w9, w10, [x0]
2223 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2227 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2228 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2229 ; -O0: and w8, w9, w8
2231 ; -O0: casal w8, w10, [x11]
2232 ; -O0: subs w9, w8, w9
2233 ; -O0: subs w9, w9, #1
2235 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2236 ; -O1: and w10, w8, w1
2238 ; -O1: casal w9, w10, [x0]
2240 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2244 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2245 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2246 ; -O0: and w8, w9, w8
2248 ; -O0: casal w8, w10, [x11]
2249 ; -O0: subs w9, w8, w9
2250 ; -O0: subs w9, w9, #1
2252 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2253 ; -O1: and w10, w8, w1
2255 ; -O1: casal w9, w10, [x0]
2257 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2261 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2262 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2263 ; -O0: and x8, x9, x8
2265 ; -O0: cas x8, x10, [x11]
2266 ; -O0: subs x9, x8, x9
2267 ; -O0: subs w9, w9, #1
2269 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2270 ; -O1: and x10, x8, x1
2272 ; -O1: cas x9, x10, [x0]
2274 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2278 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2279 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2280 ; -O0: and x8, x9, x8
2282 ; -O0: casa x8, x10, [x11]
2283 ; -O0: subs x9, x8, x9
2284 ; -O0: subs w9, w9, #1
2286 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2287 ; -O1: and x10, x8, x1
2289 ; -O1: casa x9, x10, [x0]
2291 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2295 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2296 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2297 ; -O0: and x8, x9, x8
2299 ; -O0: casl x8, x10, [x11]
2300 ; -O0: subs x9, x8, x9
2301 ; -O0: subs w9, w9, #1
2303 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2304 ; -O1: and x10, x8, x1
2306 ; -O1: casl x9, x10, [x0]
2308 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2312 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2313 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2314 ; -O0: and x8, x9, x8
2316 ; -O0: casal x8, x10, [x11]
2317 ; -O0: subs x9, x8, x9
2318 ; -O0: subs w9, w9, #1
2320 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2321 ; -O1: and x10, x8, x1
2323 ; -O1: casal x9, x10, [x0]
2325 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2329 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2330 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2331 ; -O0: and x8, x9, x8
2333 ; -O0: casal x8, x10, [x11]
2334 ; -O0: subs x9, x8, x9
2335 ; -O0: subs w9, w9, #1
2337 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2338 ; -O1: and x10, x8, x1
2340 ; -O1: casal x9, x10, [x0]
2342 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2346 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2347 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2348 ; -O0: and x9, x10, x9
2349 ; -O0: and x12, x11, x12
2352 ; -O0: casp x0, x1, x2, x3, [x8]
2353 ; -O0: subs x11, x9, x11
2354 ; -O0: ccmp x8, x10, #0, eq
2356 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2357 ; -O1: ldp x4, x5, [x0]
2358 ; -O1: and x8, x4, x2
2359 ; -O1: and x9, x7, x3
2362 ; -O1: casp x4, x5, x10, x11, [x0]
2364 ; -O1: ccmp x5, x7, #0, eq
2365 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2369 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2370 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2371 ; -O0: and x9, x10, x9
2372 ; -O0: and x12, x11, x12
2375 ; -O0: caspa x0, x1, x2, x3, [x8]
2376 ; -O0: subs x11, x9, x11
2377 ; -O0: ccmp x8, x10, #0, eq
2379 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2380 ; -O1: ldp x4, x5, [x0]
2381 ; -O1: and x8, x4, x2
2382 ; -O1: and x9, x7, x3
2385 ; -O1: caspa x4, x5, x10, x11, [x0]
2387 ; -O1: ccmp x5, x7, #0, eq
2388 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2392 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2393 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2394 ; -O0: and x9, x10, x9
2395 ; -O0: and x12, x11, x12
2398 ; -O0: caspl x0, x1, x2, x3, [x8]
2399 ; -O0: subs x11, x9, x11
2400 ; -O0: ccmp x8, x10, #0, eq
2402 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2403 ; -O1: ldp x4, x5, [x0]
2404 ; -O1: and x8, x4, x2
2405 ; -O1: and x9, x7, x3
2408 ; -O1: caspl x4, x5, x10, x11, [x0]
2410 ; -O1: ccmp x5, x7, #0, eq
2411 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2415 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2416 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2417 ; -O0: and x9, x10, x9
2418 ; -O0: and x12, x11, x12
2421 ; -O0: caspal x0, x1, x2, x3, [x8]
2422 ; -O0: subs x11, x9, x11
2423 ; -O0: ccmp x8, x10, #0, eq
2425 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2426 ; -O1: ldp x4, x5, [x0]
2427 ; -O1: and x8, x4, x2
2428 ; -O1: and x9, x7, x3
2431 ; -O1: caspal x4, x5, x10, x11, [x0]
2433 ; -O1: ccmp x5, x7, #0, eq
2434 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2438 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2439 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2440 ; -O0: and x9, x10, x9
2441 ; -O0: and x12, x11, x12
2444 ; -O0: caspal x0, x1, x2, x3, [x8]
2445 ; -O0: subs x11, x9, x11
2446 ; -O0: ccmp x8, x10, #0, eq
2448 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2449 ; -O1: ldp x4, x5, [x0]
2450 ; -O1: and x8, x4, x2
2451 ; -O1: and x9, x7, x3
2454 ; -O1: caspal x4, x5, x10, x11, [x0]
2456 ; -O1: ccmp x5, x7, #0, eq
2457 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2461 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2462 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2463 ; -O0: and w8, w9, w8
2465 ; -O0: casb w8, w10, [x11]
2466 ; -O0: subs w9, w8, w9, uxtb
2467 ; -O0: subs w9, w9, #1
2469 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2470 ; -O1: and w10, w8, w1
2472 ; -O1: casb w9, w10, [x0]
2473 ; -O1: cmp w9, w8, uxtb
2474 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2478 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2479 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2480 ; -O0: and w8, w9, w8
2482 ; -O0: casab w8, w10, [x11]
2483 ; -O0: subs w9, w8, w9, uxtb
2484 ; -O0: subs w9, w9, #1
2486 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2487 ; -O1: and w10, w8, w1
2489 ; -O1: casab w9, w10, [x0]
2490 ; -O1: cmp w9, w8, uxtb
2491 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2495 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2496 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2497 ; -O0: and w8, w9, w8
2499 ; -O0: caslb w8, w10, [x11]
2500 ; -O0: subs w9, w8, w9, uxtb
2501 ; -O0: subs w9, w9, #1
2503 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2504 ; -O1: and w10, w8, w1
2506 ; -O1: caslb w9, w10, [x0]
2507 ; -O1: cmp w9, w8, uxtb
2508 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2512 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2513 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2514 ; -O0: and w8, w9, w8
2516 ; -O0: casalb w8, w10, [x11]
2517 ; -O0: subs w9, w8, w9, uxtb
2518 ; -O0: subs w9, w9, #1
2520 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2521 ; -O1: and w10, w8, w1
2523 ; -O1: casalb w9, w10, [x0]
2524 ; -O1: cmp w9, w8, uxtb
2525 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2529 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2530 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2531 ; -O0: and w8, w9, w8
2533 ; -O0: casalb w8, w10, [x11]
2534 ; -O0: subs w9, w8, w9, uxtb
2535 ; -O0: subs w9, w9, #1
2537 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2538 ; -O1: and w10, w8, w1
2540 ; -O1: casalb w9, w10, [x0]
2541 ; -O1: cmp w9, w8, uxtb
2542 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2546 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2547 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2548 ; -O0: and w8, w9, w8
2550 ; -O0: bl __atomic_compare_exchange
2552 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2553 ; -O1: and w8, w0, w20
2555 ; -O1: bl __atomic_compare_exchange
2556 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2560 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2561 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2562 ; -O0: and w8, w9, w8
2564 ; -O0: bl __atomic_compare_exchange
2566 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2567 ; -O1: and w8, w0, w20
2569 ; -O1: bl __atomic_compare_exchange
2570 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2574 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2575 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2576 ; -O0: and w8, w9, w8
2578 ; -O0: bl __atomic_compare_exchange
2580 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2581 ; -O1: and w8, w0, w20
2583 ; -O1: bl __atomic_compare_exchange
2584 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2588 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2589 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2590 ; -O0: and w8, w9, w8
2592 ; -O0: bl __atomic_compare_exchange
2594 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2595 ; -O1: and w8, w0, w20
2597 ; -O1: bl __atomic_compare_exchange
2598 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2602 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2603 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2604 ; -O0: and w8, w9, w8
2606 ; -O0: bl __atomic_compare_exchange
2608 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2609 ; -O1: and w8, w0, w20
2611 ; -O1: bl __atomic_compare_exchange
2612 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2616 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2617 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2618 ; -O0: and w8, w9, w8
2620 ; -O0: bl __atomic_compare_exchange
2622 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2623 ; -O1: and w8, w0, w20
2625 ; -O1: bl __atomic_compare_exchange
2626 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2630 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2631 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2632 ; -O0: and w8, w9, w8
2634 ; -O0: bl __atomic_compare_exchange
2636 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2637 ; -O1: and w8, w0, w20
2639 ; -O1: bl __atomic_compare_exchange
2640 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2644 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2645 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2646 ; -O0: and w8, w9, w8
2648 ; -O0: bl __atomic_compare_exchange
2650 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2651 ; -O1: and w8, w0, w20
2653 ; -O1: bl __atomic_compare_exchange
2654 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2658 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2659 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2660 ; -O0: and w8, w9, w8
2662 ; -O0: bl __atomic_compare_exchange
2664 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2665 ; -O1: and w8, w0, w20
2667 ; -O1: bl __atomic_compare_exchange
2668 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2672 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2673 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2674 ; -O0: and w8, w9, w8
2676 ; -O0: bl __atomic_compare_exchange
2678 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2679 ; -O1: and w8, w0, w20
2681 ; -O1: bl __atomic_compare_exchange
2682 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2686 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2687 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2688 ; -O0: and x8, x9, x8
2690 ; -O0: bl __atomic_compare_exchange
2692 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2693 ; -O1: and x8, x0, x20
2695 ; -O1: bl __atomic_compare_exchange
2696 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2700 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2701 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2702 ; -O0: and x8, x9, x8
2704 ; -O0: bl __atomic_compare_exchange
2706 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2707 ; -O1: and x8, x0, x20
2709 ; -O1: bl __atomic_compare_exchange
2710 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2714 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2715 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2716 ; -O0: and x8, x9, x8
2718 ; -O0: bl __atomic_compare_exchange
2720 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2721 ; -O1: and x8, x0, x20
2723 ; -O1: bl __atomic_compare_exchange
2724 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2728 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2729 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2730 ; -O0: and x8, x9, x8
2732 ; -O0: bl __atomic_compare_exchange
2734 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2735 ; -O1: and x8, x0, x20
2737 ; -O1: bl __atomic_compare_exchange
2738 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2742 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2743 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2744 ; -O0: and x8, x9, x8
2746 ; -O0: bl __atomic_compare_exchange
2748 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2749 ; -O1: and x8, x0, x20
2751 ; -O1: bl __atomic_compare_exchange
2752 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2756 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2757 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2758 ; -O0: and x9, x11, x9
2759 ; -O0: and x8, x10, x8
2762 ; -O0: bl __atomic_compare_exchange
2764 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2765 ; -O1: ldp x0, x1, [x0]
2766 ; -O1: and x8, x1, x19
2767 ; -O1: and x9, x0, x21
2770 ; -O1: bl __atomic_compare_exchange
2771 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2775 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2776 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2777 ; -O0: and x9, x11, x9
2778 ; -O0: and x8, x10, x8
2781 ; -O0: bl __atomic_compare_exchange
2783 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2784 ; -O1: ldp x0, x1, [x0]
2785 ; -O1: and x8, x1, x19
2786 ; -O1: and x9, x0, x21
2789 ; -O1: bl __atomic_compare_exchange
2790 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2794 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2795 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2796 ; -O0: and x9, x11, x9
2797 ; -O0: and x8, x10, x8
2800 ; -O0: bl __atomic_compare_exchange
2802 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2803 ; -O1: ldp x0, x1, [x0]
2804 ; -O1: and x8, x1, x19
2805 ; -O1: and x9, x0, x21
2808 ; -O1: bl __atomic_compare_exchange
2809 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2813 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2814 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2815 ; -O0: and x9, x11, x9
2816 ; -O0: and x8, x10, x8
2819 ; -O0: bl __atomic_compare_exchange
2821 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2822 ; -O1: ldp x0, x1, [x0]
2823 ; -O1: and x8, x1, x19
2824 ; -O1: and x9, x0, x21
2827 ; -O1: bl __atomic_compare_exchange
2828 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2832 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2833 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2834 ; -O0: and x9, x11, x9
2835 ; -O0: and x8, x10, x8
2838 ; -O0: bl __atomic_compare_exchange
2840 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2841 ; -O1: ldp x0, x1, [x0]
2842 ; -O1: and x8, x1, x19
2843 ; -O1: and x9, x0, x21
2846 ; -O1: bl __atomic_compare_exchange
2847 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2851 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2852 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2853 ; CHECK: ldsetb w1, w0, [x0]
2854 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2858 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
2859 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
2860 ; CHECK: ldsetab w1, w0, [x0]
2861 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2865 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
2866 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
2867 ; CHECK: ldsetlb w1, w0, [x0]
2868 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2872 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2873 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
2874 ; CHECK: ldsetalb w1, w0, [x0]
2875 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2879 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2880 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
2881 ; CHECK: ldsetalb w1, w0, [x0]
2882 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
2886 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2887 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
2888 ; CHECK: ldseth w1, w0, [x0]
2889 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
2893 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
2894 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
2895 ; CHECK: ldsetah w1, w0, [x0]
2896 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
2900 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
2901 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
2902 ; CHECK: ldsetlh w1, w0, [x0]
2903 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
2907 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2908 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
2909 ; CHECK: ldsetalh w1, w0, [x0]
2910 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
2914 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2915 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
2916 ; CHECK: ldsetalh w1, w0, [x0]
2917 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
2921 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2922 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
2923 ; CHECK: ldset w1, w0, [x0]
2924 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
2928 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
2929 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
2930 ; CHECK: ldseta w1, w0, [x0]
2931 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
2935 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
2936 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
2937 ; CHECK: ldsetl w1, w0, [x0]
2938 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
2942 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2943 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
2944 ; CHECK: ldsetal w1, w0, [x0]
2945 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
2949 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2950 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
2951 ; CHECK: ldsetal w1, w0, [x0]
2952 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
2956 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2957 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
2958 ; CHECK: ldset x1, x0, [x0]
2959 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
2963 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
2964 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
2965 ; CHECK: ldseta x1, x0, [x0]
2966 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
2970 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
2971 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
2972 ; CHECK: ldsetl x1, x0, [x0]
2973 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
2977 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2978 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
2979 ; CHECK: ldsetal x1, x0, [x0]
2980 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
2984 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2985 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
2986 ; CHECK: ldsetal x1, x0, [x0]
2987 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
2991 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2992 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
2993 ; -O0: ldsetp x0, x1, [x8]
2995 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
2996 ; -O1: ldsetp x2, x1, [x0]
2997 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
3001 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
3002 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
3003 ; -O0: ldsetpa x0, x1, [x8]
3005 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
3006 ; -O1: ldsetpa x2, x1, [x0]
3007 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
3011 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
3012 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
3013 ; -O0: ldsetpl x0, x1, [x8]
3015 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
3016 ; -O1: ldsetpl x2, x1, [x0]
3017 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
3021 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3022 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3023 ; -O0: ldsetpal x0, x1, [x8]
3025 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3026 ; -O1: ldsetpal x2, x1, [x0]
3027 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
3031 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3032 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3033 ; -O0: ldsetpal x0, x1, [x8]
3035 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3036 ; -O1: ldsetpal x2, x1, [x0]
3037 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
3041 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3042 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
3043 ; CHECK: ldsetb w1, w0, [x0]
3044 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3048 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3049 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
3050 ; CHECK: ldsetab w1, w0, [x0]
3051 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3055 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3056 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3057 ; CHECK: ldsetlb w1, w0, [x0]
3058 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3062 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3063 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3064 ; CHECK: ldsetalb w1, w0, [x0]
3065 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3069 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3070 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3071 ; CHECK: ldsetalb w1, w0, [x0]
3072 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3076 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3077 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3078 ; -O0: orr w8, w9, w8
3079 ; -O0: bl __atomic_compare_exchange
3081 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3082 ; -O1: orr w8, w0, w20
3083 ; -O1: bl __atomic_compare_exchange
3084 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3088 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3089 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3090 ; -O0: orr w8, w9, w8
3091 ; -O0: bl __atomic_compare_exchange
3093 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3094 ; -O1: orr w8, w0, w20
3095 ; -O1: bl __atomic_compare_exchange
3096 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3100 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3101 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3102 ; -O0: orr w8, w9, w8
3103 ; -O0: bl __atomic_compare_exchange
3105 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3106 ; -O1: orr w8, w0, w20
3107 ; -O1: bl __atomic_compare_exchange
3108 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3112 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3113 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3114 ; -O0: orr w8, w9, w8
3115 ; -O0: bl __atomic_compare_exchange
3117 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3118 ; -O1: orr w8, w0, w20
3119 ; -O1: bl __atomic_compare_exchange
3120 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3124 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3125 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3126 ; -O0: orr w8, w9, w8
3127 ; -O0: bl __atomic_compare_exchange
3129 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3130 ; -O1: orr w8, w0, w20
3131 ; -O1: bl __atomic_compare_exchange
3132 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3136 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3137 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3138 ; -O0: orr w8, w9, w8
3139 ; -O0: bl __atomic_compare_exchange
3141 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3142 ; -O1: orr w8, w0, w20
3143 ; -O1: bl __atomic_compare_exchange
3144 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3148 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3149 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3150 ; -O0: orr w8, w9, w8
3151 ; -O0: bl __atomic_compare_exchange
3153 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3154 ; -O1: orr w8, w0, w20
3155 ; -O1: bl __atomic_compare_exchange
3156 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3160 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3161 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3162 ; -O0: orr w8, w9, w8
3163 ; -O0: bl __atomic_compare_exchange
3165 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3166 ; -O1: orr w8, w0, w20
3167 ; -O1: bl __atomic_compare_exchange
3168 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3172 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3173 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3174 ; -O0: orr w8, w9, w8
3175 ; -O0: bl __atomic_compare_exchange
3177 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3178 ; -O1: orr w8, w0, w20
3179 ; -O1: bl __atomic_compare_exchange
3180 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3184 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3185 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3186 ; -O0: orr w8, w9, w8
3187 ; -O0: bl __atomic_compare_exchange
3189 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3190 ; -O1: orr w8, w0, w20
3191 ; -O1: bl __atomic_compare_exchange
3192 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3196 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3197 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3198 ; -O0: orr x8, x9, x8
3199 ; -O0: bl __atomic_compare_exchange
3201 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3202 ; -O1: orr x8, x0, x20
3203 ; -O1: bl __atomic_compare_exchange
3204 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3208 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3209 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3210 ; -O0: orr x8, x9, x8
3211 ; -O0: bl __atomic_compare_exchange
3213 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3214 ; -O1: orr x8, x0, x20
3215 ; -O1: bl __atomic_compare_exchange
3216 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3220 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3221 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3222 ; -O0: orr x8, x9, x8
3223 ; -O0: bl __atomic_compare_exchange
3225 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3226 ; -O1: orr x8, x0, x20
3227 ; -O1: bl __atomic_compare_exchange
3228 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3232 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3233 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3234 ; -O0: orr x8, x9, x8
3235 ; -O0: bl __atomic_compare_exchange
3237 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3238 ; -O1: orr x8, x0, x20
3239 ; -O1: bl __atomic_compare_exchange
3240 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3244 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3245 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3246 ; -O0: orr x8, x9, x8
3247 ; -O0: bl __atomic_compare_exchange
3249 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3250 ; -O1: orr x8, x0, x20
3251 ; -O1: bl __atomic_compare_exchange
3252 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3256 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3257 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3258 ; -O0: orr x8, x11, x8
3259 ; -O0: orr x9, x10, x9
3260 ; -O0: bl __atomic_compare_exchange
3262 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3263 ; -O1: ldp x0, x1, [x0]
3264 ; -O1: orr x8, x1, x19
3265 ; -O1: orr x9, x0, x21
3266 ; -O1: bl __atomic_compare_exchange
3267 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3271 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3272 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3273 ; -O0: orr x8, x11, x8
3274 ; -O0: orr x9, x10, x9
3275 ; -O0: bl __atomic_compare_exchange
3277 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3278 ; -O1: ldp x0, x1, [x0]
3279 ; -O1: orr x8, x1, x19
3280 ; -O1: orr x9, x0, x21
3281 ; -O1: bl __atomic_compare_exchange
3282 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3286 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3287 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3288 ; -O0: orr x8, x11, x8
3289 ; -O0: orr x9, x10, x9
3290 ; -O0: bl __atomic_compare_exchange
3292 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3293 ; -O1: ldp x0, x1, [x0]
3294 ; -O1: orr x8, x1, x19
3295 ; -O1: orr x9, x0, x21
3296 ; -O1: bl __atomic_compare_exchange
3297 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3301 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3302 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3303 ; -O0: orr x8, x11, x8
3304 ; -O0: orr x9, x10, x9
3305 ; -O0: bl __atomic_compare_exchange
3307 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3308 ; -O1: ldp x0, x1, [x0]
3309 ; -O1: orr x8, x1, x19
3310 ; -O1: orr x9, x0, x21
3311 ; -O1: bl __atomic_compare_exchange
3312 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3316 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3317 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3318 ; -O0: orr x8, x11, x8
3319 ; -O0: orr x9, x10, x9
3320 ; -O0: bl __atomic_compare_exchange
3322 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3323 ; -O1: ldp x0, x1, [x0]
3324 ; -O1: orr x8, x1, x19
3325 ; -O1: orr x9, x0, x21
3326 ; -O1: bl __atomic_compare_exchange
3327 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3331 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3332 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3333 ; CHECK: ldeorb w1, w0, [x0]
3334 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3338 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3339 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3340 ; CHECK: ldeorab w1, w0, [x0]
3341 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3345 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3346 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3347 ; CHECK: ldeorlb w1, w0, [x0]
3348 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3352 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3353 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3354 ; CHECK: ldeoralb w1, w0, [x0]
3355 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3359 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3360 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3361 ; CHECK: ldeoralb w1, w0, [x0]
3362 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3366 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3367 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3368 ; CHECK: ldeorh w1, w0, [x0]
3369 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3373 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3374 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3375 ; CHECK: ldeorah w1, w0, [x0]
3376 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3380 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3381 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3382 ; CHECK: ldeorlh w1, w0, [x0]
3383 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3387 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3388 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3389 ; CHECK: ldeoralh w1, w0, [x0]
3390 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3394 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3395 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3396 ; CHECK: ldeoralh w1, w0, [x0]
3397 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3401 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3402 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3403 ; CHECK: ldeor w1, w0, [x0]
3404 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3408 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3409 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3410 ; CHECK: ldeora w1, w0, [x0]
3411 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3415 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3416 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3417 ; CHECK: ldeorl w1, w0, [x0]
3418 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3422 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3423 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3424 ; CHECK: ldeoral w1, w0, [x0]
3425 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3429 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3430 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3431 ; CHECK: ldeoral w1, w0, [x0]
3432 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3436 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3437 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3438 ; CHECK: ldeor x1, x0, [x0]
3439 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3443 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3444 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3445 ; CHECK: ldeora x1, x0, [x0]
3446 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3450 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3451 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3452 ; CHECK: ldeorl x1, x0, [x0]
3453 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3457 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3458 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3459 ; CHECK: ldeoral x1, x0, [x0]
3460 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3464 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3465 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3466 ; CHECK: ldeoral x1, x0, [x0]
3467 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3471 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3472 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3473 ; -O0: eor x2, x11, x12
3474 ; -O0: eor x9, x10, x9
3475 ; -O0: casp x0, x1, x2, x3, [x8]
3476 ; -O0: subs x11, x9, x11
3477 ; -O0: ccmp x8, x10, #0, eq
3479 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3480 ; -O1: ldp x4, x5, [x0]
3481 ; -O1: eor x8, x4, x2
3482 ; -O1: eor x9, x7, x3
3483 ; -O1: casp x4, x5, x8, x9, [x0]
3485 ; -O1: ccmp x5, x7, #0, eq
3486 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3490 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3491 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3492 ; -O0: eor x2, x11, x12
3493 ; -O0: eor x9, x10, x9
3494 ; -O0: caspa x0, x1, x2, x3, [x8]
3495 ; -O0: subs x11, x9, x11
3496 ; -O0: ccmp x8, x10, #0, eq
3498 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3499 ; -O1: ldp x4, x5, [x0]
3500 ; -O1: eor x8, x4, x2
3501 ; -O1: eor x9, x7, x3
3502 ; -O1: caspa x4, x5, x8, x9, [x0]
3504 ; -O1: ccmp x5, x7, #0, eq
3505 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3509 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3510 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3511 ; -O0: eor x2, x11, x12
3512 ; -O0: eor x9, x10, x9
3513 ; -O0: caspl x0, x1, x2, x3, [x8]
3514 ; -O0: subs x11, x9, x11
3515 ; -O0: ccmp x8, x10, #0, eq
3517 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3518 ; -O1: ldp x4, x5, [x0]
3519 ; -O1: eor x8, x4, x2
3520 ; -O1: eor x9, x7, x3
3521 ; -O1: caspl x4, x5, x8, x9, [x0]
3523 ; -O1: ccmp x5, x7, #0, eq
3524 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3528 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3529 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3530 ; -O0: eor x2, x11, x12
3531 ; -O0: eor x9, x10, x9
3532 ; -O0: caspal x0, x1, x2, x3, [x8]
3533 ; -O0: subs x11, x9, x11
3534 ; -O0: ccmp x8, x10, #0, eq
3536 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3537 ; -O1: ldp x4, x5, [x0]
3538 ; -O1: eor x8, x4, x2
3539 ; -O1: eor x9, x7, x3
3540 ; -O1: caspal x4, x5, x8, x9, [x0]
3542 ; -O1: ccmp x5, x7, #0, eq
3543 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3547 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3548 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3549 ; -O0: eor x2, x11, x12
3550 ; -O0: eor x9, x10, x9
3551 ; -O0: caspal x0, x1, x2, x3, [x8]
3552 ; -O0: subs x11, x9, x11
3553 ; -O0: ccmp x8, x10, #0, eq
3555 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3556 ; -O1: ldp x4, x5, [x0]
3557 ; -O1: eor x8, x4, x2
3558 ; -O1: eor x9, x7, x3
3559 ; -O1: caspal x4, x5, x8, x9, [x0]
3561 ; -O1: ccmp x5, x7, #0, eq
3562 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3566 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3567 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3568 ; CHECK: ldeorb w1, w0, [x0]
3569 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3573 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3574 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3575 ; CHECK: ldeorab w1, w0, [x0]
3576 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3580 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3581 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3582 ; CHECK: ldeorlb w1, w0, [x0]
3583 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3587 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3588 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3589 ; CHECK: ldeoralb w1, w0, [x0]
3590 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3594 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3595 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3596 ; CHECK: ldeoralb w1, w0, [x0]
3597 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3601 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3602 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3603 ; -O0: eor w8, w9, w8
3604 ; -O0: bl __atomic_compare_exchange
3606 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3607 ; -O1: eor w8, w0, w20
3608 ; -O1: bl __atomic_compare_exchange
3609 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3613 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3614 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3615 ; -O0: eor w8, w9, w8
3616 ; -O0: bl __atomic_compare_exchange
3618 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3619 ; -O1: eor w8, w0, w20
3620 ; -O1: bl __atomic_compare_exchange
3621 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3625 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3626 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3627 ; -O0: eor w8, w9, w8
3628 ; -O0: bl __atomic_compare_exchange
3630 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3631 ; -O1: eor w8, w0, w20
3632 ; -O1: bl __atomic_compare_exchange
3633 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3637 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3638 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3639 ; -O0: eor w8, w9, w8
3640 ; -O0: bl __atomic_compare_exchange
3642 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3643 ; -O1: eor w8, w0, w20
3644 ; -O1: bl __atomic_compare_exchange
3645 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3649 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3650 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3651 ; -O0: eor w8, w9, w8
3652 ; -O0: bl __atomic_compare_exchange
3654 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3655 ; -O1: eor w8, w0, w20
3656 ; -O1: bl __atomic_compare_exchange
3657 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3661 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3662 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3663 ; -O0: eor w8, w9, w8
3664 ; -O0: bl __atomic_compare_exchange
3666 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3667 ; -O1: eor w8, w0, w20
3668 ; -O1: bl __atomic_compare_exchange
3669 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3673 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3674 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3675 ; -O0: eor w8, w9, w8
3676 ; -O0: bl __atomic_compare_exchange
3678 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3679 ; -O1: eor w8, w0, w20
3680 ; -O1: bl __atomic_compare_exchange
3681 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3685 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3686 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3687 ; -O0: eor w8, w9, w8
3688 ; -O0: bl __atomic_compare_exchange
3690 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3691 ; -O1: eor w8, w0, w20
3692 ; -O1: bl __atomic_compare_exchange
3693 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3697 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3698 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3699 ; -O0: eor w8, w9, w8
3700 ; -O0: bl __atomic_compare_exchange
3702 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3703 ; -O1: eor w8, w0, w20
3704 ; -O1: bl __atomic_compare_exchange
3705 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3709 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3710 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3711 ; -O0: eor w8, w9, w8
3712 ; -O0: bl __atomic_compare_exchange
3714 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3715 ; -O1: eor w8, w0, w20
3716 ; -O1: bl __atomic_compare_exchange
3717 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3721 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3722 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3723 ; -O0: eor x8, x9, x8
3724 ; -O0: bl __atomic_compare_exchange
3726 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3727 ; -O1: eor x8, x0, x20
3728 ; -O1: bl __atomic_compare_exchange
3729 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3733 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3734 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3735 ; -O0: eor x8, x9, x8
3736 ; -O0: bl __atomic_compare_exchange
3738 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3739 ; -O1: eor x8, x0, x20
3740 ; -O1: bl __atomic_compare_exchange
3741 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3745 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3746 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3747 ; -O0: eor x8, x9, x8
3748 ; -O0: bl __atomic_compare_exchange
3750 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3751 ; -O1: eor x8, x0, x20
3752 ; -O1: bl __atomic_compare_exchange
3753 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3757 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3758 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3759 ; -O0: eor x8, x9, x8
3760 ; -O0: bl __atomic_compare_exchange
3762 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3763 ; -O1: eor x8, x0, x20
3764 ; -O1: bl __atomic_compare_exchange
3765 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3769 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3770 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3771 ; -O0: eor x8, x9, x8
3772 ; -O0: bl __atomic_compare_exchange
3774 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3775 ; -O1: eor x8, x0, x20
3776 ; -O1: bl __atomic_compare_exchange
3777 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3781 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3782 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3783 ; -O0: eor x8, x11, x8
3784 ; -O0: eor x9, x10, x9
3785 ; -O0: bl __atomic_compare_exchange
3787 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
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 monotonic, align 1
3796 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3797 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3798 ; -O0: eor x8, x11, x8
3799 ; -O0: eor x9, x10, x9
3800 ; -O0: bl __atomic_compare_exchange
3802 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
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 acquire, align 1
3811 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
3812 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
3813 ; -O0: eor x8, x11, x8
3814 ; -O0: eor x9, x10, x9
3815 ; -O0: bl __atomic_compare_exchange
3817 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
3818 ; -O1: ldp x0, x1, [x0]
3819 ; -O1: eor x8, x1, x19
3820 ; -O1: eor x9, x0, x21
3821 ; -O1: bl __atomic_compare_exchange
3822 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
3826 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3827 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3828 ; -O0: eor x8, x11, x8
3829 ; -O0: eor x9, x10, x9
3830 ; -O0: bl __atomic_compare_exchange
3832 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3833 ; -O1: ldp x0, x1, [x0]
3834 ; -O1: eor x8, x1, x19
3835 ; -O1: eor x9, x0, x21
3836 ; -O1: bl __atomic_compare_exchange
3837 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
3841 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3842 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3843 ; -O0: eor x8, x11, x8
3844 ; -O0: eor x9, x10, x9
3845 ; -O0: bl __atomic_compare_exchange
3847 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3848 ; -O1: ldp x0, x1, [x0]
3849 ; -O1: eor x8, x1, x19
3850 ; -O1: eor x9, x0, x21
3851 ; -O1: bl __atomic_compare_exchange
3852 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
3856 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3857 ; CHECK-LABEL: atomicrmw_max_i8_aligned_monotonic:
3858 ; CHECK: ldsmaxb w1, w0, [x0]
3859 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
3863 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
3864 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acquire:
3865 ; CHECK: ldsmaxab w1, w0, [x0]
3866 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
3870 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
3871 ; CHECK-LABEL: atomicrmw_max_i8_aligned_release:
3872 ; CHECK: ldsmaxlb w1, w0, [x0]
3873 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
3877 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3878 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acq_rel:
3879 ; CHECK: ldsmaxalb w1, w0, [x0]
3880 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
3884 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3885 ; CHECK-LABEL: atomicrmw_max_i8_aligned_seq_cst:
3886 ; CHECK: ldsmaxalb w1, w0, [x0]
3887 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
3891 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3892 ; CHECK-LABEL: atomicrmw_max_i16_aligned_monotonic:
3893 ; CHECK: ldsmaxh w1, w0, [x0]
3894 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
3898 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
3899 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acquire:
3900 ; CHECK: ldsmaxah w1, w0, [x0]
3901 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
3905 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
3906 ; CHECK-LABEL: atomicrmw_max_i16_aligned_release:
3907 ; CHECK: ldsmaxlh w1, w0, [x0]
3908 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
3912 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3913 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acq_rel:
3914 ; CHECK: ldsmaxalh w1, w0, [x0]
3915 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
3919 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3920 ; CHECK-LABEL: atomicrmw_max_i16_aligned_seq_cst:
3921 ; CHECK: ldsmaxalh w1, w0, [x0]
3922 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
3926 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3927 ; CHECK-LABEL: atomicrmw_max_i32_aligned_monotonic:
3928 ; CHECK: ldsmax w1, w0, [x0]
3929 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
3933 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
3934 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acquire:
3935 ; CHECK: ldsmaxa w1, w0, [x0]
3936 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
3940 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
3941 ; CHECK-LABEL: atomicrmw_max_i32_aligned_release:
3942 ; CHECK: ldsmaxl w1, w0, [x0]
3943 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
3947 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3948 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acq_rel:
3949 ; CHECK: ldsmaxal w1, w0, [x0]
3950 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
3954 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3955 ; CHECK-LABEL: atomicrmw_max_i32_aligned_seq_cst:
3956 ; CHECK: ldsmaxal w1, w0, [x0]
3957 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
3961 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3962 ; CHECK-LABEL: atomicrmw_max_i64_aligned_monotonic:
3963 ; CHECK: ldsmax x1, x0, [x0]
3964 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
3968 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
3969 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acquire:
3970 ; CHECK: ldsmaxa x1, x0, [x0]
3971 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
3975 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
3976 ; CHECK-LABEL: atomicrmw_max_i64_aligned_release:
3977 ; CHECK: ldsmaxl x1, x0, [x0]
3978 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
3982 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3983 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acq_rel:
3984 ; CHECK: ldsmaxal x1, x0, [x0]
3985 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
3989 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3990 ; CHECK-LABEL: atomicrmw_max_i64_aligned_seq_cst:
3991 ; CHECK: ldsmaxal x1, x0, [x0]
3992 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
3996 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3997 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
3998 ; -O0: subs x13, x9, x10
3999 ; -O0: csel x9, x10, x9, lt
4000 ; -O0: csel x2, x11, x12, lt
4001 ; -O0: casp x0, x1, x2, x3, [x8]
4002 ; -O0: subs x11, x9, x11
4003 ; -O0: ccmp x8, x10, #0, eq
4005 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
4006 ; -O1: ldp x4, x5, [x0]
4008 ; -O1: csel x9, x7, x3, lt
4009 ; -O1: csel x8, x4, x2, lt
4010 ; -O1: casp x4, x5, x8, x9, [x0]
4012 ; -O1: ccmp x5, x7, #0, eq
4013 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
4017 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
4018 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
4019 ; -O0: subs x13, x9, x10
4020 ; -O0: csel x9, x10, x9, lt
4021 ; -O0: csel x2, x11, x12, lt
4022 ; -O0: caspa x0, x1, x2, x3, [x8]
4023 ; -O0: subs x11, x9, x11
4024 ; -O0: ccmp x8, x10, #0, eq
4026 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
4027 ; -O1: ldp x4, x5, [x0]
4029 ; -O1: csel x9, x7, x3, lt
4030 ; -O1: csel x8, x4, x2, lt
4031 ; -O1: caspa x4, x5, x8, x9, [x0]
4033 ; -O1: ccmp x5, x7, #0, eq
4034 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4038 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4039 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4040 ; -O0: subs x13, x9, x10
4041 ; -O0: csel x9, x10, x9, lt
4042 ; -O0: csel x2, x11, x12, lt
4043 ; -O0: caspl x0, x1, x2, x3, [x8]
4044 ; -O0: subs x11, x9, x11
4045 ; -O0: ccmp x8, x10, #0, eq
4047 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
4048 ; -O1: ldp x4, x5, [x0]
4050 ; -O1: csel x9, x7, x3, lt
4051 ; -O1: csel x8, x4, x2, lt
4052 ; -O1: caspl x4, x5, x8, x9, [x0]
4054 ; -O1: ccmp x5, x7, #0, eq
4055 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4059 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4060 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4061 ; -O0: subs x13, x9, x10
4062 ; -O0: csel x9, x10, x9, lt
4063 ; -O0: csel x2, x11, x12, lt
4064 ; -O0: caspal x0, x1, x2, x3, [x8]
4065 ; -O0: subs x11, x9, x11
4066 ; -O0: ccmp x8, x10, #0, eq
4068 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4069 ; -O1: ldp x4, x5, [x0]
4071 ; -O1: csel x9, x7, x3, lt
4072 ; -O1: csel x8, x4, x2, lt
4073 ; -O1: caspal x4, x5, x8, x9, [x0]
4075 ; -O1: ccmp x5, x7, #0, eq
4076 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4080 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4081 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4082 ; -O0: subs x13, x9, x10
4083 ; -O0: csel x9, x10, x9, lt
4084 ; -O0: csel x2, x11, x12, lt
4085 ; -O0: caspal x0, x1, x2, x3, [x8]
4086 ; -O0: subs x11, x9, x11
4087 ; -O0: ccmp x8, x10, #0, eq
4089 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4090 ; -O1: ldp x4, x5, [x0]
4092 ; -O1: csel x9, x7, x3, lt
4093 ; -O1: csel x8, x4, x2, lt
4094 ; -O1: caspal x4, x5, x8, x9, [x0]
4096 ; -O1: ccmp x5, x7, #0, eq
4097 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4101 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4102 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4103 ; CHECK: ldsmaxb w1, w0, [x0]
4104 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4108 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4109 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acquire:
4110 ; CHECK: ldsmaxab w1, w0, [x0]
4111 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4115 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4116 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_release:
4117 ; CHECK: ldsmaxlb w1, w0, [x0]
4118 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4122 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4123 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4124 ; CHECK: ldsmaxalb w1, w0, [x0]
4125 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4129 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4130 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4131 ; CHECK: ldsmaxalb w1, w0, [x0]
4132 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4136 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4137 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4139 ; -O0: subs w10, w10, w8, sxth
4140 ; -O0: csel w8, w9, w8, gt
4141 ; -O0: bl __atomic_compare_exchange
4143 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4145 ; -O1: cmp w8, w20, sxth
4146 ; -O1: csel w8, w0, w20, gt
4147 ; -O1: bl __atomic_compare_exchange
4148 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4152 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4153 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4155 ; -O0: subs w10, w10, w8, sxth
4156 ; -O0: csel w8, w9, w8, gt
4157 ; -O0: bl __atomic_compare_exchange
4159 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4161 ; -O1: cmp w8, w20, sxth
4162 ; -O1: csel w8, w0, w20, gt
4163 ; -O1: bl __atomic_compare_exchange
4164 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4168 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4169 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4171 ; -O0: subs w10, w10, w8, sxth
4172 ; -O0: csel w8, w9, w8, gt
4173 ; -O0: bl __atomic_compare_exchange
4175 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4177 ; -O1: cmp w8, w20, sxth
4178 ; -O1: csel w8, w0, w20, gt
4179 ; -O1: bl __atomic_compare_exchange
4180 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4184 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4185 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4187 ; -O0: subs w10, w10, w8, sxth
4188 ; -O0: csel w8, w9, w8, gt
4189 ; -O0: bl __atomic_compare_exchange
4191 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
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 acq_rel, align 1
4200 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4201 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4203 ; -O0: subs w10, w10, w8, sxth
4204 ; -O0: csel w8, w9, w8, gt
4205 ; -O0: bl __atomic_compare_exchange
4207 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4209 ; -O1: cmp w8, w20, sxth
4210 ; -O1: csel w8, w0, w20, gt
4211 ; -O1: bl __atomic_compare_exchange
4212 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4216 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4217 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4218 ; -O0: subs w10, w9, w8
4219 ; -O0: csel w8, w9, w8, gt
4220 ; -O0: bl __atomic_compare_exchange
4222 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4224 ; -O1: csel w8, w0, w20, gt
4225 ; -O1: bl __atomic_compare_exchange
4226 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4230 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4231 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4232 ; -O0: subs w10, w9, w8
4233 ; -O0: csel w8, w9, w8, gt
4234 ; -O0: bl __atomic_compare_exchange
4236 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4238 ; -O1: csel w8, w0, w20, gt
4239 ; -O1: bl __atomic_compare_exchange
4240 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4244 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4245 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4246 ; -O0: subs w10, w9, w8
4247 ; -O0: csel w8, w9, w8, gt
4248 ; -O0: bl __atomic_compare_exchange
4250 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4252 ; -O1: csel w8, w0, w20, gt
4253 ; -O1: bl __atomic_compare_exchange
4254 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4258 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4259 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4260 ; -O0: subs w10, w9, w8
4261 ; -O0: csel w8, w9, w8, gt
4262 ; -O0: bl __atomic_compare_exchange
4264 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4266 ; -O1: csel w8, w0, w20, gt
4267 ; -O1: bl __atomic_compare_exchange
4268 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4272 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4273 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4274 ; -O0: subs w10, w9, w8
4275 ; -O0: csel w8, w9, w8, gt
4276 ; -O0: bl __atomic_compare_exchange
4278 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4280 ; -O1: csel w8, w0, w20, gt
4281 ; -O1: bl __atomic_compare_exchange
4282 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4286 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4287 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4288 ; -O0: subs x10, x9, x8
4289 ; -O0: csel x8, x9, x8, gt
4290 ; -O0: bl __atomic_compare_exchange
4292 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4294 ; -O1: csel x8, x0, x20, gt
4295 ; -O1: bl __atomic_compare_exchange
4296 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4300 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4301 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4302 ; -O0: subs x10, x9, x8
4303 ; -O0: csel x8, x9, x8, gt
4304 ; -O0: bl __atomic_compare_exchange
4306 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4308 ; -O1: csel x8, x0, x20, gt
4309 ; -O1: bl __atomic_compare_exchange
4310 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4314 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4315 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4316 ; -O0: subs x10, x9, x8
4317 ; -O0: csel x8, x9, x8, gt
4318 ; -O0: bl __atomic_compare_exchange
4320 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4322 ; -O1: csel x8, x0, x20, gt
4323 ; -O1: bl __atomic_compare_exchange
4324 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4328 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4329 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4330 ; -O0: subs x10, x9, x8
4331 ; -O0: csel x8, x9, x8, gt
4332 ; -O0: bl __atomic_compare_exchange
4334 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4336 ; -O1: csel x8, x0, x20, gt
4337 ; -O1: bl __atomic_compare_exchange
4338 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4342 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4343 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4344 ; -O0: subs x10, x9, x8
4345 ; -O0: csel x8, x9, x8, gt
4346 ; -O0: bl __atomic_compare_exchange
4348 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4350 ; -O1: csel x8, x0, x20, gt
4351 ; -O1: bl __atomic_compare_exchange
4352 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4356 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4357 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4358 ; -O0: subs x12, x9, x10
4359 ; -O0: csel x8, x11, x8, lt
4360 ; -O0: csel x9, x10, x9, lt
4361 ; -O0: bl __atomic_compare_exchange
4363 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4364 ; -O1: ldp x0, x1, [x0]
4366 ; -O1: csel x8, x1, x19, lt
4367 ; -O1: csel x9, x0, x21, lt
4368 ; -O1: bl __atomic_compare_exchange
4369 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4373 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4374 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4375 ; -O0: subs x12, x9, x10
4376 ; -O0: csel x8, x11, x8, lt
4377 ; -O0: csel x9, x10, x9, lt
4378 ; -O0: bl __atomic_compare_exchange
4380 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4381 ; -O1: ldp x0, x1, [x0]
4383 ; -O1: csel x8, x1, x19, lt
4384 ; -O1: csel x9, x0, x21, lt
4385 ; -O1: bl __atomic_compare_exchange
4386 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4390 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4391 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4392 ; -O0: subs x12, x9, x10
4393 ; -O0: csel x8, x11, x8, lt
4394 ; -O0: csel x9, x10, x9, lt
4395 ; -O0: bl __atomic_compare_exchange
4397 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4398 ; -O1: ldp x0, x1, [x0]
4400 ; -O1: csel x8, x1, x19, lt
4401 ; -O1: csel x9, x0, x21, lt
4402 ; -O1: bl __atomic_compare_exchange
4403 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4407 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4408 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4409 ; -O0: subs x12, x9, x10
4410 ; -O0: csel x8, x11, x8, lt
4411 ; -O0: csel x9, x10, x9, lt
4412 ; -O0: bl __atomic_compare_exchange
4414 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4415 ; -O1: ldp x0, x1, [x0]
4417 ; -O1: csel x8, x1, x19, lt
4418 ; -O1: csel x9, x0, x21, lt
4419 ; -O1: bl __atomic_compare_exchange
4420 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4424 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4425 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4426 ; -O0: subs x12, x9, x10
4427 ; -O0: csel x8, x11, x8, lt
4428 ; -O0: csel x9, x10, x9, lt
4429 ; -O0: bl __atomic_compare_exchange
4431 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4432 ; -O1: ldp x0, x1, [x0]
4434 ; -O1: csel x8, x1, x19, lt
4435 ; -O1: csel x9, x0, x21, lt
4436 ; -O1: bl __atomic_compare_exchange
4437 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4441 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4442 ; CHECK-LABEL: atomicrmw_min_i8_aligned_monotonic:
4443 ; CHECK: ldsminb w1, w0, [x0]
4444 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4448 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4449 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acquire:
4450 ; CHECK: ldsminab w1, w0, [x0]
4451 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4455 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4456 ; CHECK-LABEL: atomicrmw_min_i8_aligned_release:
4457 ; CHECK: ldsminlb w1, w0, [x0]
4458 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4462 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4463 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4464 ; CHECK: ldsminalb w1, w0, [x0]
4465 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4469 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4470 ; CHECK-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4471 ; CHECK: ldsminalb w1, w0, [x0]
4472 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4476 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4477 ; CHECK-LABEL: atomicrmw_min_i16_aligned_monotonic:
4478 ; CHECK: ldsminh w1, w0, [x0]
4479 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
4483 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
4484 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acquire:
4485 ; CHECK: ldsminah w1, w0, [x0]
4486 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
4490 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
4491 ; CHECK-LABEL: atomicrmw_min_i16_aligned_release:
4492 ; CHECK: ldsminlh w1, w0, [x0]
4493 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
4497 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4498 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4499 ; CHECK: ldsminalh w1, w0, [x0]
4500 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
4504 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4505 ; CHECK-LABEL: atomicrmw_min_i16_aligned_seq_cst:
4506 ; CHECK: ldsminalh w1, w0, [x0]
4507 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
4511 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4512 ; CHECK-LABEL: atomicrmw_min_i32_aligned_monotonic:
4513 ; CHECK: ldsmin w1, w0, [x0]
4514 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
4518 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
4519 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acquire:
4520 ; CHECK: ldsmina w1, w0, [x0]
4521 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
4525 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
4526 ; CHECK-LABEL: atomicrmw_min_i32_aligned_release:
4527 ; CHECK: ldsminl w1, w0, [x0]
4528 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
4532 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4533 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acq_rel:
4534 ; CHECK: ldsminal w1, w0, [x0]
4535 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
4539 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4540 ; CHECK-LABEL: atomicrmw_min_i32_aligned_seq_cst:
4541 ; CHECK: ldsminal w1, w0, [x0]
4542 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
4546 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4547 ; CHECK-LABEL: atomicrmw_min_i64_aligned_monotonic:
4548 ; CHECK: ldsmin x1, x0, [x0]
4549 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
4553 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
4554 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acquire:
4555 ; CHECK: ldsmina x1, x0, [x0]
4556 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
4560 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
4561 ; CHECK-LABEL: atomicrmw_min_i64_aligned_release:
4562 ; CHECK: ldsminl x1, x0, [x0]
4563 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
4567 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4568 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acq_rel:
4569 ; CHECK: ldsminal x1, x0, [x0]
4570 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
4574 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4575 ; CHECK-LABEL: atomicrmw_min_i64_aligned_seq_cst:
4576 ; CHECK: ldsminal x1, x0, [x0]
4577 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
4581 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4582 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
4583 ; -O0: subs x13, x9, x10
4584 ; -O0: csel x9, x10, x9, ge
4585 ; -O0: csel x2, x11, x12, ge
4586 ; -O0: casp x0, x1, x2, x3, [x8]
4587 ; -O0: subs x11, x9, x11
4588 ; -O0: ccmp x8, x10, #0, eq
4590 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
4591 ; -O1: ldp x4, x5, [x0]
4593 ; -O1: csel x9, x7, x3, ge
4594 ; -O1: csel x8, x4, x2, ge
4595 ; -O1: casp x4, x5, x8, x9, [x0]
4597 ; -O1: ccmp x5, x7, #0, eq
4598 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
4602 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
4603 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
4604 ; -O0: subs x13, x9, x10
4605 ; -O0: csel x9, x10, x9, ge
4606 ; -O0: csel x2, x11, x12, ge
4607 ; -O0: caspa x0, x1, x2, x3, [x8]
4608 ; -O0: subs x11, x9, x11
4609 ; -O0: ccmp x8, x10, #0, eq
4611 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
4612 ; -O1: ldp x4, x5, [x0]
4614 ; -O1: csel x9, x7, x3, ge
4615 ; -O1: csel x8, x4, x2, ge
4616 ; -O1: caspa x4, x5, x8, x9, [x0]
4618 ; -O1: ccmp x5, x7, #0, eq
4619 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
4623 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
4624 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
4625 ; -O0: subs x13, x9, x10
4626 ; -O0: csel x9, x10, x9, ge
4627 ; -O0: csel x2, x11, x12, ge
4628 ; -O0: caspl x0, x1, x2, x3, [x8]
4629 ; -O0: subs x11, x9, x11
4630 ; -O0: ccmp x8, x10, #0, eq
4632 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
4633 ; -O1: ldp x4, x5, [x0]
4635 ; -O1: csel x9, x7, x3, ge
4636 ; -O1: csel x8, x4, x2, ge
4637 ; -O1: caspl x4, x5, x8, x9, [x0]
4639 ; -O1: ccmp x5, x7, #0, eq
4640 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
4644 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4645 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4646 ; -O0: subs x13, x9, x10
4647 ; -O0: csel x9, x10, x9, ge
4648 ; -O0: csel x2, x11, x12, ge
4649 ; -O0: caspal x0, x1, x2, x3, [x8]
4650 ; -O0: subs x11, x9, x11
4651 ; -O0: ccmp x8, x10, #0, eq
4653 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4654 ; -O1: ldp x4, x5, [x0]
4656 ; -O1: csel x9, x7, x3, ge
4657 ; -O1: csel x8, x4, x2, ge
4658 ; -O1: caspal x4, x5, x8, x9, [x0]
4660 ; -O1: ccmp x5, x7, #0, eq
4661 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
4665 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4666 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4667 ; -O0: subs x13, x9, x10
4668 ; -O0: csel x9, x10, x9, ge
4669 ; -O0: csel x2, x11, x12, ge
4670 ; -O0: caspal x0, x1, x2, x3, [x8]
4671 ; -O0: subs x11, x9, x11
4672 ; -O0: ccmp x8, x10, #0, eq
4674 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4675 ; -O1: ldp x4, x5, [x0]
4677 ; -O1: csel x9, x7, x3, ge
4678 ; -O1: csel x8, x4, x2, ge
4679 ; -O1: caspal x4, x5, x8, x9, [x0]
4681 ; -O1: ccmp x5, x7, #0, eq
4682 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
4686 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4687 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_monotonic:
4688 ; CHECK: ldsminb w1, w0, [x0]
4689 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4693 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4694 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acquire:
4695 ; CHECK: ldsminab w1, w0, [x0]
4696 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4700 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
4701 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_release:
4702 ; CHECK: ldsminlb w1, w0, [x0]
4703 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4707 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4708 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
4709 ; CHECK: ldsminalb w1, w0, [x0]
4710 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4714 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4715 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
4716 ; CHECK: ldsminalb w1, w0, [x0]
4717 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4721 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4722 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4724 ; -O0: subs w10, w10, w8, sxth
4725 ; -O0: csel w8, w9, w8, le
4726 ; -O0: bl __atomic_compare_exchange
4728 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4730 ; -O1: cmp w8, w20, sxth
4731 ; -O1: csel w8, w0, w20, le
4732 ; -O1: bl __atomic_compare_exchange
4733 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
4737 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4738 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
4740 ; -O0: subs w10, w10, w8, sxth
4741 ; -O0: csel w8, w9, w8, le
4742 ; -O0: bl __atomic_compare_exchange
4744 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
4746 ; -O1: cmp w8, w20, sxth
4747 ; -O1: csel w8, w0, w20, le
4748 ; -O1: bl __atomic_compare_exchange
4749 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
4753 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
4754 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
4756 ; -O0: subs w10, w10, w8, sxth
4757 ; -O0: csel w8, w9, w8, le
4758 ; -O0: bl __atomic_compare_exchange
4760 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
4762 ; -O1: cmp w8, w20, sxth
4763 ; -O1: csel w8, w0, w20, le
4764 ; -O1: bl __atomic_compare_exchange
4765 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
4769 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4770 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4772 ; -O0: subs w10, w10, w8, sxth
4773 ; -O0: csel w8, w9, w8, le
4774 ; -O0: bl __atomic_compare_exchange
4776 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4778 ; -O1: cmp w8, w20, sxth
4779 ; -O1: csel w8, w0, w20, le
4780 ; -O1: bl __atomic_compare_exchange
4781 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
4785 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4786 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4788 ; -O0: subs w10, w10, w8, sxth
4789 ; -O0: csel w8, w9, w8, le
4790 ; -O0: bl __atomic_compare_exchange
4792 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4794 ; -O1: cmp w8, w20, sxth
4795 ; -O1: csel w8, w0, w20, le
4796 ; -O1: bl __atomic_compare_exchange
4797 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
4801 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4802 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4803 ; -O0: subs w10, w9, w8
4804 ; -O0: csel w8, w9, w8, le
4805 ; -O0: bl __atomic_compare_exchange
4807 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4809 ; -O1: csel w8, w0, w20, le
4810 ; -O1: bl __atomic_compare_exchange
4811 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
4815 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4816 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
4817 ; -O0: subs w10, w9, w8
4818 ; -O0: csel w8, w9, w8, le
4819 ; -O0: bl __atomic_compare_exchange
4821 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
4823 ; -O1: csel w8, w0, w20, le
4824 ; -O1: bl __atomic_compare_exchange
4825 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
4829 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
4830 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
4831 ; -O0: subs w10, w9, w8
4832 ; -O0: csel w8, w9, w8, le
4833 ; -O0: bl __atomic_compare_exchange
4835 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
4837 ; -O1: csel w8, w0, w20, le
4838 ; -O1: bl __atomic_compare_exchange
4839 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
4843 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4844 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
4845 ; -O0: subs w10, w9, w8
4846 ; -O0: csel w8, w9, w8, le
4847 ; -O0: bl __atomic_compare_exchange
4849 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
4851 ; -O1: csel w8, w0, w20, le
4852 ; -O1: bl __atomic_compare_exchange
4853 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
4857 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4858 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
4859 ; -O0: subs w10, w9, w8
4860 ; -O0: csel w8, w9, w8, le
4861 ; -O0: bl __atomic_compare_exchange
4863 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
4865 ; -O1: csel w8, w0, w20, le
4866 ; -O1: bl __atomic_compare_exchange
4867 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
4871 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4872 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
4873 ; -O0: subs x10, x9, x8
4874 ; -O0: csel x8, x9, x8, le
4875 ; -O0: bl __atomic_compare_exchange
4877 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
4879 ; -O1: csel x8, x0, x20, le
4880 ; -O1: bl __atomic_compare_exchange
4881 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
4885 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4886 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
4887 ; -O0: subs x10, x9, x8
4888 ; -O0: csel x8, x9, x8, le
4889 ; -O0: bl __atomic_compare_exchange
4891 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
4893 ; -O1: csel x8, x0, x20, le
4894 ; -O1: bl __atomic_compare_exchange
4895 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
4899 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
4900 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
4901 ; -O0: subs x10, x9, x8
4902 ; -O0: csel x8, x9, x8, le
4903 ; -O0: bl __atomic_compare_exchange
4905 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
4907 ; -O1: csel x8, x0, x20, le
4908 ; -O1: bl __atomic_compare_exchange
4909 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
4913 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4914 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
4915 ; -O0: subs x10, x9, x8
4916 ; -O0: csel x8, x9, x8, le
4917 ; -O0: bl __atomic_compare_exchange
4919 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
4921 ; -O1: csel x8, x0, x20, le
4922 ; -O1: bl __atomic_compare_exchange
4923 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
4927 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4928 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
4929 ; -O0: subs x10, x9, x8
4930 ; -O0: csel x8, x9, x8, le
4931 ; -O0: bl __atomic_compare_exchange
4933 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
4935 ; -O1: csel x8, x0, x20, le
4936 ; -O1: bl __atomic_compare_exchange
4937 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
4941 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4942 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
4943 ; -O0: subs x12, x9, x10
4944 ; -O0: csel x8, x11, x8, ge
4945 ; -O0: csel x9, x10, x9, ge
4946 ; -O0: bl __atomic_compare_exchange
4948 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
4949 ; -O1: ldp x0, x1, [x0]
4951 ; -O1: csel x8, x1, x19, ge
4952 ; -O1: csel x9, x0, x21, ge
4953 ; -O1: bl __atomic_compare_exchange
4954 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
4958 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4959 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
4960 ; -O0: subs x12, x9, x10
4961 ; -O0: csel x8, x11, x8, ge
4962 ; -O0: csel x9, x10, x9, ge
4963 ; -O0: bl __atomic_compare_exchange
4965 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
4966 ; -O1: ldp x0, x1, [x0]
4968 ; -O1: csel x8, x1, x19, ge
4969 ; -O1: csel x9, x0, x21, ge
4970 ; -O1: bl __atomic_compare_exchange
4971 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
4975 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
4976 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
4977 ; -O0: subs x12, x9, x10
4978 ; -O0: csel x8, x11, x8, ge
4979 ; -O0: csel x9, x10, x9, ge
4980 ; -O0: bl __atomic_compare_exchange
4982 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
4983 ; -O1: ldp x0, x1, [x0]
4985 ; -O1: csel x8, x1, x19, ge
4986 ; -O1: csel x9, x0, x21, ge
4987 ; -O1: bl __atomic_compare_exchange
4988 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
4992 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4993 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
4994 ; -O0: subs x12, x9, x10
4995 ; -O0: csel x8, x11, x8, ge
4996 ; -O0: csel x9, x10, x9, ge
4997 ; -O0: bl __atomic_compare_exchange
4999 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5000 ; -O1: ldp x0, x1, [x0]
5002 ; -O1: csel x8, x1, x19, ge
5003 ; -O1: csel x9, x0, x21, ge
5004 ; -O1: bl __atomic_compare_exchange
5005 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5009 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5010 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5011 ; -O0: subs x12, x9, x10
5012 ; -O0: csel x8, x11, x8, ge
5013 ; -O0: csel x9, x10, x9, ge
5014 ; -O0: bl __atomic_compare_exchange
5016 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5017 ; -O1: ldp x0, x1, [x0]
5019 ; -O1: csel x8, x1, x19, ge
5020 ; -O1: csel x9, x0, x21, ge
5021 ; -O1: bl __atomic_compare_exchange
5022 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5026 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5027 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5028 ; CHECK: ldumaxb w1, w0, [x0]
5029 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5033 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5034 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acquire:
5035 ; CHECK: ldumaxab w1, w0, [x0]
5036 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5040 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5041 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_release:
5042 ; CHECK: ldumaxlb w1, w0, [x0]
5043 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5047 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5048 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5049 ; CHECK: ldumaxalb w1, w0, [x0]
5050 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5054 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5055 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5056 ; CHECK: ldumaxalb w1, w0, [x0]
5057 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5061 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5062 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5063 ; CHECK: ldumaxh w1, w0, [x0]
5064 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5068 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5069 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acquire:
5070 ; CHECK: ldumaxah w1, w0, [x0]
5071 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5075 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5076 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_release:
5077 ; CHECK: ldumaxlh w1, w0, [x0]
5078 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5082 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5083 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5084 ; CHECK: ldumaxalh w1, w0, [x0]
5085 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
5089 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5090 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5091 ; CHECK: ldumaxalh w1, w0, [x0]
5092 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
5096 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5097 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5098 ; CHECK: ldumax w1, w0, [x0]
5099 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
5103 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
5104 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acquire:
5105 ; CHECK: ldumaxa w1, w0, [x0]
5106 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
5110 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
5111 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_release:
5112 ; CHECK: ldumaxl w1, w0, [x0]
5113 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
5117 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5118 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5119 ; CHECK: ldumaxal w1, w0, [x0]
5120 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
5124 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5125 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5126 ; CHECK: ldumaxal w1, w0, [x0]
5127 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
5131 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5132 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5133 ; CHECK: ldumax x1, x0, [x0]
5134 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
5138 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
5139 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acquire:
5140 ; CHECK: ldumaxa x1, x0, [x0]
5141 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
5145 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
5146 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_release:
5147 ; CHECK: ldumaxl x1, x0, [x0]
5148 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
5152 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5153 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
5154 ; CHECK: ldumaxal x1, x0, [x0]
5155 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
5159 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5160 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
5161 ; CHECK: ldumaxal x1, x0, [x0]
5162 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
5166 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5167 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5168 ; -O0: subs x13, x9, x10
5169 ; -O0: csel x9, x10, x9, lo
5170 ; -O0: csel x2, x11, x12, lo
5171 ; -O0: casp x0, x1, x2, x3, [x8]
5172 ; -O0: subs x11, x9, x11
5173 ; -O0: ccmp x8, x10, #0, eq
5175 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5176 ; -O1: ldp x4, x5, [x0]
5178 ; -O1: csel x9, x7, x3, lo
5179 ; -O1: csel x8, x4, x2, lo
5180 ; -O1: casp x4, x5, x8, x9, [x0]
5182 ; -O1: ccmp x5, x7, #0, eq
5183 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
5187 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
5188 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
5189 ; -O0: subs x13, x9, x10
5190 ; -O0: csel x9, x10, x9, lo
5191 ; -O0: csel x2, x11, x12, lo
5192 ; -O0: caspa x0, x1, x2, x3, [x8]
5193 ; -O0: subs x11, x9, x11
5194 ; -O0: ccmp x8, x10, #0, eq
5196 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
5197 ; -O1: ldp x4, x5, [x0]
5199 ; -O1: csel x9, x7, x3, lo
5200 ; -O1: csel x8, x4, x2, lo
5201 ; -O1: caspa x4, x5, x8, x9, [x0]
5203 ; -O1: ccmp x5, x7, #0, eq
5204 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
5208 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
5209 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
5210 ; -O0: subs x13, x9, x10
5211 ; -O0: csel x9, x10, x9, lo
5212 ; -O0: csel x2, x11, x12, lo
5213 ; -O0: caspl x0, x1, x2, x3, [x8]
5214 ; -O0: subs x11, x9, x11
5215 ; -O0: ccmp x8, x10, #0, eq
5217 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
5218 ; -O1: ldp x4, x5, [x0]
5220 ; -O1: csel x9, x7, x3, lo
5221 ; -O1: csel x8, x4, x2, lo
5222 ; -O1: caspl x4, x5, x8, x9, [x0]
5224 ; -O1: ccmp x5, x7, #0, eq
5225 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
5229 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5230 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5231 ; -O0: subs x13, x9, x10
5232 ; -O0: csel x9, x10, x9, lo
5233 ; -O0: csel x2, x11, x12, lo
5234 ; -O0: caspal x0, x1, x2, x3, [x8]
5235 ; -O0: subs x11, x9, x11
5236 ; -O0: ccmp x8, x10, #0, eq
5238 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5239 ; -O1: ldp x4, x5, [x0]
5241 ; -O1: csel x9, x7, x3, lo
5242 ; -O1: csel x8, x4, x2, lo
5243 ; -O1: caspal x4, x5, x8, x9, [x0]
5245 ; -O1: ccmp x5, x7, #0, eq
5246 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
5250 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5251 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5252 ; -O0: subs x13, x9, x10
5253 ; -O0: csel x9, x10, x9, lo
5254 ; -O0: csel x2, x11, x12, lo
5255 ; -O0: caspal x0, x1, x2, x3, [x8]
5256 ; -O0: subs x11, x9, x11
5257 ; -O0: ccmp x8, x10, #0, eq
5259 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5260 ; -O1: ldp x4, x5, [x0]
5262 ; -O1: csel x9, x7, x3, lo
5263 ; -O1: csel x8, x4, x2, lo
5264 ; -O1: caspal x4, x5, x8, x9, [x0]
5266 ; -O1: ccmp x5, x7, #0, eq
5267 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
5271 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5272 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
5273 ; CHECK: ldumaxb w1, w0, [x0]
5274 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5278 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5279 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acquire:
5280 ; CHECK: ldumaxab w1, w0, [x0]
5281 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5285 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
5286 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_release:
5287 ; CHECK: ldumaxlb w1, w0, [x0]
5288 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5292 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5293 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
5294 ; CHECK: ldumaxalb w1, w0, [x0]
5295 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5299 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5300 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
5301 ; CHECK: ldumaxalb w1, w0, [x0]
5302 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5306 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5307 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5308 ; -O0: and w10, w9, #0xffff
5309 ; -O0: subs w10, w10, w8, uxth
5310 ; -O0: csel w8, w9, w8, hi
5311 ; -O0: bl __atomic_compare_exchange
5313 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5314 ; -O1: and w8, w0, #0xffff
5315 ; -O1: cmp w8, w20, uxth
5316 ; -O1: csel w8, w0, w20, hi
5317 ; -O1: bl __atomic_compare_exchange
5318 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
5322 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5323 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5324 ; -O0: and w10, w9, #0xffff
5325 ; -O0: subs w10, w10, w8, uxth
5326 ; -O0: csel w8, w9, w8, hi
5327 ; -O0: bl __atomic_compare_exchange
5329 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5330 ; -O1: and w8, w0, #0xffff
5331 ; -O1: cmp w8, w20, uxth
5332 ; -O1: csel w8, w0, w20, hi
5333 ; -O1: bl __atomic_compare_exchange
5334 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
5338 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
5339 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
5340 ; -O0: and w10, w9, #0xffff
5341 ; -O0: subs w10, w10, w8, uxth
5342 ; -O0: csel w8, w9, w8, hi
5343 ; -O0: bl __atomic_compare_exchange
5345 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
5346 ; -O1: and w8, w0, #0xffff
5347 ; -O1: cmp w8, w20, uxth
5348 ; -O1: csel w8, w0, w20, hi
5349 ; -O1: bl __atomic_compare_exchange
5350 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
5354 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5355 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5356 ; -O0: and w10, w9, #0xffff
5357 ; -O0: subs w10, w10, w8, uxth
5358 ; -O0: csel w8, w9, w8, hi
5359 ; -O0: bl __atomic_compare_exchange
5361 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5362 ; -O1: and w8, w0, #0xffff
5363 ; -O1: cmp w8, w20, uxth
5364 ; -O1: csel w8, w0, w20, hi
5365 ; -O1: bl __atomic_compare_exchange
5366 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
5370 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5371 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5372 ; -O0: and w10, w9, #0xffff
5373 ; -O0: subs w10, w10, w8, uxth
5374 ; -O0: csel w8, w9, w8, hi
5375 ; -O0: bl __atomic_compare_exchange
5377 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5378 ; -O1: and w8, w0, #0xffff
5379 ; -O1: cmp w8, w20, uxth
5380 ; -O1: csel w8, w0, w20, hi
5381 ; -O1: bl __atomic_compare_exchange
5382 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
5386 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5387 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5388 ; -O0: subs w10, w9, w8
5389 ; -O0: csel w8, w9, w8, hi
5390 ; -O0: bl __atomic_compare_exchange
5392 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5394 ; -O1: csel w8, w0, w20, hi
5395 ; -O1: bl __atomic_compare_exchange
5396 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
5400 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5401 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5402 ; -O0: subs w10, w9, w8
5403 ; -O0: csel w8, w9, w8, hi
5404 ; -O0: bl __atomic_compare_exchange
5406 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5408 ; -O1: csel w8, w0, w20, hi
5409 ; -O1: bl __atomic_compare_exchange
5410 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
5414 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
5415 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
5416 ; -O0: subs w10, w9, w8
5417 ; -O0: csel w8, w9, w8, hi
5418 ; -O0: bl __atomic_compare_exchange
5420 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
5422 ; -O1: csel w8, w0, w20, hi
5423 ; -O1: bl __atomic_compare_exchange
5424 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
5428 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5429 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5430 ; -O0: subs w10, w9, w8
5431 ; -O0: csel w8, w9, w8, hi
5432 ; -O0: bl __atomic_compare_exchange
5434 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5436 ; -O1: csel w8, w0, w20, hi
5437 ; -O1: bl __atomic_compare_exchange
5438 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
5442 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5443 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5444 ; -O0: subs w10, w9, w8
5445 ; -O0: csel w8, w9, w8, hi
5446 ; -O0: bl __atomic_compare_exchange
5448 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5450 ; -O1: csel w8, w0, w20, hi
5451 ; -O1: bl __atomic_compare_exchange
5452 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
5456 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5457 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5458 ; -O0: subs x10, x9, x8
5459 ; -O0: csel x8, x9, x8, hi
5460 ; -O0: bl __atomic_compare_exchange
5462 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5464 ; -O1: csel x8, x0, x20, hi
5465 ; -O1: bl __atomic_compare_exchange
5466 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
5470 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5471 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5472 ; -O0: subs x10, x9, x8
5473 ; -O0: csel x8, x9, x8, hi
5474 ; -O0: bl __atomic_compare_exchange
5476 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5478 ; -O1: csel x8, x0, x20, hi
5479 ; -O1: bl __atomic_compare_exchange
5480 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
5484 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
5485 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
5486 ; -O0: subs x10, x9, x8
5487 ; -O0: csel x8, x9, x8, hi
5488 ; -O0: bl __atomic_compare_exchange
5490 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
5492 ; -O1: csel x8, x0, x20, hi
5493 ; -O1: bl __atomic_compare_exchange
5494 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
5498 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5499 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5500 ; -O0: subs x10, x9, x8
5501 ; -O0: csel x8, x9, x8, hi
5502 ; -O0: bl __atomic_compare_exchange
5504 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5506 ; -O1: csel x8, x0, x20, hi
5507 ; -O1: bl __atomic_compare_exchange
5508 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
5512 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5513 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5514 ; -O0: subs x10, x9, x8
5515 ; -O0: csel x8, x9, x8, hi
5516 ; -O0: bl __atomic_compare_exchange
5518 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5520 ; -O1: csel x8, x0, x20, hi
5521 ; -O1: bl __atomic_compare_exchange
5522 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
5526 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5527 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5528 ; -O0: subs x12, x9, x10
5529 ; -O0: csel x8, x11, x8, lo
5530 ; -O0: csel x9, x10, x9, lo
5531 ; -O0: bl __atomic_compare_exchange
5533 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5534 ; -O1: ldp x0, x1, [x0]
5536 ; -O1: csel x8, x1, x19, lo
5537 ; -O1: csel x9, x0, x21, lo
5538 ; -O1: bl __atomic_compare_exchange
5539 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
5543 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5544 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5545 ; -O0: subs x12, x9, x10
5546 ; -O0: csel x8, x11, x8, lo
5547 ; -O0: csel x9, x10, x9, lo
5548 ; -O0: bl __atomic_compare_exchange
5550 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5551 ; -O1: ldp x0, x1, [x0]
5553 ; -O1: csel x8, x1, x19, lo
5554 ; -O1: csel x9, x0, x21, lo
5555 ; -O1: bl __atomic_compare_exchange
5556 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
5560 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
5561 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
5562 ; -O0: subs x12, x9, x10
5563 ; -O0: csel x8, x11, x8, lo
5564 ; -O0: csel x9, x10, x9, lo
5565 ; -O0: bl __atomic_compare_exchange
5567 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
5568 ; -O1: ldp x0, x1, [x0]
5570 ; -O1: csel x8, x1, x19, lo
5571 ; -O1: csel x9, x0, x21, lo
5572 ; -O1: bl __atomic_compare_exchange
5573 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
5577 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5578 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5579 ; -O0: subs x12, x9, x10
5580 ; -O0: csel x8, x11, x8, lo
5581 ; -O0: csel x9, x10, x9, lo
5582 ; -O0: bl __atomic_compare_exchange
5584 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5585 ; -O1: ldp x0, x1, [x0]
5587 ; -O1: csel x8, x1, x19, lo
5588 ; -O1: csel x9, x0, x21, lo
5589 ; -O1: bl __atomic_compare_exchange
5590 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
5594 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5595 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5596 ; -O0: subs x12, x9, x10
5597 ; -O0: csel x8, x11, x8, lo
5598 ; -O0: csel x9, x10, x9, lo
5599 ; -O0: bl __atomic_compare_exchange
5601 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5602 ; -O1: ldp x0, x1, [x0]
5604 ; -O1: csel x8, x1, x19, lo
5605 ; -O1: csel x9, x0, x21, lo
5606 ; -O1: bl __atomic_compare_exchange
5607 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
5611 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5612 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_monotonic:
5613 ; CHECK: lduminb w1, w0, [x0]
5614 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
5618 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
5619 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acquire:
5620 ; CHECK: lduminab w1, w0, [x0]
5621 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
5625 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
5626 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_release:
5627 ; CHECK: lduminlb w1, w0, [x0]
5628 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
5632 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5633 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
5634 ; CHECK: lduminalb w1, w0, [x0]
5635 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
5639 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5640 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
5641 ; CHECK: lduminalb w1, w0, [x0]
5642 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
5646 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5647 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_monotonic:
5648 ; CHECK: lduminh w1, w0, [x0]
5649 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
5653 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
5654 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acquire:
5655 ; CHECK: lduminah w1, w0, [x0]
5656 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
5660 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
5661 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_release:
5662 ; CHECK: lduminlh w1, w0, [x0]
5663 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
5667 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5668 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
5669 ; CHECK: lduminalh w1, w0, [x0]
5670 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
5674 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5675 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
5676 ; CHECK: lduminalh w1, w0, [x0]
5677 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
5681 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5682 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_monotonic:
5683 ; CHECK: ldumin w1, w0, [x0]
5684 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
5688 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
5689 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acquire:
5690 ; CHECK: ldumina w1, w0, [x0]
5691 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
5695 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
5696 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_release:
5697 ; CHECK: lduminl w1, w0, [x0]
5698 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
5702 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5703 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
5704 ; CHECK: lduminal w1, w0, [x0]
5705 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
5709 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5710 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
5711 ; CHECK: lduminal w1, w0, [x0]
5712 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
5716 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5717 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_monotonic:
5718 ; CHECK: ldumin x1, x0, [x0]
5719 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
5723 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
5724 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acquire:
5725 ; CHECK: ldumina x1, x0, [x0]
5726 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
5730 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
5731 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_release:
5732 ; CHECK: lduminl x1, x0, [x0]
5733 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
5737 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5738 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
5739 ; CHECK: lduminal x1, x0, [x0]
5740 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
5744 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5745 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
5746 ; CHECK: lduminal x1, x0, [x0]
5747 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
5751 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5752 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
5753 ; -O0: subs x13, x9, x10
5754 ; -O0: csel x9, x10, x9, hs
5755 ; -O0: csel x2, x11, x12, hs
5756 ; -O0: casp x0, x1, x2, x3, [x8]
5757 ; -O0: subs x11, x9, x11
5758 ; -O0: ccmp x8, x10, #0, eq
5760 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
5761 ; -O1: ldp x4, x5, [x0]
5763 ; -O1: csel x9, x7, x3, hs
5764 ; -O1: csel x8, x4, x2, hs
5765 ; -O1: casp x4, x5, x8, x9, [x0]
5767 ; -O1: ccmp x5, x7, #0, eq
5768 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
5772 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
5773 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
5774 ; -O0: subs x13, x9, x10
5775 ; -O0: csel x9, x10, x9, hs
5776 ; -O0: csel x2, x11, x12, hs
5777 ; -O0: caspa x0, x1, x2, x3, [x8]
5778 ; -O0: subs x11, x9, x11
5779 ; -O0: ccmp x8, x10, #0, eq
5781 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
5782 ; -O1: ldp x4, x5, [x0]
5784 ; -O1: csel x9, x7, x3, hs
5785 ; -O1: csel x8, x4, x2, hs
5786 ; -O1: caspa x4, x5, x8, x9, [x0]
5788 ; -O1: ccmp x5, x7, #0, eq
5789 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
5793 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
5794 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
5795 ; -O0: subs x13, x9, x10
5796 ; -O0: csel x9, x10, x9, hs
5797 ; -O0: csel x2, x11, x12, hs
5798 ; -O0: caspl x0, x1, x2, x3, [x8]
5799 ; -O0: subs x11, x9, x11
5800 ; -O0: ccmp x8, x10, #0, eq
5802 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
5803 ; -O1: ldp x4, x5, [x0]
5805 ; -O1: csel x9, x7, x3, hs
5806 ; -O1: csel x8, x4, x2, hs
5807 ; -O1: caspl x4, x5, x8, x9, [x0]
5809 ; -O1: ccmp x5, x7, #0, eq
5810 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
5814 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5815 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
5816 ; -O0: subs x13, x9, x10
5817 ; -O0: csel x9, x10, x9, hs
5818 ; -O0: csel x2, x11, x12, hs
5819 ; -O0: caspal x0, x1, x2, x3, [x8]
5820 ; -O0: subs x11, x9, x11
5821 ; -O0: ccmp x8, x10, #0, eq
5823 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
5824 ; -O1: ldp x4, x5, [x0]
5826 ; -O1: csel x9, x7, x3, hs
5827 ; -O1: csel x8, x4, x2, hs
5828 ; -O1: caspal x4, x5, x8, x9, [x0]
5830 ; -O1: ccmp x5, x7, #0, eq
5831 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
5835 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5836 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
5837 ; -O0: subs x13, x9, x10
5838 ; -O0: csel x9, x10, x9, hs
5839 ; -O0: csel x2, x11, x12, hs
5840 ; -O0: caspal x0, x1, x2, x3, [x8]
5841 ; -O0: subs x11, x9, x11
5842 ; -O0: ccmp x8, x10, #0, eq
5844 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
5845 ; -O1: ldp x4, x5, [x0]
5847 ; -O1: csel x9, x7, x3, hs
5848 ; -O1: csel x8, x4, x2, hs
5849 ; -O1: caspal x4, x5, x8, x9, [x0]
5851 ; -O1: ccmp x5, x7, #0, eq
5852 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
5856 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5857 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
5858 ; CHECK: lduminb w1, w0, [x0]
5859 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
5863 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5864 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acquire:
5865 ; CHECK: lduminab w1, w0, [x0]
5866 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
5870 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
5871 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_release:
5872 ; CHECK: lduminlb w1, w0, [x0]
5873 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
5877 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5878 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
5879 ; CHECK: lduminalb w1, w0, [x0]
5880 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
5884 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5885 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
5886 ; CHECK: lduminalb w1, w0, [x0]
5887 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
5891 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5892 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
5893 ; -O0: and w10, w9, #0xffff
5894 ; -O0: subs w10, w10, w8, uxth
5895 ; -O0: csel w8, w9, w8, ls
5896 ; -O0: bl __atomic_compare_exchange
5898 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
5899 ; -O1: and w8, w0, #0xffff
5900 ; -O1: cmp w8, w20, uxth
5901 ; -O1: csel w8, w0, w20, ls
5902 ; -O1: bl __atomic_compare_exchange
5903 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
5907 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5908 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
5909 ; -O0: and w10, w9, #0xffff
5910 ; -O0: subs w10, w10, w8, uxth
5911 ; -O0: csel w8, w9, w8, ls
5912 ; -O0: bl __atomic_compare_exchange
5914 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
5915 ; -O1: and w8, w0, #0xffff
5916 ; -O1: cmp w8, w20, uxth
5917 ; -O1: csel w8, w0, w20, ls
5918 ; -O1: bl __atomic_compare_exchange
5919 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
5923 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
5924 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
5925 ; -O0: and w10, w9, #0xffff
5926 ; -O0: subs w10, w10, w8, uxth
5927 ; -O0: csel w8, w9, w8, ls
5928 ; -O0: bl __atomic_compare_exchange
5930 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
5931 ; -O1: and w8, w0, #0xffff
5932 ; -O1: cmp w8, w20, uxth
5933 ; -O1: csel w8, w0, w20, ls
5934 ; -O1: bl __atomic_compare_exchange
5935 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
5939 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5940 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
5941 ; -O0: and w10, w9, #0xffff
5942 ; -O0: subs w10, w10, w8, uxth
5943 ; -O0: csel w8, w9, w8, ls
5944 ; -O0: bl __atomic_compare_exchange
5946 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
5947 ; -O1: and w8, w0, #0xffff
5948 ; -O1: cmp w8, w20, uxth
5949 ; -O1: csel w8, w0, w20, ls
5950 ; -O1: bl __atomic_compare_exchange
5951 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
5955 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5956 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
5957 ; -O0: and w10, w9, #0xffff
5958 ; -O0: subs w10, w10, w8, uxth
5959 ; -O0: csel w8, w9, w8, ls
5960 ; -O0: bl __atomic_compare_exchange
5962 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
5963 ; -O1: and w8, w0, #0xffff
5964 ; -O1: cmp w8, w20, uxth
5965 ; -O1: csel w8, w0, w20, ls
5966 ; -O1: bl __atomic_compare_exchange
5967 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
5971 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5972 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
5973 ; -O0: subs w10, w9, w8
5974 ; -O0: csel w8, w9, w8, ls
5975 ; -O0: bl __atomic_compare_exchange
5977 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
5979 ; -O1: csel w8, w0, w20, ls
5980 ; -O1: bl __atomic_compare_exchange
5981 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
5985 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5986 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
5987 ; -O0: subs w10, w9, w8
5988 ; -O0: csel w8, w9, w8, ls
5989 ; -O0: bl __atomic_compare_exchange
5991 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
5993 ; -O1: csel w8, w0, w20, ls
5994 ; -O1: bl __atomic_compare_exchange
5995 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
5999 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
6000 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
6001 ; -O0: subs w10, w9, w8
6002 ; -O0: csel w8, w9, w8, ls
6003 ; -O0: bl __atomic_compare_exchange
6005 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
6007 ; -O1: csel w8, w0, w20, ls
6008 ; -O1: bl __atomic_compare_exchange
6009 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
6013 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6014 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6015 ; -O0: subs w10, w9, w8
6016 ; -O0: csel w8, w9, w8, ls
6017 ; -O0: bl __atomic_compare_exchange
6019 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6021 ; -O1: csel w8, w0, w20, ls
6022 ; -O1: bl __atomic_compare_exchange
6023 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
6027 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6028 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6029 ; -O0: subs w10, w9, w8
6030 ; -O0: csel w8, w9, w8, ls
6031 ; -O0: bl __atomic_compare_exchange
6033 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6035 ; -O1: csel w8, w0, w20, ls
6036 ; -O1: bl __atomic_compare_exchange
6037 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
6041 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6042 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6043 ; -O0: subs x10, x9, x8
6044 ; -O0: csel x8, x9, x8, ls
6045 ; -O0: bl __atomic_compare_exchange
6047 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6049 ; -O1: csel x8, x0, x20, ls
6050 ; -O1: bl __atomic_compare_exchange
6051 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
6055 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6056 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6057 ; -O0: subs x10, x9, x8
6058 ; -O0: csel x8, x9, x8, ls
6059 ; -O0: bl __atomic_compare_exchange
6061 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6063 ; -O1: csel x8, x0, x20, ls
6064 ; -O1: bl __atomic_compare_exchange
6065 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
6069 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
6070 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
6071 ; -O0: subs x10, x9, x8
6072 ; -O0: csel x8, x9, x8, ls
6073 ; -O0: bl __atomic_compare_exchange
6075 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
6077 ; -O1: csel x8, x0, x20, ls
6078 ; -O1: bl __atomic_compare_exchange
6079 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
6083 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6084 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6085 ; -O0: subs x10, x9, x8
6086 ; -O0: csel x8, x9, x8, ls
6087 ; -O0: bl __atomic_compare_exchange
6089 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6091 ; -O1: csel x8, x0, x20, ls
6092 ; -O1: bl __atomic_compare_exchange
6093 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
6097 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6098 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6099 ; -O0: subs x10, x9, x8
6100 ; -O0: csel x8, x9, x8, ls
6101 ; -O0: bl __atomic_compare_exchange
6103 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6105 ; -O1: csel x8, x0, x20, ls
6106 ; -O1: bl __atomic_compare_exchange
6107 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
6111 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6112 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6113 ; -O0: subs x12, x9, x10
6114 ; -O0: csel x8, x11, x8, hs
6115 ; -O0: csel x9, x10, x9, hs
6116 ; -O0: bl __atomic_compare_exchange
6118 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6119 ; -O1: ldp x0, x1, [x0]
6121 ; -O1: csel x8, x1, x19, hs
6122 ; -O1: csel x9, x0, x21, hs
6123 ; -O1: bl __atomic_compare_exchange
6124 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
6128 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6129 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6130 ; -O0: subs x12, x9, x10
6131 ; -O0: csel x8, x11, x8, hs
6132 ; -O0: csel x9, x10, x9, hs
6133 ; -O0: bl __atomic_compare_exchange
6135 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6136 ; -O1: ldp x0, x1, [x0]
6138 ; -O1: csel x8, x1, x19, hs
6139 ; -O1: csel x9, x0, x21, hs
6140 ; -O1: bl __atomic_compare_exchange
6141 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
6145 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
6146 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
6147 ; -O0: subs x12, x9, x10
6148 ; -O0: csel x8, x11, x8, hs
6149 ; -O0: csel x9, x10, x9, hs
6150 ; -O0: bl __atomic_compare_exchange
6152 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
6153 ; -O1: ldp x0, x1, [x0]
6155 ; -O1: csel x8, x1, x19, hs
6156 ; -O1: csel x9, x0, x21, hs
6157 ; -O1: bl __atomic_compare_exchange
6158 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
6162 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6163 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6164 ; -O0: subs x12, x9, x10
6165 ; -O0: csel x8, x11, x8, hs
6166 ; -O0: csel x9, x10, x9, hs
6167 ; -O0: bl __atomic_compare_exchange
6169 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6170 ; -O1: ldp x0, x1, [x0]
6172 ; -O1: csel x8, x1, x19, hs
6173 ; -O1: csel x9, x0, x21, hs
6174 ; -O1: bl __atomic_compare_exchange
6175 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
6179 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6180 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6181 ; -O0: subs x12, x9, x10
6182 ; -O0: csel x8, x11, x8, hs
6183 ; -O0: csel x9, x10, x9, hs
6184 ; -O0: bl __atomic_compare_exchange
6186 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6187 ; -O1: ldp x0, x1, [x0]
6189 ; -O1: csel x8, x1, x19, hs
6190 ; -O1: csel x9, x0, x21, hs
6191 ; -O1: bl __atomic_compare_exchange
6192 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1