1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.1a -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+v8.1a -O1 | FileCheck %s --check-prefixes=CHECK,-O1
6 define dso_local i8 @atomicrmw_xchg_i8_aligned_monotonic(ptr %ptr, i8 %value) {
7 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_monotonic:
8 ; CHECK: swpb w1, w0, [x0]
9 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
13 define dso_local i8 @atomicrmw_xchg_i8_aligned_acquire(ptr %ptr, i8 %value) {
14 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_acquire:
15 ; CHECK: swpab w1, w0, [x0]
16 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
20 define dso_local i8 @atomicrmw_xchg_i8_aligned_release(ptr %ptr, i8 %value) {
21 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_release:
22 ; CHECK: swplb w1, w0, [x0]
23 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
27 define dso_local i8 @atomicrmw_xchg_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
28 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_acq_rel:
29 ; CHECK: swpalb w1, w0, [x0]
30 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
34 define dso_local i8 @atomicrmw_xchg_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
35 ; CHECK-LABEL: atomicrmw_xchg_i8_aligned_seq_cst:
36 ; CHECK: swpalb w1, w0, [x0]
37 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
41 define dso_local i16 @atomicrmw_xchg_i16_aligned_monotonic(ptr %ptr, i16 %value) {
42 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_monotonic:
43 ; CHECK: swph w1, w0, [x0]
44 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 2
48 define dso_local i16 @atomicrmw_xchg_i16_aligned_acquire(ptr %ptr, i16 %value) {
49 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_acquire:
50 ; CHECK: swpah w1, w0, [x0]
51 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 2
55 define dso_local i16 @atomicrmw_xchg_i16_aligned_release(ptr %ptr, i16 %value) {
56 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_release:
57 ; CHECK: swplh w1, w0, [x0]
58 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 2
62 define dso_local i16 @atomicrmw_xchg_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
63 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_acq_rel:
64 ; CHECK: swpalh w1, w0, [x0]
65 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 2
69 define dso_local i16 @atomicrmw_xchg_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
70 ; CHECK-LABEL: atomicrmw_xchg_i16_aligned_seq_cst:
71 ; CHECK: swpalh w1, w0, [x0]
72 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 2
76 define dso_local i32 @atomicrmw_xchg_i32_aligned_monotonic(ptr %ptr, i32 %value) {
77 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_monotonic:
78 ; CHECK: swp w1, w0, [x0]
79 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 4
83 define dso_local i32 @atomicrmw_xchg_i32_aligned_acquire(ptr %ptr, i32 %value) {
84 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_acquire:
85 ; CHECK: swpa w1, w0, [x0]
86 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 4
90 define dso_local i32 @atomicrmw_xchg_i32_aligned_release(ptr %ptr, i32 %value) {
91 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_release:
92 ; CHECK: swpl w1, w0, [x0]
93 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 4
97 define dso_local i32 @atomicrmw_xchg_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
98 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_acq_rel:
99 ; CHECK: swpal w1, w0, [x0]
100 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 4
104 define dso_local i32 @atomicrmw_xchg_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
105 ; CHECK-LABEL: atomicrmw_xchg_i32_aligned_seq_cst:
106 ; CHECK: swpal w1, w0, [x0]
107 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 4
111 define dso_local i64 @atomicrmw_xchg_i64_aligned_monotonic(ptr %ptr, i64 %value) {
112 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_monotonic:
113 ; CHECK: swp x1, x0, [x0]
114 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 8
118 define dso_local i64 @atomicrmw_xchg_i64_aligned_acquire(ptr %ptr, i64 %value) {
119 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_acquire:
120 ; CHECK: swpa x1, x0, [x0]
121 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 8
125 define dso_local i64 @atomicrmw_xchg_i64_aligned_release(ptr %ptr, i64 %value) {
126 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_release:
127 ; CHECK: swpl x1, x0, [x0]
128 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 8
132 define dso_local i64 @atomicrmw_xchg_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
133 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_acq_rel:
134 ; CHECK: swpal x1, x0, [x0]
135 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 8
139 define dso_local i64 @atomicrmw_xchg_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
140 ; CHECK-LABEL: atomicrmw_xchg_i64_aligned_seq_cst:
141 ; CHECK: swpal x1, x0, [x0]
142 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 8
146 define dso_local i128 @atomicrmw_xchg_i128_aligned_monotonic(ptr %ptr, i128 %value) {
147 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
148 ; -O0: casp x0, x1, x2, x3, [x8]
149 ; -O0: eor x8, x10, x8
150 ; -O0: eor x11, x9, x11
151 ; -O0: orr x8, x8, x11
152 ; -O0: subs x8, x8, #0
154 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
155 ; -O1: ldp x4, x5, [x0]
156 ; -O1: casp x4, x5, x2, x3, [x0]
158 ; -O1: ccmp x4, x6, #0, eq
159 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
163 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
164 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
165 ; -O0: caspa x0, x1, x2, x3, [x8]
166 ; -O0: eor x8, x10, x8
167 ; -O0: eor x11, x9, x11
168 ; -O0: orr x8, x8, x11
169 ; -O0: subs x8, x8, #0
171 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
172 ; -O1: ldp x4, x5, [x0]
173 ; -O1: caspa x4, x5, x2, x3, [x0]
175 ; -O1: ccmp x4, x6, #0, eq
176 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
180 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
181 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
182 ; -O0: caspl x0, x1, x2, x3, [x8]
183 ; -O0: eor x8, x10, x8
184 ; -O0: eor x11, x9, x11
185 ; -O0: orr x8, x8, x11
186 ; -O0: subs x8, x8, #0
188 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
189 ; -O1: ldp x4, x5, [x0]
190 ; -O1: caspl x4, x5, x2, x3, [x0]
192 ; -O1: ccmp x4, x6, #0, eq
193 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
197 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
198 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
199 ; -O0: caspal x0, x1, x2, x3, [x8]
200 ; -O0: eor x8, x10, x8
201 ; -O0: eor x11, x9, x11
202 ; -O0: orr x8, x8, x11
203 ; -O0: subs x8, x8, #0
205 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
206 ; -O1: ldp x4, x5, [x0]
207 ; -O1: caspal x4, x5, x2, x3, [x0]
209 ; -O1: ccmp x4, x6, #0, eq
210 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
214 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
215 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
216 ; -O0: caspal x0, x1, x2, x3, [x8]
217 ; -O0: eor x8, x10, x8
218 ; -O0: eor x11, x9, x11
219 ; -O0: orr x8, x8, x11
220 ; -O0: subs x8, x8, #0
222 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
223 ; -O1: ldp x4, x5, [x0]
224 ; -O1: caspal x4, x5, x2, x3, [x0]
226 ; -O1: ccmp x4, x6, #0, eq
227 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
231 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
232 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
233 ; CHECK: swpb w1, w0, [x0]
234 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
238 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
239 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
240 ; CHECK: swpab w1, w0, [x0]
241 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
245 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
246 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_release:
247 ; CHECK: swplb w1, w0, [x0]
248 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
252 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
253 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
254 ; CHECK: swpalb w1, w0, [x0]
255 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
259 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
260 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
261 ; CHECK: swpalb w1, w0, [x0]
262 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
266 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
267 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
268 ; CHECK: bl __atomic_exchange
269 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
273 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
274 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
275 ; CHECK: bl __atomic_exchange
276 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
280 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
281 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
282 ; CHECK: bl __atomic_exchange
283 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
287 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
288 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
289 ; CHECK: bl __atomic_exchange
290 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
294 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
295 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
296 ; CHECK: bl __atomic_exchange
297 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
301 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
302 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
303 ; CHECK: bl __atomic_exchange
304 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
308 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
309 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
310 ; CHECK: bl __atomic_exchange
311 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
315 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
316 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
317 ; CHECK: bl __atomic_exchange
318 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
322 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
323 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
324 ; CHECK: bl __atomic_exchange
325 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
329 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
330 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
331 ; CHECK: bl __atomic_exchange
332 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
336 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
337 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
338 ; CHECK: bl __atomic_exchange
339 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
343 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
344 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
345 ; CHECK: bl __atomic_exchange
346 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
350 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
351 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
352 ; CHECK: bl __atomic_exchange
353 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
357 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
358 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
359 ; CHECK: bl __atomic_exchange
360 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
364 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
365 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
366 ; CHECK: bl __atomic_exchange
367 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
371 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
372 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
373 ; CHECK: bl __atomic_exchange
374 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
378 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
379 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
380 ; CHECK: bl __atomic_exchange
381 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
385 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
386 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
387 ; CHECK: bl __atomic_exchange
388 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
392 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
393 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
394 ; CHECK: bl __atomic_exchange
395 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
399 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
400 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
401 ; CHECK: bl __atomic_exchange
402 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
406 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
407 ; CHECK-LABEL: atomicrmw_add_i8_aligned_monotonic:
408 ; CHECK: ldaddb w1, w0, [x0]
409 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
413 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
414 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acquire:
415 ; CHECK: ldaddab w1, w0, [x0]
416 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
420 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
421 ; CHECK-LABEL: atomicrmw_add_i8_aligned_release:
422 ; CHECK: ldaddlb w1, w0, [x0]
423 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
427 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
428 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acq_rel:
429 ; CHECK: ldaddalb w1, w0, [x0]
430 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
434 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
435 ; CHECK-LABEL: atomicrmw_add_i8_aligned_seq_cst:
436 ; CHECK: ldaddalb w1, w0, [x0]
437 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
441 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
442 ; CHECK-LABEL: atomicrmw_add_i16_aligned_monotonic:
443 ; CHECK: ldaddh w1, w0, [x0]
444 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
448 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
449 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acquire:
450 ; CHECK: ldaddah w1, w0, [x0]
451 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
455 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
456 ; CHECK-LABEL: atomicrmw_add_i16_aligned_release:
457 ; CHECK: ldaddlh w1, w0, [x0]
458 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
462 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
463 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acq_rel:
464 ; CHECK: ldaddalh w1, w0, [x0]
465 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
469 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
470 ; CHECK-LABEL: atomicrmw_add_i16_aligned_seq_cst:
471 ; CHECK: ldaddalh w1, w0, [x0]
472 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
476 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
477 ; CHECK-LABEL: atomicrmw_add_i32_aligned_monotonic:
478 ; CHECK: ldadd w1, w0, [x0]
479 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
483 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
484 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acquire:
485 ; CHECK: ldadda w1, w0, [x0]
486 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
490 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
491 ; CHECK-LABEL: atomicrmw_add_i32_aligned_release:
492 ; CHECK: ldaddl w1, w0, [x0]
493 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
497 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
498 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acq_rel:
499 ; CHECK: ldaddal w1, w0, [x0]
500 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
504 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
505 ; CHECK-LABEL: atomicrmw_add_i32_aligned_seq_cst:
506 ; CHECK: ldaddal w1, w0, [x0]
507 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
511 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
512 ; CHECK-LABEL: atomicrmw_add_i64_aligned_monotonic:
513 ; CHECK: ldadd x1, x0, [x0]
514 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
518 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
519 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acquire:
520 ; CHECK: ldadda x1, x0, [x0]
521 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
525 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
526 ; CHECK-LABEL: atomicrmw_add_i64_aligned_release:
527 ; CHECK: ldaddl x1, x0, [x0]
528 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
532 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
533 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acq_rel:
534 ; CHECK: ldaddal x1, x0, [x0]
535 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
539 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
540 ; CHECK-LABEL: atomicrmw_add_i64_aligned_seq_cst:
541 ; CHECK: ldaddal x1, x0, [x0]
542 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
546 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
547 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
548 ; -O0: adds x2, x9, x11
549 ; -O0: and w11, w9, #0x1
550 ; -O0: subs w11, w11, #1
551 ; -O0: casp x0, x1, x2, x3, [x8]
552 ; -O0: eor x8, x10, x8
553 ; -O0: eor x11, x9, x11
554 ; -O0: orr x8, x8, x11
555 ; -O0: subs x8, x8, #0
557 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
558 ; -O1: ldp x4, x5, [x0]
559 ; -O1: adds x8, x4, x2
560 ; -O1: casp x4, x5, x8, x9, [x0]
562 ; -O1: ccmp x4, x6, #0, eq
563 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
567 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
568 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
569 ; -O0: adds x2, x9, x11
570 ; -O0: and w11, w9, #0x1
571 ; -O0: subs w11, w11, #1
572 ; -O0: caspa x0, x1, x2, x3, [x8]
573 ; -O0: eor x8, x10, x8
574 ; -O0: eor x11, x9, x11
575 ; -O0: orr x8, x8, x11
576 ; -O0: subs x8, x8, #0
578 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
579 ; -O1: ldp x4, x5, [x0]
580 ; -O1: adds x8, x4, x2
581 ; -O1: caspa x4, x5, x8, x9, [x0]
583 ; -O1: ccmp x4, x6, #0, eq
584 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
588 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
589 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
590 ; -O0: adds x2, x9, x11
591 ; -O0: and w11, w9, #0x1
592 ; -O0: subs w11, w11, #1
593 ; -O0: caspl x0, x1, x2, x3, [x8]
594 ; -O0: eor x8, x10, x8
595 ; -O0: eor x11, x9, x11
596 ; -O0: orr x8, x8, x11
597 ; -O0: subs x8, x8, #0
599 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
600 ; -O1: ldp x4, x5, [x0]
601 ; -O1: adds x8, x4, x2
602 ; -O1: caspl x4, x5, x8, x9, [x0]
604 ; -O1: ccmp x4, x6, #0, eq
605 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
609 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
610 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
611 ; -O0: adds x2, x9, x11
612 ; -O0: and w11, w9, #0x1
613 ; -O0: subs w11, w11, #1
614 ; -O0: caspal x0, x1, x2, x3, [x8]
615 ; -O0: eor x8, x10, x8
616 ; -O0: eor x11, x9, x11
617 ; -O0: orr x8, x8, x11
618 ; -O0: subs x8, x8, #0
620 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
621 ; -O1: ldp x4, x5, [x0]
622 ; -O1: adds x8, x4, x2
623 ; -O1: caspal x4, x5, x8, x9, [x0]
625 ; -O1: ccmp x4, x6, #0, eq
626 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
630 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
631 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
632 ; -O0: adds x2, x9, x11
633 ; -O0: and w11, w9, #0x1
634 ; -O0: subs w11, w11, #1
635 ; -O0: caspal x0, x1, x2, x3, [x8]
636 ; -O0: eor x8, x10, x8
637 ; -O0: eor x11, x9, x11
638 ; -O0: orr x8, x8, x11
639 ; -O0: subs x8, x8, #0
641 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
642 ; -O1: ldp x4, x5, [x0]
643 ; -O1: adds x8, x4, x2
644 ; -O1: caspal x4, x5, x8, x9, [x0]
646 ; -O1: ccmp x4, x6, #0, eq
647 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
651 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
652 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
653 ; CHECK: ldaddb w1, w0, [x0]
654 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
658 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
659 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
660 ; CHECK: ldaddab w1, w0, [x0]
661 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
665 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
666 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
667 ; CHECK: ldaddlb w1, w0, [x0]
668 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
672 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
673 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
674 ; CHECK: ldaddalb w1, w0, [x0]
675 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
679 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
680 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
681 ; CHECK: ldaddalb w1, w0, [x0]
682 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
686 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
687 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
688 ; -O0: add w8, w8, w9, uxth
689 ; -O0: bl __atomic_compare_exchange
691 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
692 ; -O1: add w8, w0, w20
693 ; -O1: bl __atomic_compare_exchange
694 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
698 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
699 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
700 ; -O0: add w8, w8, w9, uxth
701 ; -O0: bl __atomic_compare_exchange
703 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
704 ; -O1: add w8, w0, w20
705 ; -O1: bl __atomic_compare_exchange
706 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
710 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
711 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
712 ; -O0: add w8, w8, w9, uxth
713 ; -O0: bl __atomic_compare_exchange
715 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
716 ; -O1: add w8, w0, w20
717 ; -O1: bl __atomic_compare_exchange
718 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
722 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
723 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
724 ; -O0: add w8, w8, w9, uxth
725 ; -O0: bl __atomic_compare_exchange
727 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
728 ; -O1: add w8, w0, w20
729 ; -O1: bl __atomic_compare_exchange
730 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
734 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
735 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
736 ; -O0: add w8, w8, w9, uxth
737 ; -O0: bl __atomic_compare_exchange
739 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
740 ; -O1: add w8, w0, w20
741 ; -O1: bl __atomic_compare_exchange
742 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
746 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
747 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
748 ; -O0: add w8, w9, w8
749 ; -O0: bl __atomic_compare_exchange
751 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
752 ; -O1: add w8, w0, w20
753 ; -O1: bl __atomic_compare_exchange
754 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
758 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
759 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
760 ; -O0: add w8, w9, w8
761 ; -O0: bl __atomic_compare_exchange
763 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
764 ; -O1: add w8, w0, w20
765 ; -O1: bl __atomic_compare_exchange
766 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
770 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
771 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
772 ; -O0: add w8, w9, w8
773 ; -O0: bl __atomic_compare_exchange
775 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
776 ; -O1: add w8, w0, w20
777 ; -O1: bl __atomic_compare_exchange
778 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
782 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
783 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
784 ; -O0: add w8, w9, w8
785 ; -O0: bl __atomic_compare_exchange
787 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
788 ; -O1: add w8, w0, w20
789 ; -O1: bl __atomic_compare_exchange
790 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
794 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
795 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
796 ; -O0: add w8, w9, w8
797 ; -O0: bl __atomic_compare_exchange
799 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
800 ; -O1: add w8, w0, w20
801 ; -O1: bl __atomic_compare_exchange
802 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
806 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
807 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
808 ; -O0: add x8, x9, x8
809 ; -O0: bl __atomic_compare_exchange
811 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
812 ; -O1: add x8, x0, x20
813 ; -O1: bl __atomic_compare_exchange
814 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
818 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
819 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
820 ; -O0: add x8, x9, x8
821 ; -O0: bl __atomic_compare_exchange
823 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
824 ; -O1: add x8, x0, x20
825 ; -O1: bl __atomic_compare_exchange
826 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
830 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
831 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
832 ; -O0: add x8, x9, x8
833 ; -O0: bl __atomic_compare_exchange
835 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
836 ; -O1: add x8, x0, x20
837 ; -O1: bl __atomic_compare_exchange
838 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
842 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
843 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
844 ; -O0: add x8, x9, x8
845 ; -O0: bl __atomic_compare_exchange
847 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
848 ; -O1: add x8, x0, x20
849 ; -O1: bl __atomic_compare_exchange
850 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
854 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
855 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
856 ; -O0: add x8, x9, x8
857 ; -O0: bl __atomic_compare_exchange
859 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
860 ; -O1: add x8, x0, x20
861 ; -O1: bl __atomic_compare_exchange
862 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
866 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
867 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
868 ; -O0: adds x9, x8, x9
869 ; -O0: and w11, w8, #0x1
870 ; -O0: subs w11, w11, #1
871 ; -O0: bl __atomic_compare_exchange
873 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
874 ; -O1: ldp x0, x1, [x0]
875 ; -O1: adds x8, x0, x21
876 ; -O1: bl __atomic_compare_exchange
877 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
881 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
882 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
883 ; -O0: adds x9, x8, x9
884 ; -O0: and w11, w8, #0x1
885 ; -O0: subs w11, w11, #1
886 ; -O0: bl __atomic_compare_exchange
888 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
889 ; -O1: ldp x0, x1, [x0]
890 ; -O1: adds x8, x0, x21
891 ; -O1: bl __atomic_compare_exchange
892 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
896 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
897 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
898 ; -O0: adds x9, x8, x9
899 ; -O0: and w11, w8, #0x1
900 ; -O0: subs w11, w11, #1
901 ; -O0: bl __atomic_compare_exchange
903 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
904 ; -O1: ldp x0, x1, [x0]
905 ; -O1: adds x8, x0, x21
906 ; -O1: bl __atomic_compare_exchange
907 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
911 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
912 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
913 ; -O0: adds x9, x8, x9
914 ; -O0: and w11, w8, #0x1
915 ; -O0: subs w11, w11, #1
916 ; -O0: bl __atomic_compare_exchange
918 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
919 ; -O1: ldp x0, x1, [x0]
920 ; -O1: adds x8, x0, x21
921 ; -O1: bl __atomic_compare_exchange
922 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
926 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
927 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
928 ; -O0: adds x9, x8, x9
929 ; -O0: and w11, w8, #0x1
930 ; -O0: subs w11, w11, #1
931 ; -O0: bl __atomic_compare_exchange
933 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
934 ; -O1: ldp x0, x1, [x0]
935 ; -O1: adds x8, x0, x21
936 ; -O1: bl __atomic_compare_exchange
937 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
941 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
942 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_monotonic:
943 ; CHECK: ldaddb w8, w0, [x0]
944 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
948 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
949 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acquire:
950 ; CHECK: ldaddab w8, w0, [x0]
951 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
955 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
956 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_release:
957 ; CHECK: ldaddlb w8, w0, [x0]
958 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
962 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
963 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
964 ; CHECK: ldaddalb w8, w0, [x0]
965 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
969 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
970 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
971 ; CHECK: ldaddalb w8, w0, [x0]
972 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
976 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
977 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_monotonic:
978 ; CHECK: ldaddh w8, w0, [x0]
979 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
983 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
984 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acquire:
985 ; CHECK: ldaddah w8, w0, [x0]
986 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
990 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
991 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_release:
992 ; CHECK: ldaddlh w8, w0, [x0]
993 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
997 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
998 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
999 ; CHECK: ldaddalh w8, w0, [x0]
1000 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
1004 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1005 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1006 ; CHECK: ldaddalh w8, w0, [x0]
1007 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1011 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1012 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1013 ; CHECK: ldadd w8, w0, [x0]
1014 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1018 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1019 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acquire:
1020 ; CHECK: ldadda w8, w0, [x0]
1021 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1025 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1026 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_release:
1027 ; CHECK: ldaddl w8, w0, [x0]
1028 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1032 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1033 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1034 ; CHECK: ldaddal w8, w0, [x0]
1035 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1039 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1040 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1041 ; CHECK: ldaddal w8, w0, [x0]
1042 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1046 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1047 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1048 ; CHECK: ldadd x8, x0, [x0]
1049 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1053 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1054 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acquire:
1055 ; CHECK: ldadda x8, x0, [x0]
1056 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1060 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1061 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_release:
1062 ; CHECK: ldaddl x8, x0, [x0]
1063 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1067 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1068 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1069 ; CHECK: ldaddal x8, x0, [x0]
1070 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1074 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1075 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1076 ; CHECK: ldaddal x8, x0, [x0]
1077 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1081 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1082 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1083 ; -O0: subs x2, x9, x11
1084 ; -O0: and w11, w9, #0x1
1085 ; -O0: casp x0, x1, x2, x3, [x8]
1086 ; -O0: eor x8, x10, x8
1087 ; -O0: eor x11, x9, x11
1088 ; -O0: orr x8, x8, x11
1089 ; -O0: subs x8, x8, #0
1091 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1092 ; -O1: ldp x4, x5, [x0]
1093 ; -O1: subs x8, x4, x2
1094 ; -O1: casp x4, x5, x8, x9, [x0]
1096 ; -O1: ccmp x4, x6, #0, eq
1097 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1101 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1102 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1103 ; -O0: subs x2, x9, x11
1104 ; -O0: and w11, w9, #0x1
1105 ; -O0: caspa x0, x1, x2, x3, [x8]
1106 ; -O0: eor x8, x10, x8
1107 ; -O0: eor x11, x9, x11
1108 ; -O0: orr x8, x8, x11
1109 ; -O0: subs x8, x8, #0
1111 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1112 ; -O1: ldp x4, x5, [x0]
1113 ; -O1: subs x8, x4, x2
1114 ; -O1: caspa x4, x5, x8, x9, [x0]
1116 ; -O1: ccmp x4, x6, #0, eq
1117 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1121 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1122 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1123 ; -O0: subs x2, x9, x11
1124 ; -O0: and w11, w9, #0x1
1125 ; -O0: caspl x0, x1, x2, x3, [x8]
1126 ; -O0: eor x8, x10, x8
1127 ; -O0: eor x11, x9, x11
1128 ; -O0: orr x8, x8, x11
1129 ; -O0: subs x8, x8, #0
1131 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1132 ; -O1: ldp x4, x5, [x0]
1133 ; -O1: subs x8, x4, x2
1134 ; -O1: caspl x4, x5, x8, x9, [x0]
1136 ; -O1: ccmp x4, x6, #0, eq
1137 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1141 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1142 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1143 ; -O0: subs x2, x9, x11
1144 ; -O0: and w11, w9, #0x1
1145 ; -O0: caspal x0, x1, x2, x3, [x8]
1146 ; -O0: eor x8, x10, x8
1147 ; -O0: eor x11, x9, x11
1148 ; -O0: orr x8, x8, x11
1149 ; -O0: subs x8, x8, #0
1151 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1152 ; -O1: ldp x4, x5, [x0]
1153 ; -O1: subs x8, x4, x2
1154 ; -O1: caspal x4, x5, x8, x9, [x0]
1156 ; -O1: ccmp x4, x6, #0, eq
1157 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1161 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1162 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1163 ; -O0: subs x2, x9, x11
1164 ; -O0: and w11, w9, #0x1
1165 ; -O0: caspal x0, x1, x2, x3, [x8]
1166 ; -O0: eor x8, x10, x8
1167 ; -O0: eor x11, x9, x11
1168 ; -O0: orr x8, x8, x11
1169 ; -O0: subs x8, x8, #0
1171 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1172 ; -O1: ldp x4, x5, [x0]
1173 ; -O1: subs x8, x4, x2
1174 ; -O1: caspal x4, x5, x8, x9, [x0]
1176 ; -O1: ccmp x4, x6, #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 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1183 ; CHECK: ldaddb w8, w0, [x0]
1184 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1188 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1189 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1190 ; CHECK: ldaddab w8, w0, [x0]
1191 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1195 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1196 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_release:
1197 ; CHECK: ldaddlb w8, w0, [x0]
1198 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1202 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1203 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1204 ; CHECK: ldaddalb w8, w0, [x0]
1205 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1209 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1210 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1211 ; CHECK: ldaddalb w8, w0, [x0]
1212 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1216 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1217 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1218 ; -O0: subs w8, w9, w8
1219 ; -O0: bl __atomic_compare_exchange
1221 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1222 ; -O1: sub w8, w0, w20
1223 ; -O1: bl __atomic_compare_exchange
1224 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1228 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1229 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1230 ; -O0: subs w8, w9, w8
1231 ; -O0: bl __atomic_compare_exchange
1233 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1234 ; -O1: sub w8, w0, w20
1235 ; -O1: bl __atomic_compare_exchange
1236 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1240 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1241 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1242 ; -O0: subs w8, w9, w8
1243 ; -O0: bl __atomic_compare_exchange
1245 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1246 ; -O1: sub w8, w0, w20
1247 ; -O1: bl __atomic_compare_exchange
1248 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1252 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1253 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1254 ; -O0: subs w8, w9, w8
1255 ; -O0: bl __atomic_compare_exchange
1257 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1258 ; -O1: sub w8, w0, w20
1259 ; -O1: bl __atomic_compare_exchange
1260 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1264 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1265 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1266 ; -O0: subs w8, w9, w8
1267 ; -O0: bl __atomic_compare_exchange
1269 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1270 ; -O1: sub w8, w0, w20
1271 ; -O1: bl __atomic_compare_exchange
1272 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1276 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1277 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1278 ; -O0: subs w8, w9, w8
1279 ; -O0: bl __atomic_compare_exchange
1281 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1282 ; -O1: sub w8, w0, w20
1283 ; -O1: bl __atomic_compare_exchange
1284 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1288 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1289 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1290 ; -O0: subs w8, w9, w8
1291 ; -O0: bl __atomic_compare_exchange
1293 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1294 ; -O1: sub w8, w0, w20
1295 ; -O1: bl __atomic_compare_exchange
1296 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1300 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1301 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1302 ; -O0: subs w8, w9, w8
1303 ; -O0: bl __atomic_compare_exchange
1305 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1306 ; -O1: sub w8, w0, w20
1307 ; -O1: bl __atomic_compare_exchange
1308 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1312 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1313 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1314 ; -O0: subs w8, w9, w8
1315 ; -O0: bl __atomic_compare_exchange
1317 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1318 ; -O1: sub w8, w0, w20
1319 ; -O1: bl __atomic_compare_exchange
1320 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1324 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1325 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1326 ; -O0: subs w8, w9, w8
1327 ; -O0: bl __atomic_compare_exchange
1329 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1330 ; -O1: sub w8, w0, w20
1331 ; -O1: bl __atomic_compare_exchange
1332 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1336 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1337 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1338 ; -O0: subs x8, x9, x8
1339 ; -O0: bl __atomic_compare_exchange
1341 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1342 ; -O1: sub x8, x0, x20
1343 ; -O1: bl __atomic_compare_exchange
1344 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1348 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1349 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1350 ; -O0: subs x8, x9, x8
1351 ; -O0: bl __atomic_compare_exchange
1353 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1354 ; -O1: sub x8, x0, x20
1355 ; -O1: bl __atomic_compare_exchange
1356 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1360 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1361 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1362 ; -O0: subs x8, x9, x8
1363 ; -O0: bl __atomic_compare_exchange
1365 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1366 ; -O1: sub x8, x0, x20
1367 ; -O1: bl __atomic_compare_exchange
1368 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1372 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1373 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1374 ; -O0: subs x8, x9, x8
1375 ; -O0: bl __atomic_compare_exchange
1377 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1378 ; -O1: sub x8, x0, x20
1379 ; -O1: bl __atomic_compare_exchange
1380 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1384 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1385 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1386 ; -O0: subs x8, x9, x8
1387 ; -O0: bl __atomic_compare_exchange
1389 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1390 ; -O1: sub x8, x0, x20
1391 ; -O1: bl __atomic_compare_exchange
1392 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1396 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1397 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1398 ; -O0: subs x9, x8, x9
1399 ; -O0: and w11, w8, #0x1
1400 ; -O0: bl __atomic_compare_exchange
1402 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1403 ; -O1: ldp x0, x1, [x0]
1404 ; -O1: subs x8, x0, x21
1405 ; -O1: bl __atomic_compare_exchange
1406 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1410 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1411 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1412 ; -O0: subs x9, x8, x9
1413 ; -O0: and w11, w8, #0x1
1414 ; -O0: bl __atomic_compare_exchange
1416 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1417 ; -O1: ldp x0, x1, [x0]
1418 ; -O1: subs x8, x0, x21
1419 ; -O1: bl __atomic_compare_exchange
1420 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1424 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1425 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1426 ; -O0: subs x9, x8, x9
1427 ; -O0: and w11, w8, #0x1
1428 ; -O0: bl __atomic_compare_exchange
1430 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1431 ; -O1: ldp x0, x1, [x0]
1432 ; -O1: subs x8, x0, x21
1433 ; -O1: bl __atomic_compare_exchange
1434 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1438 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1439 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1440 ; -O0: subs x9, x8, x9
1441 ; -O0: and w11, w8, #0x1
1442 ; -O0: bl __atomic_compare_exchange
1444 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1445 ; -O1: ldp x0, x1, [x0]
1446 ; -O1: subs x8, x0, x21
1447 ; -O1: bl __atomic_compare_exchange
1448 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1452 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1453 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1454 ; -O0: subs x9, x8, x9
1455 ; -O0: and w11, w8, #0x1
1456 ; -O0: bl __atomic_compare_exchange
1458 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1459 ; -O1: ldp x0, x1, [x0]
1460 ; -O1: subs x8, x0, x21
1461 ; -O1: bl __atomic_compare_exchange
1462 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1466 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1467 ; CHECK-LABEL: atomicrmw_and_i8_aligned_monotonic:
1469 ; CHECK: ldclrb w8, w0, [x0]
1470 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1474 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1475 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acquire:
1477 ; CHECK: ldclrab w8, w0, [x0]
1478 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1482 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1483 ; CHECK-LABEL: atomicrmw_and_i8_aligned_release:
1485 ; CHECK: ldclrlb w8, w0, [x0]
1486 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1490 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1491 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1493 ; CHECK: ldclralb w8, w0, [x0]
1494 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1498 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1499 ; CHECK-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1501 ; CHECK: ldclralb w8, w0, [x0]
1502 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1506 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1507 ; CHECK-LABEL: atomicrmw_and_i16_aligned_monotonic:
1509 ; CHECK: ldclrh w8, w0, [x0]
1510 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1514 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1515 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acquire:
1517 ; CHECK: ldclrah w8, w0, [x0]
1518 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1522 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1523 ; CHECK-LABEL: atomicrmw_and_i16_aligned_release:
1525 ; CHECK: ldclrlh w8, w0, [x0]
1526 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1530 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1531 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1533 ; CHECK: ldclralh w8, w0, [x0]
1534 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1538 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1539 ; CHECK-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1541 ; CHECK: ldclralh w8, w0, [x0]
1542 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1546 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1547 ; CHECK-LABEL: atomicrmw_and_i32_aligned_monotonic:
1549 ; CHECK: ldclr w8, w0, [x0]
1550 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1554 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1555 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acquire:
1557 ; CHECK: ldclra w8, w0, [x0]
1558 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1562 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1563 ; CHECK-LABEL: atomicrmw_and_i32_aligned_release:
1565 ; CHECK: ldclrl w8, w0, [x0]
1566 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1570 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1571 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1573 ; CHECK: ldclral w8, w0, [x0]
1574 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1578 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1579 ; CHECK-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1581 ; CHECK: ldclral w8, w0, [x0]
1582 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1586 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1587 ; CHECK-LABEL: atomicrmw_and_i64_aligned_monotonic:
1589 ; CHECK: ldclr x8, x0, [x0]
1590 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1594 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1595 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acquire:
1597 ; CHECK: ldclra x8, x0, [x0]
1598 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1602 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1603 ; CHECK-LABEL: atomicrmw_and_i64_aligned_release:
1605 ; CHECK: ldclrl x8, x0, [x0]
1606 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1610 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1611 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1613 ; CHECK: ldclral x8, x0, [x0]
1614 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1618 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1619 ; CHECK-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1621 ; CHECK: ldclral x8, x0, [x0]
1622 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1626 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1627 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1628 ; -O0: and x2, x9, x11
1629 ; -O0: and x9, x9, x10
1630 ; -O0: casp x0, x1, x2, x3, [x8]
1631 ; -O0: eor x8, x10, x8
1632 ; -O0: eor x11, x9, x11
1633 ; -O0: orr x8, x8, x11
1634 ; -O0: subs x8, x8, #0
1636 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1637 ; -O1: ldp x4, x5, [x0]
1638 ; -O1: and x8, x4, x2
1639 ; -O1: and x9, x7, x3
1640 ; -O1: casp x4, x5, x8, x9, [x0]
1642 ; -O1: ccmp x4, x6, #0, eq
1643 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1647 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1648 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1649 ; -O0: and x2, x9, x11
1650 ; -O0: and x9, x9, x10
1651 ; -O0: caspa x0, x1, x2, x3, [x8]
1652 ; -O0: eor x8, x10, x8
1653 ; -O0: eor x11, x9, x11
1654 ; -O0: orr x8, x8, x11
1655 ; -O0: subs x8, x8, #0
1657 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1658 ; -O1: ldp x4, x5, [x0]
1659 ; -O1: and x8, x4, x2
1660 ; -O1: and x9, x7, x3
1661 ; -O1: caspa x4, x5, x8, x9, [x0]
1663 ; -O1: ccmp x4, x6, #0, eq
1664 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1668 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1669 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1670 ; -O0: and x2, x9, x11
1671 ; -O0: and x9, x9, x10
1672 ; -O0: caspl x0, x1, x2, x3, [x8]
1673 ; -O0: eor x8, x10, x8
1674 ; -O0: eor x11, x9, x11
1675 ; -O0: orr x8, x8, x11
1676 ; -O0: subs x8, x8, #0
1678 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1679 ; -O1: ldp x4, x5, [x0]
1680 ; -O1: and x8, x4, x2
1681 ; -O1: and x9, x7, x3
1682 ; -O1: caspl x4, x5, x8, x9, [x0]
1684 ; -O1: ccmp x4, x6, #0, eq
1685 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1689 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1690 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1691 ; -O0: and x2, x9, x11
1692 ; -O0: and x9, x9, x10
1693 ; -O0: caspal x0, x1, x2, x3, [x8]
1694 ; -O0: eor x8, x10, x8
1695 ; -O0: eor x11, x9, x11
1696 ; -O0: orr x8, x8, x11
1697 ; -O0: subs x8, x8, #0
1699 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1700 ; -O1: ldp x4, x5, [x0]
1701 ; -O1: and x8, x4, x2
1702 ; -O1: and x9, x7, x3
1703 ; -O1: caspal x4, x5, x8, x9, [x0]
1705 ; -O1: ccmp x4, x6, #0, eq
1706 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1710 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1711 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1712 ; -O0: and x2, x9, x11
1713 ; -O0: and x9, x9, x10
1714 ; -O0: caspal x0, x1, x2, x3, [x8]
1715 ; -O0: eor x8, x10, x8
1716 ; -O0: eor x11, x9, x11
1717 ; -O0: orr x8, x8, x11
1718 ; -O0: subs x8, x8, #0
1720 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1721 ; -O1: ldp x4, x5, [x0]
1722 ; -O1: and x8, x4, x2
1723 ; -O1: and x9, x7, x3
1724 ; -O1: caspal x4, x5, x8, x9, [x0]
1726 ; -O1: ccmp x4, x6, #0, eq
1727 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1731 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1732 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1734 ; CHECK: ldclrb w8, w0, [x0]
1735 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1739 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1740 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acquire:
1742 ; CHECK: ldclrab w8, w0, [x0]
1743 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1747 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1748 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_release:
1750 ; CHECK: ldclrlb w8, w0, [x0]
1751 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1755 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1756 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1758 ; CHECK: ldclralb w8, w0, [x0]
1759 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1763 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1764 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1766 ; CHECK: ldclralb w8, w0, [x0]
1767 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1771 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1772 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1773 ; -O0: and w8, w9, w8
1774 ; -O0: bl __atomic_compare_exchange
1776 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1777 ; -O1: and w8, w0, w20
1778 ; -O1: bl __atomic_compare_exchange
1779 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1783 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1784 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1785 ; -O0: and w8, w9, w8
1786 ; -O0: bl __atomic_compare_exchange
1788 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1789 ; -O1: and w8, w0, w20
1790 ; -O1: bl __atomic_compare_exchange
1791 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1795 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1796 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1797 ; -O0: and w8, w9, w8
1798 ; -O0: bl __atomic_compare_exchange
1800 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1801 ; -O1: and w8, w0, w20
1802 ; -O1: bl __atomic_compare_exchange
1803 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1807 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1808 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1809 ; -O0: and w8, w9, w8
1810 ; -O0: bl __atomic_compare_exchange
1812 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1813 ; -O1: and w8, w0, w20
1814 ; -O1: bl __atomic_compare_exchange
1815 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1819 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1820 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1821 ; -O0: and w8, w9, w8
1822 ; -O0: bl __atomic_compare_exchange
1824 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1825 ; -O1: and w8, w0, w20
1826 ; -O1: bl __atomic_compare_exchange
1827 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1831 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1832 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1833 ; -O0: and w8, w9, w8
1834 ; -O0: bl __atomic_compare_exchange
1836 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1837 ; -O1: and w8, w0, w20
1838 ; -O1: bl __atomic_compare_exchange
1839 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1843 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1844 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1845 ; -O0: and w8, w9, w8
1846 ; -O0: bl __atomic_compare_exchange
1848 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1849 ; -O1: and w8, w0, w20
1850 ; -O1: bl __atomic_compare_exchange
1851 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1855 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1856 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1857 ; -O0: and w8, w9, w8
1858 ; -O0: bl __atomic_compare_exchange
1860 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
1861 ; -O1: and w8, w0, w20
1862 ; -O1: bl __atomic_compare_exchange
1863 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
1867 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1868 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1869 ; -O0: and w8, w9, w8
1870 ; -O0: bl __atomic_compare_exchange
1872 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1873 ; -O1: and w8, w0, w20
1874 ; -O1: bl __atomic_compare_exchange
1875 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
1879 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1880 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1881 ; -O0: and w8, w9, w8
1882 ; -O0: bl __atomic_compare_exchange
1884 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1885 ; -O1: and w8, w0, w20
1886 ; -O1: bl __atomic_compare_exchange
1887 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
1891 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1892 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1893 ; -O0: and x8, x9, x8
1894 ; -O0: bl __atomic_compare_exchange
1896 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1897 ; -O1: and x8, x0, x20
1898 ; -O1: bl __atomic_compare_exchange
1899 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
1903 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1904 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
1905 ; -O0: and x8, x9, x8
1906 ; -O0: bl __atomic_compare_exchange
1908 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
1909 ; -O1: and x8, x0, x20
1910 ; -O1: bl __atomic_compare_exchange
1911 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
1915 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
1916 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
1917 ; -O0: and x8, x9, x8
1918 ; -O0: bl __atomic_compare_exchange
1920 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
1921 ; -O1: and x8, x0, x20
1922 ; -O1: bl __atomic_compare_exchange
1923 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
1927 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1928 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1929 ; -O0: and x8, x9, x8
1930 ; -O0: bl __atomic_compare_exchange
1932 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1933 ; -O1: and x8, x0, x20
1934 ; -O1: bl __atomic_compare_exchange
1935 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
1939 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1940 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1941 ; -O0: and x8, x9, x8
1942 ; -O0: bl __atomic_compare_exchange
1944 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1945 ; -O1: and x8, x0, x20
1946 ; -O1: bl __atomic_compare_exchange
1947 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
1951 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1952 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1953 ; -O0: and x9, x8, x9
1954 ; -O0: and x8, x8, x10
1955 ; -O0: bl __atomic_compare_exchange
1957 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1958 ; -O1: ldp x0, x1, [x0]
1959 ; -O1: and x8, x1, x19
1960 ; -O1: and x9, x0, x21
1961 ; -O1: bl __atomic_compare_exchange
1962 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
1966 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1967 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
1968 ; -O0: and x9, x8, x9
1969 ; -O0: and x8, x8, x10
1970 ; -O0: bl __atomic_compare_exchange
1972 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
1973 ; -O1: ldp x0, x1, [x0]
1974 ; -O1: and x8, x1, x19
1975 ; -O1: and x9, x0, x21
1976 ; -O1: bl __atomic_compare_exchange
1977 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
1981 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
1982 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
1983 ; -O0: and x9, x8, x9
1984 ; -O0: and x8, x8, x10
1985 ; -O0: bl __atomic_compare_exchange
1987 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
1988 ; -O1: ldp x0, x1, [x0]
1989 ; -O1: and x8, x1, x19
1990 ; -O1: and x9, x0, x21
1991 ; -O1: bl __atomic_compare_exchange
1992 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
1996 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1997 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1998 ; -O0: and x9, x8, x9
1999 ; -O0: and x8, x8, x10
2000 ; -O0: bl __atomic_compare_exchange
2002 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2003 ; -O1: ldp x0, x1, [x0]
2004 ; -O1: and x8, x1, x19
2005 ; -O1: and x9, x0, x21
2006 ; -O1: bl __atomic_compare_exchange
2007 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2011 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2012 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2013 ; -O0: and x9, x8, x9
2014 ; -O0: and x8, x8, x10
2015 ; -O0: bl __atomic_compare_exchange
2017 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2018 ; -O1: ldp x0, x1, [x0]
2019 ; -O1: and x8, x1, x19
2020 ; -O1: and x9, x0, x21
2021 ; -O1: bl __atomic_compare_exchange
2022 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2026 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2027 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2028 ; -O0: and w8, w10, w8
2030 ; -O0: casb w9, w8, [x11]
2031 ; -O0: and w8, w9, #0xff
2032 ; -O0: subs w8, w8, w10, uxtb
2034 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2035 ; -O1: and w10, w8, w1
2037 ; -O1: casb w9, w10, [x0]
2038 ; -O1: cmp w9, w8, uxtb
2039 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2043 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2044 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2045 ; -O0: and w8, w10, w8
2047 ; -O0: casab w9, w8, [x11]
2048 ; -O0: and w8, w9, #0xff
2049 ; -O0: subs w8, w8, w10, uxtb
2051 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2052 ; -O1: and w10, w8, w1
2054 ; -O1: casab w9, w10, [x0]
2055 ; -O1: cmp w9, w8, uxtb
2056 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2060 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2061 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2062 ; -O0: and w8, w10, w8
2064 ; -O0: caslb w9, w8, [x11]
2065 ; -O0: and w8, w9, #0xff
2066 ; -O0: subs w8, w8, w10, uxtb
2068 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2069 ; -O1: and w10, w8, w1
2071 ; -O1: caslb w9, w10, [x0]
2072 ; -O1: cmp w9, w8, uxtb
2073 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2077 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2078 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2079 ; -O0: and w8, w10, w8
2081 ; -O0: casalb w9, w8, [x11]
2082 ; -O0: and w8, w9, #0xff
2083 ; -O0: subs w8, w8, w10, uxtb
2085 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2086 ; -O1: and w10, w8, w1
2088 ; -O1: casalb w9, w10, [x0]
2089 ; -O1: cmp w9, w8, uxtb
2090 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2094 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2095 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2096 ; -O0: and w8, w10, w8
2098 ; -O0: casalb w9, w8, [x11]
2099 ; -O0: and w8, w9, #0xff
2100 ; -O0: subs w8, w8, w10, uxtb
2102 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2103 ; -O1: and w10, w8, w1
2105 ; -O1: casalb w9, w10, [x0]
2106 ; -O1: cmp w9, w8, uxtb
2107 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2111 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2112 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2113 ; -O0: and w9, w8, w9
2115 ; -O0: cash w9, w10, [x11]
2116 ; -O0: subs w8, w8, w9, uxth
2118 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2119 ; -O1: and w10, w8, w1
2121 ; -O1: cash w9, w10, [x0]
2122 ; -O1: cmp w9, w8, uxth
2123 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2127 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2128 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2129 ; -O0: and w9, w8, w9
2131 ; -O0: casah w9, w10, [x11]
2132 ; -O0: subs w8, w8, w9, uxth
2134 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2135 ; -O1: and w10, w8, w1
2137 ; -O1: casah w9, w10, [x0]
2138 ; -O1: cmp w9, w8, uxth
2139 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2143 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2144 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2145 ; -O0: and w9, w8, w9
2147 ; -O0: caslh w9, w10, [x11]
2148 ; -O0: subs w8, w8, w9, uxth
2150 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2151 ; -O1: and w10, w8, w1
2153 ; -O1: caslh w9, w10, [x0]
2154 ; -O1: cmp w9, w8, uxth
2155 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2159 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2160 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2161 ; -O0: and w9, w8, w9
2163 ; -O0: casalh w9, w10, [x11]
2164 ; -O0: subs w8, w8, w9, uxth
2166 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2167 ; -O1: and w10, w8, w1
2169 ; -O1: casalh w9, w10, [x0]
2170 ; -O1: cmp w9, w8, uxth
2171 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2175 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2176 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2177 ; -O0: and w9, w8, w9
2179 ; -O0: casalh w9, w10, [x11]
2180 ; -O0: subs w8, w8, w9, uxth
2182 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2183 ; -O1: and w10, w8, w1
2185 ; -O1: casalh w9, w10, [x0]
2186 ; -O1: cmp w9, w8, uxth
2187 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2191 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2192 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2193 ; -O0: and w9, w8, w9
2195 ; -O0: cas w9, w10, [x11]
2196 ; -O0: subs w8, w9, w8
2198 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2199 ; -O1: and w10, w8, w1
2201 ; -O1: cas w9, w10, [x0]
2203 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2207 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2208 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2209 ; -O0: and w9, w8, w9
2211 ; -O0: casa w9, w10, [x11]
2212 ; -O0: subs w8, w9, w8
2214 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2215 ; -O1: and w10, w8, w1
2217 ; -O1: casa w9, w10, [x0]
2219 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2223 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2224 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2225 ; -O0: and w9, w8, w9
2227 ; -O0: casl w9, w10, [x11]
2228 ; -O0: subs w8, w9, w8
2230 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2231 ; -O1: and w10, w8, w1
2233 ; -O1: casl w9, w10, [x0]
2235 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2239 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2240 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2241 ; -O0: and w9, w8, w9
2243 ; -O0: casal w9, w10, [x11]
2244 ; -O0: subs w8, w9, w8
2246 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2247 ; -O1: and w10, w8, w1
2249 ; -O1: casal w9, w10, [x0]
2251 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2255 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2256 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2257 ; -O0: and w9, w8, w9
2259 ; -O0: casal w9, w10, [x11]
2260 ; -O0: subs w8, w9, w8
2262 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2263 ; -O1: and w10, w8, w1
2265 ; -O1: casal w9, w10, [x0]
2267 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2271 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2272 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2273 ; -O0: and x9, x8, x9
2275 ; -O0: cas x9, x10, [x11]
2276 ; -O0: subs x8, x9, x8
2278 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2279 ; -O1: and x10, x8, x1
2281 ; -O1: cas x9, x10, [x0]
2283 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2287 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2288 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2289 ; -O0: and x9, x8, x9
2291 ; -O0: casa x9, x10, [x11]
2292 ; -O0: subs x8, x9, x8
2294 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2295 ; -O1: and x10, x8, x1
2297 ; -O1: casa x9, x10, [x0]
2299 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2303 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2304 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2305 ; -O0: and x9, x8, x9
2307 ; -O0: casl x9, x10, [x11]
2308 ; -O0: subs x8, x9, x8
2310 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2311 ; -O1: and x10, x8, x1
2313 ; -O1: casl x9, x10, [x0]
2315 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2319 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2320 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2321 ; -O0: and x9, x8, x9
2323 ; -O0: casal x9, x10, [x11]
2324 ; -O0: subs x8, x9, x8
2326 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2327 ; -O1: and x10, x8, x1
2329 ; -O1: casal x9, x10, [x0]
2331 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2335 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2336 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2337 ; -O0: and x9, x8, x9
2339 ; -O0: casal x9, x10, [x11]
2340 ; -O0: subs x8, x9, x8
2342 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2343 ; -O1: and x10, x8, x1
2345 ; -O1: casal x9, x10, [x0]
2347 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2351 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2352 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2353 ; -O0: and x10, x9, x10
2354 ; -O0: and x9, x9, x11
2357 ; -O0: casp x0, x1, x2, x3, [x8]
2358 ; -O0: eor x8, x10, x8
2359 ; -O0: eor x11, x9, x11
2360 ; -O0: orr x8, x8, x11
2361 ; -O0: subs x8, x8, #0
2363 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2364 ; -O1: ldp x4, x5, [x0]
2365 ; -O1: and x8, x4, x2
2366 ; -O1: and x9, x7, x3
2369 ; -O1: casp x4, x5, x10, x11, [x0]
2371 ; -O1: ccmp x4, x6, #0, eq
2372 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2376 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2377 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2378 ; -O0: and x10, x9, x10
2379 ; -O0: and x9, x9, x11
2382 ; -O0: caspa x0, x1, x2, x3, [x8]
2383 ; -O0: eor x8, x10, x8
2384 ; -O0: eor x11, x9, x11
2385 ; -O0: orr x8, x8, x11
2386 ; -O0: subs x8, x8, #0
2388 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2389 ; -O1: ldp x4, x5, [x0]
2390 ; -O1: and x8, x4, x2
2391 ; -O1: and x9, x7, x3
2394 ; -O1: caspa x4, x5, x10, x11, [x0]
2396 ; -O1: ccmp x4, x6, #0, eq
2397 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2401 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2402 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2403 ; -O0: and x10, x9, x10
2404 ; -O0: and x9, x9, x11
2407 ; -O0: caspl x0, x1, x2, x3, [x8]
2408 ; -O0: eor x8, x10, x8
2409 ; -O0: eor x11, x9, x11
2410 ; -O0: orr x8, x8, x11
2411 ; -O0: subs x8, x8, #0
2413 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2414 ; -O1: ldp x4, x5, [x0]
2415 ; -O1: and x8, x4, x2
2416 ; -O1: and x9, x7, x3
2419 ; -O1: caspl x4, x5, x10, x11, [x0]
2421 ; -O1: ccmp x4, x6, #0, eq
2422 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2426 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2427 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2428 ; -O0: and x10, x9, x10
2429 ; -O0: and x9, x9, x11
2432 ; -O0: caspal x0, x1, x2, x3, [x8]
2433 ; -O0: eor x8, x10, x8
2434 ; -O0: eor x11, x9, x11
2435 ; -O0: orr x8, x8, x11
2436 ; -O0: subs x8, x8, #0
2438 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2439 ; -O1: ldp x4, x5, [x0]
2440 ; -O1: and x8, x4, x2
2441 ; -O1: and x9, x7, x3
2444 ; -O1: caspal x4, x5, x10, x11, [x0]
2446 ; -O1: ccmp x4, x6, #0, eq
2447 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2451 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2452 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2453 ; -O0: and x10, x9, x10
2454 ; -O0: and x9, x9, x11
2457 ; -O0: caspal x0, x1, x2, x3, [x8]
2458 ; -O0: eor x8, x10, x8
2459 ; -O0: eor x11, x9, x11
2460 ; -O0: orr x8, x8, x11
2461 ; -O0: subs x8, x8, #0
2463 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2464 ; -O1: ldp x4, x5, [x0]
2465 ; -O1: and x8, x4, x2
2466 ; -O1: and x9, x7, x3
2469 ; -O1: caspal x4, x5, x10, x11, [x0]
2471 ; -O1: ccmp x4, x6, #0, eq
2472 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2476 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2477 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2478 ; -O0: and w8, w10, w8
2480 ; -O0: casb w9, w8, [x11]
2481 ; -O0: and w8, w9, #0xff
2482 ; -O0: subs w8, w8, w10, uxtb
2484 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2485 ; -O1: and w10, w8, w1
2487 ; -O1: casb w9, w10, [x0]
2488 ; -O1: cmp w9, w8, uxtb
2489 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2493 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2494 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2495 ; -O0: and w8, w10, w8
2497 ; -O0: casab w9, w8, [x11]
2498 ; -O0: and w8, w9, #0xff
2499 ; -O0: subs w8, w8, w10, uxtb
2501 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2502 ; -O1: and w10, w8, w1
2504 ; -O1: casab w9, w10, [x0]
2505 ; -O1: cmp w9, w8, uxtb
2506 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2510 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2511 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2512 ; -O0: and w8, w10, w8
2514 ; -O0: caslb w9, w8, [x11]
2515 ; -O0: and w8, w9, #0xff
2516 ; -O0: subs w8, w8, w10, uxtb
2518 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2519 ; -O1: and w10, w8, w1
2521 ; -O1: caslb w9, w10, [x0]
2522 ; -O1: cmp w9, w8, uxtb
2523 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2527 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2528 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2529 ; -O0: and w8, w10, w8
2531 ; -O0: casalb w9, w8, [x11]
2532 ; -O0: and w8, w9, #0xff
2533 ; -O0: subs w8, w8, w10, uxtb
2535 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2536 ; -O1: and w10, w8, w1
2538 ; -O1: casalb w9, w10, [x0]
2539 ; -O1: cmp w9, w8, uxtb
2540 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2544 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2545 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2546 ; -O0: and w8, w10, w8
2548 ; -O0: casalb w9, w8, [x11]
2549 ; -O0: and w8, w9, #0xff
2550 ; -O0: subs w8, w8, w10, uxtb
2552 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2553 ; -O1: and w10, w8, w1
2555 ; -O1: casalb w9, w10, [x0]
2556 ; -O1: cmp w9, w8, uxtb
2557 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2561 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2562 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2563 ; -O0: and w8, w9, w8
2565 ; -O0: bl __atomic_compare_exchange
2567 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2568 ; -O1: and w8, w0, w20
2570 ; -O1: bl __atomic_compare_exchange
2571 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2575 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2576 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2577 ; -O0: and w8, w9, w8
2579 ; -O0: bl __atomic_compare_exchange
2581 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2582 ; -O1: and w8, w0, w20
2584 ; -O1: bl __atomic_compare_exchange
2585 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2589 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2590 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2591 ; -O0: and w8, w9, w8
2593 ; -O0: bl __atomic_compare_exchange
2595 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2596 ; -O1: and w8, w0, w20
2598 ; -O1: bl __atomic_compare_exchange
2599 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2603 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2604 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2605 ; -O0: and w8, w9, w8
2607 ; -O0: bl __atomic_compare_exchange
2609 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2610 ; -O1: and w8, w0, w20
2612 ; -O1: bl __atomic_compare_exchange
2613 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2617 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2618 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2619 ; -O0: and w8, w9, w8
2621 ; -O0: bl __atomic_compare_exchange
2623 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2624 ; -O1: and w8, w0, w20
2626 ; -O1: bl __atomic_compare_exchange
2627 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2631 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2632 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2633 ; -O0: and w8, w9, w8
2635 ; -O0: bl __atomic_compare_exchange
2637 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2638 ; -O1: and w8, w0, w20
2640 ; -O1: bl __atomic_compare_exchange
2641 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2645 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2646 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2647 ; -O0: and w8, w9, w8
2649 ; -O0: bl __atomic_compare_exchange
2651 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2652 ; -O1: and w8, w0, w20
2654 ; -O1: bl __atomic_compare_exchange
2655 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2659 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2660 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2661 ; -O0: and w8, w9, w8
2663 ; -O0: bl __atomic_compare_exchange
2665 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2666 ; -O1: and w8, w0, w20
2668 ; -O1: bl __atomic_compare_exchange
2669 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2673 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2674 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2675 ; -O0: and w8, w9, w8
2677 ; -O0: bl __atomic_compare_exchange
2679 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2680 ; -O1: and w8, w0, w20
2682 ; -O1: bl __atomic_compare_exchange
2683 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2687 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2688 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2689 ; -O0: and w8, w9, w8
2691 ; -O0: bl __atomic_compare_exchange
2693 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2694 ; -O1: and w8, w0, w20
2696 ; -O1: bl __atomic_compare_exchange
2697 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2701 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2702 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2703 ; -O0: and x8, x9, x8
2705 ; -O0: bl __atomic_compare_exchange
2707 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2708 ; -O1: and x8, x0, x20
2710 ; -O1: bl __atomic_compare_exchange
2711 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2715 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2716 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2717 ; -O0: and x8, x9, x8
2719 ; -O0: bl __atomic_compare_exchange
2721 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2722 ; -O1: and x8, x0, x20
2724 ; -O1: bl __atomic_compare_exchange
2725 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2729 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2730 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2731 ; -O0: and x8, x9, x8
2733 ; -O0: bl __atomic_compare_exchange
2735 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2736 ; -O1: and x8, x0, x20
2738 ; -O1: bl __atomic_compare_exchange
2739 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2743 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2744 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2745 ; -O0: and x8, x9, x8
2747 ; -O0: bl __atomic_compare_exchange
2749 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2750 ; -O1: and x8, x0, x20
2752 ; -O1: bl __atomic_compare_exchange
2753 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2757 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2758 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2759 ; -O0: and x8, x9, x8
2761 ; -O0: bl __atomic_compare_exchange
2763 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2764 ; -O1: and x8, x0, x20
2766 ; -O1: bl __atomic_compare_exchange
2767 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2771 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2772 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2773 ; -O0: and x9, x8, x9
2774 ; -O0: and x8, x8, x10
2777 ; -O0: bl __atomic_compare_exchange
2779 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2780 ; -O1: ldp x0, x1, [x0]
2781 ; -O1: and x8, x1, x19
2782 ; -O1: and x9, x0, x21
2785 ; -O1: bl __atomic_compare_exchange
2786 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2790 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2791 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2792 ; -O0: and x9, x8, x9
2793 ; -O0: and x8, x8, x10
2796 ; -O0: bl __atomic_compare_exchange
2798 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2799 ; -O1: ldp x0, x1, [x0]
2800 ; -O1: and x8, x1, x19
2801 ; -O1: and x9, x0, x21
2804 ; -O1: bl __atomic_compare_exchange
2805 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2809 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2810 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2811 ; -O0: and x9, x8, x9
2812 ; -O0: and x8, x8, x10
2815 ; -O0: bl __atomic_compare_exchange
2817 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2818 ; -O1: ldp x0, x1, [x0]
2819 ; -O1: and x8, x1, x19
2820 ; -O1: and x9, x0, x21
2823 ; -O1: bl __atomic_compare_exchange
2824 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2828 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2829 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2830 ; -O0: and x9, x8, x9
2831 ; -O0: and x8, x8, x10
2834 ; -O0: bl __atomic_compare_exchange
2836 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2837 ; -O1: ldp x0, x1, [x0]
2838 ; -O1: and x8, x1, x19
2839 ; -O1: and x9, x0, x21
2842 ; -O1: bl __atomic_compare_exchange
2843 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2847 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2848 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2849 ; -O0: and x9, x8, x9
2850 ; -O0: and x8, x8, x10
2853 ; -O0: bl __atomic_compare_exchange
2855 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2856 ; -O1: ldp x0, x1, [x0]
2857 ; -O1: and x8, x1, x19
2858 ; -O1: and x9, x0, x21
2861 ; -O1: bl __atomic_compare_exchange
2862 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2866 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2867 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2868 ; CHECK: ldsetb w1, w0, [x0]
2869 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2873 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
2874 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
2875 ; CHECK: ldsetab w1, w0, [x0]
2876 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2880 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
2881 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
2882 ; CHECK: ldsetlb w1, w0, [x0]
2883 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2887 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2888 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
2889 ; CHECK: ldsetalb w1, w0, [x0]
2890 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2894 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2895 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
2896 ; CHECK: ldsetalb w1, w0, [x0]
2897 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
2901 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2902 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
2903 ; CHECK: ldseth w1, w0, [x0]
2904 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
2908 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
2909 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
2910 ; CHECK: ldsetah w1, w0, [x0]
2911 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
2915 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
2916 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
2917 ; CHECK: ldsetlh w1, w0, [x0]
2918 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
2922 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2923 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
2924 ; CHECK: ldsetalh w1, w0, [x0]
2925 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
2929 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2930 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
2931 ; CHECK: ldsetalh w1, w0, [x0]
2932 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
2936 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2937 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
2938 ; CHECK: ldset w1, w0, [x0]
2939 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
2943 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
2944 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
2945 ; CHECK: ldseta w1, w0, [x0]
2946 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
2950 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
2951 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
2952 ; CHECK: ldsetl w1, w0, [x0]
2953 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
2957 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2958 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
2959 ; CHECK: ldsetal w1, w0, [x0]
2960 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
2964 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2965 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
2966 ; CHECK: ldsetal w1, w0, [x0]
2967 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
2971 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2972 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
2973 ; CHECK: ldset x1, x0, [x0]
2974 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
2978 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
2979 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
2980 ; CHECK: ldseta x1, x0, [x0]
2981 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
2985 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
2986 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
2987 ; CHECK: ldsetl x1, x0, [x0]
2988 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
2992 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2993 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
2994 ; CHECK: ldsetal x1, x0, [x0]
2995 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
2999 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3000 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
3001 ; CHECK: ldsetal x1, x0, [x0]
3002 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
3006 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3007 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
3008 ; -O0: orr x2, x9, x11
3009 ; -O0: orr x9, x9, x10
3010 ; -O0: casp x0, x1, x2, x3, [x8]
3011 ; -O0: eor x8, x10, x8
3012 ; -O0: eor x11, x9, x11
3013 ; -O0: orr x8, x8, x11
3014 ; -O0: subs x8, x8, #0
3016 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
3017 ; -O1: ldp x4, x5, [x0]
3018 ; -O1: orr x8, x4, x2
3019 ; -O1: orr x9, x7, x3
3020 ; -O1: casp x4, x5, x8, x9, [x0]
3022 ; -O1: ccmp x4, x6, #0, eq
3023 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
3027 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
3028 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
3029 ; -O0: orr x2, x9, x11
3030 ; -O0: orr x9, x9, x10
3031 ; -O0: caspa x0, x1, x2, x3, [x8]
3032 ; -O0: eor x8, x10, x8
3033 ; -O0: eor x11, x9, x11
3034 ; -O0: orr x8, x8, x11
3035 ; -O0: subs x8, x8, #0
3037 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
3038 ; -O1: ldp x4, x5, [x0]
3039 ; -O1: orr x8, x4, x2
3040 ; -O1: orr x9, x7, x3
3041 ; -O1: caspa x4, x5, x8, x9, [x0]
3043 ; -O1: ccmp x4, x6, #0, eq
3044 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
3048 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
3049 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
3050 ; -O0: orr x2, x9, x11
3051 ; -O0: orr x9, x9, x10
3052 ; -O0: caspl x0, x1, x2, x3, [x8]
3053 ; -O0: eor x8, x10, x8
3054 ; -O0: eor x11, x9, x11
3055 ; -O0: orr x8, x8, x11
3056 ; -O0: subs x8, x8, #0
3058 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
3059 ; -O1: ldp x4, x5, [x0]
3060 ; -O1: orr x8, x4, x2
3061 ; -O1: orr x9, x7, x3
3062 ; -O1: caspl x4, x5, x8, x9, [x0]
3064 ; -O1: ccmp x4, x6, #0, eq
3065 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
3069 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3070 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3071 ; -O0: orr x2, x9, x11
3072 ; -O0: orr x9, x9, x10
3073 ; -O0: caspal x0, x1, x2, x3, [x8]
3074 ; -O0: eor x8, x10, x8
3075 ; -O0: eor x11, x9, x11
3076 ; -O0: orr x8, x8, x11
3077 ; -O0: subs x8, x8, #0
3079 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3080 ; -O1: ldp x4, x5, [x0]
3081 ; -O1: orr x8, x4, x2
3082 ; -O1: orr x9, x7, x3
3083 ; -O1: caspal x4, x5, x8, x9, [x0]
3085 ; -O1: ccmp x4, x6, #0, eq
3086 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
3090 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3091 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3092 ; -O0: orr x2, x9, x11
3093 ; -O0: orr x9, x9, x10
3094 ; -O0: caspal x0, x1, x2, x3, [x8]
3095 ; -O0: eor x8, x10, x8
3096 ; -O0: eor x11, x9, x11
3097 ; -O0: orr x8, x8, x11
3098 ; -O0: subs x8, x8, #0
3100 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3101 ; -O1: ldp x4, x5, [x0]
3102 ; -O1: orr x8, x4, x2
3103 ; -O1: orr x9, x7, x3
3104 ; -O1: caspal x4, x5, x8, x9, [x0]
3106 ; -O1: ccmp x4, x6, #0, eq
3107 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
3111 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3112 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
3113 ; CHECK: ldsetb w1, w0, [x0]
3114 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3118 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3119 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
3120 ; CHECK: ldsetab w1, w0, [x0]
3121 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3125 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3126 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3127 ; CHECK: ldsetlb w1, w0, [x0]
3128 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3132 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3133 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3134 ; CHECK: ldsetalb w1, w0, [x0]
3135 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3139 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3140 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3141 ; CHECK: ldsetalb w1, w0, [x0]
3142 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3146 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3147 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3148 ; -O0: orr w8, w9, w8
3149 ; -O0: bl __atomic_compare_exchange
3151 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3152 ; -O1: orr w8, w0, w20
3153 ; -O1: bl __atomic_compare_exchange
3154 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3158 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3159 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3160 ; -O0: orr w8, w9, w8
3161 ; -O0: bl __atomic_compare_exchange
3163 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3164 ; -O1: orr w8, w0, w20
3165 ; -O1: bl __atomic_compare_exchange
3166 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3170 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3171 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3172 ; -O0: orr w8, w9, w8
3173 ; -O0: bl __atomic_compare_exchange
3175 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3176 ; -O1: orr w8, w0, w20
3177 ; -O1: bl __atomic_compare_exchange
3178 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3182 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3183 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3184 ; -O0: orr w8, w9, w8
3185 ; -O0: bl __atomic_compare_exchange
3187 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3188 ; -O1: orr w8, w0, w20
3189 ; -O1: bl __atomic_compare_exchange
3190 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3194 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3195 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3196 ; -O0: orr w8, w9, w8
3197 ; -O0: bl __atomic_compare_exchange
3199 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3200 ; -O1: orr w8, w0, w20
3201 ; -O1: bl __atomic_compare_exchange
3202 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3206 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3207 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3208 ; -O0: orr w8, w9, w8
3209 ; -O0: bl __atomic_compare_exchange
3211 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3212 ; -O1: orr w8, w0, w20
3213 ; -O1: bl __atomic_compare_exchange
3214 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3218 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3219 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3220 ; -O0: orr w8, w9, w8
3221 ; -O0: bl __atomic_compare_exchange
3223 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3224 ; -O1: orr w8, w0, w20
3225 ; -O1: bl __atomic_compare_exchange
3226 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3230 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3231 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3232 ; -O0: orr w8, w9, w8
3233 ; -O0: bl __atomic_compare_exchange
3235 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3236 ; -O1: orr w8, w0, w20
3237 ; -O1: bl __atomic_compare_exchange
3238 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3242 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3243 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3244 ; -O0: orr w8, w9, w8
3245 ; -O0: bl __atomic_compare_exchange
3247 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3248 ; -O1: orr w8, w0, w20
3249 ; -O1: bl __atomic_compare_exchange
3250 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3254 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3255 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3256 ; -O0: orr w8, w9, w8
3257 ; -O0: bl __atomic_compare_exchange
3259 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3260 ; -O1: orr w8, w0, w20
3261 ; -O1: bl __atomic_compare_exchange
3262 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3266 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3267 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3268 ; -O0: orr x8, x9, x8
3269 ; -O0: bl __atomic_compare_exchange
3271 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3272 ; -O1: orr x8, x0, x20
3273 ; -O1: bl __atomic_compare_exchange
3274 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3278 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3279 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3280 ; -O0: orr x8, x9, x8
3281 ; -O0: bl __atomic_compare_exchange
3283 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3284 ; -O1: orr x8, x0, x20
3285 ; -O1: bl __atomic_compare_exchange
3286 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3290 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3291 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3292 ; -O0: orr x8, x9, x8
3293 ; -O0: bl __atomic_compare_exchange
3295 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3296 ; -O1: orr x8, x0, x20
3297 ; -O1: bl __atomic_compare_exchange
3298 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3302 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3303 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3304 ; -O0: orr x8, x9, x8
3305 ; -O0: bl __atomic_compare_exchange
3307 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3308 ; -O1: orr x8, x0, x20
3309 ; -O1: bl __atomic_compare_exchange
3310 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3314 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3315 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3316 ; -O0: orr x8, x9, x8
3317 ; -O0: bl __atomic_compare_exchange
3319 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3320 ; -O1: orr x8, x0, x20
3321 ; -O1: bl __atomic_compare_exchange
3322 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3326 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3327 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3328 ; -O0: orr x9, x8, x9
3329 ; -O0: orr x8, x8, x10
3330 ; -O0: bl __atomic_compare_exchange
3332 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3333 ; -O1: ldp x0, x1, [x0]
3334 ; -O1: orr x8, x1, x19
3335 ; -O1: orr x9, x0, x21
3336 ; -O1: bl __atomic_compare_exchange
3337 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3341 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3342 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3343 ; -O0: orr x9, x8, x9
3344 ; -O0: orr x8, x8, x10
3345 ; -O0: bl __atomic_compare_exchange
3347 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3348 ; -O1: ldp x0, x1, [x0]
3349 ; -O1: orr x8, x1, x19
3350 ; -O1: orr x9, x0, x21
3351 ; -O1: bl __atomic_compare_exchange
3352 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3356 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3357 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3358 ; -O0: orr x9, x8, x9
3359 ; -O0: orr x8, x8, x10
3360 ; -O0: bl __atomic_compare_exchange
3362 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3363 ; -O1: ldp x0, x1, [x0]
3364 ; -O1: orr x8, x1, x19
3365 ; -O1: orr x9, x0, x21
3366 ; -O1: bl __atomic_compare_exchange
3367 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3371 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3372 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3373 ; -O0: orr x9, x8, x9
3374 ; -O0: orr x8, x8, x10
3375 ; -O0: bl __atomic_compare_exchange
3377 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3378 ; -O1: ldp x0, x1, [x0]
3379 ; -O1: orr x8, x1, x19
3380 ; -O1: orr x9, x0, x21
3381 ; -O1: bl __atomic_compare_exchange
3382 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3386 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3387 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3388 ; -O0: orr x9, x8, x9
3389 ; -O0: orr x8, x8, x10
3390 ; -O0: bl __atomic_compare_exchange
3392 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3393 ; -O1: ldp x0, x1, [x0]
3394 ; -O1: orr x8, x1, x19
3395 ; -O1: orr x9, x0, x21
3396 ; -O1: bl __atomic_compare_exchange
3397 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3401 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3402 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3403 ; CHECK: ldeorb w1, w0, [x0]
3404 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3408 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3409 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3410 ; CHECK: ldeorab w1, w0, [x0]
3411 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3415 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3416 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3417 ; CHECK: ldeorlb w1, w0, [x0]
3418 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3422 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3423 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3424 ; CHECK: ldeoralb w1, w0, [x0]
3425 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3429 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3430 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3431 ; CHECK: ldeoralb w1, w0, [x0]
3432 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3436 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3437 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3438 ; CHECK: ldeorh w1, w0, [x0]
3439 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3443 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3444 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3445 ; CHECK: ldeorah w1, w0, [x0]
3446 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3450 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3451 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3452 ; CHECK: ldeorlh w1, w0, [x0]
3453 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3457 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3458 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3459 ; CHECK: ldeoralh w1, w0, [x0]
3460 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3464 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3465 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3466 ; CHECK: ldeoralh w1, w0, [x0]
3467 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3471 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3472 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3473 ; CHECK: ldeor w1, w0, [x0]
3474 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3478 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3479 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3480 ; CHECK: ldeora w1, w0, [x0]
3481 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3485 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3486 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3487 ; CHECK: ldeorl w1, w0, [x0]
3488 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3492 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3493 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3494 ; CHECK: ldeoral w1, w0, [x0]
3495 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3499 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3500 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3501 ; CHECK: ldeoral w1, w0, [x0]
3502 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3506 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3507 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3508 ; CHECK: ldeor x1, x0, [x0]
3509 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3513 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3514 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3515 ; CHECK: ldeora x1, x0, [x0]
3516 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3520 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3521 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3522 ; CHECK: ldeorl x1, x0, [x0]
3523 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3527 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3528 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3529 ; CHECK: ldeoral x1, x0, [x0]
3530 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3534 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3535 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3536 ; CHECK: ldeoral x1, x0, [x0]
3537 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3541 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3542 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3543 ; -O0: eor x2, x9, x11
3544 ; -O0: eor x9, x9, x10
3545 ; -O0: casp x0, x1, x2, x3, [x8]
3546 ; -O0: eor x8, x10, x8
3547 ; -O0: eor x11, x9, x11
3548 ; -O0: orr x8, x8, x11
3549 ; -O0: subs x8, x8, #0
3551 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3552 ; -O1: ldp x4, x5, [x0]
3553 ; -O1: eor x8, x4, x2
3554 ; -O1: eor x9, x7, x3
3555 ; -O1: casp x4, x5, x8, x9, [x0]
3557 ; -O1: ccmp x4, x6, #0, eq
3558 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3562 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3563 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3564 ; -O0: eor x2, x9, x11
3565 ; -O0: eor x9, x9, x10
3566 ; -O0: caspa x0, x1, x2, x3, [x8]
3567 ; -O0: eor x8, x10, x8
3568 ; -O0: eor x11, x9, x11
3569 ; -O0: orr x8, x8, x11
3570 ; -O0: subs x8, x8, #0
3572 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3573 ; -O1: ldp x4, x5, [x0]
3574 ; -O1: eor x8, x4, x2
3575 ; -O1: eor x9, x7, x3
3576 ; -O1: caspa x4, x5, x8, x9, [x0]
3578 ; -O1: ccmp x4, x6, #0, eq
3579 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3583 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3584 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3585 ; -O0: eor x2, x9, x11
3586 ; -O0: eor x9, x9, x10
3587 ; -O0: caspl x0, x1, x2, x3, [x8]
3588 ; -O0: eor x8, x10, x8
3589 ; -O0: eor x11, x9, x11
3590 ; -O0: orr x8, x8, x11
3591 ; -O0: subs x8, x8, #0
3593 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3594 ; -O1: ldp x4, x5, [x0]
3595 ; -O1: eor x8, x4, x2
3596 ; -O1: eor x9, x7, x3
3597 ; -O1: caspl x4, x5, x8, x9, [x0]
3599 ; -O1: ccmp x4, x6, #0, eq
3600 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3604 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3605 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3606 ; -O0: eor x2, x9, x11
3607 ; -O0: eor x9, x9, x10
3608 ; -O0: caspal x0, x1, x2, x3, [x8]
3609 ; -O0: eor x8, x10, x8
3610 ; -O0: eor x11, x9, x11
3611 ; -O0: orr x8, x8, x11
3612 ; -O0: subs x8, x8, #0
3614 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3615 ; -O1: ldp x4, x5, [x0]
3616 ; -O1: eor x8, x4, x2
3617 ; -O1: eor x9, x7, x3
3618 ; -O1: caspal x4, x5, x8, x9, [x0]
3620 ; -O1: ccmp x4, x6, #0, eq
3621 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3625 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3626 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3627 ; -O0: eor x2, x9, x11
3628 ; -O0: eor x9, x9, x10
3629 ; -O0: caspal x0, x1, x2, x3, [x8]
3630 ; -O0: eor x8, x10, x8
3631 ; -O0: eor x11, x9, x11
3632 ; -O0: orr x8, x8, x11
3633 ; -O0: subs x8, x8, #0
3635 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3636 ; -O1: ldp x4, x5, [x0]
3637 ; -O1: eor x8, x4, x2
3638 ; -O1: eor x9, x7, x3
3639 ; -O1: caspal x4, x5, x8, x9, [x0]
3641 ; -O1: ccmp x4, x6, #0, eq
3642 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3646 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3647 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3648 ; CHECK: ldeorb w1, w0, [x0]
3649 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3653 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3654 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3655 ; CHECK: ldeorab w1, w0, [x0]
3656 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3660 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3661 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3662 ; CHECK: ldeorlb w1, w0, [x0]
3663 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3667 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3668 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3669 ; CHECK: ldeoralb w1, w0, [x0]
3670 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3674 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3675 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3676 ; CHECK: ldeoralb w1, w0, [x0]
3677 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3681 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3682 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3683 ; -O0: eor w8, w9, w8
3684 ; -O0: bl __atomic_compare_exchange
3686 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3687 ; -O1: eor w8, w0, w20
3688 ; -O1: bl __atomic_compare_exchange
3689 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3693 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3694 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3695 ; -O0: eor w8, w9, w8
3696 ; -O0: bl __atomic_compare_exchange
3698 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3699 ; -O1: eor w8, w0, w20
3700 ; -O1: bl __atomic_compare_exchange
3701 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3705 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3706 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3707 ; -O0: eor w8, w9, w8
3708 ; -O0: bl __atomic_compare_exchange
3710 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3711 ; -O1: eor w8, w0, w20
3712 ; -O1: bl __atomic_compare_exchange
3713 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3717 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3718 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3719 ; -O0: eor w8, w9, w8
3720 ; -O0: bl __atomic_compare_exchange
3722 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3723 ; -O1: eor w8, w0, w20
3724 ; -O1: bl __atomic_compare_exchange
3725 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3729 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3730 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3731 ; -O0: eor w8, w9, w8
3732 ; -O0: bl __atomic_compare_exchange
3734 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3735 ; -O1: eor w8, w0, w20
3736 ; -O1: bl __atomic_compare_exchange
3737 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3741 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3742 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3743 ; -O0: eor w8, w9, w8
3744 ; -O0: bl __atomic_compare_exchange
3746 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3747 ; -O1: eor w8, w0, w20
3748 ; -O1: bl __atomic_compare_exchange
3749 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3753 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3754 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3755 ; -O0: eor w8, w9, w8
3756 ; -O0: bl __atomic_compare_exchange
3758 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3759 ; -O1: eor w8, w0, w20
3760 ; -O1: bl __atomic_compare_exchange
3761 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3765 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3766 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3767 ; -O0: eor w8, w9, w8
3768 ; -O0: bl __atomic_compare_exchange
3770 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3771 ; -O1: eor w8, w0, w20
3772 ; -O1: bl __atomic_compare_exchange
3773 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3777 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3778 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3779 ; -O0: eor w8, w9, w8
3780 ; -O0: bl __atomic_compare_exchange
3782 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3783 ; -O1: eor w8, w0, w20
3784 ; -O1: bl __atomic_compare_exchange
3785 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3789 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3790 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3791 ; -O0: eor w8, w9, w8
3792 ; -O0: bl __atomic_compare_exchange
3794 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3795 ; -O1: eor w8, w0, w20
3796 ; -O1: bl __atomic_compare_exchange
3797 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3801 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3802 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3803 ; -O0: eor x8, x9, x8
3804 ; -O0: bl __atomic_compare_exchange
3806 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3807 ; -O1: eor x8, x0, x20
3808 ; -O1: bl __atomic_compare_exchange
3809 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3813 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3814 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3815 ; -O0: eor x8, x9, x8
3816 ; -O0: bl __atomic_compare_exchange
3818 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3819 ; -O1: eor x8, x0, x20
3820 ; -O1: bl __atomic_compare_exchange
3821 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3825 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3826 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3827 ; -O0: eor x8, x9, x8
3828 ; -O0: bl __atomic_compare_exchange
3830 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3831 ; -O1: eor x8, x0, x20
3832 ; -O1: bl __atomic_compare_exchange
3833 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3837 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3838 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3839 ; -O0: eor x8, x9, x8
3840 ; -O0: bl __atomic_compare_exchange
3842 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3843 ; -O1: eor x8, x0, x20
3844 ; -O1: bl __atomic_compare_exchange
3845 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3849 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3850 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3851 ; -O0: eor x8, x9, x8
3852 ; -O0: bl __atomic_compare_exchange
3854 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3855 ; -O1: eor x8, x0, x20
3856 ; -O1: bl __atomic_compare_exchange
3857 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3861 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3862 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3863 ; -O0: eor x9, x8, x9
3864 ; -O0: eor x8, x8, x10
3865 ; -O0: bl __atomic_compare_exchange
3867 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3868 ; -O1: ldp x0, x1, [x0]
3869 ; -O1: eor x8, x1, x19
3870 ; -O1: eor x9, x0, x21
3871 ; -O1: bl __atomic_compare_exchange
3872 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
3876 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3877 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3878 ; -O0: eor x9, x8, x9
3879 ; -O0: eor x8, x8, x10
3880 ; -O0: bl __atomic_compare_exchange
3882 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3883 ; -O1: ldp x0, x1, [x0]
3884 ; -O1: eor x8, x1, x19
3885 ; -O1: eor x9, x0, x21
3886 ; -O1: bl __atomic_compare_exchange
3887 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
3891 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
3892 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
3893 ; -O0: eor x9, x8, x9
3894 ; -O0: eor x8, x8, x10
3895 ; -O0: bl __atomic_compare_exchange
3897 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
3898 ; -O1: ldp x0, x1, [x0]
3899 ; -O1: eor x8, x1, x19
3900 ; -O1: eor x9, x0, x21
3901 ; -O1: bl __atomic_compare_exchange
3902 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
3906 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3907 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3908 ; -O0: eor x9, x8, x9
3909 ; -O0: eor x8, x8, x10
3910 ; -O0: bl __atomic_compare_exchange
3912 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3913 ; -O1: ldp x0, x1, [x0]
3914 ; -O1: eor x8, x1, x19
3915 ; -O1: eor x9, x0, x21
3916 ; -O1: bl __atomic_compare_exchange
3917 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
3921 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3922 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3923 ; -O0: eor x9, x8, x9
3924 ; -O0: eor x8, x8, x10
3925 ; -O0: bl __atomic_compare_exchange
3927 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3928 ; -O1: ldp x0, x1, [x0]
3929 ; -O1: eor x8, x1, x19
3930 ; -O1: eor x9, x0, x21
3931 ; -O1: bl __atomic_compare_exchange
3932 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
3936 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3937 ; CHECK-LABEL: atomicrmw_max_i8_aligned_monotonic:
3938 ; CHECK: ldsmaxb w1, w0, [x0]
3939 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
3943 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
3944 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acquire:
3945 ; CHECK: ldsmaxab w1, w0, [x0]
3946 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
3950 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
3951 ; CHECK-LABEL: atomicrmw_max_i8_aligned_release:
3952 ; CHECK: ldsmaxlb w1, w0, [x0]
3953 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
3957 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3958 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acq_rel:
3959 ; CHECK: ldsmaxalb w1, w0, [x0]
3960 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
3964 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3965 ; CHECK-LABEL: atomicrmw_max_i8_aligned_seq_cst:
3966 ; CHECK: ldsmaxalb w1, w0, [x0]
3967 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
3971 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3972 ; CHECK-LABEL: atomicrmw_max_i16_aligned_monotonic:
3973 ; CHECK: ldsmaxh w1, w0, [x0]
3974 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
3978 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
3979 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acquire:
3980 ; CHECK: ldsmaxah w1, w0, [x0]
3981 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
3985 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
3986 ; CHECK-LABEL: atomicrmw_max_i16_aligned_release:
3987 ; CHECK: ldsmaxlh w1, w0, [x0]
3988 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
3992 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3993 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acq_rel:
3994 ; CHECK: ldsmaxalh w1, w0, [x0]
3995 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
3999 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4000 ; CHECK-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4001 ; CHECK: ldsmaxalh w1, w0, [x0]
4002 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
4006 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4007 ; CHECK-LABEL: atomicrmw_max_i32_aligned_monotonic:
4008 ; CHECK: ldsmax w1, w0, [x0]
4009 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
4013 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
4014 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acquire:
4015 ; CHECK: ldsmaxa w1, w0, [x0]
4016 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
4020 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
4021 ; CHECK-LABEL: atomicrmw_max_i32_aligned_release:
4022 ; CHECK: ldsmaxl w1, w0, [x0]
4023 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
4027 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4028 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4029 ; CHECK: ldsmaxal w1, w0, [x0]
4030 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
4034 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4035 ; CHECK-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4036 ; CHECK: ldsmaxal w1, w0, [x0]
4037 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
4041 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4042 ; CHECK-LABEL: atomicrmw_max_i64_aligned_monotonic:
4043 ; CHECK: ldsmax x1, x0, [x0]
4044 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
4048 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
4049 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acquire:
4050 ; CHECK: ldsmaxa x1, x0, [x0]
4051 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
4055 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
4056 ; CHECK-LABEL: atomicrmw_max_i64_aligned_release:
4057 ; CHECK: ldsmaxl x1, x0, [x0]
4058 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
4062 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4063 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4064 ; CHECK: ldsmaxal x1, x0, [x0]
4065 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
4069 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4070 ; CHECK-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4071 ; CHECK: ldsmaxal x1, x0, [x0]
4072 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
4076 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4077 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
4078 ; -O0: subs x9, x9, x10
4079 ; -O0: subs x9, x9, x10
4080 ; -O0: subs x9, x9, x12
4081 ; -O0: and w13, w13, #0x1
4082 ; -O0: ands w13, w13, #0x1
4083 ; -O0: csel w9, w9, w11, ne
4084 ; -O0: and w13, w9, #0x1
4085 ; -O0: ands w13, w13, #0x1
4086 ; -O0: csel x2, x11, x12, ne
4087 ; -O0: and w11, w9, #0x1
4088 ; -O0: ands w11, w11, #0x1
4089 ; -O0: csel x9, x9, x10, ne
4090 ; -O0: casp x0, x1, x2, x3, [x8]
4091 ; -O0: eor x8, x10, x8
4092 ; -O0: eor x11, x9, x11
4093 ; -O0: orr x8, x8, x11
4094 ; -O0: subs x8, x8, #0
4096 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
4097 ; -O1: ldp x4, x5, [x0]
4099 ; -O1: csel x9, x7, x3, lt
4100 ; -O1: csel x8, x4, x2, lt
4101 ; -O1: casp x4, x5, x8, x9, [x0]
4103 ; -O1: ccmp x4, x6, #0, eq
4104 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
4108 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
4109 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
4110 ; -O0: subs x9, x9, x10
4111 ; -O0: subs x9, x9, x10
4112 ; -O0: subs x9, x9, x12
4113 ; -O0: and w13, w13, #0x1
4114 ; -O0: ands w13, w13, #0x1
4115 ; -O0: csel w9, w9, w11, ne
4116 ; -O0: and w13, w9, #0x1
4117 ; -O0: ands w13, w13, #0x1
4118 ; -O0: csel x2, x11, x12, ne
4119 ; -O0: and w11, w9, #0x1
4120 ; -O0: ands w11, w11, #0x1
4121 ; -O0: csel x9, x9, x10, ne
4122 ; -O0: caspa x0, x1, x2, x3, [x8]
4123 ; -O0: eor x8, x10, x8
4124 ; -O0: eor x11, x9, x11
4125 ; -O0: orr x8, x8, x11
4126 ; -O0: subs x8, x8, #0
4128 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
4129 ; -O1: ldp x4, x5, [x0]
4131 ; -O1: csel x9, x7, x3, lt
4132 ; -O1: csel x8, x4, x2, lt
4133 ; -O1: caspa x4, x5, x8, x9, [x0]
4135 ; -O1: ccmp x4, x6, #0, eq
4136 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4140 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4141 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4142 ; -O0: subs x9, x9, x10
4143 ; -O0: subs x9, x9, x10
4144 ; -O0: subs x9, x9, x12
4145 ; -O0: and w13, w13, #0x1
4146 ; -O0: ands w13, w13, #0x1
4147 ; -O0: csel w9, w9, w11, ne
4148 ; -O0: and w13, w9, #0x1
4149 ; -O0: ands w13, w13, #0x1
4150 ; -O0: csel x2, x11, x12, ne
4151 ; -O0: and w11, w9, #0x1
4152 ; -O0: ands w11, w11, #0x1
4153 ; -O0: csel x9, x9, x10, ne
4154 ; -O0: caspl x0, x1, x2, x3, [x8]
4155 ; -O0: eor x8, x10, x8
4156 ; -O0: eor x11, x9, x11
4157 ; -O0: orr x8, x8, x11
4158 ; -O0: subs x8, x8, #0
4160 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
4161 ; -O1: ldp x4, x5, [x0]
4163 ; -O1: csel x9, x7, x3, lt
4164 ; -O1: csel x8, x4, x2, lt
4165 ; -O1: caspl x4, x5, x8, x9, [x0]
4167 ; -O1: ccmp x4, x6, #0, eq
4168 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4172 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4173 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4174 ; -O0: subs x9, x9, x10
4175 ; -O0: subs x9, x9, x10
4176 ; -O0: subs x9, x9, x12
4177 ; -O0: and w13, w13, #0x1
4178 ; -O0: ands w13, w13, #0x1
4179 ; -O0: csel w9, w9, w11, ne
4180 ; -O0: and w13, w9, #0x1
4181 ; -O0: ands w13, w13, #0x1
4182 ; -O0: csel x2, x11, x12, ne
4183 ; -O0: and w11, w9, #0x1
4184 ; -O0: ands w11, w11, #0x1
4185 ; -O0: csel x9, x9, x10, ne
4186 ; -O0: caspal x0, x1, x2, x3, [x8]
4187 ; -O0: eor x8, x10, x8
4188 ; -O0: eor x11, x9, x11
4189 ; -O0: orr x8, x8, x11
4190 ; -O0: subs x8, x8, #0
4192 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4193 ; -O1: ldp x4, x5, [x0]
4195 ; -O1: csel x9, x7, x3, lt
4196 ; -O1: csel x8, x4, x2, lt
4197 ; -O1: caspal x4, x5, x8, x9, [x0]
4199 ; -O1: ccmp x4, x6, #0, eq
4200 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4204 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4205 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4206 ; -O0: subs x9, x9, x10
4207 ; -O0: subs x9, x9, x10
4208 ; -O0: subs x9, x9, x12
4209 ; -O0: and w13, w13, #0x1
4210 ; -O0: ands w13, w13, #0x1
4211 ; -O0: csel w9, w9, w11, ne
4212 ; -O0: and w13, w9, #0x1
4213 ; -O0: ands w13, w13, #0x1
4214 ; -O0: csel x2, x11, x12, ne
4215 ; -O0: and w11, w9, #0x1
4216 ; -O0: ands w11, w11, #0x1
4217 ; -O0: csel x9, x9, x10, ne
4218 ; -O0: caspal x0, x1, x2, x3, [x8]
4219 ; -O0: eor x8, x10, x8
4220 ; -O0: eor x11, x9, x11
4221 ; -O0: orr x8, x8, x11
4222 ; -O0: subs x8, x8, #0
4224 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4225 ; -O1: ldp x4, x5, [x0]
4227 ; -O1: csel x9, x7, x3, lt
4228 ; -O1: csel x8, x4, x2, lt
4229 ; -O1: caspal x4, x5, x8, x9, [x0]
4231 ; -O1: ccmp x4, x6, #0, eq
4232 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4236 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4237 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4238 ; CHECK: ldsmaxb w1, w0, [x0]
4239 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4243 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4244 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acquire:
4245 ; CHECK: ldsmaxab w1, w0, [x0]
4246 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4250 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4251 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_release:
4252 ; CHECK: ldsmaxlb w1, w0, [x0]
4253 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4257 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4258 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4259 ; CHECK: ldsmaxalb w1, w0, [x0]
4260 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4264 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4265 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4266 ; CHECK: ldsmaxalb w1, w0, [x0]
4267 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4271 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4272 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4274 ; -O0: subs w10, w10, w8, sxth
4275 ; -O0: and w10, w10, #0x1
4276 ; -O0: ands w10, w10, #0x1
4277 ; -O0: csel w8, w9, w8, ne
4278 ; -O0: bl __atomic_compare_exchange
4280 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4282 ; -O1: cmp w8, w20, sxth
4283 ; -O1: csel w8, w0, w20, gt
4284 ; -O1: bl __atomic_compare_exchange
4285 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4289 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4290 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4292 ; -O0: subs w10, w10, w8, sxth
4293 ; -O0: and w10, w10, #0x1
4294 ; -O0: ands w10, w10, #0x1
4295 ; -O0: csel w8, w9, w8, ne
4296 ; -O0: bl __atomic_compare_exchange
4298 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4300 ; -O1: cmp w8, w20, sxth
4301 ; -O1: csel w8, w0, w20, gt
4302 ; -O1: bl __atomic_compare_exchange
4303 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4307 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4308 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4310 ; -O0: subs w10, w10, w8, sxth
4311 ; -O0: and w10, w10, #0x1
4312 ; -O0: ands w10, w10, #0x1
4313 ; -O0: csel w8, w9, w8, ne
4314 ; -O0: bl __atomic_compare_exchange
4316 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4318 ; -O1: cmp w8, w20, sxth
4319 ; -O1: csel w8, w0, w20, gt
4320 ; -O1: bl __atomic_compare_exchange
4321 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4325 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4326 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4328 ; -O0: subs w10, w10, w8, sxth
4329 ; -O0: and w10, w10, #0x1
4330 ; -O0: ands w10, w10, #0x1
4331 ; -O0: csel w8, w9, w8, ne
4332 ; -O0: bl __atomic_compare_exchange
4334 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4336 ; -O1: cmp w8, w20, sxth
4337 ; -O1: csel w8, w0, w20, gt
4338 ; -O1: bl __atomic_compare_exchange
4339 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
4343 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4344 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4346 ; -O0: subs w10, w10, w8, sxth
4347 ; -O0: and w10, w10, #0x1
4348 ; -O0: ands w10, w10, #0x1
4349 ; -O0: csel w8, w9, w8, ne
4350 ; -O0: bl __atomic_compare_exchange
4352 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4354 ; -O1: cmp w8, w20, sxth
4355 ; -O1: csel w8, w0, w20, gt
4356 ; -O1: bl __atomic_compare_exchange
4357 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4361 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4362 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4363 ; -O0: subs w10, w9, w8
4364 ; -O0: and w10, w10, #0x1
4365 ; -O0: ands w10, w10, #0x1
4366 ; -O0: csel w8, w9, w8, ne
4367 ; -O0: bl __atomic_compare_exchange
4369 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4371 ; -O1: csel w8, w0, w20, gt
4372 ; -O1: bl __atomic_compare_exchange
4373 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4377 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4378 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4379 ; -O0: subs w10, w9, w8
4380 ; -O0: and w10, w10, #0x1
4381 ; -O0: ands w10, w10, #0x1
4382 ; -O0: csel w8, w9, w8, ne
4383 ; -O0: bl __atomic_compare_exchange
4385 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4387 ; -O1: csel w8, w0, w20, gt
4388 ; -O1: bl __atomic_compare_exchange
4389 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4393 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4394 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4395 ; -O0: subs w10, w9, w8
4396 ; -O0: and w10, w10, #0x1
4397 ; -O0: ands w10, w10, #0x1
4398 ; -O0: csel w8, w9, w8, ne
4399 ; -O0: bl __atomic_compare_exchange
4401 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4403 ; -O1: csel w8, w0, w20, gt
4404 ; -O1: bl __atomic_compare_exchange
4405 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4409 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4410 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4411 ; -O0: subs w10, w9, w8
4412 ; -O0: and w10, w10, #0x1
4413 ; -O0: ands w10, w10, #0x1
4414 ; -O0: csel w8, w9, w8, ne
4415 ; -O0: bl __atomic_compare_exchange
4417 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4419 ; -O1: csel w8, w0, w20, gt
4420 ; -O1: bl __atomic_compare_exchange
4421 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4425 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4426 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4427 ; -O0: subs w10, w9, w8
4428 ; -O0: and w10, w10, #0x1
4429 ; -O0: ands w10, w10, #0x1
4430 ; -O0: csel w8, w9, w8, ne
4431 ; -O0: bl __atomic_compare_exchange
4433 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4435 ; -O1: csel w8, w0, w20, gt
4436 ; -O1: bl __atomic_compare_exchange
4437 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4441 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4442 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4443 ; -O0: subs x10, x9, x8
4444 ; -O0: and w10, w10, #0x1
4445 ; -O0: ands w10, w10, #0x1
4446 ; -O0: csel x8, x9, x8, ne
4447 ; -O0: bl __atomic_compare_exchange
4449 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4451 ; -O1: csel x8, x0, x20, gt
4452 ; -O1: bl __atomic_compare_exchange
4453 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4457 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4458 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4459 ; -O0: subs x10, x9, x8
4460 ; -O0: and w10, w10, #0x1
4461 ; -O0: ands w10, w10, #0x1
4462 ; -O0: csel x8, x9, x8, ne
4463 ; -O0: bl __atomic_compare_exchange
4465 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4467 ; -O1: csel x8, x0, x20, gt
4468 ; -O1: bl __atomic_compare_exchange
4469 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4473 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4474 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4475 ; -O0: subs x10, x9, x8
4476 ; -O0: and w10, w10, #0x1
4477 ; -O0: ands w10, w10, #0x1
4478 ; -O0: csel x8, x9, x8, ne
4479 ; -O0: bl __atomic_compare_exchange
4481 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4483 ; -O1: csel x8, x0, x20, gt
4484 ; -O1: bl __atomic_compare_exchange
4485 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4489 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4490 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4491 ; -O0: subs x10, x9, x8
4492 ; -O0: and w10, w10, #0x1
4493 ; -O0: ands w10, w10, #0x1
4494 ; -O0: csel x8, x9, x8, ne
4495 ; -O0: bl __atomic_compare_exchange
4497 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4499 ; -O1: csel x8, x0, x20, gt
4500 ; -O1: bl __atomic_compare_exchange
4501 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4505 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4506 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4507 ; -O0: subs x10, x9, x8
4508 ; -O0: and w10, w10, #0x1
4509 ; -O0: ands w10, w10, #0x1
4510 ; -O0: csel x8, x9, x8, ne
4511 ; -O0: bl __atomic_compare_exchange
4513 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4515 ; -O1: csel x8, x0, x20, gt
4516 ; -O1: bl __atomic_compare_exchange
4517 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4521 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4522 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4523 ; -O0: subs x8, x8, x10
4524 ; -O0: subs x8, x8, x10
4525 ; -O0: subs x8, x8, x11
4526 ; -O0: and w12, w12, #0x1
4527 ; -O0: ands w12, w12, #0x1
4528 ; -O0: csel w8, w8, w9, ne
4529 ; -O0: and w12, w8, #0x1
4530 ; -O0: ands w12, w12, #0x1
4531 ; -O0: csel x9, x9, x11, ne
4532 ; -O0: and w11, w8, #0x1
4533 ; -O0: ands w11, w11, #0x1
4534 ; -O0: csel x8, x8, x10, ne
4535 ; -O0: bl __atomic_compare_exchange
4537 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4538 ; -O1: ldp x0, x1, [x0]
4540 ; -O1: csel x8, x1, x19, lt
4541 ; -O1: csel x9, x0, x21, lt
4542 ; -O1: bl __atomic_compare_exchange
4543 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4547 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4548 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4549 ; -O0: subs x8, x8, x10
4550 ; -O0: subs x8, x8, x10
4551 ; -O0: subs x8, x8, x11
4552 ; -O0: and w12, w12, #0x1
4553 ; -O0: ands w12, w12, #0x1
4554 ; -O0: csel w8, w8, w9, ne
4555 ; -O0: and w12, w8, #0x1
4556 ; -O0: ands w12, w12, #0x1
4557 ; -O0: csel x9, x9, x11, ne
4558 ; -O0: and w11, w8, #0x1
4559 ; -O0: ands w11, w11, #0x1
4560 ; -O0: csel x8, x8, x10, ne
4561 ; -O0: bl __atomic_compare_exchange
4563 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4564 ; -O1: ldp x0, x1, [x0]
4566 ; -O1: csel x8, x1, x19, lt
4567 ; -O1: csel x9, x0, x21, lt
4568 ; -O1: bl __atomic_compare_exchange
4569 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4573 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4574 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4575 ; -O0: subs x8, x8, x10
4576 ; -O0: subs x8, x8, x10
4577 ; -O0: subs x8, x8, x11
4578 ; -O0: and w12, w12, #0x1
4579 ; -O0: ands w12, w12, #0x1
4580 ; -O0: csel w8, w8, w9, ne
4581 ; -O0: and w12, w8, #0x1
4582 ; -O0: ands w12, w12, #0x1
4583 ; -O0: csel x9, x9, x11, ne
4584 ; -O0: and w11, w8, #0x1
4585 ; -O0: ands w11, w11, #0x1
4586 ; -O0: csel x8, x8, x10, ne
4587 ; -O0: bl __atomic_compare_exchange
4589 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4590 ; -O1: ldp x0, x1, [x0]
4592 ; -O1: csel x8, x1, x19, lt
4593 ; -O1: csel x9, x0, x21, lt
4594 ; -O1: bl __atomic_compare_exchange
4595 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4599 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4600 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4601 ; -O0: subs x8, x8, x10
4602 ; -O0: subs x8, x8, x10
4603 ; -O0: subs x8, x8, x11
4604 ; -O0: and w12, w12, #0x1
4605 ; -O0: ands w12, w12, #0x1
4606 ; -O0: csel w8, w8, w9, ne
4607 ; -O0: and w12, w8, #0x1
4608 ; -O0: ands w12, w12, #0x1
4609 ; -O0: csel x9, x9, x11, ne
4610 ; -O0: and w11, w8, #0x1
4611 ; -O0: ands w11, w11, #0x1
4612 ; -O0: csel x8, x8, x10, ne
4613 ; -O0: bl __atomic_compare_exchange
4615 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4616 ; -O1: ldp x0, x1, [x0]
4618 ; -O1: csel x8, x1, x19, lt
4619 ; -O1: csel x9, x0, x21, lt
4620 ; -O1: bl __atomic_compare_exchange
4621 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4625 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4626 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4627 ; -O0: subs x8, x8, x10
4628 ; -O0: subs x8, x8, x10
4629 ; -O0: subs x8, x8, x11
4630 ; -O0: and w12, w12, #0x1
4631 ; -O0: ands w12, w12, #0x1
4632 ; -O0: csel w8, w8, w9, ne
4633 ; -O0: and w12, w8, #0x1
4634 ; -O0: ands w12, w12, #0x1
4635 ; -O0: csel x9, x9, x11, ne
4636 ; -O0: and w11, w8, #0x1
4637 ; -O0: ands w11, w11, #0x1
4638 ; -O0: csel x8, x8, x10, ne
4639 ; -O0: bl __atomic_compare_exchange
4641 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4642 ; -O1: ldp x0, x1, [x0]
4644 ; -O1: csel x8, x1, x19, lt
4645 ; -O1: csel x9, x0, x21, lt
4646 ; -O1: bl __atomic_compare_exchange
4647 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4651 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4652 ; CHECK-LABEL: atomicrmw_min_i8_aligned_monotonic:
4653 ; CHECK: ldsminb w1, w0, [x0]
4654 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4658 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4659 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acquire:
4660 ; CHECK: ldsminab w1, w0, [x0]
4661 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4665 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4666 ; CHECK-LABEL: atomicrmw_min_i8_aligned_release:
4667 ; CHECK: ldsminlb w1, w0, [x0]
4668 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4672 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4673 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4674 ; CHECK: ldsminalb w1, w0, [x0]
4675 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4679 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4680 ; CHECK-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4681 ; CHECK: ldsminalb w1, w0, [x0]
4682 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4686 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4687 ; CHECK-LABEL: atomicrmw_min_i16_aligned_monotonic:
4688 ; CHECK: ldsminh w1, w0, [x0]
4689 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
4693 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
4694 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acquire:
4695 ; CHECK: ldsminah w1, w0, [x0]
4696 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
4700 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
4701 ; CHECK-LABEL: atomicrmw_min_i16_aligned_release:
4702 ; CHECK: ldsminlh w1, w0, [x0]
4703 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
4707 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4708 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4709 ; CHECK: ldsminalh w1, w0, [x0]
4710 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
4714 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4715 ; CHECK-LABEL: atomicrmw_min_i16_aligned_seq_cst:
4716 ; CHECK: ldsminalh w1, w0, [x0]
4717 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
4721 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4722 ; CHECK-LABEL: atomicrmw_min_i32_aligned_monotonic:
4723 ; CHECK: ldsmin w1, w0, [x0]
4724 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
4728 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
4729 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acquire:
4730 ; CHECK: ldsmina w1, w0, [x0]
4731 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
4735 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
4736 ; CHECK-LABEL: atomicrmw_min_i32_aligned_release:
4737 ; CHECK: ldsminl w1, w0, [x0]
4738 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
4742 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4743 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acq_rel:
4744 ; CHECK: ldsminal w1, w0, [x0]
4745 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
4749 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4750 ; CHECK-LABEL: atomicrmw_min_i32_aligned_seq_cst:
4751 ; CHECK: ldsminal w1, w0, [x0]
4752 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
4756 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4757 ; CHECK-LABEL: atomicrmw_min_i64_aligned_monotonic:
4758 ; CHECK: ldsmin x1, x0, [x0]
4759 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
4763 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
4764 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acquire:
4765 ; CHECK: ldsmina x1, x0, [x0]
4766 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
4770 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
4771 ; CHECK-LABEL: atomicrmw_min_i64_aligned_release:
4772 ; CHECK: ldsminl x1, x0, [x0]
4773 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
4777 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4778 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acq_rel:
4779 ; CHECK: ldsminal x1, x0, [x0]
4780 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
4784 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4785 ; CHECK-LABEL: atomicrmw_min_i64_aligned_seq_cst:
4786 ; CHECK: ldsminal x1, x0, [x0]
4787 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
4791 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4792 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
4793 ; -O0: subs x9, x9, x10
4794 ; -O0: subs x9, x9, x10
4795 ; -O0: subs x9, x9, x12
4796 ; -O0: and w13, w13, #0x1
4797 ; -O0: ands w13, w13, #0x1
4798 ; -O0: csel w9, w9, w11, ne
4799 ; -O0: and w13, w9, #0x1
4800 ; -O0: ands w13, w13, #0x1
4801 ; -O0: csel x2, x11, x12, ne
4802 ; -O0: and w11, w9, #0x1
4803 ; -O0: ands w11, w11, #0x1
4804 ; -O0: csel x9, x9, x10, ne
4805 ; -O0: casp x0, x1, x2, x3, [x8]
4806 ; -O0: eor x8, x10, x8
4807 ; -O0: eor x11, x9, x11
4808 ; -O0: orr x8, x8, x11
4809 ; -O0: subs x8, x8, #0
4811 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
4812 ; -O1: ldp x4, x5, [x0]
4814 ; -O1: csel x9, x7, x3, ge
4815 ; -O1: csel x8, x4, x2, ge
4816 ; -O1: casp x4, x5, x8, x9, [x0]
4818 ; -O1: ccmp x4, x6, #0, eq
4819 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
4823 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
4824 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
4825 ; -O0: subs x9, x9, x10
4826 ; -O0: subs x9, x9, x10
4827 ; -O0: subs x9, x9, x12
4828 ; -O0: and w13, w13, #0x1
4829 ; -O0: ands w13, w13, #0x1
4830 ; -O0: csel w9, w9, w11, ne
4831 ; -O0: and w13, w9, #0x1
4832 ; -O0: ands w13, w13, #0x1
4833 ; -O0: csel x2, x11, x12, ne
4834 ; -O0: and w11, w9, #0x1
4835 ; -O0: ands w11, w11, #0x1
4836 ; -O0: csel x9, x9, x10, ne
4837 ; -O0: caspa x0, x1, x2, x3, [x8]
4838 ; -O0: eor x8, x10, x8
4839 ; -O0: eor x11, x9, x11
4840 ; -O0: orr x8, x8, x11
4841 ; -O0: subs x8, x8, #0
4843 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
4844 ; -O1: ldp x4, x5, [x0]
4846 ; -O1: csel x9, x7, x3, ge
4847 ; -O1: csel x8, x4, x2, ge
4848 ; -O1: caspa x4, x5, x8, x9, [x0]
4850 ; -O1: ccmp x4, x6, #0, eq
4851 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
4855 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
4856 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
4857 ; -O0: subs x9, x9, x10
4858 ; -O0: subs x9, x9, x10
4859 ; -O0: subs x9, x9, x12
4860 ; -O0: and w13, w13, #0x1
4861 ; -O0: ands w13, w13, #0x1
4862 ; -O0: csel w9, w9, w11, ne
4863 ; -O0: and w13, w9, #0x1
4864 ; -O0: ands w13, w13, #0x1
4865 ; -O0: csel x2, x11, x12, ne
4866 ; -O0: and w11, w9, #0x1
4867 ; -O0: ands w11, w11, #0x1
4868 ; -O0: csel x9, x9, x10, ne
4869 ; -O0: caspl x0, x1, x2, x3, [x8]
4870 ; -O0: eor x8, x10, x8
4871 ; -O0: eor x11, x9, x11
4872 ; -O0: orr x8, x8, x11
4873 ; -O0: subs x8, x8, #0
4875 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
4876 ; -O1: ldp x4, x5, [x0]
4878 ; -O1: csel x9, x7, x3, ge
4879 ; -O1: csel x8, x4, x2, ge
4880 ; -O1: caspl x4, x5, x8, x9, [x0]
4882 ; -O1: ccmp x4, x6, #0, eq
4883 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
4887 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4888 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4889 ; -O0: subs x9, x9, x10
4890 ; -O0: subs x9, x9, x10
4891 ; -O0: subs x9, x9, x12
4892 ; -O0: and w13, w13, #0x1
4893 ; -O0: ands w13, w13, #0x1
4894 ; -O0: csel w9, w9, w11, ne
4895 ; -O0: and w13, w9, #0x1
4896 ; -O0: ands w13, w13, #0x1
4897 ; -O0: csel x2, x11, x12, ne
4898 ; -O0: and w11, w9, #0x1
4899 ; -O0: ands w11, w11, #0x1
4900 ; -O0: csel x9, x9, x10, ne
4901 ; -O0: caspal x0, x1, x2, x3, [x8]
4902 ; -O0: eor x8, x10, x8
4903 ; -O0: eor x11, x9, x11
4904 ; -O0: orr x8, x8, x11
4905 ; -O0: subs x8, x8, #0
4907 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4908 ; -O1: ldp x4, x5, [x0]
4910 ; -O1: csel x9, x7, x3, ge
4911 ; -O1: csel x8, x4, x2, ge
4912 ; -O1: caspal x4, x5, x8, x9, [x0]
4914 ; -O1: ccmp x4, x6, #0, eq
4915 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
4919 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4920 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4921 ; -O0: subs x9, x9, x10
4922 ; -O0: subs x9, x9, x10
4923 ; -O0: subs x9, x9, x12
4924 ; -O0: and w13, w13, #0x1
4925 ; -O0: ands w13, w13, #0x1
4926 ; -O0: csel w9, w9, w11, ne
4927 ; -O0: and w13, w9, #0x1
4928 ; -O0: ands w13, w13, #0x1
4929 ; -O0: csel x2, x11, x12, ne
4930 ; -O0: and w11, w9, #0x1
4931 ; -O0: ands w11, w11, #0x1
4932 ; -O0: csel x9, x9, x10, ne
4933 ; -O0: caspal x0, x1, x2, x3, [x8]
4934 ; -O0: eor x8, x10, x8
4935 ; -O0: eor x11, x9, x11
4936 ; -O0: orr x8, x8, x11
4937 ; -O0: subs x8, x8, #0
4939 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4940 ; -O1: ldp x4, x5, [x0]
4942 ; -O1: csel x9, x7, x3, ge
4943 ; -O1: csel x8, x4, x2, ge
4944 ; -O1: caspal x4, x5, x8, x9, [x0]
4946 ; -O1: ccmp x4, x6, #0, eq
4947 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
4951 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4952 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_monotonic:
4953 ; CHECK: ldsminb w1, w0, [x0]
4954 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4958 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4959 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acquire:
4960 ; CHECK: ldsminab w1, w0, [x0]
4961 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4965 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
4966 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_release:
4967 ; CHECK: ldsminlb w1, w0, [x0]
4968 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4972 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4973 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
4974 ; CHECK: ldsminalb w1, w0, [x0]
4975 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4979 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4980 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
4981 ; CHECK: ldsminalb w1, w0, [x0]
4982 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4986 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4987 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4989 ; -O0: subs w10, w10, w8, sxth
4990 ; -O0: and w10, w10, #0x1
4991 ; -O0: ands w10, w10, #0x1
4992 ; -O0: csel w8, w9, w8, ne
4993 ; -O0: bl __atomic_compare_exchange
4995 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4997 ; -O1: cmp w8, w20, sxth
4998 ; -O1: csel w8, w0, w20, le
4999 ; -O1: bl __atomic_compare_exchange
5000 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
5004 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5005 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
5007 ; -O0: subs w10, w10, w8, sxth
5008 ; -O0: and w10, w10, #0x1
5009 ; -O0: ands w10, w10, #0x1
5010 ; -O0: csel w8, w9, w8, ne
5011 ; -O0: bl __atomic_compare_exchange
5013 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
5015 ; -O1: cmp w8, w20, sxth
5016 ; -O1: csel w8, w0, w20, le
5017 ; -O1: bl __atomic_compare_exchange
5018 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
5022 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
5023 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
5025 ; -O0: subs w10, w10, w8, sxth
5026 ; -O0: and w10, w10, #0x1
5027 ; -O0: ands w10, w10, #0x1
5028 ; -O0: csel w8, w9, w8, ne
5029 ; -O0: bl __atomic_compare_exchange
5031 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
5033 ; -O1: cmp w8, w20, sxth
5034 ; -O1: csel w8, w0, w20, le
5035 ; -O1: bl __atomic_compare_exchange
5036 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
5040 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5041 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
5043 ; -O0: subs w10, w10, w8, sxth
5044 ; -O0: and w10, w10, #0x1
5045 ; -O0: ands w10, w10, #0x1
5046 ; -O0: csel w8, w9, w8, ne
5047 ; -O0: bl __atomic_compare_exchange
5049 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
5051 ; -O1: cmp w8, w20, sxth
5052 ; -O1: csel w8, w0, w20, le
5053 ; -O1: bl __atomic_compare_exchange
5054 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
5058 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5059 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
5061 ; -O0: subs w10, w10, w8, sxth
5062 ; -O0: and w10, w10, #0x1
5063 ; -O0: ands w10, w10, #0x1
5064 ; -O0: csel w8, w9, w8, ne
5065 ; -O0: bl __atomic_compare_exchange
5067 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
5069 ; -O1: cmp w8, w20, sxth
5070 ; -O1: csel w8, w0, w20, le
5071 ; -O1: bl __atomic_compare_exchange
5072 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
5076 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5077 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
5078 ; -O0: subs w10, w9, w8
5079 ; -O0: and w10, w10, #0x1
5080 ; -O0: ands w10, w10, #0x1
5081 ; -O0: csel w8, w9, w8, ne
5082 ; -O0: bl __atomic_compare_exchange
5084 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
5086 ; -O1: csel w8, w0, w20, le
5087 ; -O1: bl __atomic_compare_exchange
5088 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
5092 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5093 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
5094 ; -O0: subs w10, w9, w8
5095 ; -O0: and w10, w10, #0x1
5096 ; -O0: ands w10, w10, #0x1
5097 ; -O0: csel w8, w9, w8, ne
5098 ; -O0: bl __atomic_compare_exchange
5100 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
5102 ; -O1: csel w8, w0, w20, le
5103 ; -O1: bl __atomic_compare_exchange
5104 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
5108 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
5109 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
5110 ; -O0: subs w10, w9, w8
5111 ; -O0: and w10, w10, #0x1
5112 ; -O0: ands w10, w10, #0x1
5113 ; -O0: csel w8, w9, w8, ne
5114 ; -O0: bl __atomic_compare_exchange
5116 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
5118 ; -O1: csel w8, w0, w20, le
5119 ; -O1: bl __atomic_compare_exchange
5120 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
5124 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5125 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5126 ; -O0: subs w10, w9, w8
5127 ; -O0: and w10, w10, #0x1
5128 ; -O0: ands w10, w10, #0x1
5129 ; -O0: csel w8, w9, w8, ne
5130 ; -O0: bl __atomic_compare_exchange
5132 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5134 ; -O1: csel w8, w0, w20, le
5135 ; -O1: bl __atomic_compare_exchange
5136 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
5140 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5141 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5142 ; -O0: subs w10, w9, w8
5143 ; -O0: and w10, w10, #0x1
5144 ; -O0: ands w10, w10, #0x1
5145 ; -O0: csel w8, w9, w8, ne
5146 ; -O0: bl __atomic_compare_exchange
5148 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5150 ; -O1: csel w8, w0, w20, le
5151 ; -O1: bl __atomic_compare_exchange
5152 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
5156 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5157 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5158 ; -O0: subs x10, x9, x8
5159 ; -O0: and w10, w10, #0x1
5160 ; -O0: ands w10, w10, #0x1
5161 ; -O0: csel x8, x9, x8, ne
5162 ; -O0: bl __atomic_compare_exchange
5164 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5166 ; -O1: csel x8, x0, x20, le
5167 ; -O1: bl __atomic_compare_exchange
5168 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
5172 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5173 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
5174 ; -O0: subs x10, x9, x8
5175 ; -O0: and w10, w10, #0x1
5176 ; -O0: ands w10, w10, #0x1
5177 ; -O0: csel x8, x9, x8, ne
5178 ; -O0: bl __atomic_compare_exchange
5180 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
5182 ; -O1: csel x8, x0, x20, le
5183 ; -O1: bl __atomic_compare_exchange
5184 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
5188 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
5189 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
5190 ; -O0: subs x10, x9, x8
5191 ; -O0: and w10, w10, #0x1
5192 ; -O0: ands w10, w10, #0x1
5193 ; -O0: csel x8, x9, x8, ne
5194 ; -O0: bl __atomic_compare_exchange
5196 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
5198 ; -O1: csel x8, x0, x20, le
5199 ; -O1: bl __atomic_compare_exchange
5200 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
5204 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5205 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5206 ; -O0: subs x10, x9, x8
5207 ; -O0: and w10, w10, #0x1
5208 ; -O0: ands w10, w10, #0x1
5209 ; -O0: csel x8, x9, x8, ne
5210 ; -O0: bl __atomic_compare_exchange
5212 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5214 ; -O1: csel x8, x0, x20, le
5215 ; -O1: bl __atomic_compare_exchange
5216 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
5220 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5221 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5222 ; -O0: subs x10, x9, x8
5223 ; -O0: and w10, w10, #0x1
5224 ; -O0: ands w10, w10, #0x1
5225 ; -O0: csel x8, x9, x8, ne
5226 ; -O0: bl __atomic_compare_exchange
5228 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5230 ; -O1: csel x8, x0, x20, le
5231 ; -O1: bl __atomic_compare_exchange
5232 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
5236 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5237 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5238 ; -O0: subs x8, x8, x10
5239 ; -O0: subs x8, x8, x10
5240 ; -O0: subs x8, x8, x11
5241 ; -O0: and w12, w12, #0x1
5242 ; -O0: ands w12, w12, #0x1
5243 ; -O0: csel w8, w8, w9, ne
5244 ; -O0: and w12, w8, #0x1
5245 ; -O0: ands w12, w12, #0x1
5246 ; -O0: csel x9, x9, x11, ne
5247 ; -O0: and w11, w8, #0x1
5248 ; -O0: ands w11, w11, #0x1
5249 ; -O0: csel x8, x8, x10, ne
5250 ; -O0: bl __atomic_compare_exchange
5252 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5253 ; -O1: ldp x0, x1, [x0]
5255 ; -O1: csel x8, x1, x19, ge
5256 ; -O1: csel x9, x0, x21, ge
5257 ; -O1: bl __atomic_compare_exchange
5258 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
5262 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5263 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
5264 ; -O0: subs x8, x8, x10
5265 ; -O0: subs x8, x8, x10
5266 ; -O0: subs x8, x8, x11
5267 ; -O0: and w12, w12, #0x1
5268 ; -O0: ands w12, w12, #0x1
5269 ; -O0: csel w8, w8, w9, ne
5270 ; -O0: and w12, w8, #0x1
5271 ; -O0: ands w12, w12, #0x1
5272 ; -O0: csel x9, x9, x11, ne
5273 ; -O0: and w11, w8, #0x1
5274 ; -O0: ands w11, w11, #0x1
5275 ; -O0: csel x8, x8, x10, ne
5276 ; -O0: bl __atomic_compare_exchange
5278 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
5279 ; -O1: ldp x0, x1, [x0]
5281 ; -O1: csel x8, x1, x19, ge
5282 ; -O1: csel x9, x0, x21, ge
5283 ; -O1: bl __atomic_compare_exchange
5284 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
5288 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
5289 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
5290 ; -O0: subs x8, x8, x10
5291 ; -O0: subs x8, x8, x10
5292 ; -O0: subs x8, x8, x11
5293 ; -O0: and w12, w12, #0x1
5294 ; -O0: ands w12, w12, #0x1
5295 ; -O0: csel w8, w8, w9, ne
5296 ; -O0: and w12, w8, #0x1
5297 ; -O0: ands w12, w12, #0x1
5298 ; -O0: csel x9, x9, x11, ne
5299 ; -O0: and w11, w8, #0x1
5300 ; -O0: ands w11, w11, #0x1
5301 ; -O0: csel x8, x8, x10, ne
5302 ; -O0: bl __atomic_compare_exchange
5304 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
5305 ; -O1: ldp x0, x1, [x0]
5307 ; -O1: csel x8, x1, x19, ge
5308 ; -O1: csel x9, x0, x21, ge
5309 ; -O1: bl __atomic_compare_exchange
5310 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
5314 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5315 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5316 ; -O0: subs x8, x8, x10
5317 ; -O0: subs x8, x8, x10
5318 ; -O0: subs x8, x8, x11
5319 ; -O0: and w12, w12, #0x1
5320 ; -O0: ands w12, w12, #0x1
5321 ; -O0: csel w8, w8, w9, ne
5322 ; -O0: and w12, w8, #0x1
5323 ; -O0: ands w12, w12, #0x1
5324 ; -O0: csel x9, x9, x11, ne
5325 ; -O0: and w11, w8, #0x1
5326 ; -O0: ands w11, w11, #0x1
5327 ; -O0: csel x8, x8, x10, ne
5328 ; -O0: bl __atomic_compare_exchange
5330 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5331 ; -O1: ldp x0, x1, [x0]
5333 ; -O1: csel x8, x1, x19, ge
5334 ; -O1: csel x9, x0, x21, ge
5335 ; -O1: bl __atomic_compare_exchange
5336 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5340 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5341 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5342 ; -O0: subs x8, x8, x10
5343 ; -O0: subs x8, x8, x10
5344 ; -O0: subs x8, x8, x11
5345 ; -O0: and w12, w12, #0x1
5346 ; -O0: ands w12, w12, #0x1
5347 ; -O0: csel w8, w8, w9, ne
5348 ; -O0: and w12, w8, #0x1
5349 ; -O0: ands w12, w12, #0x1
5350 ; -O0: csel x9, x9, x11, ne
5351 ; -O0: and w11, w8, #0x1
5352 ; -O0: ands w11, w11, #0x1
5353 ; -O0: csel x8, x8, x10, ne
5354 ; -O0: bl __atomic_compare_exchange
5356 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5357 ; -O1: ldp x0, x1, [x0]
5359 ; -O1: csel x8, x1, x19, ge
5360 ; -O1: csel x9, x0, x21, ge
5361 ; -O1: bl __atomic_compare_exchange
5362 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5366 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5367 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5368 ; CHECK: ldumaxb w1, w0, [x0]
5369 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5373 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5374 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acquire:
5375 ; CHECK: ldumaxab w1, w0, [x0]
5376 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5380 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5381 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_release:
5382 ; CHECK: ldumaxlb w1, w0, [x0]
5383 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5387 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5388 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5389 ; CHECK: ldumaxalb w1, w0, [x0]
5390 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5394 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5395 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5396 ; CHECK: ldumaxalb w1, w0, [x0]
5397 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5401 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5402 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5403 ; CHECK: ldumaxh w1, w0, [x0]
5404 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5408 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5409 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acquire:
5410 ; CHECK: ldumaxah w1, w0, [x0]
5411 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5415 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5416 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_release:
5417 ; CHECK: ldumaxlh w1, w0, [x0]
5418 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5422 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5423 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5424 ; CHECK: ldumaxalh w1, w0, [x0]
5425 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
5429 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5430 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5431 ; CHECK: ldumaxalh w1, w0, [x0]
5432 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
5436 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5437 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5438 ; CHECK: ldumax w1, w0, [x0]
5439 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
5443 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
5444 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acquire:
5445 ; CHECK: ldumaxa w1, w0, [x0]
5446 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
5450 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
5451 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_release:
5452 ; CHECK: ldumaxl w1, w0, [x0]
5453 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
5457 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5458 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5459 ; CHECK: ldumaxal w1, w0, [x0]
5460 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
5464 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5465 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5466 ; CHECK: ldumaxal w1, w0, [x0]
5467 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
5471 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5472 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5473 ; CHECK: ldumax x1, x0, [x0]
5474 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
5478 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
5479 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acquire:
5480 ; CHECK: ldumaxa x1, x0, [x0]
5481 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
5485 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
5486 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_release:
5487 ; CHECK: ldumaxl x1, x0, [x0]
5488 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
5492 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5493 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
5494 ; CHECK: ldumaxal x1, x0, [x0]
5495 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
5499 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5500 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
5501 ; CHECK: ldumaxal x1, x0, [x0]
5502 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
5506 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5507 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5508 ; -O0: subs x9, x9, x10
5509 ; -O0: subs x9, x9, x10
5510 ; -O0: subs x9, x9, x12
5511 ; -O0: and w13, w13, #0x1
5512 ; -O0: ands w13, w13, #0x1
5513 ; -O0: csel w9, w9, w11, ne
5514 ; -O0: and w13, w9, #0x1
5515 ; -O0: ands w13, w13, #0x1
5516 ; -O0: csel x2, x11, x12, ne
5517 ; -O0: and w11, w9, #0x1
5518 ; -O0: ands w11, w11, #0x1
5519 ; -O0: csel x9, x9, x10, ne
5520 ; -O0: casp x0, x1, x2, x3, [x8]
5521 ; -O0: eor x8, x10, x8
5522 ; -O0: eor x11, x9, x11
5523 ; -O0: orr x8, x8, x11
5524 ; -O0: subs x8, x8, #0
5526 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5527 ; -O1: ldp x4, x5, [x0]
5529 ; -O1: csel x9, x7, x3, lo
5530 ; -O1: csel x8, x4, x2, lo
5531 ; -O1: casp x4, x5, x8, x9, [x0]
5533 ; -O1: ccmp x4, x6, #0, eq
5534 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
5538 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
5539 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
5540 ; -O0: subs x9, x9, x10
5541 ; -O0: subs x9, x9, x10
5542 ; -O0: subs x9, x9, x12
5543 ; -O0: and w13, w13, #0x1
5544 ; -O0: ands w13, w13, #0x1
5545 ; -O0: csel w9, w9, w11, ne
5546 ; -O0: and w13, w9, #0x1
5547 ; -O0: ands w13, w13, #0x1
5548 ; -O0: csel x2, x11, x12, ne
5549 ; -O0: and w11, w9, #0x1
5550 ; -O0: ands w11, w11, #0x1
5551 ; -O0: csel x9, x9, x10, ne
5552 ; -O0: caspa x0, x1, x2, x3, [x8]
5553 ; -O0: eor x8, x10, x8
5554 ; -O0: eor x11, x9, x11
5555 ; -O0: orr x8, x8, x11
5556 ; -O0: subs x8, x8, #0
5558 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
5559 ; -O1: ldp x4, x5, [x0]
5561 ; -O1: csel x9, x7, x3, lo
5562 ; -O1: csel x8, x4, x2, lo
5563 ; -O1: caspa x4, x5, x8, x9, [x0]
5565 ; -O1: ccmp x4, x6, #0, eq
5566 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
5570 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
5571 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
5572 ; -O0: subs x9, x9, x10
5573 ; -O0: subs x9, x9, x10
5574 ; -O0: subs x9, x9, x12
5575 ; -O0: and w13, w13, #0x1
5576 ; -O0: ands w13, w13, #0x1
5577 ; -O0: csel w9, w9, w11, ne
5578 ; -O0: and w13, w9, #0x1
5579 ; -O0: ands w13, w13, #0x1
5580 ; -O0: csel x2, x11, x12, ne
5581 ; -O0: and w11, w9, #0x1
5582 ; -O0: ands w11, w11, #0x1
5583 ; -O0: csel x9, x9, x10, ne
5584 ; -O0: caspl x0, x1, x2, x3, [x8]
5585 ; -O0: eor x8, x10, x8
5586 ; -O0: eor x11, x9, x11
5587 ; -O0: orr x8, x8, x11
5588 ; -O0: subs x8, x8, #0
5590 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
5591 ; -O1: ldp x4, x5, [x0]
5593 ; -O1: csel x9, x7, x3, lo
5594 ; -O1: csel x8, x4, x2, lo
5595 ; -O1: caspl x4, x5, x8, x9, [x0]
5597 ; -O1: ccmp x4, x6, #0, eq
5598 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
5602 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5603 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5604 ; -O0: subs x9, x9, x10
5605 ; -O0: subs x9, x9, x10
5606 ; -O0: subs x9, x9, x12
5607 ; -O0: and w13, w13, #0x1
5608 ; -O0: ands w13, w13, #0x1
5609 ; -O0: csel w9, w9, w11, ne
5610 ; -O0: and w13, w9, #0x1
5611 ; -O0: ands w13, w13, #0x1
5612 ; -O0: csel x2, x11, x12, ne
5613 ; -O0: and w11, w9, #0x1
5614 ; -O0: ands w11, w11, #0x1
5615 ; -O0: csel x9, x9, x10, ne
5616 ; -O0: caspal x0, x1, x2, x3, [x8]
5617 ; -O0: eor x8, x10, x8
5618 ; -O0: eor x11, x9, x11
5619 ; -O0: orr x8, x8, x11
5620 ; -O0: subs x8, x8, #0
5622 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5623 ; -O1: ldp x4, x5, [x0]
5625 ; -O1: csel x9, x7, x3, lo
5626 ; -O1: csel x8, x4, x2, lo
5627 ; -O1: caspal x4, x5, x8, x9, [x0]
5629 ; -O1: ccmp x4, x6, #0, eq
5630 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
5634 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5635 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5636 ; -O0: subs x9, x9, x10
5637 ; -O0: subs x9, x9, x10
5638 ; -O0: subs x9, x9, x12
5639 ; -O0: and w13, w13, #0x1
5640 ; -O0: ands w13, w13, #0x1
5641 ; -O0: csel w9, w9, w11, ne
5642 ; -O0: and w13, w9, #0x1
5643 ; -O0: ands w13, w13, #0x1
5644 ; -O0: csel x2, x11, x12, ne
5645 ; -O0: and w11, w9, #0x1
5646 ; -O0: ands w11, w11, #0x1
5647 ; -O0: csel x9, x9, x10, ne
5648 ; -O0: caspal x0, x1, x2, x3, [x8]
5649 ; -O0: eor x8, x10, x8
5650 ; -O0: eor x11, x9, x11
5651 ; -O0: orr x8, x8, x11
5652 ; -O0: subs x8, x8, #0
5654 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5655 ; -O1: ldp x4, x5, [x0]
5657 ; -O1: csel x9, x7, x3, lo
5658 ; -O1: csel x8, x4, x2, lo
5659 ; -O1: caspal x4, x5, x8, x9, [x0]
5661 ; -O1: ccmp x4, x6, #0, eq
5662 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
5666 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5667 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
5668 ; CHECK: ldumaxb w1, w0, [x0]
5669 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5673 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5674 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acquire:
5675 ; CHECK: ldumaxab w1, w0, [x0]
5676 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5680 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
5681 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_release:
5682 ; CHECK: ldumaxlb w1, w0, [x0]
5683 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5687 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5688 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
5689 ; CHECK: ldumaxalb w1, w0, [x0]
5690 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5694 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5695 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
5696 ; CHECK: ldumaxalb w1, w0, [x0]
5697 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5701 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5702 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5703 ; -O0: subs w10, w10, w8, uxth
5704 ; -O0: and w10, w10, #0x1
5705 ; -O0: ands w10, w10, #0x1
5706 ; -O0: csel w8, w9, w8, ne
5707 ; -O0: bl __atomic_compare_exchange
5709 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5710 ; -O1: and w8, w0, #0xffff
5711 ; -O1: cmp w8, w20, uxth
5712 ; -O1: csel w8, w0, w20, hi
5713 ; -O1: bl __atomic_compare_exchange
5714 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
5718 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5719 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5720 ; -O0: subs w10, w10, w8, uxth
5721 ; -O0: and w10, w10, #0x1
5722 ; -O0: ands w10, w10, #0x1
5723 ; -O0: csel w8, w9, w8, ne
5724 ; -O0: bl __atomic_compare_exchange
5726 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5727 ; -O1: and w8, w0, #0xffff
5728 ; -O1: cmp w8, w20, uxth
5729 ; -O1: csel w8, w0, w20, hi
5730 ; -O1: bl __atomic_compare_exchange
5731 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
5735 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
5736 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
5737 ; -O0: subs w10, w10, w8, uxth
5738 ; -O0: and w10, w10, #0x1
5739 ; -O0: ands w10, w10, #0x1
5740 ; -O0: csel w8, w9, w8, ne
5741 ; -O0: bl __atomic_compare_exchange
5743 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
5744 ; -O1: and w8, w0, #0xffff
5745 ; -O1: cmp w8, w20, uxth
5746 ; -O1: csel w8, w0, w20, hi
5747 ; -O1: bl __atomic_compare_exchange
5748 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
5752 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5753 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5754 ; -O0: subs w10, w10, w8, uxth
5755 ; -O0: and w10, w10, #0x1
5756 ; -O0: ands w10, w10, #0x1
5757 ; -O0: csel w8, w9, w8, ne
5758 ; -O0: bl __atomic_compare_exchange
5760 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5761 ; -O1: and w8, w0, #0xffff
5762 ; -O1: cmp w8, w20, uxth
5763 ; -O1: csel w8, w0, w20, hi
5764 ; -O1: bl __atomic_compare_exchange
5765 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
5769 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5770 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5771 ; -O0: subs w10, w10, w8, uxth
5772 ; -O0: and w10, w10, #0x1
5773 ; -O0: ands w10, w10, #0x1
5774 ; -O0: csel w8, w9, w8, ne
5775 ; -O0: bl __atomic_compare_exchange
5777 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5778 ; -O1: and w8, w0, #0xffff
5779 ; -O1: cmp w8, w20, uxth
5780 ; -O1: csel w8, w0, w20, hi
5781 ; -O1: bl __atomic_compare_exchange
5782 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
5786 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5787 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5788 ; -O0: subs w10, w9, w8
5789 ; -O0: and w10, w10, #0x1
5790 ; -O0: ands w10, w10, #0x1
5791 ; -O0: csel w8, w9, w8, ne
5792 ; -O0: bl __atomic_compare_exchange
5794 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5796 ; -O1: csel w8, w0, w20, hi
5797 ; -O1: bl __atomic_compare_exchange
5798 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
5802 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5803 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5804 ; -O0: subs w10, w9, w8
5805 ; -O0: and w10, w10, #0x1
5806 ; -O0: ands w10, w10, #0x1
5807 ; -O0: csel w8, w9, w8, ne
5808 ; -O0: bl __atomic_compare_exchange
5810 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5812 ; -O1: csel w8, w0, w20, hi
5813 ; -O1: bl __atomic_compare_exchange
5814 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
5818 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
5819 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
5820 ; -O0: subs w10, w9, w8
5821 ; -O0: and w10, w10, #0x1
5822 ; -O0: ands w10, w10, #0x1
5823 ; -O0: csel w8, w9, w8, ne
5824 ; -O0: bl __atomic_compare_exchange
5826 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
5828 ; -O1: csel w8, w0, w20, hi
5829 ; -O1: bl __atomic_compare_exchange
5830 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
5834 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5835 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5836 ; -O0: subs w10, w9, w8
5837 ; -O0: and w10, w10, #0x1
5838 ; -O0: ands w10, w10, #0x1
5839 ; -O0: csel w8, w9, w8, ne
5840 ; -O0: bl __atomic_compare_exchange
5842 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5844 ; -O1: csel w8, w0, w20, hi
5845 ; -O1: bl __atomic_compare_exchange
5846 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
5850 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5851 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5852 ; -O0: subs w10, w9, w8
5853 ; -O0: and w10, w10, #0x1
5854 ; -O0: ands w10, w10, #0x1
5855 ; -O0: csel w8, w9, w8, ne
5856 ; -O0: bl __atomic_compare_exchange
5858 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5860 ; -O1: csel w8, w0, w20, hi
5861 ; -O1: bl __atomic_compare_exchange
5862 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
5866 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5867 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5868 ; -O0: subs x10, x9, x8
5869 ; -O0: and w10, w10, #0x1
5870 ; -O0: ands w10, w10, #0x1
5871 ; -O0: csel x8, x9, x8, ne
5872 ; -O0: bl __atomic_compare_exchange
5874 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5876 ; -O1: csel x8, x0, x20, hi
5877 ; -O1: bl __atomic_compare_exchange
5878 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
5882 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5883 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5884 ; -O0: subs x10, x9, x8
5885 ; -O0: and w10, w10, #0x1
5886 ; -O0: ands w10, w10, #0x1
5887 ; -O0: csel x8, x9, x8, ne
5888 ; -O0: bl __atomic_compare_exchange
5890 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5892 ; -O1: csel x8, x0, x20, hi
5893 ; -O1: bl __atomic_compare_exchange
5894 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
5898 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
5899 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
5900 ; -O0: subs x10, x9, x8
5901 ; -O0: and w10, w10, #0x1
5902 ; -O0: ands w10, w10, #0x1
5903 ; -O0: csel x8, x9, x8, ne
5904 ; -O0: bl __atomic_compare_exchange
5906 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
5908 ; -O1: csel x8, x0, x20, hi
5909 ; -O1: bl __atomic_compare_exchange
5910 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
5914 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5915 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5916 ; -O0: subs x10, x9, x8
5917 ; -O0: and w10, w10, #0x1
5918 ; -O0: ands w10, w10, #0x1
5919 ; -O0: csel x8, x9, x8, ne
5920 ; -O0: bl __atomic_compare_exchange
5922 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5924 ; -O1: csel x8, x0, x20, hi
5925 ; -O1: bl __atomic_compare_exchange
5926 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
5930 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5931 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5932 ; -O0: subs x10, x9, x8
5933 ; -O0: and w10, w10, #0x1
5934 ; -O0: ands w10, w10, #0x1
5935 ; -O0: csel x8, x9, x8, ne
5936 ; -O0: bl __atomic_compare_exchange
5938 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5940 ; -O1: csel x8, x0, x20, hi
5941 ; -O1: bl __atomic_compare_exchange
5942 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
5946 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5947 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5948 ; -O0: subs x8, x8, x10
5949 ; -O0: subs x8, x8, x10
5950 ; -O0: subs x8, x8, x11
5951 ; -O0: and w12, w12, #0x1
5952 ; -O0: ands w12, w12, #0x1
5953 ; -O0: csel w8, w8, w9, ne
5954 ; -O0: and w12, w8, #0x1
5955 ; -O0: ands w12, w12, #0x1
5956 ; -O0: csel x9, x9, x11, ne
5957 ; -O0: and w11, w8, #0x1
5958 ; -O0: ands w11, w11, #0x1
5959 ; -O0: csel x8, x8, x10, ne
5960 ; -O0: bl __atomic_compare_exchange
5962 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5963 ; -O1: ldp x0, x1, [x0]
5965 ; -O1: csel x8, x1, x19, lo
5966 ; -O1: csel x9, x0, x21, lo
5967 ; -O1: bl __atomic_compare_exchange
5968 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
5972 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5973 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5974 ; -O0: subs x8, x8, x10
5975 ; -O0: subs x8, x8, x10
5976 ; -O0: subs x8, x8, x11
5977 ; -O0: and w12, w12, #0x1
5978 ; -O0: ands w12, w12, #0x1
5979 ; -O0: csel w8, w8, w9, ne
5980 ; -O0: and w12, w8, #0x1
5981 ; -O0: ands w12, w12, #0x1
5982 ; -O0: csel x9, x9, x11, ne
5983 ; -O0: and w11, w8, #0x1
5984 ; -O0: ands w11, w11, #0x1
5985 ; -O0: csel x8, x8, x10, ne
5986 ; -O0: bl __atomic_compare_exchange
5988 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5989 ; -O1: ldp x0, x1, [x0]
5991 ; -O1: csel x8, x1, x19, lo
5992 ; -O1: csel x9, x0, x21, lo
5993 ; -O1: bl __atomic_compare_exchange
5994 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
5998 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
5999 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
6000 ; -O0: subs x8, x8, x10
6001 ; -O0: subs x8, x8, x10
6002 ; -O0: subs x8, x8, x11
6003 ; -O0: and w12, w12, #0x1
6004 ; -O0: ands w12, w12, #0x1
6005 ; -O0: csel w8, w8, w9, ne
6006 ; -O0: and w12, w8, #0x1
6007 ; -O0: ands w12, w12, #0x1
6008 ; -O0: csel x9, x9, x11, ne
6009 ; -O0: and w11, w8, #0x1
6010 ; -O0: ands w11, w11, #0x1
6011 ; -O0: csel x8, x8, x10, ne
6012 ; -O0: bl __atomic_compare_exchange
6014 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
6015 ; -O1: ldp x0, x1, [x0]
6017 ; -O1: csel x8, x1, x19, lo
6018 ; -O1: csel x9, x0, x21, lo
6019 ; -O1: bl __atomic_compare_exchange
6020 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
6024 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6025 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
6026 ; -O0: subs x8, x8, x10
6027 ; -O0: subs x8, x8, x10
6028 ; -O0: subs x8, x8, x11
6029 ; -O0: and w12, w12, #0x1
6030 ; -O0: ands w12, w12, #0x1
6031 ; -O0: csel w8, w8, w9, ne
6032 ; -O0: and w12, w8, #0x1
6033 ; -O0: ands w12, w12, #0x1
6034 ; -O0: csel x9, x9, x11, ne
6035 ; -O0: and w11, w8, #0x1
6036 ; -O0: ands w11, w11, #0x1
6037 ; -O0: csel x8, x8, x10, ne
6038 ; -O0: bl __atomic_compare_exchange
6040 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
6041 ; -O1: ldp x0, x1, [x0]
6043 ; -O1: csel x8, x1, x19, lo
6044 ; -O1: csel x9, x0, x21, lo
6045 ; -O1: bl __atomic_compare_exchange
6046 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
6050 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6051 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
6052 ; -O0: subs x8, x8, x10
6053 ; -O0: subs x8, x8, x10
6054 ; -O0: subs x8, x8, x11
6055 ; -O0: and w12, w12, #0x1
6056 ; -O0: ands w12, w12, #0x1
6057 ; -O0: csel w8, w8, w9, ne
6058 ; -O0: and w12, w8, #0x1
6059 ; -O0: ands w12, w12, #0x1
6060 ; -O0: csel x9, x9, x11, ne
6061 ; -O0: and w11, w8, #0x1
6062 ; -O0: ands w11, w11, #0x1
6063 ; -O0: csel x8, x8, x10, ne
6064 ; -O0: bl __atomic_compare_exchange
6066 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
6067 ; -O1: ldp x0, x1, [x0]
6069 ; -O1: csel x8, x1, x19, lo
6070 ; -O1: csel x9, x0, x21, lo
6071 ; -O1: bl __atomic_compare_exchange
6072 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
6076 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
6077 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_monotonic:
6078 ; CHECK: lduminb w1, w0, [x0]
6079 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
6083 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
6084 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acquire:
6085 ; CHECK: lduminab w1, w0, [x0]
6086 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
6090 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
6091 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_release:
6092 ; CHECK: lduminlb w1, w0, [x0]
6093 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
6097 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
6098 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
6099 ; CHECK: lduminalb w1, w0, [x0]
6100 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
6104 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
6105 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
6106 ; CHECK: lduminalb w1, w0, [x0]
6107 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
6111 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
6112 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_monotonic:
6113 ; CHECK: lduminh w1, w0, [x0]
6114 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
6118 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
6119 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acquire:
6120 ; CHECK: lduminah w1, w0, [x0]
6121 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
6125 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
6126 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_release:
6127 ; CHECK: lduminlh w1, w0, [x0]
6128 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
6132 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6133 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
6134 ; CHECK: lduminalh w1, w0, [x0]
6135 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
6139 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6140 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
6141 ; CHECK: lduminalh w1, w0, [x0]
6142 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
6146 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6147 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_monotonic:
6148 ; CHECK: ldumin w1, w0, [x0]
6149 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
6153 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
6154 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acquire:
6155 ; CHECK: ldumina w1, w0, [x0]
6156 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
6160 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
6161 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_release:
6162 ; CHECK: lduminl w1, w0, [x0]
6163 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
6167 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6168 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
6169 ; CHECK: lduminal w1, w0, [x0]
6170 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
6174 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6175 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
6176 ; CHECK: lduminal w1, w0, [x0]
6177 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
6181 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6182 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_monotonic:
6183 ; CHECK: ldumin x1, x0, [x0]
6184 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
6188 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
6189 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acquire:
6190 ; CHECK: ldumina x1, x0, [x0]
6191 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
6195 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
6196 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_release:
6197 ; CHECK: lduminl x1, x0, [x0]
6198 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
6202 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6203 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
6204 ; CHECK: lduminal x1, x0, [x0]
6205 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
6209 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6210 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
6211 ; CHECK: lduminal x1, x0, [x0]
6212 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
6216 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6217 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
6218 ; -O0: subs x9, x9, x10
6219 ; -O0: subs x9, x9, x10
6220 ; -O0: subs x9, x9, x12
6221 ; -O0: and w13, w13, #0x1
6222 ; -O0: ands w13, w13, #0x1
6223 ; -O0: csel w9, w9, w11, ne
6224 ; -O0: and w13, w9, #0x1
6225 ; -O0: ands w13, w13, #0x1
6226 ; -O0: csel x2, x11, x12, ne
6227 ; -O0: and w11, w9, #0x1
6228 ; -O0: ands w11, w11, #0x1
6229 ; -O0: csel x9, x9, x10, ne
6230 ; -O0: casp x0, x1, x2, x3, [x8]
6231 ; -O0: eor x8, x10, x8
6232 ; -O0: eor x11, x9, x11
6233 ; -O0: orr x8, x8, x11
6234 ; -O0: subs x8, x8, #0
6236 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
6237 ; -O1: ldp x4, x5, [x0]
6239 ; -O1: csel x9, x7, x3, hs
6240 ; -O1: csel x8, x4, x2, hs
6241 ; -O1: casp x4, x5, x8, x9, [x0]
6243 ; -O1: ccmp x4, x6, #0, eq
6244 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
6248 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
6249 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
6250 ; -O0: subs x9, x9, x10
6251 ; -O0: subs x9, x9, x10
6252 ; -O0: subs x9, x9, x12
6253 ; -O0: and w13, w13, #0x1
6254 ; -O0: ands w13, w13, #0x1
6255 ; -O0: csel w9, w9, w11, ne
6256 ; -O0: and w13, w9, #0x1
6257 ; -O0: ands w13, w13, #0x1
6258 ; -O0: csel x2, x11, x12, ne
6259 ; -O0: and w11, w9, #0x1
6260 ; -O0: ands w11, w11, #0x1
6261 ; -O0: csel x9, x9, x10, ne
6262 ; -O0: caspa x0, x1, x2, x3, [x8]
6263 ; -O0: eor x8, x10, x8
6264 ; -O0: eor x11, x9, x11
6265 ; -O0: orr x8, x8, x11
6266 ; -O0: subs x8, x8, #0
6268 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
6269 ; -O1: ldp x4, x5, [x0]
6271 ; -O1: csel x9, x7, x3, hs
6272 ; -O1: csel x8, x4, x2, hs
6273 ; -O1: caspa x4, x5, x8, x9, [x0]
6275 ; -O1: ccmp x4, x6, #0, eq
6276 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
6280 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
6281 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
6282 ; -O0: subs x9, x9, x10
6283 ; -O0: subs x9, x9, x10
6284 ; -O0: subs x9, x9, x12
6285 ; -O0: and w13, w13, #0x1
6286 ; -O0: ands w13, w13, #0x1
6287 ; -O0: csel w9, w9, w11, ne
6288 ; -O0: and w13, w9, #0x1
6289 ; -O0: ands w13, w13, #0x1
6290 ; -O0: csel x2, x11, x12, ne
6291 ; -O0: and w11, w9, #0x1
6292 ; -O0: ands w11, w11, #0x1
6293 ; -O0: csel x9, x9, x10, ne
6294 ; -O0: caspl x0, x1, x2, x3, [x8]
6295 ; -O0: eor x8, x10, x8
6296 ; -O0: eor x11, x9, x11
6297 ; -O0: orr x8, x8, x11
6298 ; -O0: subs x8, x8, #0
6300 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
6301 ; -O1: ldp x4, x5, [x0]
6303 ; -O1: csel x9, x7, x3, hs
6304 ; -O1: csel x8, x4, x2, hs
6305 ; -O1: caspl x4, x5, x8, x9, [x0]
6307 ; -O1: ccmp x4, x6, #0, eq
6308 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
6312 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6313 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6314 ; -O0: subs x9, x9, x10
6315 ; -O0: subs x9, x9, x10
6316 ; -O0: subs x9, x9, x12
6317 ; -O0: and w13, w13, #0x1
6318 ; -O0: ands w13, w13, #0x1
6319 ; -O0: csel w9, w9, w11, ne
6320 ; -O0: and w13, w9, #0x1
6321 ; -O0: ands w13, w13, #0x1
6322 ; -O0: csel x2, x11, x12, ne
6323 ; -O0: and w11, w9, #0x1
6324 ; -O0: ands w11, w11, #0x1
6325 ; -O0: csel x9, x9, x10, ne
6326 ; -O0: caspal x0, x1, x2, x3, [x8]
6327 ; -O0: eor x8, x10, x8
6328 ; -O0: eor x11, x9, x11
6329 ; -O0: orr x8, x8, x11
6330 ; -O0: subs x8, x8, #0
6332 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6333 ; -O1: ldp x4, x5, [x0]
6335 ; -O1: csel x9, x7, x3, hs
6336 ; -O1: csel x8, x4, x2, hs
6337 ; -O1: caspal x4, x5, x8, x9, [x0]
6339 ; -O1: ccmp x4, x6, #0, eq
6340 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
6344 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6345 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6346 ; -O0: subs x9, x9, x10
6347 ; -O0: subs x9, x9, x10
6348 ; -O0: subs x9, x9, x12
6349 ; -O0: and w13, w13, #0x1
6350 ; -O0: ands w13, w13, #0x1
6351 ; -O0: csel w9, w9, w11, ne
6352 ; -O0: and w13, w9, #0x1
6353 ; -O0: ands w13, w13, #0x1
6354 ; -O0: csel x2, x11, x12, ne
6355 ; -O0: and w11, w9, #0x1
6356 ; -O0: ands w11, w11, #0x1
6357 ; -O0: csel x9, x9, x10, ne
6358 ; -O0: caspal x0, x1, x2, x3, [x8]
6359 ; -O0: eor x8, x10, x8
6360 ; -O0: eor x11, x9, x11
6361 ; -O0: orr x8, x8, x11
6362 ; -O0: subs x8, x8, #0
6364 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6365 ; -O1: ldp x4, x5, [x0]
6367 ; -O1: csel x9, x7, x3, hs
6368 ; -O1: csel x8, x4, x2, hs
6369 ; -O1: caspal x4, x5, x8, x9, [x0]
6371 ; -O1: ccmp x4, x6, #0, eq
6372 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
6376 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6377 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
6378 ; CHECK: lduminb w1, w0, [x0]
6379 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
6383 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6384 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acquire:
6385 ; CHECK: lduminab w1, w0, [x0]
6386 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
6390 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
6391 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_release:
6392 ; CHECK: lduminlb w1, w0, [x0]
6393 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
6397 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6398 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
6399 ; CHECK: lduminalb w1, w0, [x0]
6400 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
6404 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6405 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
6406 ; CHECK: lduminalb w1, w0, [x0]
6407 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
6411 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6412 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6413 ; -O0: subs w10, w10, w8, uxth
6414 ; -O0: and w10, w10, #0x1
6415 ; -O0: ands w10, w10, #0x1
6416 ; -O0: csel w8, w9, w8, ne
6417 ; -O0: bl __atomic_compare_exchange
6419 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6420 ; -O1: and w8, w0, #0xffff
6421 ; -O1: cmp w8, w20, uxth
6422 ; -O1: csel w8, w0, w20, ls
6423 ; -O1: bl __atomic_compare_exchange
6424 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
6428 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6429 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6430 ; -O0: subs w10, w10, w8, uxth
6431 ; -O0: and w10, w10, #0x1
6432 ; -O0: ands w10, w10, #0x1
6433 ; -O0: csel w8, w9, w8, ne
6434 ; -O0: bl __atomic_compare_exchange
6436 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6437 ; -O1: and w8, w0, #0xffff
6438 ; -O1: cmp w8, w20, uxth
6439 ; -O1: csel w8, w0, w20, ls
6440 ; -O1: bl __atomic_compare_exchange
6441 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
6445 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
6446 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
6447 ; -O0: subs w10, w10, w8, uxth
6448 ; -O0: and w10, w10, #0x1
6449 ; -O0: ands w10, w10, #0x1
6450 ; -O0: csel w8, w9, w8, ne
6451 ; -O0: bl __atomic_compare_exchange
6453 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
6454 ; -O1: and w8, w0, #0xffff
6455 ; -O1: cmp w8, w20, uxth
6456 ; -O1: csel w8, w0, w20, ls
6457 ; -O1: bl __atomic_compare_exchange
6458 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
6462 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6463 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6464 ; -O0: subs w10, w10, w8, uxth
6465 ; -O0: and w10, w10, #0x1
6466 ; -O0: ands w10, w10, #0x1
6467 ; -O0: csel w8, w9, w8, ne
6468 ; -O0: bl __atomic_compare_exchange
6470 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6471 ; -O1: and w8, w0, #0xffff
6472 ; -O1: cmp w8, w20, uxth
6473 ; -O1: csel w8, w0, w20, ls
6474 ; -O1: bl __atomic_compare_exchange
6475 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
6479 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6480 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6481 ; -O0: subs w10, w10, w8, uxth
6482 ; -O0: and w10, w10, #0x1
6483 ; -O0: ands w10, w10, #0x1
6484 ; -O0: csel w8, w9, w8, ne
6485 ; -O0: bl __atomic_compare_exchange
6487 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6488 ; -O1: and w8, w0, #0xffff
6489 ; -O1: cmp w8, w20, uxth
6490 ; -O1: csel w8, w0, w20, ls
6491 ; -O1: bl __atomic_compare_exchange
6492 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
6496 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6497 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6498 ; -O0: subs w10, w9, w8
6499 ; -O0: and w10, w10, #0x1
6500 ; -O0: ands w10, w10, #0x1
6501 ; -O0: csel w8, w9, w8, ne
6502 ; -O0: bl __atomic_compare_exchange
6504 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6506 ; -O1: csel w8, w0, w20, ls
6507 ; -O1: bl __atomic_compare_exchange
6508 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
6512 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6513 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6514 ; -O0: subs w10, w9, w8
6515 ; -O0: and w10, w10, #0x1
6516 ; -O0: ands w10, w10, #0x1
6517 ; -O0: csel w8, w9, w8, ne
6518 ; -O0: bl __atomic_compare_exchange
6520 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6522 ; -O1: csel w8, w0, w20, ls
6523 ; -O1: bl __atomic_compare_exchange
6524 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
6528 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
6529 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
6530 ; -O0: subs w10, w9, w8
6531 ; -O0: and w10, w10, #0x1
6532 ; -O0: ands w10, w10, #0x1
6533 ; -O0: csel w8, w9, w8, ne
6534 ; -O0: bl __atomic_compare_exchange
6536 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
6538 ; -O1: csel w8, w0, w20, ls
6539 ; -O1: bl __atomic_compare_exchange
6540 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
6544 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6545 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6546 ; -O0: subs w10, w9, w8
6547 ; -O0: and w10, w10, #0x1
6548 ; -O0: ands w10, w10, #0x1
6549 ; -O0: csel w8, w9, w8, ne
6550 ; -O0: bl __atomic_compare_exchange
6552 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6554 ; -O1: csel w8, w0, w20, ls
6555 ; -O1: bl __atomic_compare_exchange
6556 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
6560 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6561 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6562 ; -O0: subs w10, w9, w8
6563 ; -O0: and w10, w10, #0x1
6564 ; -O0: ands w10, w10, #0x1
6565 ; -O0: csel w8, w9, w8, ne
6566 ; -O0: bl __atomic_compare_exchange
6568 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6570 ; -O1: csel w8, w0, w20, ls
6571 ; -O1: bl __atomic_compare_exchange
6572 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
6576 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6577 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6578 ; -O0: subs x10, x9, x8
6579 ; -O0: and w10, w10, #0x1
6580 ; -O0: ands w10, w10, #0x1
6581 ; -O0: csel x8, x9, x8, ne
6582 ; -O0: bl __atomic_compare_exchange
6584 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6586 ; -O1: csel x8, x0, x20, ls
6587 ; -O1: bl __atomic_compare_exchange
6588 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
6592 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6593 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6594 ; -O0: subs x10, x9, x8
6595 ; -O0: and w10, w10, #0x1
6596 ; -O0: ands w10, w10, #0x1
6597 ; -O0: csel x8, x9, x8, ne
6598 ; -O0: bl __atomic_compare_exchange
6600 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6602 ; -O1: csel x8, x0, x20, ls
6603 ; -O1: bl __atomic_compare_exchange
6604 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
6608 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
6609 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
6610 ; -O0: subs x10, x9, x8
6611 ; -O0: and w10, w10, #0x1
6612 ; -O0: ands w10, w10, #0x1
6613 ; -O0: csel x8, x9, x8, ne
6614 ; -O0: bl __atomic_compare_exchange
6616 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
6618 ; -O1: csel x8, x0, x20, ls
6619 ; -O1: bl __atomic_compare_exchange
6620 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
6624 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6625 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6626 ; -O0: subs x10, x9, x8
6627 ; -O0: and w10, w10, #0x1
6628 ; -O0: ands w10, w10, #0x1
6629 ; -O0: csel x8, x9, x8, ne
6630 ; -O0: bl __atomic_compare_exchange
6632 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6634 ; -O1: csel x8, x0, x20, ls
6635 ; -O1: bl __atomic_compare_exchange
6636 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
6640 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6641 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6642 ; -O0: subs x10, x9, x8
6643 ; -O0: and w10, w10, #0x1
6644 ; -O0: ands w10, w10, #0x1
6645 ; -O0: csel x8, x9, x8, ne
6646 ; -O0: bl __atomic_compare_exchange
6648 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6650 ; -O1: csel x8, x0, x20, ls
6651 ; -O1: bl __atomic_compare_exchange
6652 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
6656 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6657 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6658 ; -O0: subs x8, x8, x10
6659 ; -O0: subs x8, x8, x10
6660 ; -O0: subs x8, x8, x11
6661 ; -O0: and w12, w12, #0x1
6662 ; -O0: ands w12, w12, #0x1
6663 ; -O0: csel w8, w8, w9, ne
6664 ; -O0: and w12, w8, #0x1
6665 ; -O0: ands w12, w12, #0x1
6666 ; -O0: csel x9, x9, x11, ne
6667 ; -O0: and w11, w8, #0x1
6668 ; -O0: ands w11, w11, #0x1
6669 ; -O0: csel x8, x8, x10, ne
6670 ; -O0: bl __atomic_compare_exchange
6672 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6673 ; -O1: ldp x0, x1, [x0]
6675 ; -O1: csel x8, x1, x19, hs
6676 ; -O1: csel x9, x0, x21, hs
6677 ; -O1: bl __atomic_compare_exchange
6678 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
6682 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6683 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6684 ; -O0: subs x8, x8, x10
6685 ; -O0: subs x8, x8, x10
6686 ; -O0: subs x8, x8, x11
6687 ; -O0: and w12, w12, #0x1
6688 ; -O0: ands w12, w12, #0x1
6689 ; -O0: csel w8, w8, w9, ne
6690 ; -O0: and w12, w8, #0x1
6691 ; -O0: ands w12, w12, #0x1
6692 ; -O0: csel x9, x9, x11, ne
6693 ; -O0: and w11, w8, #0x1
6694 ; -O0: ands w11, w11, #0x1
6695 ; -O0: csel x8, x8, x10, ne
6696 ; -O0: bl __atomic_compare_exchange
6698 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6699 ; -O1: ldp x0, x1, [x0]
6701 ; -O1: csel x8, x1, x19, hs
6702 ; -O1: csel x9, x0, x21, hs
6703 ; -O1: bl __atomic_compare_exchange
6704 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
6708 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
6709 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
6710 ; -O0: subs x8, x8, x10
6711 ; -O0: subs x8, x8, x10
6712 ; -O0: subs x8, x8, x11
6713 ; -O0: and w12, w12, #0x1
6714 ; -O0: ands w12, w12, #0x1
6715 ; -O0: csel w8, w8, w9, ne
6716 ; -O0: and w12, w8, #0x1
6717 ; -O0: ands w12, w12, #0x1
6718 ; -O0: csel x9, x9, x11, ne
6719 ; -O0: and w11, w8, #0x1
6720 ; -O0: ands w11, w11, #0x1
6721 ; -O0: csel x8, x8, x10, ne
6722 ; -O0: bl __atomic_compare_exchange
6724 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
6725 ; -O1: ldp x0, x1, [x0]
6727 ; -O1: csel x8, x1, x19, hs
6728 ; -O1: csel x9, x0, x21, hs
6729 ; -O1: bl __atomic_compare_exchange
6730 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
6734 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6735 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6736 ; -O0: subs x8, x8, x10
6737 ; -O0: subs x8, x8, x10
6738 ; -O0: subs x8, x8, x11
6739 ; -O0: and w12, w12, #0x1
6740 ; -O0: ands w12, w12, #0x1
6741 ; -O0: csel w8, w8, w9, ne
6742 ; -O0: and w12, w8, #0x1
6743 ; -O0: ands w12, w12, #0x1
6744 ; -O0: csel x9, x9, x11, ne
6745 ; -O0: and w11, w8, #0x1
6746 ; -O0: ands w11, w11, #0x1
6747 ; -O0: csel x8, x8, x10, ne
6748 ; -O0: bl __atomic_compare_exchange
6750 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6751 ; -O1: ldp x0, x1, [x0]
6753 ; -O1: csel x8, x1, x19, hs
6754 ; -O1: csel x9, x0, x21, hs
6755 ; -O1: bl __atomic_compare_exchange
6756 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
6760 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6761 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6762 ; -O0: subs x8, x8, x10
6763 ; -O0: subs x8, x8, x10
6764 ; -O0: subs x8, x8, x11
6765 ; -O0: and w12, w12, #0x1
6766 ; -O0: ands w12, w12, #0x1
6767 ; -O0: csel w8, w8, w9, ne
6768 ; -O0: and w12, w8, #0x1
6769 ; -O0: ands w12, w12, #0x1
6770 ; -O0: csel x9, x9, x11, ne
6771 ; -O0: and w11, w8, #0x1
6772 ; -O0: ands w11, w11, #0x1
6773 ; -O0: csel x8, x8, x10, ne
6774 ; -O0: bl __atomic_compare_exchange
6776 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6777 ; -O1: ldp x0, x1, [x0]
6779 ; -O1: csel x8, x1, x19, hs
6780 ; -O1: csel x9, x0, x21, hs
6781 ; -O1: bl __atomic_compare_exchange
6782 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1