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: subs w11, w11, #1
550 ; -O0: casp x0, x1, x2, x3, [x8]
551 ; -O0: eor x8, x10, x8
552 ; -O0: eor x11, x9, x11
553 ; -O0: orr x8, x8, x11
554 ; -O0: subs x8, x8, #0
556 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
557 ; -O1: ldp x4, x5, [x0]
558 ; -O1: adds x8, x4, x2
559 ; -O1: casp x4, x5, x8, x9, [x0]
561 ; -O1: ccmp x4, x6, #0, eq
562 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
566 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
567 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
568 ; -O0: adds x2, x9, x11
569 ; -O0: subs w11, w11, #1
570 ; -O0: caspa x0, x1, x2, x3, [x8]
571 ; -O0: eor x8, x10, x8
572 ; -O0: eor x11, x9, x11
573 ; -O0: orr x8, x8, x11
574 ; -O0: subs x8, x8, #0
576 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
577 ; -O1: ldp x4, x5, [x0]
578 ; -O1: adds x8, x4, x2
579 ; -O1: caspa x4, x5, x8, x9, [x0]
581 ; -O1: ccmp x4, x6, #0, eq
582 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
586 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
587 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
588 ; -O0: adds x2, x9, x11
589 ; -O0: subs w11, w11, #1
590 ; -O0: caspl x0, x1, x2, x3, [x8]
591 ; -O0: eor x8, x10, x8
592 ; -O0: eor x11, x9, x11
593 ; -O0: orr x8, x8, x11
594 ; -O0: subs x8, x8, #0
596 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
597 ; -O1: ldp x4, x5, [x0]
598 ; -O1: adds x8, x4, x2
599 ; -O1: caspl x4, x5, x8, x9, [x0]
601 ; -O1: ccmp x4, x6, #0, eq
602 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
606 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
607 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
608 ; -O0: adds x2, x9, x11
609 ; -O0: subs w11, w11, #1
610 ; -O0: caspal x0, x1, x2, x3, [x8]
611 ; -O0: eor x8, x10, x8
612 ; -O0: eor x11, x9, x11
613 ; -O0: orr x8, x8, x11
614 ; -O0: subs x8, x8, #0
616 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
617 ; -O1: ldp x4, x5, [x0]
618 ; -O1: adds x8, x4, x2
619 ; -O1: caspal x4, x5, x8, x9, [x0]
621 ; -O1: ccmp x4, x6, #0, eq
622 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
626 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
627 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
628 ; -O0: adds x2, x9, x11
629 ; -O0: subs w11, w11, #1
630 ; -O0: caspal x0, x1, x2, x3, [x8]
631 ; -O0: eor x8, x10, x8
632 ; -O0: eor x11, x9, x11
633 ; -O0: orr x8, x8, x11
634 ; -O0: subs x8, x8, #0
636 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
637 ; -O1: ldp x4, x5, [x0]
638 ; -O1: adds x8, x4, x2
639 ; -O1: caspal x4, x5, x8, x9, [x0]
641 ; -O1: ccmp x4, x6, #0, eq
642 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
646 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
647 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
648 ; CHECK: ldaddb w1, w0, [x0]
649 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
653 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
654 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
655 ; CHECK: ldaddab w1, w0, [x0]
656 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
660 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
661 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
662 ; CHECK: ldaddlb w1, w0, [x0]
663 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
667 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
668 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
669 ; CHECK: ldaddalb w1, w0, [x0]
670 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
674 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
675 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
676 ; CHECK: ldaddalb w1, w0, [x0]
677 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
681 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
682 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
683 ; -O0: add w8, w8, w9, uxth
684 ; -O0: bl __atomic_compare_exchange
686 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
687 ; -O1: add w8, w0, w20
688 ; -O1: bl __atomic_compare_exchange
689 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
693 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
694 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
695 ; -O0: add w8, w8, w9, uxth
696 ; -O0: bl __atomic_compare_exchange
698 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
699 ; -O1: add w8, w0, w20
700 ; -O1: bl __atomic_compare_exchange
701 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
705 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
706 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
707 ; -O0: add w8, w8, w9, uxth
708 ; -O0: bl __atomic_compare_exchange
710 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
711 ; -O1: add w8, w0, w20
712 ; -O1: bl __atomic_compare_exchange
713 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
717 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
718 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
719 ; -O0: add w8, w8, w9, uxth
720 ; -O0: bl __atomic_compare_exchange
722 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
723 ; -O1: add w8, w0, w20
724 ; -O1: bl __atomic_compare_exchange
725 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
729 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
730 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
731 ; -O0: add w8, w8, w9, uxth
732 ; -O0: bl __atomic_compare_exchange
734 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
735 ; -O1: add w8, w0, w20
736 ; -O1: bl __atomic_compare_exchange
737 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
741 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
742 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
743 ; -O0: add w8, w9, w8
744 ; -O0: bl __atomic_compare_exchange
746 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
747 ; -O1: add w8, w0, w20
748 ; -O1: bl __atomic_compare_exchange
749 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
753 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
754 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
755 ; -O0: add w8, w9, w8
756 ; -O0: bl __atomic_compare_exchange
758 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
759 ; -O1: add w8, w0, w20
760 ; -O1: bl __atomic_compare_exchange
761 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
765 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
766 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
767 ; -O0: add w8, w9, w8
768 ; -O0: bl __atomic_compare_exchange
770 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
771 ; -O1: add w8, w0, w20
772 ; -O1: bl __atomic_compare_exchange
773 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
777 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
778 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
779 ; -O0: add w8, w9, w8
780 ; -O0: bl __atomic_compare_exchange
782 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
783 ; -O1: add w8, w0, w20
784 ; -O1: bl __atomic_compare_exchange
785 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
789 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
790 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
791 ; -O0: add w8, w9, w8
792 ; -O0: bl __atomic_compare_exchange
794 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
795 ; -O1: add w8, w0, w20
796 ; -O1: bl __atomic_compare_exchange
797 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
801 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
802 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
803 ; -O0: add x8, x9, x8
804 ; -O0: bl __atomic_compare_exchange
806 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
807 ; -O1: add x8, x0, x20
808 ; -O1: bl __atomic_compare_exchange
809 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
813 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
814 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
815 ; -O0: add x8, x9, x8
816 ; -O0: bl __atomic_compare_exchange
818 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
819 ; -O1: add x8, x0, x20
820 ; -O1: bl __atomic_compare_exchange
821 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
825 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
826 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
827 ; -O0: add x8, x9, x8
828 ; -O0: bl __atomic_compare_exchange
830 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
831 ; -O1: add x8, x0, x20
832 ; -O1: bl __atomic_compare_exchange
833 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
837 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
838 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
839 ; -O0: add x8, x9, x8
840 ; -O0: bl __atomic_compare_exchange
842 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
843 ; -O1: add x8, x0, x20
844 ; -O1: bl __atomic_compare_exchange
845 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
849 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
850 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
851 ; -O0: add x8, x9, x8
852 ; -O0: bl __atomic_compare_exchange
854 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
855 ; -O1: add x8, x0, x20
856 ; -O1: bl __atomic_compare_exchange
857 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
861 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
862 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
863 ; -O0: adds x9, x8, x9
864 ; -O0: subs w11, w11, #1
865 ; -O0: bl __atomic_compare_exchange
867 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
868 ; -O1: ldp x0, x1, [x0]
869 ; -O1: adds x8, x0, x21
870 ; -O1: bl __atomic_compare_exchange
871 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
875 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
876 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
877 ; -O0: adds x9, x8, x9
878 ; -O0: subs w11, w11, #1
879 ; -O0: bl __atomic_compare_exchange
881 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
882 ; -O1: ldp x0, x1, [x0]
883 ; -O1: adds x8, x0, x21
884 ; -O1: bl __atomic_compare_exchange
885 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
889 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
890 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
891 ; -O0: adds x9, x8, x9
892 ; -O0: subs w11, w11, #1
893 ; -O0: bl __atomic_compare_exchange
895 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
896 ; -O1: ldp x0, x1, [x0]
897 ; -O1: adds x8, x0, x21
898 ; -O1: bl __atomic_compare_exchange
899 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
903 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
904 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
905 ; -O0: adds x9, x8, x9
906 ; -O0: subs w11, w11, #1
907 ; -O0: bl __atomic_compare_exchange
909 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
910 ; -O1: ldp x0, x1, [x0]
911 ; -O1: adds x8, x0, x21
912 ; -O1: bl __atomic_compare_exchange
913 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
917 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
918 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
919 ; -O0: adds x9, x8, x9
920 ; -O0: subs w11, w11, #1
921 ; -O0: bl __atomic_compare_exchange
923 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
924 ; -O1: ldp x0, x1, [x0]
925 ; -O1: adds x8, x0, x21
926 ; -O1: bl __atomic_compare_exchange
927 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
931 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
932 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_monotonic:
933 ; CHECK: ldaddb w8, w0, [x0]
934 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
938 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
939 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acquire:
940 ; CHECK: ldaddab w8, w0, [x0]
941 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
945 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
946 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_release:
947 ; CHECK: ldaddlb w8, w0, [x0]
948 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
952 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
953 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
954 ; CHECK: ldaddalb w8, w0, [x0]
955 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
959 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
960 ; CHECK-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
961 ; CHECK: ldaddalb w8, w0, [x0]
962 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
966 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
967 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_monotonic:
968 ; CHECK: ldaddh w8, w0, [x0]
969 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
973 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
974 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acquire:
975 ; CHECK: ldaddah w8, w0, [x0]
976 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
980 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
981 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_release:
982 ; CHECK: ldaddlh w8, w0, [x0]
983 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
987 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
988 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
989 ; CHECK: ldaddalh w8, w0, [x0]
990 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
994 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
995 ; CHECK-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
996 ; CHECK: ldaddalh w8, w0, [x0]
997 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1001 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1002 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1003 ; CHECK: ldadd w8, w0, [x0]
1004 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1008 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1009 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acquire:
1010 ; CHECK: ldadda w8, w0, [x0]
1011 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1015 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1016 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_release:
1017 ; CHECK: ldaddl w8, w0, [x0]
1018 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1022 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1023 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1024 ; CHECK: ldaddal w8, w0, [x0]
1025 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1029 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1030 ; CHECK-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1031 ; CHECK: ldaddal w8, w0, [x0]
1032 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1036 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1037 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1038 ; CHECK: ldadd x8, x0, [x0]
1039 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1043 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1044 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acquire:
1045 ; CHECK: ldadda x8, x0, [x0]
1046 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1050 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1051 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_release:
1052 ; CHECK: ldaddl x8, x0, [x0]
1053 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1057 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1058 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1059 ; CHECK: ldaddal x8, x0, [x0]
1060 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1064 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1065 ; CHECK-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1066 ; CHECK: ldaddal x8, x0, [x0]
1067 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1071 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1072 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1073 ; -O0: subs x2, x9, x11
1074 ; -O0: casp x0, x1, x2, x3, [x8]
1075 ; -O0: eor x8, x10, x8
1076 ; -O0: eor x11, x9, x11
1077 ; -O0: orr x8, x8, x11
1078 ; -O0: subs x8, x8, #0
1080 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1081 ; -O1: ldp x4, x5, [x0]
1082 ; -O1: subs x8, x4, x2
1083 ; -O1: casp x4, x5, x8, x9, [x0]
1085 ; -O1: ccmp x4, x6, #0, eq
1086 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1090 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1091 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1092 ; -O0: subs x2, x9, x11
1093 ; -O0: caspa x0, x1, x2, x3, [x8]
1094 ; -O0: eor x8, x10, x8
1095 ; -O0: eor x11, x9, x11
1096 ; -O0: orr x8, x8, x11
1097 ; -O0: subs x8, x8, #0
1099 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1100 ; -O1: ldp x4, x5, [x0]
1101 ; -O1: subs x8, x4, x2
1102 ; -O1: caspa x4, x5, x8, x9, [x0]
1104 ; -O1: ccmp x4, x6, #0, eq
1105 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1109 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1110 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1111 ; -O0: subs x2, x9, x11
1112 ; -O0: caspl x0, x1, x2, x3, [x8]
1113 ; -O0: eor x8, x10, x8
1114 ; -O0: eor x11, x9, x11
1115 ; -O0: orr x8, x8, x11
1116 ; -O0: subs x8, x8, #0
1118 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1119 ; -O1: ldp x4, x5, [x0]
1120 ; -O1: subs x8, x4, x2
1121 ; -O1: caspl x4, x5, x8, x9, [x0]
1123 ; -O1: ccmp x4, x6, #0, eq
1124 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1128 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1129 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1130 ; -O0: subs x2, x9, x11
1131 ; -O0: caspal x0, x1, x2, x3, [x8]
1132 ; -O0: eor x8, x10, x8
1133 ; -O0: eor x11, x9, x11
1134 ; -O0: orr x8, x8, x11
1135 ; -O0: subs x8, x8, #0
1137 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1138 ; -O1: ldp x4, x5, [x0]
1139 ; -O1: subs x8, x4, x2
1140 ; -O1: caspal x4, x5, x8, x9, [x0]
1142 ; -O1: ccmp x4, x6, #0, eq
1143 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1147 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1148 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1149 ; -O0: subs x2, x9, x11
1150 ; -O0: caspal x0, x1, x2, x3, [x8]
1151 ; -O0: eor x8, x10, x8
1152 ; -O0: eor x11, x9, x11
1153 ; -O0: orr x8, x8, x11
1154 ; -O0: subs x8, x8, #0
1156 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1157 ; -O1: ldp x4, x5, [x0]
1158 ; -O1: subs x8, x4, x2
1159 ; -O1: caspal x4, x5, x8, x9, [x0]
1161 ; -O1: ccmp x4, x6, #0, eq
1162 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1166 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1167 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1168 ; CHECK: ldaddb w8, w0, [x0]
1169 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1173 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1174 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1175 ; CHECK: ldaddab w8, w0, [x0]
1176 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1180 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1181 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_release:
1182 ; CHECK: ldaddlb w8, w0, [x0]
1183 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1187 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1188 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1189 ; CHECK: ldaddalb w8, w0, [x0]
1190 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1194 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1195 ; CHECK-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1196 ; CHECK: ldaddalb w8, w0, [x0]
1197 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1201 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1202 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1203 ; -O0: subs w8, w9, w8
1204 ; -O0: bl __atomic_compare_exchange
1206 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1207 ; -O1: sub w8, w0, w20
1208 ; -O1: bl __atomic_compare_exchange
1209 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1213 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1214 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1215 ; -O0: subs w8, w9, w8
1216 ; -O0: bl __atomic_compare_exchange
1218 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1219 ; -O1: sub w8, w0, w20
1220 ; -O1: bl __atomic_compare_exchange
1221 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1225 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1226 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1227 ; -O0: subs w8, w9, w8
1228 ; -O0: bl __atomic_compare_exchange
1230 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1231 ; -O1: sub w8, w0, w20
1232 ; -O1: bl __atomic_compare_exchange
1233 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1237 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1238 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1239 ; -O0: subs w8, w9, w8
1240 ; -O0: bl __atomic_compare_exchange
1242 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1243 ; -O1: sub w8, w0, w20
1244 ; -O1: bl __atomic_compare_exchange
1245 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1249 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1250 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1251 ; -O0: subs w8, w9, w8
1252 ; -O0: bl __atomic_compare_exchange
1254 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1255 ; -O1: sub w8, w0, w20
1256 ; -O1: bl __atomic_compare_exchange
1257 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1261 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1262 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1263 ; -O0: subs w8, w9, w8
1264 ; -O0: bl __atomic_compare_exchange
1266 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1267 ; -O1: sub w8, w0, w20
1268 ; -O1: bl __atomic_compare_exchange
1269 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1273 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1274 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1275 ; -O0: subs w8, w9, w8
1276 ; -O0: bl __atomic_compare_exchange
1278 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1279 ; -O1: sub w8, w0, w20
1280 ; -O1: bl __atomic_compare_exchange
1281 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1285 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1286 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1287 ; -O0: subs w8, w9, w8
1288 ; -O0: bl __atomic_compare_exchange
1290 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1291 ; -O1: sub w8, w0, w20
1292 ; -O1: bl __atomic_compare_exchange
1293 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1297 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1298 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1299 ; -O0: subs w8, w9, w8
1300 ; -O0: bl __atomic_compare_exchange
1302 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1303 ; -O1: sub w8, w0, w20
1304 ; -O1: bl __atomic_compare_exchange
1305 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1309 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1310 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1311 ; -O0: subs w8, w9, w8
1312 ; -O0: bl __atomic_compare_exchange
1314 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1315 ; -O1: sub w8, w0, w20
1316 ; -O1: bl __atomic_compare_exchange
1317 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1321 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1322 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1323 ; -O0: subs x8, x9, x8
1324 ; -O0: bl __atomic_compare_exchange
1326 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1327 ; -O1: sub x8, x0, x20
1328 ; -O1: bl __atomic_compare_exchange
1329 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1333 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1334 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1335 ; -O0: subs x8, x9, x8
1336 ; -O0: bl __atomic_compare_exchange
1338 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1339 ; -O1: sub x8, x0, x20
1340 ; -O1: bl __atomic_compare_exchange
1341 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1345 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1346 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1347 ; -O0: subs x8, x9, x8
1348 ; -O0: bl __atomic_compare_exchange
1350 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1351 ; -O1: sub x8, x0, x20
1352 ; -O1: bl __atomic_compare_exchange
1353 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1357 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1358 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1359 ; -O0: subs x8, x9, x8
1360 ; -O0: bl __atomic_compare_exchange
1362 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1363 ; -O1: sub x8, x0, x20
1364 ; -O1: bl __atomic_compare_exchange
1365 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1369 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1370 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1371 ; -O0: subs x8, x9, x8
1372 ; -O0: bl __atomic_compare_exchange
1374 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1375 ; -O1: sub x8, x0, x20
1376 ; -O1: bl __atomic_compare_exchange
1377 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1381 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1382 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1383 ; -O0: subs x9, x8, x9
1384 ; -O0: bl __atomic_compare_exchange
1386 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1387 ; -O1: ldp x0, x1, [x0]
1388 ; -O1: subs x8, x0, x21
1389 ; -O1: bl __atomic_compare_exchange
1390 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1394 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1395 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1396 ; -O0: subs x9, x8, x9
1397 ; -O0: bl __atomic_compare_exchange
1399 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1400 ; -O1: ldp x0, x1, [x0]
1401 ; -O1: subs x8, x0, x21
1402 ; -O1: bl __atomic_compare_exchange
1403 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1407 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1408 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1409 ; -O0: subs x9, x8, x9
1410 ; -O0: bl __atomic_compare_exchange
1412 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1413 ; -O1: ldp x0, x1, [x0]
1414 ; -O1: subs x8, x0, x21
1415 ; -O1: bl __atomic_compare_exchange
1416 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1420 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1421 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1422 ; -O0: subs x9, x8, x9
1423 ; -O0: bl __atomic_compare_exchange
1425 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1426 ; -O1: ldp x0, x1, [x0]
1427 ; -O1: subs x8, x0, x21
1428 ; -O1: bl __atomic_compare_exchange
1429 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1433 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1434 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1435 ; -O0: subs x9, x8, x9
1436 ; -O0: bl __atomic_compare_exchange
1438 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1439 ; -O1: ldp x0, x1, [x0]
1440 ; -O1: subs x8, x0, x21
1441 ; -O1: bl __atomic_compare_exchange
1442 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1446 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1447 ; CHECK-LABEL: atomicrmw_and_i8_aligned_monotonic:
1449 ; CHECK: ldclrb w8, w0, [x0]
1450 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1454 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1455 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acquire:
1457 ; CHECK: ldclrab w8, w0, [x0]
1458 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1462 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1463 ; CHECK-LABEL: atomicrmw_and_i8_aligned_release:
1465 ; CHECK: ldclrlb w8, w0, [x0]
1466 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1470 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1471 ; CHECK-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1473 ; CHECK: ldclralb w8, w0, [x0]
1474 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1478 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1479 ; CHECK-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1481 ; CHECK: ldclralb w8, w0, [x0]
1482 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1486 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1487 ; CHECK-LABEL: atomicrmw_and_i16_aligned_monotonic:
1489 ; CHECK: ldclrh w8, w0, [x0]
1490 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1494 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1495 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acquire:
1497 ; CHECK: ldclrah w8, w0, [x0]
1498 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1502 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1503 ; CHECK-LABEL: atomicrmw_and_i16_aligned_release:
1505 ; CHECK: ldclrlh w8, w0, [x0]
1506 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1510 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1511 ; CHECK-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1513 ; CHECK: ldclralh w8, w0, [x0]
1514 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1518 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1519 ; CHECK-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1521 ; CHECK: ldclralh w8, w0, [x0]
1522 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1526 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1527 ; CHECK-LABEL: atomicrmw_and_i32_aligned_monotonic:
1529 ; CHECK: ldclr w8, w0, [x0]
1530 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1534 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1535 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acquire:
1537 ; CHECK: ldclra w8, w0, [x0]
1538 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1542 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1543 ; CHECK-LABEL: atomicrmw_and_i32_aligned_release:
1545 ; CHECK: ldclrl w8, w0, [x0]
1546 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1550 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1551 ; CHECK-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1553 ; CHECK: ldclral w8, w0, [x0]
1554 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1558 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1559 ; CHECK-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1561 ; CHECK: ldclral w8, w0, [x0]
1562 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1566 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1567 ; CHECK-LABEL: atomicrmw_and_i64_aligned_monotonic:
1569 ; CHECK: ldclr x8, x0, [x0]
1570 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1574 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1575 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acquire:
1577 ; CHECK: ldclra x8, x0, [x0]
1578 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1582 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1583 ; CHECK-LABEL: atomicrmw_and_i64_aligned_release:
1585 ; CHECK: ldclrl x8, x0, [x0]
1586 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1590 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1591 ; CHECK-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1593 ; CHECK: ldclral x8, x0, [x0]
1594 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1598 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1599 ; CHECK-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1601 ; CHECK: ldclral x8, x0, [x0]
1602 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1606 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1607 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1608 ; -O0: and x2, x9, x11
1609 ; -O0: and x9, x9, x10
1610 ; -O0: casp x0, x1, x2, x3, [x8]
1611 ; -O0: eor x8, x10, x8
1612 ; -O0: eor x11, x9, x11
1613 ; -O0: orr x8, x8, x11
1614 ; -O0: subs x8, x8, #0
1616 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1617 ; -O1: ldp x4, x5, [x0]
1618 ; -O1: and x8, x4, x2
1619 ; -O1: and x9, x7, x3
1620 ; -O1: casp x4, x5, x8, x9, [x0]
1622 ; -O1: ccmp x4, x6, #0, eq
1623 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1627 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1628 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1629 ; -O0: and x2, x9, x11
1630 ; -O0: and x9, x9, x10
1631 ; -O0: caspa x0, x1, x2, x3, [x8]
1632 ; -O0: eor x8, x10, x8
1633 ; -O0: eor x11, x9, x11
1634 ; -O0: orr x8, x8, x11
1635 ; -O0: subs x8, x8, #0
1637 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1638 ; -O1: ldp x4, x5, [x0]
1639 ; -O1: and x8, x4, x2
1640 ; -O1: and x9, x7, x3
1641 ; -O1: caspa x4, x5, x8, x9, [x0]
1643 ; -O1: ccmp x4, x6, #0, eq
1644 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1648 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1649 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1650 ; -O0: and x2, x9, x11
1651 ; -O0: and x9, x9, x10
1652 ; -O0: caspl x0, x1, x2, x3, [x8]
1653 ; -O0: eor x8, x10, x8
1654 ; -O0: eor x11, x9, x11
1655 ; -O0: orr x8, x8, x11
1656 ; -O0: subs x8, x8, #0
1658 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1659 ; -O1: ldp x4, x5, [x0]
1660 ; -O1: and x8, x4, x2
1661 ; -O1: and x9, x7, x3
1662 ; -O1: caspl x4, x5, x8, x9, [x0]
1664 ; -O1: ccmp x4, x6, #0, eq
1665 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1669 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1670 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1671 ; -O0: and x2, x9, x11
1672 ; -O0: and x9, x9, x10
1673 ; -O0: caspal x0, x1, x2, x3, [x8]
1674 ; -O0: eor x8, x10, x8
1675 ; -O0: eor x11, x9, x11
1676 ; -O0: orr x8, x8, x11
1677 ; -O0: subs x8, x8, #0
1679 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1680 ; -O1: ldp x4, x5, [x0]
1681 ; -O1: and x8, x4, x2
1682 ; -O1: and x9, x7, x3
1683 ; -O1: caspal x4, x5, x8, x9, [x0]
1685 ; -O1: ccmp x4, x6, #0, eq
1686 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1690 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1691 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1692 ; -O0: and x2, x9, x11
1693 ; -O0: and x9, x9, x10
1694 ; -O0: caspal x0, x1, x2, x3, [x8]
1695 ; -O0: eor x8, x10, x8
1696 ; -O0: eor x11, x9, x11
1697 ; -O0: orr x8, x8, x11
1698 ; -O0: subs x8, x8, #0
1700 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1701 ; -O1: ldp x4, x5, [x0]
1702 ; -O1: and x8, x4, x2
1703 ; -O1: and x9, x7, x3
1704 ; -O1: caspal x4, x5, x8, x9, [x0]
1706 ; -O1: ccmp x4, x6, #0, eq
1707 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1711 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1712 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1714 ; CHECK: ldclrb w8, w0, [x0]
1715 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1719 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1720 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acquire:
1722 ; CHECK: ldclrab w8, w0, [x0]
1723 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1727 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1728 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_release:
1730 ; CHECK: ldclrlb w8, w0, [x0]
1731 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1735 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1736 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1738 ; CHECK: ldclralb w8, w0, [x0]
1739 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1743 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1744 ; CHECK-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1746 ; CHECK: ldclralb w8, w0, [x0]
1747 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1751 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1752 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1753 ; -O0: and w8, w9, w8
1754 ; -O0: bl __atomic_compare_exchange
1756 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1757 ; -O1: and w8, w0, w20
1758 ; -O1: bl __atomic_compare_exchange
1759 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1763 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1764 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1765 ; -O0: and w8, w9, w8
1766 ; -O0: bl __atomic_compare_exchange
1768 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1769 ; -O1: and w8, w0, w20
1770 ; -O1: bl __atomic_compare_exchange
1771 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1775 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1776 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1777 ; -O0: and w8, w9, w8
1778 ; -O0: bl __atomic_compare_exchange
1780 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1781 ; -O1: and w8, w0, w20
1782 ; -O1: bl __atomic_compare_exchange
1783 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1787 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1788 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1789 ; -O0: and w8, w9, w8
1790 ; -O0: bl __atomic_compare_exchange
1792 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1793 ; -O1: and w8, w0, w20
1794 ; -O1: bl __atomic_compare_exchange
1795 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1799 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1800 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1801 ; -O0: and w8, w9, w8
1802 ; -O0: bl __atomic_compare_exchange
1804 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1805 ; -O1: and w8, w0, w20
1806 ; -O1: bl __atomic_compare_exchange
1807 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1811 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1812 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1813 ; -O0: and w8, w9, w8
1814 ; -O0: bl __atomic_compare_exchange
1816 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1817 ; -O1: and w8, w0, w20
1818 ; -O1: bl __atomic_compare_exchange
1819 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1823 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1824 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1825 ; -O0: and w8, w9, w8
1826 ; -O0: bl __atomic_compare_exchange
1828 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1829 ; -O1: and w8, w0, w20
1830 ; -O1: bl __atomic_compare_exchange
1831 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1835 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1836 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1837 ; -O0: and w8, w9, w8
1838 ; -O0: bl __atomic_compare_exchange
1840 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
1841 ; -O1: and w8, w0, w20
1842 ; -O1: bl __atomic_compare_exchange
1843 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
1847 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1848 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1849 ; -O0: and w8, w9, w8
1850 ; -O0: bl __atomic_compare_exchange
1852 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1853 ; -O1: and w8, w0, w20
1854 ; -O1: bl __atomic_compare_exchange
1855 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
1859 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1860 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1861 ; -O0: and w8, w9, w8
1862 ; -O0: bl __atomic_compare_exchange
1864 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1865 ; -O1: and w8, w0, w20
1866 ; -O1: bl __atomic_compare_exchange
1867 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
1871 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1872 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1873 ; -O0: and x8, x9, x8
1874 ; -O0: bl __atomic_compare_exchange
1876 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1877 ; -O1: and x8, x0, x20
1878 ; -O1: bl __atomic_compare_exchange
1879 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
1883 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1884 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
1885 ; -O0: and x8, x9, x8
1886 ; -O0: bl __atomic_compare_exchange
1888 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
1889 ; -O1: and x8, x0, x20
1890 ; -O1: bl __atomic_compare_exchange
1891 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
1895 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
1896 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
1897 ; -O0: and x8, x9, x8
1898 ; -O0: bl __atomic_compare_exchange
1900 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
1901 ; -O1: and x8, x0, x20
1902 ; -O1: bl __atomic_compare_exchange
1903 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
1907 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1908 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1909 ; -O0: and x8, x9, x8
1910 ; -O0: bl __atomic_compare_exchange
1912 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
1913 ; -O1: and x8, x0, x20
1914 ; -O1: bl __atomic_compare_exchange
1915 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
1919 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1920 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1921 ; -O0: and x8, x9, x8
1922 ; -O0: bl __atomic_compare_exchange
1924 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
1925 ; -O1: and x8, x0, x20
1926 ; -O1: bl __atomic_compare_exchange
1927 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
1931 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1932 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1933 ; -O0: and x9, x8, x9
1934 ; -O0: and x8, x8, x10
1935 ; -O0: bl __atomic_compare_exchange
1937 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
1938 ; -O1: ldp x0, x1, [x0]
1939 ; -O1: and x8, x1, x19
1940 ; -O1: and x9, x0, x21
1941 ; -O1: bl __atomic_compare_exchange
1942 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
1946 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1947 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
1948 ; -O0: and x9, x8, x9
1949 ; -O0: and x8, x8, x10
1950 ; -O0: bl __atomic_compare_exchange
1952 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
1953 ; -O1: ldp x0, x1, [x0]
1954 ; -O1: and x8, x1, x19
1955 ; -O1: and x9, x0, x21
1956 ; -O1: bl __atomic_compare_exchange
1957 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
1961 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
1962 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
1963 ; -O0: and x9, x8, x9
1964 ; -O0: and x8, x8, x10
1965 ; -O0: bl __atomic_compare_exchange
1967 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
1968 ; -O1: ldp x0, x1, [x0]
1969 ; -O1: and x8, x1, x19
1970 ; -O1: and x9, x0, x21
1971 ; -O1: bl __atomic_compare_exchange
1972 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
1976 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1977 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1978 ; -O0: and x9, x8, x9
1979 ; -O0: and x8, x8, x10
1980 ; -O0: bl __atomic_compare_exchange
1982 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
1983 ; -O1: ldp x0, x1, [x0]
1984 ; -O1: and x8, x1, x19
1985 ; -O1: and x9, x0, x21
1986 ; -O1: bl __atomic_compare_exchange
1987 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
1991 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1992 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1993 ; -O0: and x9, x8, x9
1994 ; -O0: and x8, x8, x10
1995 ; -O0: bl __atomic_compare_exchange
1997 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
1998 ; -O1: ldp x0, x1, [x0]
1999 ; -O1: and x8, x1, x19
2000 ; -O1: and x9, x0, x21
2001 ; -O1: bl __atomic_compare_exchange
2002 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2006 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2007 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2008 ; -O0: and w8, w10, w8
2010 ; -O0: casb w9, w8, [x11]
2011 ; -O0: and w8, w9, #0xff
2012 ; -O0: subs w8, w8, w10, uxtb
2014 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2015 ; -O1: and w10, w8, w1
2017 ; -O1: casb w9, w10, [x0]
2018 ; -O1: cmp w9, w8, uxtb
2019 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2023 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2024 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2025 ; -O0: and w8, w10, w8
2027 ; -O0: casab w9, w8, [x11]
2028 ; -O0: and w8, w9, #0xff
2029 ; -O0: subs w8, w8, w10, uxtb
2031 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2032 ; -O1: and w10, w8, w1
2034 ; -O1: casab w9, w10, [x0]
2035 ; -O1: cmp w9, w8, uxtb
2036 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2040 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2041 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2042 ; -O0: and w8, w10, w8
2044 ; -O0: caslb w9, w8, [x11]
2045 ; -O0: and w8, w9, #0xff
2046 ; -O0: subs w8, w8, w10, uxtb
2048 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2049 ; -O1: and w10, w8, w1
2051 ; -O1: caslb w9, w10, [x0]
2052 ; -O1: cmp w9, w8, uxtb
2053 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2057 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2058 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2059 ; -O0: and w8, w10, w8
2061 ; -O0: casalb w9, w8, [x11]
2062 ; -O0: and w8, w9, #0xff
2063 ; -O0: subs w8, w8, w10, uxtb
2065 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2066 ; -O1: and w10, w8, w1
2068 ; -O1: casalb w9, w10, [x0]
2069 ; -O1: cmp w9, w8, uxtb
2070 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2074 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2075 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2076 ; -O0: and w8, w10, w8
2078 ; -O0: casalb w9, w8, [x11]
2079 ; -O0: and w8, w9, #0xff
2080 ; -O0: subs w8, w8, w10, uxtb
2082 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2083 ; -O1: and w10, w8, w1
2085 ; -O1: casalb w9, w10, [x0]
2086 ; -O1: cmp w9, w8, uxtb
2087 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2091 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2092 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2093 ; -O0: and w9, w8, w9
2095 ; -O0: cash w9, w10, [x11]
2096 ; -O0: subs w8, w8, w9, uxth
2098 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2099 ; -O1: and w10, w8, w1
2101 ; -O1: cash w9, w10, [x0]
2102 ; -O1: cmp w9, w8, uxth
2103 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2107 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2108 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2109 ; -O0: and w9, w8, w9
2111 ; -O0: casah w9, w10, [x11]
2112 ; -O0: subs w8, w8, w9, uxth
2114 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2115 ; -O1: and w10, w8, w1
2117 ; -O1: casah w9, w10, [x0]
2118 ; -O1: cmp w9, w8, uxth
2119 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2123 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2124 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2125 ; -O0: and w9, w8, w9
2127 ; -O0: caslh w9, w10, [x11]
2128 ; -O0: subs w8, w8, w9, uxth
2130 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2131 ; -O1: and w10, w8, w1
2133 ; -O1: caslh w9, w10, [x0]
2134 ; -O1: cmp w9, w8, uxth
2135 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2139 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2140 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2141 ; -O0: and w9, w8, w9
2143 ; -O0: casalh w9, w10, [x11]
2144 ; -O0: subs w8, w8, w9, uxth
2146 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2147 ; -O1: and w10, w8, w1
2149 ; -O1: casalh w9, w10, [x0]
2150 ; -O1: cmp w9, w8, uxth
2151 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2155 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2156 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2157 ; -O0: and w9, w8, w9
2159 ; -O0: casalh w9, w10, [x11]
2160 ; -O0: subs w8, w8, w9, uxth
2162 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2163 ; -O1: and w10, w8, w1
2165 ; -O1: casalh w9, w10, [x0]
2166 ; -O1: cmp w9, w8, uxth
2167 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2171 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2172 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2173 ; -O0: and w9, w8, w9
2175 ; -O0: cas w9, w10, [x11]
2176 ; -O0: subs w8, w9, w8
2178 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2179 ; -O1: and w10, w8, w1
2181 ; -O1: cas w9, w10, [x0]
2183 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2187 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2188 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2189 ; -O0: and w9, w8, w9
2191 ; -O0: casa w9, w10, [x11]
2192 ; -O0: subs w8, w9, w8
2194 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2195 ; -O1: and w10, w8, w1
2197 ; -O1: casa w9, w10, [x0]
2199 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2203 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2204 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2205 ; -O0: and w9, w8, w9
2207 ; -O0: casl w9, w10, [x11]
2208 ; -O0: subs w8, w9, w8
2210 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2211 ; -O1: and w10, w8, w1
2213 ; -O1: casl w9, w10, [x0]
2215 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2219 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2220 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2221 ; -O0: and w9, w8, w9
2223 ; -O0: casal w9, w10, [x11]
2224 ; -O0: subs w8, w9, w8
2226 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2227 ; -O1: and w10, w8, w1
2229 ; -O1: casal w9, w10, [x0]
2231 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2235 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2236 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2237 ; -O0: and w9, w8, w9
2239 ; -O0: casal w9, w10, [x11]
2240 ; -O0: subs w8, w9, w8
2242 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2243 ; -O1: and w10, w8, w1
2245 ; -O1: casal w9, w10, [x0]
2247 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2251 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2252 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2253 ; -O0: and x9, x8, x9
2255 ; -O0: cas x9, x10, [x11]
2256 ; -O0: subs x8, x9, x8
2258 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2259 ; -O1: and x10, x8, x1
2261 ; -O1: cas x9, x10, [x0]
2263 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2267 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2268 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2269 ; -O0: and x9, x8, x9
2271 ; -O0: casa x9, x10, [x11]
2272 ; -O0: subs x8, x9, x8
2274 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2275 ; -O1: and x10, x8, x1
2277 ; -O1: casa x9, x10, [x0]
2279 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2283 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2284 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2285 ; -O0: and x9, x8, x9
2287 ; -O0: casl x9, x10, [x11]
2288 ; -O0: subs x8, x9, x8
2290 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2291 ; -O1: and x10, x8, x1
2293 ; -O1: casl x9, x10, [x0]
2295 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2299 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2300 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2301 ; -O0: and x9, x8, x9
2303 ; -O0: casal x9, x10, [x11]
2304 ; -O0: subs x8, x9, x8
2306 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2307 ; -O1: and x10, x8, x1
2309 ; -O1: casal x9, x10, [x0]
2311 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2315 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2316 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2317 ; -O0: and x9, x8, x9
2319 ; -O0: casal x9, x10, [x11]
2320 ; -O0: subs x8, x9, x8
2322 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2323 ; -O1: and x10, x8, x1
2325 ; -O1: casal x9, x10, [x0]
2327 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2331 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2332 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2333 ; -O0: and x10, x9, x10
2334 ; -O0: and x9, x9, x11
2337 ; -O0: casp x0, x1, x2, x3, [x8]
2338 ; -O0: eor x8, x10, x8
2339 ; -O0: eor x11, x9, x11
2340 ; -O0: orr x8, x8, x11
2341 ; -O0: subs x8, x8, #0
2343 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2344 ; -O1: ldp x4, x5, [x0]
2345 ; -O1: and x8, x4, x2
2346 ; -O1: and x9, x7, x3
2349 ; -O1: casp x4, x5, x10, x11, [x0]
2351 ; -O1: ccmp x4, x6, #0, eq
2352 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2356 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2357 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2358 ; -O0: and x10, x9, x10
2359 ; -O0: and x9, x9, x11
2362 ; -O0: caspa x0, x1, x2, x3, [x8]
2363 ; -O0: eor x8, x10, x8
2364 ; -O0: eor x11, x9, x11
2365 ; -O0: orr x8, x8, x11
2366 ; -O0: subs x8, x8, #0
2368 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2369 ; -O1: ldp x4, x5, [x0]
2370 ; -O1: and x8, x4, x2
2371 ; -O1: and x9, x7, x3
2374 ; -O1: caspa x4, x5, x10, x11, [x0]
2376 ; -O1: ccmp x4, x6, #0, eq
2377 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2381 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2382 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2383 ; -O0: and x10, x9, x10
2384 ; -O0: and x9, x9, x11
2387 ; -O0: caspl x0, x1, x2, x3, [x8]
2388 ; -O0: eor x8, x10, x8
2389 ; -O0: eor x11, x9, x11
2390 ; -O0: orr x8, x8, x11
2391 ; -O0: subs x8, x8, #0
2393 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2394 ; -O1: ldp x4, x5, [x0]
2395 ; -O1: and x8, x4, x2
2396 ; -O1: and x9, x7, x3
2399 ; -O1: caspl x4, x5, x10, x11, [x0]
2401 ; -O1: ccmp x4, x6, #0, eq
2402 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2406 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2407 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2408 ; -O0: and x10, x9, x10
2409 ; -O0: and x9, x9, x11
2412 ; -O0: caspal x0, x1, x2, x3, [x8]
2413 ; -O0: eor x8, x10, x8
2414 ; -O0: eor x11, x9, x11
2415 ; -O0: orr x8, x8, x11
2416 ; -O0: subs x8, x8, #0
2418 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2419 ; -O1: ldp x4, x5, [x0]
2420 ; -O1: and x8, x4, x2
2421 ; -O1: and x9, x7, x3
2424 ; -O1: caspal x4, x5, x10, x11, [x0]
2426 ; -O1: ccmp x4, x6, #0, eq
2427 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2431 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2432 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2433 ; -O0: and x10, x9, x10
2434 ; -O0: and x9, x9, x11
2437 ; -O0: caspal x0, x1, x2, x3, [x8]
2438 ; -O0: eor x8, x10, x8
2439 ; -O0: eor x11, x9, x11
2440 ; -O0: orr x8, x8, x11
2441 ; -O0: subs x8, x8, #0
2443 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2444 ; -O1: ldp x4, x5, [x0]
2445 ; -O1: and x8, x4, x2
2446 ; -O1: and x9, x7, x3
2449 ; -O1: caspal x4, x5, x10, x11, [x0]
2451 ; -O1: ccmp x4, x6, #0, eq
2452 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2456 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2457 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2458 ; -O0: and w8, w10, w8
2460 ; -O0: casb w9, w8, [x11]
2461 ; -O0: and w8, w9, #0xff
2462 ; -O0: subs w8, w8, w10, uxtb
2464 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2465 ; -O1: and w10, w8, w1
2467 ; -O1: casb w9, w10, [x0]
2468 ; -O1: cmp w9, w8, uxtb
2469 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2473 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2474 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2475 ; -O0: and w8, w10, w8
2477 ; -O0: casab w9, w8, [x11]
2478 ; -O0: and w8, w9, #0xff
2479 ; -O0: subs w8, w8, w10, uxtb
2481 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2482 ; -O1: and w10, w8, w1
2484 ; -O1: casab w9, w10, [x0]
2485 ; -O1: cmp w9, w8, uxtb
2486 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2490 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2491 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2492 ; -O0: and w8, w10, w8
2494 ; -O0: caslb w9, w8, [x11]
2495 ; -O0: and w8, w9, #0xff
2496 ; -O0: subs w8, w8, w10, uxtb
2498 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2499 ; -O1: and w10, w8, w1
2501 ; -O1: caslb w9, w10, [x0]
2502 ; -O1: cmp w9, w8, uxtb
2503 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2507 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2508 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2509 ; -O0: and w8, w10, w8
2511 ; -O0: casalb w9, w8, [x11]
2512 ; -O0: and w8, w9, #0xff
2513 ; -O0: subs w8, w8, w10, uxtb
2515 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2516 ; -O1: and w10, w8, w1
2518 ; -O1: casalb w9, w10, [x0]
2519 ; -O1: cmp w9, w8, uxtb
2520 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2524 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2525 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2526 ; -O0: and w8, w10, w8
2528 ; -O0: casalb w9, w8, [x11]
2529 ; -O0: and w8, w9, #0xff
2530 ; -O0: subs w8, w8, w10, uxtb
2532 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2533 ; -O1: and w10, w8, w1
2535 ; -O1: casalb w9, w10, [x0]
2536 ; -O1: cmp w9, w8, uxtb
2537 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2541 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2542 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2543 ; -O0: and w8, w9, w8
2545 ; -O0: bl __atomic_compare_exchange
2547 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2548 ; -O1: and w8, w0, w20
2550 ; -O1: bl __atomic_compare_exchange
2551 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2555 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2556 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2557 ; -O0: and w8, w9, w8
2559 ; -O0: bl __atomic_compare_exchange
2561 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2562 ; -O1: and w8, w0, w20
2564 ; -O1: bl __atomic_compare_exchange
2565 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2569 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2570 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2571 ; -O0: and w8, w9, w8
2573 ; -O0: bl __atomic_compare_exchange
2575 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2576 ; -O1: and w8, w0, w20
2578 ; -O1: bl __atomic_compare_exchange
2579 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2583 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2584 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2585 ; -O0: and w8, w9, w8
2587 ; -O0: bl __atomic_compare_exchange
2589 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2590 ; -O1: and w8, w0, w20
2592 ; -O1: bl __atomic_compare_exchange
2593 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2597 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2598 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2599 ; -O0: and w8, w9, w8
2601 ; -O0: bl __atomic_compare_exchange
2603 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2604 ; -O1: and w8, w0, w20
2606 ; -O1: bl __atomic_compare_exchange
2607 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2611 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2612 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2613 ; -O0: and w8, w9, w8
2615 ; -O0: bl __atomic_compare_exchange
2617 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2618 ; -O1: and w8, w0, w20
2620 ; -O1: bl __atomic_compare_exchange
2621 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2625 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2626 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2627 ; -O0: and w8, w9, w8
2629 ; -O0: bl __atomic_compare_exchange
2631 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2632 ; -O1: and w8, w0, w20
2634 ; -O1: bl __atomic_compare_exchange
2635 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2639 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2640 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2641 ; -O0: and w8, w9, w8
2643 ; -O0: bl __atomic_compare_exchange
2645 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2646 ; -O1: and w8, w0, w20
2648 ; -O1: bl __atomic_compare_exchange
2649 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2653 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2654 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2655 ; -O0: and w8, w9, w8
2657 ; -O0: bl __atomic_compare_exchange
2659 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2660 ; -O1: and w8, w0, w20
2662 ; -O1: bl __atomic_compare_exchange
2663 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2667 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2668 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2669 ; -O0: and w8, w9, w8
2671 ; -O0: bl __atomic_compare_exchange
2673 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2674 ; -O1: and w8, w0, w20
2676 ; -O1: bl __atomic_compare_exchange
2677 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2681 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2682 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2683 ; -O0: and x8, x9, x8
2685 ; -O0: bl __atomic_compare_exchange
2687 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2688 ; -O1: and x8, x0, x20
2690 ; -O1: bl __atomic_compare_exchange
2691 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2695 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2696 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2697 ; -O0: and x8, x9, x8
2699 ; -O0: bl __atomic_compare_exchange
2701 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2702 ; -O1: and x8, x0, x20
2704 ; -O1: bl __atomic_compare_exchange
2705 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2709 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2710 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2711 ; -O0: and x8, x9, x8
2713 ; -O0: bl __atomic_compare_exchange
2715 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2716 ; -O1: and x8, x0, x20
2718 ; -O1: bl __atomic_compare_exchange
2719 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2723 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2724 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2725 ; -O0: and x8, x9, x8
2727 ; -O0: bl __atomic_compare_exchange
2729 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2730 ; -O1: and x8, x0, x20
2732 ; -O1: bl __atomic_compare_exchange
2733 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2737 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2738 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2739 ; -O0: and x8, x9, x8
2741 ; -O0: bl __atomic_compare_exchange
2743 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2744 ; -O1: and x8, x0, x20
2746 ; -O1: bl __atomic_compare_exchange
2747 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2751 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2752 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2753 ; -O0: and x9, x8, x9
2754 ; -O0: and x8, x8, x10
2757 ; -O0: bl __atomic_compare_exchange
2759 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2760 ; -O1: ldp x0, x1, [x0]
2761 ; -O1: and x8, x1, x19
2762 ; -O1: and x9, x0, x21
2765 ; -O1: bl __atomic_compare_exchange
2766 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2770 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2771 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2772 ; -O0: and x9, x8, x9
2773 ; -O0: and x8, x8, x10
2776 ; -O0: bl __atomic_compare_exchange
2778 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2779 ; -O1: ldp x0, x1, [x0]
2780 ; -O1: and x8, x1, x19
2781 ; -O1: and x9, x0, x21
2784 ; -O1: bl __atomic_compare_exchange
2785 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2789 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2790 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2791 ; -O0: and x9, x8, x9
2792 ; -O0: and x8, x8, x10
2795 ; -O0: bl __atomic_compare_exchange
2797 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2798 ; -O1: ldp x0, x1, [x0]
2799 ; -O1: and x8, x1, x19
2800 ; -O1: and x9, x0, x21
2803 ; -O1: bl __atomic_compare_exchange
2804 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2808 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2809 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2810 ; -O0: and x9, x8, x9
2811 ; -O0: and x8, x8, x10
2814 ; -O0: bl __atomic_compare_exchange
2816 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2817 ; -O1: ldp x0, x1, [x0]
2818 ; -O1: and x8, x1, x19
2819 ; -O1: and x9, x0, x21
2822 ; -O1: bl __atomic_compare_exchange
2823 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2827 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2828 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2829 ; -O0: and x9, x8, x9
2830 ; -O0: and x8, x8, x10
2833 ; -O0: bl __atomic_compare_exchange
2835 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2836 ; -O1: ldp x0, x1, [x0]
2837 ; -O1: and x8, x1, x19
2838 ; -O1: and x9, x0, x21
2841 ; -O1: bl __atomic_compare_exchange
2842 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2846 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2847 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2848 ; CHECK: ldsetb w1, w0, [x0]
2849 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2853 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
2854 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
2855 ; CHECK: ldsetab w1, w0, [x0]
2856 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2860 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
2861 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
2862 ; CHECK: ldsetlb w1, w0, [x0]
2863 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2867 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2868 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
2869 ; CHECK: ldsetalb w1, w0, [x0]
2870 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2874 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2875 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
2876 ; CHECK: ldsetalb w1, w0, [x0]
2877 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
2881 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2882 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
2883 ; CHECK: ldseth w1, w0, [x0]
2884 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
2888 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
2889 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
2890 ; CHECK: ldsetah w1, w0, [x0]
2891 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
2895 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
2896 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
2897 ; CHECK: ldsetlh w1, w0, [x0]
2898 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
2902 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2903 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
2904 ; CHECK: ldsetalh w1, w0, [x0]
2905 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
2909 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2910 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
2911 ; CHECK: ldsetalh w1, w0, [x0]
2912 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
2916 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2917 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
2918 ; CHECK: ldset w1, w0, [x0]
2919 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
2923 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
2924 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
2925 ; CHECK: ldseta w1, w0, [x0]
2926 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
2930 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
2931 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
2932 ; CHECK: ldsetl w1, w0, [x0]
2933 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
2937 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2938 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
2939 ; CHECK: ldsetal w1, w0, [x0]
2940 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
2944 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2945 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
2946 ; CHECK: ldsetal w1, w0, [x0]
2947 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
2951 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2952 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
2953 ; CHECK: ldset x1, x0, [x0]
2954 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
2958 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
2959 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
2960 ; CHECK: ldseta x1, x0, [x0]
2961 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
2965 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
2966 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
2967 ; CHECK: ldsetl x1, x0, [x0]
2968 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
2972 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2973 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
2974 ; CHECK: ldsetal x1, x0, [x0]
2975 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
2979 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2980 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
2981 ; CHECK: ldsetal x1, x0, [x0]
2982 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
2986 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2987 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
2988 ; -O0: orr x2, x9, x11
2989 ; -O0: orr x9, x9, x10
2990 ; -O0: casp x0, x1, x2, x3, [x8]
2991 ; -O0: eor x8, x10, x8
2992 ; -O0: eor x11, x9, x11
2993 ; -O0: orr x8, x8, x11
2994 ; -O0: subs x8, x8, #0
2996 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
2997 ; -O1: ldp x4, x5, [x0]
2998 ; -O1: orr x8, x4, x2
2999 ; -O1: orr x9, x7, x3
3000 ; -O1: casp x4, x5, x8, x9, [x0]
3002 ; -O1: ccmp x4, x6, #0, eq
3003 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
3007 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
3008 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
3009 ; -O0: orr x2, x9, x11
3010 ; -O0: orr x9, x9, x10
3011 ; -O0: caspa x0, x1, x2, x3, [x8]
3012 ; -O0: eor x8, x10, x8
3013 ; -O0: eor x11, x9, x11
3014 ; -O0: orr x8, x8, x11
3015 ; -O0: subs x8, x8, #0
3017 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
3018 ; -O1: ldp x4, x5, [x0]
3019 ; -O1: orr x8, x4, x2
3020 ; -O1: orr x9, x7, x3
3021 ; -O1: caspa x4, x5, x8, x9, [x0]
3023 ; -O1: ccmp x4, x6, #0, eq
3024 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
3028 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
3029 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
3030 ; -O0: orr x2, x9, x11
3031 ; -O0: orr x9, x9, x10
3032 ; -O0: caspl x0, x1, x2, x3, [x8]
3033 ; -O0: eor x8, x10, x8
3034 ; -O0: eor x11, x9, x11
3035 ; -O0: orr x8, x8, x11
3036 ; -O0: subs x8, x8, #0
3038 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
3039 ; -O1: ldp x4, x5, [x0]
3040 ; -O1: orr x8, x4, x2
3041 ; -O1: orr x9, x7, x3
3042 ; -O1: caspl x4, x5, x8, x9, [x0]
3044 ; -O1: ccmp x4, x6, #0, eq
3045 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
3049 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3050 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3051 ; -O0: orr x2, x9, x11
3052 ; -O0: orr x9, x9, x10
3053 ; -O0: caspal x0, x1, x2, x3, [x8]
3054 ; -O0: eor x8, x10, x8
3055 ; -O0: eor x11, x9, x11
3056 ; -O0: orr x8, x8, x11
3057 ; -O0: subs x8, x8, #0
3059 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3060 ; -O1: ldp x4, x5, [x0]
3061 ; -O1: orr x8, x4, x2
3062 ; -O1: orr x9, x7, x3
3063 ; -O1: caspal x4, x5, x8, x9, [x0]
3065 ; -O1: ccmp x4, x6, #0, eq
3066 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
3070 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3071 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3072 ; -O0: orr x2, x9, x11
3073 ; -O0: orr x9, x9, x10
3074 ; -O0: caspal x0, x1, x2, x3, [x8]
3075 ; -O0: eor x8, x10, x8
3076 ; -O0: eor x11, x9, x11
3077 ; -O0: orr x8, x8, x11
3078 ; -O0: subs x8, x8, #0
3080 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3081 ; -O1: ldp x4, x5, [x0]
3082 ; -O1: orr x8, x4, x2
3083 ; -O1: orr x9, x7, x3
3084 ; -O1: caspal x4, x5, x8, x9, [x0]
3086 ; -O1: ccmp x4, x6, #0, eq
3087 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
3091 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3092 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
3093 ; CHECK: ldsetb w1, w0, [x0]
3094 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3098 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3099 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
3100 ; CHECK: ldsetab w1, w0, [x0]
3101 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3105 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3106 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3107 ; CHECK: ldsetlb w1, w0, [x0]
3108 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3112 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3113 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3114 ; CHECK: ldsetalb w1, w0, [x0]
3115 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3119 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3120 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3121 ; CHECK: ldsetalb w1, w0, [x0]
3122 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3126 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3127 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3128 ; -O0: orr w8, w9, w8
3129 ; -O0: bl __atomic_compare_exchange
3131 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3132 ; -O1: orr w8, w0, w20
3133 ; -O1: bl __atomic_compare_exchange
3134 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3138 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3139 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3140 ; -O0: orr w8, w9, w8
3141 ; -O0: bl __atomic_compare_exchange
3143 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3144 ; -O1: orr w8, w0, w20
3145 ; -O1: bl __atomic_compare_exchange
3146 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3150 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3151 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3152 ; -O0: orr w8, w9, w8
3153 ; -O0: bl __atomic_compare_exchange
3155 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3156 ; -O1: orr w8, w0, w20
3157 ; -O1: bl __atomic_compare_exchange
3158 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3162 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3163 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3164 ; -O0: orr w8, w9, w8
3165 ; -O0: bl __atomic_compare_exchange
3167 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3168 ; -O1: orr w8, w0, w20
3169 ; -O1: bl __atomic_compare_exchange
3170 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3174 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3175 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3176 ; -O0: orr w8, w9, w8
3177 ; -O0: bl __atomic_compare_exchange
3179 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3180 ; -O1: orr w8, w0, w20
3181 ; -O1: bl __atomic_compare_exchange
3182 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3186 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3187 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3188 ; -O0: orr w8, w9, w8
3189 ; -O0: bl __atomic_compare_exchange
3191 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3192 ; -O1: orr w8, w0, w20
3193 ; -O1: bl __atomic_compare_exchange
3194 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3198 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3199 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3200 ; -O0: orr w8, w9, w8
3201 ; -O0: bl __atomic_compare_exchange
3203 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3204 ; -O1: orr w8, w0, w20
3205 ; -O1: bl __atomic_compare_exchange
3206 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3210 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3211 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3212 ; -O0: orr w8, w9, w8
3213 ; -O0: bl __atomic_compare_exchange
3215 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3216 ; -O1: orr w8, w0, w20
3217 ; -O1: bl __atomic_compare_exchange
3218 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3222 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3223 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3224 ; -O0: orr w8, w9, w8
3225 ; -O0: bl __atomic_compare_exchange
3227 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3228 ; -O1: orr w8, w0, w20
3229 ; -O1: bl __atomic_compare_exchange
3230 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3234 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3235 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3236 ; -O0: orr w8, w9, w8
3237 ; -O0: bl __atomic_compare_exchange
3239 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3240 ; -O1: orr w8, w0, w20
3241 ; -O1: bl __atomic_compare_exchange
3242 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3246 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3247 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3248 ; -O0: orr x8, x9, x8
3249 ; -O0: bl __atomic_compare_exchange
3251 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3252 ; -O1: orr x8, x0, x20
3253 ; -O1: bl __atomic_compare_exchange
3254 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3258 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3259 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3260 ; -O0: orr x8, x9, x8
3261 ; -O0: bl __atomic_compare_exchange
3263 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3264 ; -O1: orr x8, x0, x20
3265 ; -O1: bl __atomic_compare_exchange
3266 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3270 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3271 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3272 ; -O0: orr x8, x9, x8
3273 ; -O0: bl __atomic_compare_exchange
3275 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3276 ; -O1: orr x8, x0, x20
3277 ; -O1: bl __atomic_compare_exchange
3278 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3282 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3283 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3284 ; -O0: orr x8, x9, x8
3285 ; -O0: bl __atomic_compare_exchange
3287 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3288 ; -O1: orr x8, x0, x20
3289 ; -O1: bl __atomic_compare_exchange
3290 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3294 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3295 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3296 ; -O0: orr x8, x9, x8
3297 ; -O0: bl __atomic_compare_exchange
3299 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3300 ; -O1: orr x8, x0, x20
3301 ; -O1: bl __atomic_compare_exchange
3302 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3306 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3307 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3308 ; -O0: orr x9, x8, x9
3309 ; -O0: orr x8, x8, x10
3310 ; -O0: bl __atomic_compare_exchange
3312 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3313 ; -O1: ldp x0, x1, [x0]
3314 ; -O1: orr x8, x1, x19
3315 ; -O1: orr x9, x0, x21
3316 ; -O1: bl __atomic_compare_exchange
3317 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3321 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3322 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3323 ; -O0: orr x9, x8, x9
3324 ; -O0: orr x8, x8, x10
3325 ; -O0: bl __atomic_compare_exchange
3327 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3328 ; -O1: ldp x0, x1, [x0]
3329 ; -O1: orr x8, x1, x19
3330 ; -O1: orr x9, x0, x21
3331 ; -O1: bl __atomic_compare_exchange
3332 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3336 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3337 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3338 ; -O0: orr x9, x8, x9
3339 ; -O0: orr x8, x8, x10
3340 ; -O0: bl __atomic_compare_exchange
3342 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3343 ; -O1: ldp x0, x1, [x0]
3344 ; -O1: orr x8, x1, x19
3345 ; -O1: orr x9, x0, x21
3346 ; -O1: bl __atomic_compare_exchange
3347 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3351 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3352 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3353 ; -O0: orr x9, x8, x9
3354 ; -O0: orr x8, x8, x10
3355 ; -O0: bl __atomic_compare_exchange
3357 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3358 ; -O1: ldp x0, x1, [x0]
3359 ; -O1: orr x8, x1, x19
3360 ; -O1: orr x9, x0, x21
3361 ; -O1: bl __atomic_compare_exchange
3362 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3366 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3367 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3368 ; -O0: orr x9, x8, x9
3369 ; -O0: orr x8, x8, x10
3370 ; -O0: bl __atomic_compare_exchange
3372 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3373 ; -O1: ldp x0, x1, [x0]
3374 ; -O1: orr x8, x1, x19
3375 ; -O1: orr x9, x0, x21
3376 ; -O1: bl __atomic_compare_exchange
3377 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3381 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3382 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3383 ; CHECK: ldeorb w1, w0, [x0]
3384 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3388 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3389 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3390 ; CHECK: ldeorab w1, w0, [x0]
3391 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3395 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3396 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3397 ; CHECK: ldeorlb w1, w0, [x0]
3398 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3402 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3403 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3404 ; CHECK: ldeoralb w1, w0, [x0]
3405 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3409 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3410 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3411 ; CHECK: ldeoralb w1, w0, [x0]
3412 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3416 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3417 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3418 ; CHECK: ldeorh w1, w0, [x0]
3419 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3423 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3424 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3425 ; CHECK: ldeorah w1, w0, [x0]
3426 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3430 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3431 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3432 ; CHECK: ldeorlh w1, w0, [x0]
3433 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3437 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3438 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3439 ; CHECK: ldeoralh w1, w0, [x0]
3440 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3444 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3445 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3446 ; CHECK: ldeoralh w1, w0, [x0]
3447 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3451 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3452 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3453 ; CHECK: ldeor w1, w0, [x0]
3454 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3458 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3459 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3460 ; CHECK: ldeora w1, w0, [x0]
3461 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3465 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3466 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3467 ; CHECK: ldeorl w1, w0, [x0]
3468 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3472 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3473 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3474 ; CHECK: ldeoral w1, w0, [x0]
3475 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3479 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3480 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3481 ; CHECK: ldeoral w1, w0, [x0]
3482 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3486 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3487 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3488 ; CHECK: ldeor x1, x0, [x0]
3489 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3493 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3494 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3495 ; CHECK: ldeora x1, x0, [x0]
3496 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3500 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3501 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3502 ; CHECK: ldeorl x1, x0, [x0]
3503 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3507 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3508 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3509 ; CHECK: ldeoral x1, x0, [x0]
3510 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3514 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3515 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3516 ; CHECK: ldeoral x1, x0, [x0]
3517 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3521 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3522 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3523 ; -O0: eor x2, x9, x11
3524 ; -O0: eor x9, x9, x10
3525 ; -O0: casp x0, x1, x2, x3, [x8]
3526 ; -O0: eor x8, x10, x8
3527 ; -O0: eor x11, x9, x11
3528 ; -O0: orr x8, x8, x11
3529 ; -O0: subs x8, x8, #0
3531 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3532 ; -O1: ldp x4, x5, [x0]
3533 ; -O1: eor x8, x4, x2
3534 ; -O1: eor x9, x7, x3
3535 ; -O1: casp x4, x5, x8, x9, [x0]
3537 ; -O1: ccmp x4, x6, #0, eq
3538 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3542 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3543 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3544 ; -O0: eor x2, x9, x11
3545 ; -O0: eor x9, x9, x10
3546 ; -O0: caspa x0, x1, x2, x3, [x8]
3547 ; -O0: eor x8, x10, x8
3548 ; -O0: eor x11, x9, x11
3549 ; -O0: orr x8, x8, x11
3550 ; -O0: subs x8, x8, #0
3552 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3553 ; -O1: ldp x4, x5, [x0]
3554 ; -O1: eor x8, x4, x2
3555 ; -O1: eor x9, x7, x3
3556 ; -O1: caspa x4, x5, x8, x9, [x0]
3558 ; -O1: ccmp x4, x6, #0, eq
3559 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3563 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3564 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3565 ; -O0: eor x2, x9, x11
3566 ; -O0: eor x9, x9, x10
3567 ; -O0: caspl x0, x1, x2, x3, [x8]
3568 ; -O0: eor x8, x10, x8
3569 ; -O0: eor x11, x9, x11
3570 ; -O0: orr x8, x8, x11
3571 ; -O0: subs x8, x8, #0
3573 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3574 ; -O1: ldp x4, x5, [x0]
3575 ; -O1: eor x8, x4, x2
3576 ; -O1: eor x9, x7, x3
3577 ; -O1: caspl x4, x5, x8, x9, [x0]
3579 ; -O1: ccmp x4, x6, #0, eq
3580 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3584 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3585 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3586 ; -O0: eor x2, x9, x11
3587 ; -O0: eor x9, x9, x10
3588 ; -O0: caspal x0, x1, x2, x3, [x8]
3589 ; -O0: eor x8, x10, x8
3590 ; -O0: eor x11, x9, x11
3591 ; -O0: orr x8, x8, x11
3592 ; -O0: subs x8, x8, #0
3594 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3595 ; -O1: ldp x4, x5, [x0]
3596 ; -O1: eor x8, x4, x2
3597 ; -O1: eor x9, x7, x3
3598 ; -O1: caspal x4, x5, x8, x9, [x0]
3600 ; -O1: ccmp x4, x6, #0, eq
3601 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3605 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3606 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3607 ; -O0: eor x2, x9, x11
3608 ; -O0: eor x9, x9, x10
3609 ; -O0: caspal x0, x1, x2, x3, [x8]
3610 ; -O0: eor x8, x10, x8
3611 ; -O0: eor x11, x9, x11
3612 ; -O0: orr x8, x8, x11
3613 ; -O0: subs x8, x8, #0
3615 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3616 ; -O1: ldp x4, x5, [x0]
3617 ; -O1: eor x8, x4, x2
3618 ; -O1: eor x9, x7, x3
3619 ; -O1: caspal x4, x5, x8, x9, [x0]
3621 ; -O1: ccmp x4, x6, #0, eq
3622 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3626 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3627 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3628 ; CHECK: ldeorb w1, w0, [x0]
3629 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3633 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3634 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3635 ; CHECK: ldeorab w1, w0, [x0]
3636 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3640 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3641 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3642 ; CHECK: ldeorlb w1, w0, [x0]
3643 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3647 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3648 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3649 ; CHECK: ldeoralb w1, w0, [x0]
3650 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3654 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3655 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3656 ; CHECK: ldeoralb w1, w0, [x0]
3657 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3661 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3662 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3663 ; -O0: eor w8, w9, w8
3664 ; -O0: bl __atomic_compare_exchange
3666 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3667 ; -O1: eor w8, w0, w20
3668 ; -O1: bl __atomic_compare_exchange
3669 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3673 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3674 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3675 ; -O0: eor w8, w9, w8
3676 ; -O0: bl __atomic_compare_exchange
3678 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3679 ; -O1: eor w8, w0, w20
3680 ; -O1: bl __atomic_compare_exchange
3681 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3685 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3686 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3687 ; -O0: eor w8, w9, w8
3688 ; -O0: bl __atomic_compare_exchange
3690 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3691 ; -O1: eor w8, w0, w20
3692 ; -O1: bl __atomic_compare_exchange
3693 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3697 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3698 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3699 ; -O0: eor w8, w9, w8
3700 ; -O0: bl __atomic_compare_exchange
3702 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3703 ; -O1: eor w8, w0, w20
3704 ; -O1: bl __atomic_compare_exchange
3705 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3709 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3710 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3711 ; -O0: eor w8, w9, w8
3712 ; -O0: bl __atomic_compare_exchange
3714 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3715 ; -O1: eor w8, w0, w20
3716 ; -O1: bl __atomic_compare_exchange
3717 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3721 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3722 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3723 ; -O0: eor w8, w9, w8
3724 ; -O0: bl __atomic_compare_exchange
3726 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3727 ; -O1: eor w8, w0, w20
3728 ; -O1: bl __atomic_compare_exchange
3729 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3733 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3734 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3735 ; -O0: eor w8, w9, w8
3736 ; -O0: bl __atomic_compare_exchange
3738 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3739 ; -O1: eor w8, w0, w20
3740 ; -O1: bl __atomic_compare_exchange
3741 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3745 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3746 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3747 ; -O0: eor w8, w9, w8
3748 ; -O0: bl __atomic_compare_exchange
3750 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3751 ; -O1: eor w8, w0, w20
3752 ; -O1: bl __atomic_compare_exchange
3753 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3757 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3758 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3759 ; -O0: eor w8, w9, w8
3760 ; -O0: bl __atomic_compare_exchange
3762 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3763 ; -O1: eor w8, w0, w20
3764 ; -O1: bl __atomic_compare_exchange
3765 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3769 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3770 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3771 ; -O0: eor w8, w9, w8
3772 ; -O0: bl __atomic_compare_exchange
3774 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3775 ; -O1: eor w8, w0, w20
3776 ; -O1: bl __atomic_compare_exchange
3777 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3781 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3782 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3783 ; -O0: eor x8, x9, x8
3784 ; -O0: bl __atomic_compare_exchange
3786 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3787 ; -O1: eor x8, x0, x20
3788 ; -O1: bl __atomic_compare_exchange
3789 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3793 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3794 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3795 ; -O0: eor x8, x9, x8
3796 ; -O0: bl __atomic_compare_exchange
3798 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3799 ; -O1: eor x8, x0, x20
3800 ; -O1: bl __atomic_compare_exchange
3801 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3805 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3806 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3807 ; -O0: eor x8, x9, x8
3808 ; -O0: bl __atomic_compare_exchange
3810 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3811 ; -O1: eor x8, x0, x20
3812 ; -O1: bl __atomic_compare_exchange
3813 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3817 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3818 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3819 ; -O0: eor x8, x9, x8
3820 ; -O0: bl __atomic_compare_exchange
3822 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3823 ; -O1: eor x8, x0, x20
3824 ; -O1: bl __atomic_compare_exchange
3825 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3829 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3830 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3831 ; -O0: eor x8, x9, x8
3832 ; -O0: bl __atomic_compare_exchange
3834 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3835 ; -O1: eor x8, x0, x20
3836 ; -O1: bl __atomic_compare_exchange
3837 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3841 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3842 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3843 ; -O0: eor x9, x8, x9
3844 ; -O0: eor x8, x8, x10
3845 ; -O0: bl __atomic_compare_exchange
3847 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3848 ; -O1: ldp x0, x1, [x0]
3849 ; -O1: eor x8, x1, x19
3850 ; -O1: eor x9, x0, x21
3851 ; -O1: bl __atomic_compare_exchange
3852 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
3856 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3857 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3858 ; -O0: eor x9, x8, x9
3859 ; -O0: eor x8, x8, x10
3860 ; -O0: bl __atomic_compare_exchange
3862 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3863 ; -O1: ldp x0, x1, [x0]
3864 ; -O1: eor x8, x1, x19
3865 ; -O1: eor x9, x0, x21
3866 ; -O1: bl __atomic_compare_exchange
3867 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
3871 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
3872 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
3873 ; -O0: eor x9, x8, x9
3874 ; -O0: eor x8, x8, x10
3875 ; -O0: bl __atomic_compare_exchange
3877 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
3878 ; -O1: ldp x0, x1, [x0]
3879 ; -O1: eor x8, x1, x19
3880 ; -O1: eor x9, x0, x21
3881 ; -O1: bl __atomic_compare_exchange
3882 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
3886 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3887 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3888 ; -O0: eor x9, x8, x9
3889 ; -O0: eor x8, x8, x10
3890 ; -O0: bl __atomic_compare_exchange
3892 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3893 ; -O1: ldp x0, x1, [x0]
3894 ; -O1: eor x8, x1, x19
3895 ; -O1: eor x9, x0, x21
3896 ; -O1: bl __atomic_compare_exchange
3897 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
3901 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3902 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3903 ; -O0: eor x9, x8, x9
3904 ; -O0: eor x8, x8, x10
3905 ; -O0: bl __atomic_compare_exchange
3907 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3908 ; -O1: ldp x0, x1, [x0]
3909 ; -O1: eor x8, x1, x19
3910 ; -O1: eor x9, x0, x21
3911 ; -O1: bl __atomic_compare_exchange
3912 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
3916 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3917 ; CHECK-LABEL: atomicrmw_max_i8_aligned_monotonic:
3918 ; CHECK: ldsmaxb w1, w0, [x0]
3919 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
3923 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
3924 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acquire:
3925 ; CHECK: ldsmaxab w1, w0, [x0]
3926 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
3930 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
3931 ; CHECK-LABEL: atomicrmw_max_i8_aligned_release:
3932 ; CHECK: ldsmaxlb w1, w0, [x0]
3933 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
3937 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3938 ; CHECK-LABEL: atomicrmw_max_i8_aligned_acq_rel:
3939 ; CHECK: ldsmaxalb w1, w0, [x0]
3940 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
3944 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3945 ; CHECK-LABEL: atomicrmw_max_i8_aligned_seq_cst:
3946 ; CHECK: ldsmaxalb w1, w0, [x0]
3947 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
3951 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3952 ; CHECK-LABEL: atomicrmw_max_i16_aligned_monotonic:
3953 ; CHECK: ldsmaxh w1, w0, [x0]
3954 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
3958 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
3959 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acquire:
3960 ; CHECK: ldsmaxah w1, w0, [x0]
3961 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
3965 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
3966 ; CHECK-LABEL: atomicrmw_max_i16_aligned_release:
3967 ; CHECK: ldsmaxlh w1, w0, [x0]
3968 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
3972 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3973 ; CHECK-LABEL: atomicrmw_max_i16_aligned_acq_rel:
3974 ; CHECK: ldsmaxalh w1, w0, [x0]
3975 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
3979 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3980 ; CHECK-LABEL: atomicrmw_max_i16_aligned_seq_cst:
3981 ; CHECK: ldsmaxalh w1, w0, [x0]
3982 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
3986 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3987 ; CHECK-LABEL: atomicrmw_max_i32_aligned_monotonic:
3988 ; CHECK: ldsmax w1, w0, [x0]
3989 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
3993 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
3994 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acquire:
3995 ; CHECK: ldsmaxa w1, w0, [x0]
3996 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
4000 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
4001 ; CHECK-LABEL: atomicrmw_max_i32_aligned_release:
4002 ; CHECK: ldsmaxl w1, w0, [x0]
4003 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
4007 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4008 ; CHECK-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4009 ; CHECK: ldsmaxal w1, w0, [x0]
4010 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
4014 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4015 ; CHECK-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4016 ; CHECK: ldsmaxal w1, w0, [x0]
4017 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
4021 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4022 ; CHECK-LABEL: atomicrmw_max_i64_aligned_monotonic:
4023 ; CHECK: ldsmax x1, x0, [x0]
4024 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
4028 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
4029 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acquire:
4030 ; CHECK: ldsmaxa x1, x0, [x0]
4031 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
4035 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
4036 ; CHECK-LABEL: atomicrmw_max_i64_aligned_release:
4037 ; CHECK: ldsmaxl x1, x0, [x0]
4038 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
4042 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4043 ; CHECK-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4044 ; CHECK: ldsmaxal x1, x0, [x0]
4045 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
4049 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4050 ; CHECK-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4051 ; CHECK: ldsmaxal x1, x0, [x0]
4052 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
4056 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4057 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
4058 ; -O0: subs x9, x9, x12
4059 ; -O0: subs x11, x11, x10
4060 ; -O0: subs x13, x13, x10
4061 ; -O0: csel w11, w9, w11, eq
4062 ; -O0: ands w13, w11, #0x1
4063 ; -O0: csel x2, x9, x12, ne
4064 ; -O0: ands w11, w11, #0x1
4065 ; -O0: csel x9, x9, x10, ne
4066 ; -O0: casp x0, x1, x2, x3, [x8]
4067 ; -O0: eor x8, x10, x8
4068 ; -O0: eor x11, x9, x11
4069 ; -O0: orr x8, x8, x11
4070 ; -O0: subs x8, x8, #0
4072 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
4073 ; -O1: ldp x4, x5, [x0]
4075 ; -O1: csel x9, x7, x3, lt
4076 ; -O1: csel x8, x4, x2, lt
4077 ; -O1: casp x4, x5, x8, x9, [x0]
4079 ; -O1: ccmp x4, x6, #0, eq
4080 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
4084 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
4085 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
4086 ; -O0: subs x9, x9, x12
4087 ; -O0: subs x11, x11, x10
4088 ; -O0: subs x13, x13, x10
4089 ; -O0: csel w11, w9, w11, eq
4090 ; -O0: ands w13, w11, #0x1
4091 ; -O0: csel x2, x9, x12, ne
4092 ; -O0: ands w11, w11, #0x1
4093 ; -O0: csel x9, x9, x10, ne
4094 ; -O0: caspa x0, x1, x2, x3, [x8]
4095 ; -O0: eor x8, x10, x8
4096 ; -O0: eor x11, x9, x11
4097 ; -O0: orr x8, x8, x11
4098 ; -O0: subs x8, x8, #0
4100 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
4101 ; -O1: ldp x4, x5, [x0]
4103 ; -O1: csel x9, x7, x3, lt
4104 ; -O1: csel x8, x4, x2, lt
4105 ; -O1: caspa x4, x5, x8, x9, [x0]
4107 ; -O1: ccmp x4, x6, #0, eq
4108 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4112 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4113 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4114 ; -O0: subs x9, x9, x12
4115 ; -O0: subs x11, x11, x10
4116 ; -O0: subs x13, x13, x10
4117 ; -O0: csel w11, w9, w11, eq
4118 ; -O0: ands w13, w11, #0x1
4119 ; -O0: csel x2, x9, x12, ne
4120 ; -O0: ands w11, w11, #0x1
4121 ; -O0: csel x9, x9, x10, ne
4122 ; -O0: caspl 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_release:
4129 ; -O1: ldp x4, x5, [x0]
4131 ; -O1: csel x9, x7, x3, lt
4132 ; -O1: csel x8, x4, x2, lt
4133 ; -O1: caspl x4, x5, x8, x9, [x0]
4135 ; -O1: ccmp x4, x6, #0, eq
4136 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4140 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4141 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4142 ; -O0: subs x9, x9, x12
4143 ; -O0: subs x11, x11, x10
4144 ; -O0: subs x13, x13, x10
4145 ; -O0: csel w11, w9, w11, eq
4146 ; -O0: ands w13, w11, #0x1
4147 ; -O0: csel x2, x9, x12, ne
4148 ; -O0: ands w11, w11, #0x1
4149 ; -O0: csel x9, x9, x10, ne
4150 ; -O0: caspal x0, x1, x2, x3, [x8]
4151 ; -O0: eor x8, x10, x8
4152 ; -O0: eor x11, x9, x11
4153 ; -O0: orr x8, x8, x11
4154 ; -O0: subs x8, x8, #0
4156 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4157 ; -O1: ldp x4, x5, [x0]
4159 ; -O1: csel x9, x7, x3, lt
4160 ; -O1: csel x8, x4, x2, lt
4161 ; -O1: caspal x4, x5, x8, x9, [x0]
4163 ; -O1: ccmp x4, x6, #0, eq
4164 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4168 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4169 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4170 ; -O0: subs x9, x9, x12
4171 ; -O0: subs x11, x11, x10
4172 ; -O0: subs x13, x13, x10
4173 ; -O0: csel w11, w9, w11, eq
4174 ; -O0: ands w13, w11, #0x1
4175 ; -O0: csel x2, x9, x12, ne
4176 ; -O0: ands w11, w11, #0x1
4177 ; -O0: csel x9, x9, x10, ne
4178 ; -O0: caspal x0, x1, x2, x3, [x8]
4179 ; -O0: eor x8, x10, x8
4180 ; -O0: eor x11, x9, x11
4181 ; -O0: orr x8, x8, x11
4182 ; -O0: subs x8, x8, #0
4184 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4185 ; -O1: ldp x4, x5, [x0]
4187 ; -O1: csel x9, x7, x3, lt
4188 ; -O1: csel x8, x4, x2, lt
4189 ; -O1: caspal x4, x5, x8, x9, [x0]
4191 ; -O1: ccmp x4, x6, #0, eq
4192 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4196 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4197 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4198 ; CHECK: ldsmaxb w1, w0, [x0]
4199 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4203 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4204 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acquire:
4205 ; CHECK: ldsmaxab w1, w0, [x0]
4206 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4210 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4211 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_release:
4212 ; CHECK: ldsmaxlb w1, w0, [x0]
4213 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4217 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4218 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4219 ; CHECK: ldsmaxalb w1, w0, [x0]
4220 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4224 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4225 ; CHECK-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4226 ; CHECK: ldsmaxalb w1, w0, [x0]
4227 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4231 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4232 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4234 ; -O0: subs w10, w10, w8, sxth
4235 ; -O0: csel w8, w9, w8, gt
4236 ; -O0: bl __atomic_compare_exchange
4238 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4240 ; -O1: cmp w8, w20, sxth
4241 ; -O1: csel w8, w0, w20, gt
4242 ; -O1: bl __atomic_compare_exchange
4243 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4247 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4248 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4250 ; -O0: subs w10, w10, w8, sxth
4251 ; -O0: csel w8, w9, w8, gt
4252 ; -O0: bl __atomic_compare_exchange
4254 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4256 ; -O1: cmp w8, w20, sxth
4257 ; -O1: csel w8, w0, w20, gt
4258 ; -O1: bl __atomic_compare_exchange
4259 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4263 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4264 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4266 ; -O0: subs w10, w10, w8, sxth
4267 ; -O0: csel w8, w9, w8, gt
4268 ; -O0: bl __atomic_compare_exchange
4270 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4272 ; -O1: cmp w8, w20, sxth
4273 ; -O1: csel w8, w0, w20, gt
4274 ; -O1: bl __atomic_compare_exchange
4275 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4279 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4280 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4282 ; -O0: subs w10, w10, w8, sxth
4283 ; -O0: csel w8, w9, w8, gt
4284 ; -O0: bl __atomic_compare_exchange
4286 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4288 ; -O1: cmp w8, w20, sxth
4289 ; -O1: csel w8, w0, w20, gt
4290 ; -O1: bl __atomic_compare_exchange
4291 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
4295 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4296 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4298 ; -O0: subs w10, w10, w8, sxth
4299 ; -O0: csel w8, w9, w8, gt
4300 ; -O0: bl __atomic_compare_exchange
4302 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4304 ; -O1: cmp w8, w20, sxth
4305 ; -O1: csel w8, w0, w20, gt
4306 ; -O1: bl __atomic_compare_exchange
4307 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4311 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4312 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4313 ; -O0: subs w10, w9, w8
4314 ; -O0: csel w8, w9, w8, gt
4315 ; -O0: bl __atomic_compare_exchange
4317 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4319 ; -O1: csel w8, w0, w20, gt
4320 ; -O1: bl __atomic_compare_exchange
4321 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4325 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4326 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4327 ; -O0: subs w10, w9, w8
4328 ; -O0: csel w8, w9, w8, gt
4329 ; -O0: bl __atomic_compare_exchange
4331 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4333 ; -O1: csel w8, w0, w20, gt
4334 ; -O1: bl __atomic_compare_exchange
4335 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4339 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4340 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4341 ; -O0: subs w10, w9, w8
4342 ; -O0: csel w8, w9, w8, gt
4343 ; -O0: bl __atomic_compare_exchange
4345 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4347 ; -O1: csel w8, w0, w20, gt
4348 ; -O1: bl __atomic_compare_exchange
4349 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4353 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4354 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4355 ; -O0: subs w10, w9, w8
4356 ; -O0: csel w8, w9, w8, gt
4357 ; -O0: bl __atomic_compare_exchange
4359 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4361 ; -O1: csel w8, w0, w20, gt
4362 ; -O1: bl __atomic_compare_exchange
4363 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4367 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4368 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4369 ; -O0: subs w10, w9, w8
4370 ; -O0: csel w8, w9, w8, gt
4371 ; -O0: bl __atomic_compare_exchange
4373 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4375 ; -O1: csel w8, w0, w20, gt
4376 ; -O1: bl __atomic_compare_exchange
4377 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4381 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4382 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4383 ; -O0: subs x10, x9, x8
4384 ; -O0: csel x8, x9, x8, gt
4385 ; -O0: bl __atomic_compare_exchange
4387 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4389 ; -O1: csel x8, x0, x20, gt
4390 ; -O1: bl __atomic_compare_exchange
4391 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4395 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4396 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4397 ; -O0: subs x10, x9, x8
4398 ; -O0: csel x8, x9, x8, gt
4399 ; -O0: bl __atomic_compare_exchange
4401 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4403 ; -O1: csel x8, x0, x20, gt
4404 ; -O1: bl __atomic_compare_exchange
4405 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4409 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4410 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4411 ; -O0: subs x10, x9, x8
4412 ; -O0: csel x8, x9, x8, gt
4413 ; -O0: bl __atomic_compare_exchange
4415 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4417 ; -O1: csel x8, x0, x20, gt
4418 ; -O1: bl __atomic_compare_exchange
4419 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4423 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4424 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4425 ; -O0: subs x10, x9, x8
4426 ; -O0: csel x8, x9, x8, gt
4427 ; -O0: bl __atomic_compare_exchange
4429 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4431 ; -O1: csel x8, x0, x20, gt
4432 ; -O1: bl __atomic_compare_exchange
4433 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4437 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4438 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4439 ; -O0: subs x10, x9, x8
4440 ; -O0: csel x8, x9, x8, gt
4441 ; -O0: bl __atomic_compare_exchange
4443 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4445 ; -O1: csel x8, x0, x20, gt
4446 ; -O1: bl __atomic_compare_exchange
4447 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4451 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4452 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4453 ; -O0: subs x8, x8, x9
4454 ; -O0: subs x11, x11, x10
4455 ; -O0: subs x12, x12, x10
4456 ; -O0: csel w11, w8, w11, eq
4457 ; -O0: ands w12, w11, #0x1
4458 ; -O0: csel x9, x8, x9, ne
4459 ; -O0: ands w11, w11, #0x1
4460 ; -O0: csel x8, x8, x10, ne
4461 ; -O0: bl __atomic_compare_exchange
4463 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4464 ; -O1: ldp x0, x1, [x0]
4466 ; -O1: csel x8, x1, x19, lt
4467 ; -O1: csel x9, x0, x21, lt
4468 ; -O1: bl __atomic_compare_exchange
4469 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4473 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4474 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4475 ; -O0: subs x8, x8, x9
4476 ; -O0: subs x11, x11, x10
4477 ; -O0: subs x12, x12, x10
4478 ; -O0: csel w11, w8, w11, eq
4479 ; -O0: ands w12, w11, #0x1
4480 ; -O0: csel x9, x8, x9, ne
4481 ; -O0: ands w11, w11, #0x1
4482 ; -O0: csel x8, x8, x10, ne
4483 ; -O0: bl __atomic_compare_exchange
4485 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4486 ; -O1: ldp x0, x1, [x0]
4488 ; -O1: csel x8, x1, x19, lt
4489 ; -O1: csel x9, x0, x21, lt
4490 ; -O1: bl __atomic_compare_exchange
4491 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4495 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4496 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4497 ; -O0: subs x8, x8, x9
4498 ; -O0: subs x11, x11, x10
4499 ; -O0: subs x12, x12, x10
4500 ; -O0: csel w11, w8, w11, eq
4501 ; -O0: ands w12, w11, #0x1
4502 ; -O0: csel x9, x8, x9, ne
4503 ; -O0: ands w11, w11, #0x1
4504 ; -O0: csel x8, x8, x10, ne
4505 ; -O0: bl __atomic_compare_exchange
4507 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4508 ; -O1: ldp x0, x1, [x0]
4510 ; -O1: csel x8, x1, x19, lt
4511 ; -O1: csel x9, x0, x21, lt
4512 ; -O1: bl __atomic_compare_exchange
4513 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4517 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4518 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4519 ; -O0: subs x8, x8, x9
4520 ; -O0: subs x11, x11, x10
4521 ; -O0: subs x12, x12, x10
4522 ; -O0: csel w11, w8, w11, eq
4523 ; -O0: ands w12, w11, #0x1
4524 ; -O0: csel x9, x8, x9, ne
4525 ; -O0: ands w11, w11, #0x1
4526 ; -O0: csel x8, x8, x10, ne
4527 ; -O0: bl __atomic_compare_exchange
4529 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4530 ; -O1: ldp x0, x1, [x0]
4532 ; -O1: csel x8, x1, x19, lt
4533 ; -O1: csel x9, x0, x21, lt
4534 ; -O1: bl __atomic_compare_exchange
4535 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4539 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4540 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4541 ; -O0: subs x8, x8, x9
4542 ; -O0: subs x11, x11, x10
4543 ; -O0: subs x12, x12, x10
4544 ; -O0: csel w11, w8, w11, eq
4545 ; -O0: ands w12, w11, #0x1
4546 ; -O0: csel x9, x8, x9, ne
4547 ; -O0: ands w11, w11, #0x1
4548 ; -O0: csel x8, x8, x10, ne
4549 ; -O0: bl __atomic_compare_exchange
4551 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4552 ; -O1: ldp x0, x1, [x0]
4554 ; -O1: csel x8, x1, x19, lt
4555 ; -O1: csel x9, x0, x21, lt
4556 ; -O1: bl __atomic_compare_exchange
4557 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4561 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4562 ; CHECK-LABEL: atomicrmw_min_i8_aligned_monotonic:
4563 ; CHECK: ldsminb w1, w0, [x0]
4564 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4568 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4569 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acquire:
4570 ; CHECK: ldsminab w1, w0, [x0]
4571 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4575 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4576 ; CHECK-LABEL: atomicrmw_min_i8_aligned_release:
4577 ; CHECK: ldsminlb w1, w0, [x0]
4578 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4582 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4583 ; CHECK-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4584 ; CHECK: ldsminalb w1, w0, [x0]
4585 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4589 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4590 ; CHECK-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4591 ; CHECK: ldsminalb w1, w0, [x0]
4592 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4596 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4597 ; CHECK-LABEL: atomicrmw_min_i16_aligned_monotonic:
4598 ; CHECK: ldsminh w1, w0, [x0]
4599 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
4603 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
4604 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acquire:
4605 ; CHECK: ldsminah w1, w0, [x0]
4606 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
4610 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
4611 ; CHECK-LABEL: atomicrmw_min_i16_aligned_release:
4612 ; CHECK: ldsminlh w1, w0, [x0]
4613 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
4617 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4618 ; CHECK-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4619 ; CHECK: ldsminalh w1, w0, [x0]
4620 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
4624 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4625 ; CHECK-LABEL: atomicrmw_min_i16_aligned_seq_cst:
4626 ; CHECK: ldsminalh w1, w0, [x0]
4627 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
4631 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4632 ; CHECK-LABEL: atomicrmw_min_i32_aligned_monotonic:
4633 ; CHECK: ldsmin w1, w0, [x0]
4634 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
4638 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
4639 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acquire:
4640 ; CHECK: ldsmina w1, w0, [x0]
4641 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
4645 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
4646 ; CHECK-LABEL: atomicrmw_min_i32_aligned_release:
4647 ; CHECK: ldsminl w1, w0, [x0]
4648 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
4652 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4653 ; CHECK-LABEL: atomicrmw_min_i32_aligned_acq_rel:
4654 ; CHECK: ldsminal w1, w0, [x0]
4655 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
4659 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4660 ; CHECK-LABEL: atomicrmw_min_i32_aligned_seq_cst:
4661 ; CHECK: ldsminal w1, w0, [x0]
4662 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
4666 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4667 ; CHECK-LABEL: atomicrmw_min_i64_aligned_monotonic:
4668 ; CHECK: ldsmin x1, x0, [x0]
4669 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
4673 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
4674 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acquire:
4675 ; CHECK: ldsmina x1, x0, [x0]
4676 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
4680 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
4681 ; CHECK-LABEL: atomicrmw_min_i64_aligned_release:
4682 ; CHECK: ldsminl x1, x0, [x0]
4683 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
4687 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4688 ; CHECK-LABEL: atomicrmw_min_i64_aligned_acq_rel:
4689 ; CHECK: ldsminal x1, x0, [x0]
4690 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
4694 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4695 ; CHECK-LABEL: atomicrmw_min_i64_aligned_seq_cst:
4696 ; CHECK: ldsminal x1, x0, [x0]
4697 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
4701 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4702 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
4703 ; -O0: subs x9, x9, x12
4704 ; -O0: subs x11, x11, x10
4705 ; -O0: subs x13, x13, x10
4706 ; -O0: csel w11, w9, w11, eq
4707 ; -O0: ands w13, w11, #0x1
4708 ; -O0: csel x2, x9, x12, ne
4709 ; -O0: ands w11, w11, #0x1
4710 ; -O0: csel x9, x9, x10, ne
4711 ; -O0: casp x0, x1, x2, x3, [x8]
4712 ; -O0: eor x8, x10, x8
4713 ; -O0: eor x11, x9, x11
4714 ; -O0: orr x8, x8, x11
4715 ; -O0: subs x8, x8, #0
4717 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
4718 ; -O1: ldp x4, x5, [x0]
4720 ; -O1: csel x9, x7, x3, ge
4721 ; -O1: csel x8, x4, x2, ge
4722 ; -O1: casp x4, x5, x8, x9, [x0]
4724 ; -O1: ccmp x4, x6, #0, eq
4725 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
4729 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
4730 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
4731 ; -O0: subs x9, x9, x12
4732 ; -O0: subs x11, x11, x10
4733 ; -O0: subs x13, x13, x10
4734 ; -O0: csel w11, w9, w11, eq
4735 ; -O0: ands w13, w11, #0x1
4736 ; -O0: csel x2, x9, x12, ne
4737 ; -O0: ands w11, w11, #0x1
4738 ; -O0: csel x9, x9, x10, ne
4739 ; -O0: caspa x0, x1, x2, x3, [x8]
4740 ; -O0: eor x8, x10, x8
4741 ; -O0: eor x11, x9, x11
4742 ; -O0: orr x8, x8, x11
4743 ; -O0: subs x8, x8, #0
4745 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
4746 ; -O1: ldp x4, x5, [x0]
4748 ; -O1: csel x9, x7, x3, ge
4749 ; -O1: csel x8, x4, x2, ge
4750 ; -O1: caspa x4, x5, x8, x9, [x0]
4752 ; -O1: ccmp x4, x6, #0, eq
4753 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
4757 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
4758 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
4759 ; -O0: subs x9, x9, x12
4760 ; -O0: subs x11, x11, x10
4761 ; -O0: subs x13, x13, x10
4762 ; -O0: csel w11, w9, w11, eq
4763 ; -O0: ands w13, w11, #0x1
4764 ; -O0: csel x2, x9, x12, ne
4765 ; -O0: ands w11, w11, #0x1
4766 ; -O0: csel x9, x9, x10, ne
4767 ; -O0: caspl x0, x1, x2, x3, [x8]
4768 ; -O0: eor x8, x10, x8
4769 ; -O0: eor x11, x9, x11
4770 ; -O0: orr x8, x8, x11
4771 ; -O0: subs x8, x8, #0
4773 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
4774 ; -O1: ldp x4, x5, [x0]
4776 ; -O1: csel x9, x7, x3, ge
4777 ; -O1: csel x8, x4, x2, ge
4778 ; -O1: caspl x4, x5, x8, x9, [x0]
4780 ; -O1: ccmp x4, x6, #0, eq
4781 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
4785 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4786 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4787 ; -O0: subs x9, x9, x12
4788 ; -O0: subs x11, x11, x10
4789 ; -O0: subs x13, x13, x10
4790 ; -O0: csel w11, w9, w11, eq
4791 ; -O0: ands w13, w11, #0x1
4792 ; -O0: csel x2, x9, x12, ne
4793 ; -O0: ands w11, w11, #0x1
4794 ; -O0: csel x9, x9, x10, ne
4795 ; -O0: caspal x0, x1, x2, x3, [x8]
4796 ; -O0: eor x8, x10, x8
4797 ; -O0: eor x11, x9, x11
4798 ; -O0: orr x8, x8, x11
4799 ; -O0: subs x8, x8, #0
4801 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
4802 ; -O1: ldp x4, x5, [x0]
4804 ; -O1: csel x9, x7, x3, ge
4805 ; -O1: csel x8, x4, x2, ge
4806 ; -O1: caspal x4, x5, x8, x9, [x0]
4808 ; -O1: ccmp x4, x6, #0, eq
4809 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
4813 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4814 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4815 ; -O0: subs x9, x9, x12
4816 ; -O0: subs x11, x11, x10
4817 ; -O0: subs x13, x13, x10
4818 ; -O0: csel w11, w9, w11, eq
4819 ; -O0: ands w13, w11, #0x1
4820 ; -O0: csel x2, x9, x12, ne
4821 ; -O0: ands w11, w11, #0x1
4822 ; -O0: csel x9, x9, x10, ne
4823 ; -O0: caspal x0, x1, x2, x3, [x8]
4824 ; -O0: eor x8, x10, x8
4825 ; -O0: eor x11, x9, x11
4826 ; -O0: orr x8, x8, x11
4827 ; -O0: subs x8, x8, #0
4829 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
4830 ; -O1: ldp x4, x5, [x0]
4832 ; -O1: csel x9, x7, x3, ge
4833 ; -O1: csel x8, x4, x2, ge
4834 ; -O1: caspal x4, x5, x8, x9, [x0]
4836 ; -O1: ccmp x4, x6, #0, eq
4837 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
4841 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4842 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_monotonic:
4843 ; CHECK: ldsminb w1, w0, [x0]
4844 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4848 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4849 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acquire:
4850 ; CHECK: ldsminab w1, w0, [x0]
4851 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4855 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
4856 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_release:
4857 ; CHECK: ldsminlb w1, w0, [x0]
4858 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4862 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4863 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
4864 ; CHECK: ldsminalb w1, w0, [x0]
4865 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4869 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4870 ; CHECK-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
4871 ; CHECK: ldsminalb w1, w0, [x0]
4872 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4876 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4877 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4879 ; -O0: subs w10, w10, w8, sxth
4880 ; -O0: csel w8, w9, w8, le
4881 ; -O0: bl __atomic_compare_exchange
4883 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
4885 ; -O1: cmp w8, w20, sxth
4886 ; -O1: csel w8, w0, w20, le
4887 ; -O1: bl __atomic_compare_exchange
4888 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
4892 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4893 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
4895 ; -O0: subs w10, w10, w8, sxth
4896 ; -O0: csel w8, w9, w8, le
4897 ; -O0: bl __atomic_compare_exchange
4899 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
4901 ; -O1: cmp w8, w20, sxth
4902 ; -O1: csel w8, w0, w20, le
4903 ; -O1: bl __atomic_compare_exchange
4904 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
4908 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
4909 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
4911 ; -O0: subs w10, w10, w8, sxth
4912 ; -O0: csel w8, w9, w8, le
4913 ; -O0: bl __atomic_compare_exchange
4915 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
4917 ; -O1: cmp w8, w20, sxth
4918 ; -O1: csel w8, w0, w20, le
4919 ; -O1: bl __atomic_compare_exchange
4920 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
4924 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4925 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4927 ; -O0: subs w10, w10, w8, sxth
4928 ; -O0: csel w8, w9, w8, le
4929 ; -O0: bl __atomic_compare_exchange
4931 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
4933 ; -O1: cmp w8, w20, sxth
4934 ; -O1: csel w8, w0, w20, le
4935 ; -O1: bl __atomic_compare_exchange
4936 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
4940 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4941 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4943 ; -O0: subs w10, w10, w8, sxth
4944 ; -O0: csel w8, w9, w8, le
4945 ; -O0: bl __atomic_compare_exchange
4947 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
4949 ; -O1: cmp w8, w20, sxth
4950 ; -O1: csel w8, w0, w20, le
4951 ; -O1: bl __atomic_compare_exchange
4952 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
4956 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4957 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4958 ; -O0: subs w10, w9, w8
4959 ; -O0: csel w8, w9, w8, le
4960 ; -O0: bl __atomic_compare_exchange
4962 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
4964 ; -O1: csel w8, w0, w20, le
4965 ; -O1: bl __atomic_compare_exchange
4966 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
4970 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4971 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
4972 ; -O0: subs w10, w9, w8
4973 ; -O0: csel w8, w9, w8, le
4974 ; -O0: bl __atomic_compare_exchange
4976 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
4978 ; -O1: csel w8, w0, w20, le
4979 ; -O1: bl __atomic_compare_exchange
4980 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
4984 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
4985 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
4986 ; -O0: subs w10, w9, w8
4987 ; -O0: csel w8, w9, w8, le
4988 ; -O0: bl __atomic_compare_exchange
4990 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
4992 ; -O1: csel w8, w0, w20, le
4993 ; -O1: bl __atomic_compare_exchange
4994 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
4998 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4999 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5000 ; -O0: subs w10, w9, w8
5001 ; -O0: csel w8, w9, w8, le
5002 ; -O0: bl __atomic_compare_exchange
5004 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5006 ; -O1: csel w8, w0, w20, le
5007 ; -O1: bl __atomic_compare_exchange
5008 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
5012 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5013 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5014 ; -O0: subs w10, w9, w8
5015 ; -O0: csel w8, w9, w8, le
5016 ; -O0: bl __atomic_compare_exchange
5018 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5020 ; -O1: csel w8, w0, w20, le
5021 ; -O1: bl __atomic_compare_exchange
5022 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
5026 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5027 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5028 ; -O0: subs x10, x9, x8
5029 ; -O0: csel x8, x9, x8, le
5030 ; -O0: bl __atomic_compare_exchange
5032 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5034 ; -O1: csel x8, x0, x20, le
5035 ; -O1: bl __atomic_compare_exchange
5036 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
5040 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5041 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
5042 ; -O0: subs x10, x9, x8
5043 ; -O0: csel x8, x9, x8, le
5044 ; -O0: bl __atomic_compare_exchange
5046 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
5048 ; -O1: csel x8, x0, x20, le
5049 ; -O1: bl __atomic_compare_exchange
5050 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
5054 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
5055 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
5056 ; -O0: subs x10, x9, x8
5057 ; -O0: csel x8, x9, x8, le
5058 ; -O0: bl __atomic_compare_exchange
5060 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
5062 ; -O1: csel x8, x0, x20, le
5063 ; -O1: bl __atomic_compare_exchange
5064 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
5068 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5069 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5070 ; -O0: subs x10, x9, x8
5071 ; -O0: csel x8, x9, x8, le
5072 ; -O0: bl __atomic_compare_exchange
5074 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5076 ; -O1: csel x8, x0, x20, le
5077 ; -O1: bl __atomic_compare_exchange
5078 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
5082 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5083 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5084 ; -O0: subs x10, x9, x8
5085 ; -O0: csel x8, x9, x8, le
5086 ; -O0: bl __atomic_compare_exchange
5088 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5090 ; -O1: csel x8, x0, x20, le
5091 ; -O1: bl __atomic_compare_exchange
5092 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
5096 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5097 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5098 ; -O0: subs x8, x8, x9
5099 ; -O0: subs x11, x11, x10
5100 ; -O0: subs x12, x12, x10
5101 ; -O0: csel w11, w8, w11, eq
5102 ; -O0: ands w12, w11, #0x1
5103 ; -O0: csel x9, x8, x9, ne
5104 ; -O0: ands w11, w11, #0x1
5105 ; -O0: csel x8, x8, x10, ne
5106 ; -O0: bl __atomic_compare_exchange
5108 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5109 ; -O1: ldp x0, x1, [x0]
5111 ; -O1: csel x8, x1, x19, ge
5112 ; -O1: csel x9, x0, x21, ge
5113 ; -O1: bl __atomic_compare_exchange
5114 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
5118 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5119 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
5120 ; -O0: subs x8, x8, x9
5121 ; -O0: subs x11, x11, x10
5122 ; -O0: subs x12, x12, x10
5123 ; -O0: csel w11, w8, w11, eq
5124 ; -O0: ands w12, w11, #0x1
5125 ; -O0: csel x9, x8, x9, ne
5126 ; -O0: ands w11, w11, #0x1
5127 ; -O0: csel x8, x8, x10, ne
5128 ; -O0: bl __atomic_compare_exchange
5130 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
5131 ; -O1: ldp x0, x1, [x0]
5133 ; -O1: csel x8, x1, x19, ge
5134 ; -O1: csel x9, x0, x21, ge
5135 ; -O1: bl __atomic_compare_exchange
5136 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
5140 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
5141 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
5142 ; -O0: subs x8, x8, x9
5143 ; -O0: subs x11, x11, x10
5144 ; -O0: subs x12, x12, x10
5145 ; -O0: csel w11, w8, w11, eq
5146 ; -O0: ands w12, w11, #0x1
5147 ; -O0: csel x9, x8, x9, ne
5148 ; -O0: ands w11, w11, #0x1
5149 ; -O0: csel x8, x8, x10, ne
5150 ; -O0: bl __atomic_compare_exchange
5152 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
5153 ; -O1: ldp x0, x1, [x0]
5155 ; -O1: csel x8, x1, x19, ge
5156 ; -O1: csel x9, x0, x21, ge
5157 ; -O1: bl __atomic_compare_exchange
5158 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
5162 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5163 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5164 ; -O0: subs x8, x8, x9
5165 ; -O0: subs x11, x11, x10
5166 ; -O0: subs x12, x12, x10
5167 ; -O0: csel w11, w8, w11, eq
5168 ; -O0: ands w12, w11, #0x1
5169 ; -O0: csel x9, x8, x9, ne
5170 ; -O0: ands w11, w11, #0x1
5171 ; -O0: csel x8, x8, x10, ne
5172 ; -O0: bl __atomic_compare_exchange
5174 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5175 ; -O1: ldp x0, x1, [x0]
5177 ; -O1: csel x8, x1, x19, ge
5178 ; -O1: csel x9, x0, x21, ge
5179 ; -O1: bl __atomic_compare_exchange
5180 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5184 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5185 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5186 ; -O0: subs x8, x8, x9
5187 ; -O0: subs x11, x11, x10
5188 ; -O0: subs x12, x12, x10
5189 ; -O0: csel w11, w8, w11, eq
5190 ; -O0: ands w12, w11, #0x1
5191 ; -O0: csel x9, x8, x9, ne
5192 ; -O0: ands w11, w11, #0x1
5193 ; -O0: csel x8, x8, x10, ne
5194 ; -O0: bl __atomic_compare_exchange
5196 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5197 ; -O1: ldp x0, x1, [x0]
5199 ; -O1: csel x8, x1, x19, ge
5200 ; -O1: csel x9, x0, x21, ge
5201 ; -O1: bl __atomic_compare_exchange
5202 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5206 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5207 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5208 ; CHECK: ldumaxb w1, w0, [x0]
5209 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5213 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5214 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acquire:
5215 ; CHECK: ldumaxab w1, w0, [x0]
5216 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5220 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5221 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_release:
5222 ; CHECK: ldumaxlb w1, w0, [x0]
5223 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5227 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5228 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5229 ; CHECK: ldumaxalb w1, w0, [x0]
5230 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5234 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5235 ; CHECK-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5236 ; CHECK: ldumaxalb w1, w0, [x0]
5237 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5241 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5242 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5243 ; CHECK: ldumaxh w1, w0, [x0]
5244 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5248 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5249 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acquire:
5250 ; CHECK: ldumaxah w1, w0, [x0]
5251 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5255 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5256 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_release:
5257 ; CHECK: ldumaxlh w1, w0, [x0]
5258 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5262 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5263 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5264 ; CHECK: ldumaxalh w1, w0, [x0]
5265 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
5269 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5270 ; CHECK-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5271 ; CHECK: ldumaxalh w1, w0, [x0]
5272 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
5276 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5277 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5278 ; CHECK: ldumax w1, w0, [x0]
5279 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
5283 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
5284 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acquire:
5285 ; CHECK: ldumaxa w1, w0, [x0]
5286 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
5290 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
5291 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_release:
5292 ; CHECK: ldumaxl w1, w0, [x0]
5293 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
5297 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5298 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5299 ; CHECK: ldumaxal w1, w0, [x0]
5300 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
5304 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5305 ; CHECK-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5306 ; CHECK: ldumaxal w1, w0, [x0]
5307 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
5311 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5312 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5313 ; CHECK: ldumax x1, x0, [x0]
5314 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
5318 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
5319 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acquire:
5320 ; CHECK: ldumaxa x1, x0, [x0]
5321 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
5325 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
5326 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_release:
5327 ; CHECK: ldumaxl x1, x0, [x0]
5328 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
5332 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5333 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
5334 ; CHECK: ldumaxal x1, x0, [x0]
5335 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
5339 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5340 ; CHECK-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
5341 ; CHECK: ldumaxal x1, x0, [x0]
5342 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
5346 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5347 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5348 ; -O0: subs x9, x9, x12
5349 ; -O0: subs x11, x11, x10
5350 ; -O0: subs x13, x13, x10
5351 ; -O0: csel w11, w9, w11, eq
5352 ; -O0: ands w13, w11, #0x1
5353 ; -O0: csel x2, x9, x12, ne
5354 ; -O0: ands w11, w11, #0x1
5355 ; -O0: csel x9, x9, x10, ne
5356 ; -O0: casp x0, x1, x2, x3, [x8]
5357 ; -O0: eor x8, x10, x8
5358 ; -O0: eor x11, x9, x11
5359 ; -O0: orr x8, x8, x11
5360 ; -O0: subs x8, x8, #0
5362 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
5363 ; -O1: ldp x4, x5, [x0]
5365 ; -O1: csel x9, x7, x3, lo
5366 ; -O1: csel x8, x4, x2, lo
5367 ; -O1: casp x4, x5, x8, x9, [x0]
5369 ; -O1: ccmp x4, x6, #0, eq
5370 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
5374 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
5375 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
5376 ; -O0: subs x9, x9, x12
5377 ; -O0: subs x11, x11, x10
5378 ; -O0: subs x13, x13, x10
5379 ; -O0: csel w11, w9, w11, eq
5380 ; -O0: ands w13, w11, #0x1
5381 ; -O0: csel x2, x9, x12, ne
5382 ; -O0: ands w11, w11, #0x1
5383 ; -O0: csel x9, x9, x10, ne
5384 ; -O0: caspa x0, x1, x2, x3, [x8]
5385 ; -O0: eor x8, x10, x8
5386 ; -O0: eor x11, x9, x11
5387 ; -O0: orr x8, x8, x11
5388 ; -O0: subs x8, x8, #0
5390 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
5391 ; -O1: ldp x4, x5, [x0]
5393 ; -O1: csel x9, x7, x3, lo
5394 ; -O1: csel x8, x4, x2, lo
5395 ; -O1: caspa x4, x5, x8, x9, [x0]
5397 ; -O1: ccmp x4, x6, #0, eq
5398 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
5402 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
5403 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
5404 ; -O0: subs x9, x9, x12
5405 ; -O0: subs x11, x11, x10
5406 ; -O0: subs x13, x13, x10
5407 ; -O0: csel w11, w9, w11, eq
5408 ; -O0: ands w13, w11, #0x1
5409 ; -O0: csel x2, x9, x12, ne
5410 ; -O0: ands w11, w11, #0x1
5411 ; -O0: csel x9, x9, x10, ne
5412 ; -O0: caspl x0, x1, x2, x3, [x8]
5413 ; -O0: eor x8, x10, x8
5414 ; -O0: eor x11, x9, x11
5415 ; -O0: orr x8, x8, x11
5416 ; -O0: subs x8, x8, #0
5418 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
5419 ; -O1: ldp x4, x5, [x0]
5421 ; -O1: csel x9, x7, x3, lo
5422 ; -O1: csel x8, x4, x2, lo
5423 ; -O1: caspl x4, x5, x8, x9, [x0]
5425 ; -O1: ccmp x4, x6, #0, eq
5426 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
5430 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5431 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5432 ; -O0: subs x9, x9, x12
5433 ; -O0: subs x11, x11, x10
5434 ; -O0: subs x13, x13, x10
5435 ; -O0: csel w11, w9, w11, eq
5436 ; -O0: ands w13, w11, #0x1
5437 ; -O0: csel x2, x9, x12, ne
5438 ; -O0: ands w11, w11, #0x1
5439 ; -O0: csel x9, x9, x10, ne
5440 ; -O0: caspal x0, x1, x2, x3, [x8]
5441 ; -O0: eor x8, x10, x8
5442 ; -O0: eor x11, x9, x11
5443 ; -O0: orr x8, x8, x11
5444 ; -O0: subs x8, x8, #0
5446 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
5447 ; -O1: ldp x4, x5, [x0]
5449 ; -O1: csel x9, x7, x3, lo
5450 ; -O1: csel x8, x4, x2, lo
5451 ; -O1: caspal x4, x5, x8, x9, [x0]
5453 ; -O1: ccmp x4, x6, #0, eq
5454 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
5458 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5459 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5460 ; -O0: subs x9, x9, x12
5461 ; -O0: subs x11, x11, x10
5462 ; -O0: subs x13, x13, x10
5463 ; -O0: csel w11, w9, w11, eq
5464 ; -O0: ands w13, w11, #0x1
5465 ; -O0: csel x2, x9, x12, ne
5466 ; -O0: ands w11, w11, #0x1
5467 ; -O0: csel x9, x9, x10, ne
5468 ; -O0: caspal x0, x1, x2, x3, [x8]
5469 ; -O0: eor x8, x10, x8
5470 ; -O0: eor x11, x9, x11
5471 ; -O0: orr x8, x8, x11
5472 ; -O0: subs x8, x8, #0
5474 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
5475 ; -O1: ldp x4, x5, [x0]
5477 ; -O1: csel x9, x7, x3, lo
5478 ; -O1: csel x8, x4, x2, lo
5479 ; -O1: caspal x4, x5, x8, x9, [x0]
5481 ; -O1: ccmp x4, x6, #0, eq
5482 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
5486 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5487 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
5488 ; CHECK: ldumaxb w1, w0, [x0]
5489 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5493 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5494 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acquire:
5495 ; CHECK: ldumaxab w1, w0, [x0]
5496 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5500 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
5501 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_release:
5502 ; CHECK: ldumaxlb w1, w0, [x0]
5503 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5507 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5508 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
5509 ; CHECK: ldumaxalb w1, w0, [x0]
5510 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5514 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5515 ; CHECK-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
5516 ; CHECK: ldumaxalb w1, w0, [x0]
5517 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5521 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5522 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5523 ; -O0: subs w10, w10, w8, uxth
5524 ; -O0: csel w8, w9, w8, hi
5525 ; -O0: bl __atomic_compare_exchange
5527 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
5528 ; -O1: and w8, w0, #0xffff
5529 ; -O1: cmp w8, w20, uxth
5530 ; -O1: csel w8, w0, w20, hi
5531 ; -O1: bl __atomic_compare_exchange
5532 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
5536 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5537 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5538 ; -O0: subs w10, w10, w8, uxth
5539 ; -O0: csel w8, w9, w8, hi
5540 ; -O0: bl __atomic_compare_exchange
5542 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
5543 ; -O1: and w8, w0, #0xffff
5544 ; -O1: cmp w8, w20, uxth
5545 ; -O1: csel w8, w0, w20, hi
5546 ; -O1: bl __atomic_compare_exchange
5547 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
5551 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
5552 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
5553 ; -O0: subs w10, w10, w8, uxth
5554 ; -O0: csel w8, w9, w8, hi
5555 ; -O0: bl __atomic_compare_exchange
5557 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
5558 ; -O1: and w8, w0, #0xffff
5559 ; -O1: cmp w8, w20, uxth
5560 ; -O1: csel w8, w0, w20, hi
5561 ; -O1: bl __atomic_compare_exchange
5562 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
5566 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5567 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5568 ; -O0: subs w10, w10, w8, uxth
5569 ; -O0: csel w8, w9, w8, hi
5570 ; -O0: bl __atomic_compare_exchange
5572 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
5573 ; -O1: and w8, w0, #0xffff
5574 ; -O1: cmp w8, w20, uxth
5575 ; -O1: csel w8, w0, w20, hi
5576 ; -O1: bl __atomic_compare_exchange
5577 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
5581 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5582 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5583 ; -O0: subs w10, w10, w8, uxth
5584 ; -O0: csel w8, w9, w8, hi
5585 ; -O0: bl __atomic_compare_exchange
5587 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
5588 ; -O1: and w8, w0, #0xffff
5589 ; -O1: cmp w8, w20, uxth
5590 ; -O1: csel w8, w0, w20, hi
5591 ; -O1: bl __atomic_compare_exchange
5592 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
5596 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5597 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5598 ; -O0: subs w10, w9, w8
5599 ; -O0: csel w8, w9, w8, hi
5600 ; -O0: bl __atomic_compare_exchange
5602 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
5604 ; -O1: csel w8, w0, w20, hi
5605 ; -O1: bl __atomic_compare_exchange
5606 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
5610 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5611 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5612 ; -O0: subs w10, w9, w8
5613 ; -O0: csel w8, w9, w8, hi
5614 ; -O0: bl __atomic_compare_exchange
5616 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
5618 ; -O1: csel w8, w0, w20, hi
5619 ; -O1: bl __atomic_compare_exchange
5620 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
5624 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
5625 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
5626 ; -O0: subs w10, w9, w8
5627 ; -O0: csel w8, w9, w8, hi
5628 ; -O0: bl __atomic_compare_exchange
5630 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
5632 ; -O1: csel w8, w0, w20, hi
5633 ; -O1: bl __atomic_compare_exchange
5634 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
5638 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5639 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5640 ; -O0: subs w10, w9, w8
5641 ; -O0: csel w8, w9, w8, hi
5642 ; -O0: bl __atomic_compare_exchange
5644 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
5646 ; -O1: csel w8, w0, w20, hi
5647 ; -O1: bl __atomic_compare_exchange
5648 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
5652 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5653 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5654 ; -O0: subs w10, w9, w8
5655 ; -O0: csel w8, w9, w8, hi
5656 ; -O0: bl __atomic_compare_exchange
5658 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
5660 ; -O1: csel w8, w0, w20, hi
5661 ; -O1: bl __atomic_compare_exchange
5662 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
5666 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5667 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5668 ; -O0: subs x10, x9, x8
5669 ; -O0: csel x8, x9, x8, hi
5670 ; -O0: bl __atomic_compare_exchange
5672 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
5674 ; -O1: csel x8, x0, x20, hi
5675 ; -O1: bl __atomic_compare_exchange
5676 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
5680 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5681 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5682 ; -O0: subs x10, x9, x8
5683 ; -O0: csel x8, x9, x8, hi
5684 ; -O0: bl __atomic_compare_exchange
5686 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
5688 ; -O1: csel x8, x0, x20, hi
5689 ; -O1: bl __atomic_compare_exchange
5690 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
5694 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
5695 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
5696 ; -O0: subs x10, x9, x8
5697 ; -O0: csel x8, x9, x8, hi
5698 ; -O0: bl __atomic_compare_exchange
5700 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
5702 ; -O1: csel x8, x0, x20, hi
5703 ; -O1: bl __atomic_compare_exchange
5704 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
5708 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5709 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5710 ; -O0: subs x10, x9, x8
5711 ; -O0: csel x8, x9, x8, hi
5712 ; -O0: bl __atomic_compare_exchange
5714 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
5716 ; -O1: csel x8, x0, x20, hi
5717 ; -O1: bl __atomic_compare_exchange
5718 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
5722 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5723 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5724 ; -O0: subs x10, x9, x8
5725 ; -O0: csel x8, x9, x8, hi
5726 ; -O0: bl __atomic_compare_exchange
5728 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
5730 ; -O1: csel x8, x0, x20, hi
5731 ; -O1: bl __atomic_compare_exchange
5732 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
5736 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5737 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5738 ; -O0: subs x8, x8, x9
5739 ; -O0: subs x11, x11, x10
5740 ; -O0: subs x12, x12, x10
5741 ; -O0: csel w11, w8, w11, eq
5742 ; -O0: ands w12, w11, #0x1
5743 ; -O0: csel x9, x8, x9, ne
5744 ; -O0: ands w11, w11, #0x1
5745 ; -O0: csel x8, x8, x10, ne
5746 ; -O0: bl __atomic_compare_exchange
5748 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
5749 ; -O1: ldp x0, x1, [x0]
5751 ; -O1: csel x8, x1, x19, lo
5752 ; -O1: csel x9, x0, x21, lo
5753 ; -O1: bl __atomic_compare_exchange
5754 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
5758 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5759 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5760 ; -O0: subs x8, x8, x9
5761 ; -O0: subs x11, x11, x10
5762 ; -O0: subs x12, x12, x10
5763 ; -O0: csel w11, w8, w11, eq
5764 ; -O0: ands w12, w11, #0x1
5765 ; -O0: csel x9, x8, x9, ne
5766 ; -O0: ands w11, w11, #0x1
5767 ; -O0: csel x8, x8, x10, ne
5768 ; -O0: bl __atomic_compare_exchange
5770 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
5771 ; -O1: ldp x0, x1, [x0]
5773 ; -O1: csel x8, x1, x19, lo
5774 ; -O1: csel x9, x0, x21, lo
5775 ; -O1: bl __atomic_compare_exchange
5776 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
5780 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
5781 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
5782 ; -O0: subs x8, x8, x9
5783 ; -O0: subs x11, x11, x10
5784 ; -O0: subs x12, x12, x10
5785 ; -O0: csel w11, w8, w11, eq
5786 ; -O0: ands w12, w11, #0x1
5787 ; -O0: csel x9, x8, x9, ne
5788 ; -O0: ands w11, w11, #0x1
5789 ; -O0: csel x8, x8, x10, ne
5790 ; -O0: bl __atomic_compare_exchange
5792 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
5793 ; -O1: ldp x0, x1, [x0]
5795 ; -O1: csel x8, x1, x19, lo
5796 ; -O1: csel x9, x0, x21, lo
5797 ; -O1: bl __atomic_compare_exchange
5798 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
5802 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5803 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5804 ; -O0: subs x8, x8, x9
5805 ; -O0: subs x11, x11, x10
5806 ; -O0: subs x12, x12, x10
5807 ; -O0: csel w11, w8, w11, eq
5808 ; -O0: ands w12, w11, #0x1
5809 ; -O0: csel x9, x8, x9, ne
5810 ; -O0: ands w11, w11, #0x1
5811 ; -O0: csel x8, x8, x10, ne
5812 ; -O0: bl __atomic_compare_exchange
5814 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
5815 ; -O1: ldp x0, x1, [x0]
5817 ; -O1: csel x8, x1, x19, lo
5818 ; -O1: csel x9, x0, x21, lo
5819 ; -O1: bl __atomic_compare_exchange
5820 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
5824 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5825 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5826 ; -O0: subs x8, x8, x9
5827 ; -O0: subs x11, x11, x10
5828 ; -O0: subs x12, x12, x10
5829 ; -O0: csel w11, w8, w11, eq
5830 ; -O0: ands w12, w11, #0x1
5831 ; -O0: csel x9, x8, x9, ne
5832 ; -O0: ands w11, w11, #0x1
5833 ; -O0: csel x8, x8, x10, ne
5834 ; -O0: bl __atomic_compare_exchange
5836 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
5837 ; -O1: ldp x0, x1, [x0]
5839 ; -O1: csel x8, x1, x19, lo
5840 ; -O1: csel x9, x0, x21, lo
5841 ; -O1: bl __atomic_compare_exchange
5842 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
5846 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5847 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_monotonic:
5848 ; CHECK: lduminb w1, w0, [x0]
5849 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
5853 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
5854 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acquire:
5855 ; CHECK: lduminab w1, w0, [x0]
5856 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
5860 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
5861 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_release:
5862 ; CHECK: lduminlb w1, w0, [x0]
5863 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
5867 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5868 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
5869 ; CHECK: lduminalb w1, w0, [x0]
5870 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
5874 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5875 ; CHECK-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
5876 ; CHECK: lduminalb w1, w0, [x0]
5877 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
5881 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5882 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_monotonic:
5883 ; CHECK: lduminh w1, w0, [x0]
5884 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
5888 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
5889 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acquire:
5890 ; CHECK: lduminah w1, w0, [x0]
5891 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
5895 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
5896 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_release:
5897 ; CHECK: lduminlh w1, w0, [x0]
5898 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
5902 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5903 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
5904 ; CHECK: lduminalh w1, w0, [x0]
5905 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
5909 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5910 ; CHECK-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
5911 ; CHECK: lduminalh w1, w0, [x0]
5912 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
5916 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5917 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_monotonic:
5918 ; CHECK: ldumin w1, w0, [x0]
5919 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
5923 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
5924 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acquire:
5925 ; CHECK: ldumina w1, w0, [x0]
5926 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
5930 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
5931 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_release:
5932 ; CHECK: lduminl w1, w0, [x0]
5933 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
5937 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5938 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
5939 ; CHECK: lduminal w1, w0, [x0]
5940 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
5944 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5945 ; CHECK-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
5946 ; CHECK: lduminal w1, w0, [x0]
5947 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
5951 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5952 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_monotonic:
5953 ; CHECK: ldumin x1, x0, [x0]
5954 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
5958 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
5959 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acquire:
5960 ; CHECK: ldumina x1, x0, [x0]
5961 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
5965 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
5966 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_release:
5967 ; CHECK: lduminl x1, x0, [x0]
5968 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
5972 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5973 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
5974 ; CHECK: lduminal x1, x0, [x0]
5975 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
5979 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5980 ; CHECK-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
5981 ; CHECK: lduminal x1, x0, [x0]
5982 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
5986 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5987 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
5988 ; -O0: subs x9, x9, x12
5989 ; -O0: subs x11, x11, x10
5990 ; -O0: subs x13, x13, x10
5991 ; -O0: csel w11, w9, w11, eq
5992 ; -O0: ands w13, w11, #0x1
5993 ; -O0: csel x2, x9, x12, ne
5994 ; -O0: ands w11, w11, #0x1
5995 ; -O0: csel x9, x9, x10, ne
5996 ; -O0: casp x0, x1, x2, x3, [x8]
5997 ; -O0: eor x8, x10, x8
5998 ; -O0: eor x11, x9, x11
5999 ; -O0: orr x8, x8, x11
6000 ; -O0: subs x8, x8, #0
6002 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
6003 ; -O1: ldp x4, x5, [x0]
6005 ; -O1: csel x9, x7, x3, hs
6006 ; -O1: csel x8, x4, x2, hs
6007 ; -O1: casp x4, x5, x8, x9, [x0]
6009 ; -O1: ccmp x4, x6, #0, eq
6010 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
6014 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
6015 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
6016 ; -O0: subs x9, x9, x12
6017 ; -O0: subs x11, x11, x10
6018 ; -O0: subs x13, x13, x10
6019 ; -O0: csel w11, w9, w11, eq
6020 ; -O0: ands w13, w11, #0x1
6021 ; -O0: csel x2, x9, x12, ne
6022 ; -O0: ands w11, w11, #0x1
6023 ; -O0: csel x9, x9, x10, ne
6024 ; -O0: caspa x0, x1, x2, x3, [x8]
6025 ; -O0: eor x8, x10, x8
6026 ; -O0: eor x11, x9, x11
6027 ; -O0: orr x8, x8, x11
6028 ; -O0: subs x8, x8, #0
6030 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
6031 ; -O1: ldp x4, x5, [x0]
6033 ; -O1: csel x9, x7, x3, hs
6034 ; -O1: csel x8, x4, x2, hs
6035 ; -O1: caspa x4, x5, x8, x9, [x0]
6037 ; -O1: ccmp x4, x6, #0, eq
6038 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
6042 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
6043 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
6044 ; -O0: subs x9, x9, x12
6045 ; -O0: subs x11, x11, x10
6046 ; -O0: subs x13, x13, x10
6047 ; -O0: csel w11, w9, w11, eq
6048 ; -O0: ands w13, w11, #0x1
6049 ; -O0: csel x2, x9, x12, ne
6050 ; -O0: ands w11, w11, #0x1
6051 ; -O0: csel x9, x9, x10, ne
6052 ; -O0: caspl x0, x1, x2, x3, [x8]
6053 ; -O0: eor x8, x10, x8
6054 ; -O0: eor x11, x9, x11
6055 ; -O0: orr x8, x8, x11
6056 ; -O0: subs x8, x8, #0
6058 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
6059 ; -O1: ldp x4, x5, [x0]
6061 ; -O1: csel x9, x7, x3, hs
6062 ; -O1: csel x8, x4, x2, hs
6063 ; -O1: caspl x4, x5, x8, x9, [x0]
6065 ; -O1: ccmp x4, x6, #0, eq
6066 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
6070 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6071 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6072 ; -O0: subs x9, x9, x12
6073 ; -O0: subs x11, x11, x10
6074 ; -O0: subs x13, x13, x10
6075 ; -O0: csel w11, w9, w11, eq
6076 ; -O0: ands w13, w11, #0x1
6077 ; -O0: csel x2, x9, x12, ne
6078 ; -O0: ands w11, w11, #0x1
6079 ; -O0: csel x9, x9, x10, ne
6080 ; -O0: caspal x0, x1, x2, x3, [x8]
6081 ; -O0: eor x8, x10, x8
6082 ; -O0: eor x11, x9, x11
6083 ; -O0: orr x8, x8, x11
6084 ; -O0: subs x8, x8, #0
6086 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6087 ; -O1: ldp x4, x5, [x0]
6089 ; -O1: csel x9, x7, x3, hs
6090 ; -O1: csel x8, x4, x2, hs
6091 ; -O1: caspal x4, x5, x8, x9, [x0]
6093 ; -O1: ccmp x4, x6, #0, eq
6094 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
6098 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6099 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6100 ; -O0: subs x9, x9, x12
6101 ; -O0: subs x11, x11, x10
6102 ; -O0: subs x13, x13, x10
6103 ; -O0: csel w11, w9, w11, eq
6104 ; -O0: ands w13, w11, #0x1
6105 ; -O0: csel x2, x9, x12, ne
6106 ; -O0: ands w11, w11, #0x1
6107 ; -O0: csel x9, x9, x10, ne
6108 ; -O0: caspal x0, x1, x2, x3, [x8]
6109 ; -O0: eor x8, x10, x8
6110 ; -O0: eor x11, x9, x11
6111 ; -O0: orr x8, x8, x11
6112 ; -O0: subs x8, x8, #0
6114 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6115 ; -O1: ldp x4, x5, [x0]
6117 ; -O1: csel x9, x7, x3, hs
6118 ; -O1: csel x8, x4, x2, hs
6119 ; -O1: caspal x4, x5, x8, x9, [x0]
6121 ; -O1: ccmp x4, x6, #0, eq
6122 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
6126 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6127 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
6128 ; CHECK: lduminb w1, w0, [x0]
6129 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
6133 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6134 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acquire:
6135 ; CHECK: lduminab w1, w0, [x0]
6136 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
6140 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
6141 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_release:
6142 ; CHECK: lduminlb w1, w0, [x0]
6143 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
6147 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6148 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
6149 ; CHECK: lduminalb w1, w0, [x0]
6150 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
6154 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6155 ; CHECK-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
6156 ; CHECK: lduminalb w1, w0, [x0]
6157 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
6161 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6162 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6163 ; -O0: subs w10, w10, w8, uxth
6164 ; -O0: csel w8, w9, w8, ls
6165 ; -O0: bl __atomic_compare_exchange
6167 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
6168 ; -O1: and w8, w0, #0xffff
6169 ; -O1: cmp w8, w20, uxth
6170 ; -O1: csel w8, w0, w20, ls
6171 ; -O1: bl __atomic_compare_exchange
6172 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
6176 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6177 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6178 ; -O0: subs w10, w10, w8, uxth
6179 ; -O0: csel w8, w9, w8, ls
6180 ; -O0: bl __atomic_compare_exchange
6182 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
6183 ; -O1: and w8, w0, #0xffff
6184 ; -O1: cmp w8, w20, uxth
6185 ; -O1: csel w8, w0, w20, ls
6186 ; -O1: bl __atomic_compare_exchange
6187 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
6191 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
6192 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
6193 ; -O0: subs w10, w10, w8, uxth
6194 ; -O0: csel w8, w9, w8, ls
6195 ; -O0: bl __atomic_compare_exchange
6197 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
6198 ; -O1: and w8, w0, #0xffff
6199 ; -O1: cmp w8, w20, uxth
6200 ; -O1: csel w8, w0, w20, ls
6201 ; -O1: bl __atomic_compare_exchange
6202 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
6206 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6207 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6208 ; -O0: subs w10, w10, w8, uxth
6209 ; -O0: csel w8, w9, w8, ls
6210 ; -O0: bl __atomic_compare_exchange
6212 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
6213 ; -O1: and w8, w0, #0xffff
6214 ; -O1: cmp w8, w20, uxth
6215 ; -O1: csel w8, w0, w20, ls
6216 ; -O1: bl __atomic_compare_exchange
6217 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
6221 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6222 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6223 ; -O0: subs w10, w10, w8, uxth
6224 ; -O0: csel w8, w9, w8, ls
6225 ; -O0: bl __atomic_compare_exchange
6227 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
6228 ; -O1: and w8, w0, #0xffff
6229 ; -O1: cmp w8, w20, uxth
6230 ; -O1: csel w8, w0, w20, ls
6231 ; -O1: bl __atomic_compare_exchange
6232 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
6236 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6237 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6238 ; -O0: subs w10, w9, w8
6239 ; -O0: csel w8, w9, w8, ls
6240 ; -O0: bl __atomic_compare_exchange
6242 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
6244 ; -O1: csel w8, w0, w20, ls
6245 ; -O1: bl __atomic_compare_exchange
6246 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
6250 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6251 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6252 ; -O0: subs w10, w9, w8
6253 ; -O0: csel w8, w9, w8, ls
6254 ; -O0: bl __atomic_compare_exchange
6256 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
6258 ; -O1: csel w8, w0, w20, ls
6259 ; -O1: bl __atomic_compare_exchange
6260 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
6264 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
6265 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
6266 ; -O0: subs w10, w9, w8
6267 ; -O0: csel w8, w9, w8, ls
6268 ; -O0: bl __atomic_compare_exchange
6270 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
6272 ; -O1: csel w8, w0, w20, ls
6273 ; -O1: bl __atomic_compare_exchange
6274 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
6278 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6279 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6280 ; -O0: subs w10, w9, w8
6281 ; -O0: csel w8, w9, w8, ls
6282 ; -O0: bl __atomic_compare_exchange
6284 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
6286 ; -O1: csel w8, w0, w20, ls
6287 ; -O1: bl __atomic_compare_exchange
6288 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
6292 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6293 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6294 ; -O0: subs w10, w9, w8
6295 ; -O0: csel w8, w9, w8, ls
6296 ; -O0: bl __atomic_compare_exchange
6298 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
6300 ; -O1: csel w8, w0, w20, ls
6301 ; -O1: bl __atomic_compare_exchange
6302 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
6306 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6307 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6308 ; -O0: subs x10, x9, x8
6309 ; -O0: csel x8, x9, x8, ls
6310 ; -O0: bl __atomic_compare_exchange
6312 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
6314 ; -O1: csel x8, x0, x20, ls
6315 ; -O1: bl __atomic_compare_exchange
6316 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
6320 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6321 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6322 ; -O0: subs x10, x9, x8
6323 ; -O0: csel x8, x9, x8, ls
6324 ; -O0: bl __atomic_compare_exchange
6326 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
6328 ; -O1: csel x8, x0, x20, ls
6329 ; -O1: bl __atomic_compare_exchange
6330 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
6334 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
6335 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
6336 ; -O0: subs x10, x9, x8
6337 ; -O0: csel x8, x9, x8, ls
6338 ; -O0: bl __atomic_compare_exchange
6340 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
6342 ; -O1: csel x8, x0, x20, ls
6343 ; -O1: bl __atomic_compare_exchange
6344 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
6348 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6349 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6350 ; -O0: subs x10, x9, x8
6351 ; -O0: csel x8, x9, x8, ls
6352 ; -O0: bl __atomic_compare_exchange
6354 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
6356 ; -O1: csel x8, x0, x20, ls
6357 ; -O1: bl __atomic_compare_exchange
6358 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
6362 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6363 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6364 ; -O0: subs x10, x9, x8
6365 ; -O0: csel x8, x9, x8, ls
6366 ; -O0: bl __atomic_compare_exchange
6368 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
6370 ; -O1: csel x8, x0, x20, ls
6371 ; -O1: bl __atomic_compare_exchange
6372 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
6376 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6377 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6378 ; -O0: subs x8, x8, x9
6379 ; -O0: subs x11, x11, x10
6380 ; -O0: subs x12, x12, x10
6381 ; -O0: csel w11, w8, w11, eq
6382 ; -O0: ands w12, w11, #0x1
6383 ; -O0: csel x9, x8, x9, ne
6384 ; -O0: ands w11, w11, #0x1
6385 ; -O0: csel x8, x8, x10, ne
6386 ; -O0: bl __atomic_compare_exchange
6388 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
6389 ; -O1: ldp x0, x1, [x0]
6391 ; -O1: csel x8, x1, x19, hs
6392 ; -O1: csel x9, x0, x21, hs
6393 ; -O1: bl __atomic_compare_exchange
6394 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
6398 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6399 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6400 ; -O0: subs x8, x8, x9
6401 ; -O0: subs x11, x11, x10
6402 ; -O0: subs x12, x12, x10
6403 ; -O0: csel w11, w8, w11, eq
6404 ; -O0: ands w12, w11, #0x1
6405 ; -O0: csel x9, x8, x9, ne
6406 ; -O0: ands w11, w11, #0x1
6407 ; -O0: csel x8, x8, x10, ne
6408 ; -O0: bl __atomic_compare_exchange
6410 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
6411 ; -O1: ldp x0, x1, [x0]
6413 ; -O1: csel x8, x1, x19, hs
6414 ; -O1: csel x9, x0, x21, hs
6415 ; -O1: bl __atomic_compare_exchange
6416 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
6420 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
6421 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
6422 ; -O0: subs x8, x8, x9
6423 ; -O0: subs x11, x11, x10
6424 ; -O0: subs x12, x12, x10
6425 ; -O0: csel w11, w8, w11, eq
6426 ; -O0: ands w12, w11, #0x1
6427 ; -O0: csel x9, x8, x9, ne
6428 ; -O0: ands w11, w11, #0x1
6429 ; -O0: csel x8, x8, x10, ne
6430 ; -O0: bl __atomic_compare_exchange
6432 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
6433 ; -O1: ldp x0, x1, [x0]
6435 ; -O1: csel x8, x1, x19, hs
6436 ; -O1: csel x9, x0, x21, hs
6437 ; -O1: bl __atomic_compare_exchange
6438 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
6442 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6443 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6444 ; -O0: subs x8, x8, x9
6445 ; -O0: subs x11, x11, x10
6446 ; -O0: subs x12, x12, x10
6447 ; -O0: csel w11, w8, w11, eq
6448 ; -O0: ands w12, w11, #0x1
6449 ; -O0: csel x9, x8, x9, ne
6450 ; -O0: ands w11, w11, #0x1
6451 ; -O0: csel x8, x8, x10, ne
6452 ; -O0: bl __atomic_compare_exchange
6454 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
6455 ; -O1: ldp x0, x1, [x0]
6457 ; -O1: csel x8, x1, x19, hs
6458 ; -O1: csel x9, x0, x21, hs
6459 ; -O1: bl __atomic_compare_exchange
6460 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
6464 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6465 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6466 ; -O0: subs x8, x8, x9
6467 ; -O0: subs x11, x11, x10
6468 ; -O0: subs x12, x12, x10
6469 ; -O0: csel w11, w8, w11, eq
6470 ; -O0: ands w12, w11, #0x1
6471 ; -O0: csel x9, x8, x9, ne
6472 ; -O0: ands w11, w11, #0x1
6473 ; -O0: csel x8, x8, x10, ne
6474 ; -O0: bl __atomic_compare_exchange
6476 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
6477 ; -O1: ldp x0, x1, [x0]
6479 ; -O1: csel x8, x1, x19, hs
6480 ; -O1: csel x9, x0, x21, hs
6481 ; -O1: bl __atomic_compare_exchange
6482 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1