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=+outline-atomics -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -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: bl __aarch64_swp1_relax
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: bl __aarch64_swp1_acq
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: bl __aarch64_swp1_rel
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: bl __aarch64_swp1_acq_rel
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: bl __aarch64_swp1_acq_rel
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: bl __aarch64_swp2_relax
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: bl __aarch64_swp2_acq
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: bl __aarch64_swp2_rel
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: bl __aarch64_swp2_acq_rel
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: bl __aarch64_swp2_acq_rel
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: bl __aarch64_swp4_relax
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: bl __aarch64_swp4_acq
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: bl __aarch64_swp4_rel
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: bl __aarch64_swp4_acq_rel
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: bl __aarch64_swp4_acq_rel
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: bl __aarch64_swp8_relax
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: bl __aarch64_swp8_acq
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: bl __aarch64_swp8_rel
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: bl __aarch64_swp8_acq_rel
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: bl __aarch64_swp8_acq_rel
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: ldxp x10, x9, [x11]
151 ; -O0: stxp w8, x14, x15, [x11]
152 ; -O0: stxp w8, x10, x9, [x11]
153 ; -O0: eor x8, x10, x8
154 ; -O0: eor x11, x9, x11
155 ; -O0: orr x8, x8, x11
156 ; -O0: subs x8, x8, #0
158 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
159 ; -O1: ldxp x8, x1, [x0]
160 ; -O1: stxp w9, x2, x3, [x0]
161 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
165 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
166 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
167 ; -O0: ldaxp x10, x9, [x11]
170 ; -O0: stxp w8, x14, x15, [x11]
171 ; -O0: stxp w8, x10, x9, [x11]
172 ; -O0: eor x8, x10, x8
173 ; -O0: eor x11, x9, x11
174 ; -O0: orr x8, x8, x11
175 ; -O0: subs x8, x8, #0
177 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
178 ; -O1: ldaxp x8, x1, [x0]
179 ; -O1: stxp w9, x2, x3, [x0]
180 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
184 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
185 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
186 ; -O0: ldxp x10, x9, [x11]
189 ; -O0: stlxp w8, x14, x15, [x11]
190 ; -O0: stlxp w8, x10, x9, [x11]
191 ; -O0: eor x8, x10, x8
192 ; -O0: eor x11, x9, x11
193 ; -O0: orr x8, x8, x11
194 ; -O0: subs x8, x8, #0
196 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
197 ; -O1: ldxp x8, x1, [x0]
198 ; -O1: stlxp w9, x2, x3, [x0]
199 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
203 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
204 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
205 ; -O0: ldaxp x10, x9, [x11]
208 ; -O0: stlxp w8, x14, x15, [x11]
209 ; -O0: stlxp w8, x10, x9, [x11]
210 ; -O0: eor x8, x10, x8
211 ; -O0: eor x11, x9, x11
212 ; -O0: orr x8, x8, x11
213 ; -O0: subs x8, x8, #0
215 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
216 ; -O1: ldaxp x8, x1, [x0]
217 ; -O1: stlxp w9, x2, x3, [x0]
218 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
222 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
223 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
224 ; -O0: ldaxp x10, x9, [x11]
227 ; -O0: stlxp w8, x14, x15, [x11]
228 ; -O0: stlxp w8, x10, x9, [x11]
229 ; -O0: eor x8, x10, x8
230 ; -O0: eor x11, x9, x11
231 ; -O0: orr x8, x8, x11
232 ; -O0: subs x8, x8, #0
234 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
235 ; -O1: ldaxp x8, x1, [x0]
236 ; -O1: stlxp w9, x2, x3, [x0]
237 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
241 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
242 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
243 ; CHECK: bl __aarch64_swp1_relax
244 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
248 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
249 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
250 ; CHECK: bl __aarch64_swp1_acq
251 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
255 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
256 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_release:
257 ; CHECK: bl __aarch64_swp1_rel
258 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
262 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
263 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
264 ; CHECK: bl __aarch64_swp1_acq_rel
265 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
269 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
270 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
271 ; CHECK: bl __aarch64_swp1_acq_rel
272 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
276 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
277 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
278 ; CHECK: bl __atomic_exchange
279 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
283 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
284 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
285 ; CHECK: bl __atomic_exchange
286 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
290 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
291 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
292 ; CHECK: bl __atomic_exchange
293 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
297 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
298 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
299 ; CHECK: bl __atomic_exchange
300 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
304 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
305 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
306 ; CHECK: bl __atomic_exchange
307 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
311 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
312 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
313 ; CHECK: bl __atomic_exchange
314 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
318 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
319 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
320 ; CHECK: bl __atomic_exchange
321 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
325 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
326 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
327 ; CHECK: bl __atomic_exchange
328 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
332 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
333 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
334 ; CHECK: bl __atomic_exchange
335 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
339 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
340 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
341 ; CHECK: bl __atomic_exchange
342 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
346 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
347 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
348 ; CHECK: bl __atomic_exchange
349 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
353 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
354 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
355 ; CHECK: bl __atomic_exchange
356 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
360 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
361 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
362 ; CHECK: bl __atomic_exchange
363 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
367 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
368 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
369 ; CHECK: bl __atomic_exchange
370 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
374 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
375 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
376 ; CHECK: bl __atomic_exchange
377 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
381 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
382 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
383 ; CHECK: bl __atomic_exchange
384 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
388 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
389 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
390 ; CHECK: bl __atomic_exchange
391 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
395 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
396 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
397 ; CHECK: bl __atomic_exchange
398 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
402 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
403 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
404 ; CHECK: bl __atomic_exchange
405 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
409 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
410 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
411 ; CHECK: bl __atomic_exchange
412 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
416 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
417 ; CHECK-LABEL: atomicrmw_add_i8_aligned_monotonic:
418 ; CHECK: bl __aarch64_ldadd1_relax
419 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
423 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
424 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acquire:
425 ; CHECK: bl __aarch64_ldadd1_acq
426 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
430 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
431 ; CHECK-LABEL: atomicrmw_add_i8_aligned_release:
432 ; CHECK: bl __aarch64_ldadd1_rel
433 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
437 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
438 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acq_rel:
439 ; CHECK: bl __aarch64_ldadd1_acq_rel
440 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
444 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
445 ; CHECK-LABEL: atomicrmw_add_i8_aligned_seq_cst:
446 ; CHECK: bl __aarch64_ldadd1_acq_rel
447 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
451 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
452 ; CHECK-LABEL: atomicrmw_add_i16_aligned_monotonic:
453 ; CHECK: bl __aarch64_ldadd2_relax
454 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
458 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
459 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acquire:
460 ; CHECK: bl __aarch64_ldadd2_acq
461 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
465 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
466 ; CHECK-LABEL: atomicrmw_add_i16_aligned_release:
467 ; CHECK: bl __aarch64_ldadd2_rel
468 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
472 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
473 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acq_rel:
474 ; CHECK: bl __aarch64_ldadd2_acq_rel
475 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
479 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
480 ; CHECK-LABEL: atomicrmw_add_i16_aligned_seq_cst:
481 ; CHECK: bl __aarch64_ldadd2_acq_rel
482 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
486 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
487 ; CHECK-LABEL: atomicrmw_add_i32_aligned_monotonic:
488 ; CHECK: bl __aarch64_ldadd4_relax
489 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
493 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
494 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acquire:
495 ; CHECK: bl __aarch64_ldadd4_acq
496 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
500 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
501 ; CHECK-LABEL: atomicrmw_add_i32_aligned_release:
502 ; CHECK: bl __aarch64_ldadd4_rel
503 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
507 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
508 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acq_rel:
509 ; CHECK: bl __aarch64_ldadd4_acq_rel
510 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
514 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
515 ; CHECK-LABEL: atomicrmw_add_i32_aligned_seq_cst:
516 ; CHECK: bl __aarch64_ldadd4_acq_rel
517 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
521 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
522 ; CHECK-LABEL: atomicrmw_add_i64_aligned_monotonic:
523 ; CHECK: bl __aarch64_ldadd8_relax
524 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
528 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
529 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acquire:
530 ; CHECK: bl __aarch64_ldadd8_acq
531 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
535 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
536 ; CHECK-LABEL: atomicrmw_add_i64_aligned_release:
537 ; CHECK: bl __aarch64_ldadd8_rel
538 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
542 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
543 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acq_rel:
544 ; CHECK: bl __aarch64_ldadd8_acq_rel
545 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
549 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
550 ; CHECK-LABEL: atomicrmw_add_i64_aligned_seq_cst:
551 ; CHECK: bl __aarch64_ldadd8_acq_rel
552 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
556 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
557 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
558 ; -O0: adds x14, x8, x10
559 ; -O0: and w10, w8, #0x1
560 ; -O0: subs w10, w10, #1
561 ; -O0: ldxp x10, x9, [x11]
564 ; -O0: stxp w8, x14, x15, [x11]
565 ; -O0: stxp w8, x10, x9, [x11]
566 ; -O0: eor x8, x10, x8
567 ; -O0: eor x11, x9, x11
568 ; -O0: orr x8, x8, x11
569 ; -O0: subs x8, x8, #0
571 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
572 ; -O1: ldxp x0, x1, [x8]
573 ; -O1: adds x9, x0, x2
574 ; -O1: stxp w11, x9, x10, [x8]
575 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
579 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
580 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
581 ; -O0: adds x14, x8, x10
582 ; -O0: and w10, w8, #0x1
583 ; -O0: subs w10, w10, #1
584 ; -O0: ldaxp x10, x9, [x11]
587 ; -O0: stxp w8, x14, x15, [x11]
588 ; -O0: stxp w8, x10, x9, [x11]
589 ; -O0: eor x8, x10, x8
590 ; -O0: eor x11, x9, x11
591 ; -O0: orr x8, x8, x11
592 ; -O0: subs x8, x8, #0
594 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
595 ; -O1: ldaxp x0, x1, [x8]
596 ; -O1: adds x9, x0, x2
597 ; -O1: stxp w11, x9, x10, [x8]
598 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
602 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
603 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
604 ; -O0: adds x14, x8, x10
605 ; -O0: and w10, w8, #0x1
606 ; -O0: subs w10, w10, #1
607 ; -O0: ldxp x10, x9, [x11]
610 ; -O0: stlxp w8, x14, x15, [x11]
611 ; -O0: stlxp w8, x10, x9, [x11]
612 ; -O0: eor x8, x10, x8
613 ; -O0: eor x11, x9, x11
614 ; -O0: orr x8, x8, x11
615 ; -O0: subs x8, x8, #0
617 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
618 ; -O1: ldxp x0, x1, [x8]
619 ; -O1: adds x9, x0, x2
620 ; -O1: stlxp w11, x9, x10, [x8]
621 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
625 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
626 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
627 ; -O0: adds x14, x8, x10
628 ; -O0: and w10, w8, #0x1
629 ; -O0: subs w10, w10, #1
630 ; -O0: ldaxp x10, x9, [x11]
633 ; -O0: stlxp w8, x14, x15, [x11]
634 ; -O0: stlxp w8, x10, x9, [x11]
635 ; -O0: eor x8, x10, x8
636 ; -O0: eor x11, x9, x11
637 ; -O0: orr x8, x8, x11
638 ; -O0: subs x8, x8, #0
640 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
641 ; -O1: ldaxp x0, x1, [x8]
642 ; -O1: adds x9, x0, x2
643 ; -O1: stlxp w11, x9, x10, [x8]
644 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
648 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
649 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
650 ; -O0: adds x14, x8, x10
651 ; -O0: and w10, w8, #0x1
652 ; -O0: subs w10, w10, #1
653 ; -O0: ldaxp x10, x9, [x11]
656 ; -O0: stlxp w8, x14, x15, [x11]
657 ; -O0: stlxp w8, x10, x9, [x11]
658 ; -O0: eor x8, x10, x8
659 ; -O0: eor x11, x9, x11
660 ; -O0: orr x8, x8, x11
661 ; -O0: subs x8, x8, #0
663 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
664 ; -O1: ldaxp x0, x1, [x8]
665 ; -O1: adds x9, x0, x2
666 ; -O1: stlxp w11, x9, x10, [x8]
667 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
671 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
672 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
673 ; CHECK: bl __aarch64_ldadd1_relax
674 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
678 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
679 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
680 ; CHECK: bl __aarch64_ldadd1_acq
681 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
685 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
686 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
687 ; CHECK: bl __aarch64_ldadd1_rel
688 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
692 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
693 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
694 ; CHECK: bl __aarch64_ldadd1_acq_rel
695 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
699 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
700 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
701 ; CHECK: bl __aarch64_ldadd1_acq_rel
702 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
706 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
707 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
708 ; -O0: add w8, w8, w9, uxth
709 ; -O0: bl __atomic_compare_exchange
711 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
712 ; -O1: add w8, w0, w20
713 ; -O1: bl __atomic_compare_exchange
714 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
718 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
719 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
720 ; -O0: add w8, w8, w9, uxth
721 ; -O0: bl __atomic_compare_exchange
723 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
724 ; -O1: add w8, w0, w20
725 ; -O1: bl __atomic_compare_exchange
726 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
730 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
731 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
732 ; -O0: add w8, w8, w9, uxth
733 ; -O0: bl __atomic_compare_exchange
735 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
736 ; -O1: add w8, w0, w20
737 ; -O1: bl __atomic_compare_exchange
738 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
742 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
743 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
744 ; -O0: add w8, w8, w9, uxth
745 ; -O0: bl __atomic_compare_exchange
747 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
748 ; -O1: add w8, w0, w20
749 ; -O1: bl __atomic_compare_exchange
750 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
754 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
755 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
756 ; -O0: add w8, w8, w9, uxth
757 ; -O0: bl __atomic_compare_exchange
759 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
760 ; -O1: add w8, w0, w20
761 ; -O1: bl __atomic_compare_exchange
762 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
766 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
767 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
768 ; -O0: add w8, w9, w8
769 ; -O0: bl __atomic_compare_exchange
771 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
772 ; -O1: add w8, w0, w20
773 ; -O1: bl __atomic_compare_exchange
774 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
778 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
779 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
780 ; -O0: add w8, w9, w8
781 ; -O0: bl __atomic_compare_exchange
783 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
784 ; -O1: add w8, w0, w20
785 ; -O1: bl __atomic_compare_exchange
786 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
790 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
791 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
792 ; -O0: add w8, w9, w8
793 ; -O0: bl __atomic_compare_exchange
795 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
796 ; -O1: add w8, w0, w20
797 ; -O1: bl __atomic_compare_exchange
798 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
802 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
803 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
804 ; -O0: add w8, w9, w8
805 ; -O0: bl __atomic_compare_exchange
807 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
808 ; -O1: add w8, w0, w20
809 ; -O1: bl __atomic_compare_exchange
810 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
814 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
815 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
816 ; -O0: add w8, w9, w8
817 ; -O0: bl __atomic_compare_exchange
819 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
820 ; -O1: add w8, w0, w20
821 ; -O1: bl __atomic_compare_exchange
822 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
826 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
827 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
828 ; -O0: add x8, x9, x8
829 ; -O0: bl __atomic_compare_exchange
831 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
832 ; -O1: add x8, x0, x20
833 ; -O1: bl __atomic_compare_exchange
834 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
838 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
839 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
840 ; -O0: add x8, x9, x8
841 ; -O0: bl __atomic_compare_exchange
843 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
844 ; -O1: add x8, x0, x20
845 ; -O1: bl __atomic_compare_exchange
846 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
850 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
851 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
852 ; -O0: add x8, x9, x8
853 ; -O0: bl __atomic_compare_exchange
855 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
856 ; -O1: add x8, x0, x20
857 ; -O1: bl __atomic_compare_exchange
858 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
862 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
863 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
864 ; -O0: add x8, x9, x8
865 ; -O0: bl __atomic_compare_exchange
867 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
868 ; -O1: add x8, x0, x20
869 ; -O1: bl __atomic_compare_exchange
870 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
874 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
875 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
876 ; -O0: add x8, x9, x8
877 ; -O0: bl __atomic_compare_exchange
879 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
880 ; -O1: add x8, x0, x20
881 ; -O1: bl __atomic_compare_exchange
882 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
886 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
887 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
888 ; -O0: adds x9, x8, x9
889 ; -O0: and w11, w8, #0x1
890 ; -O0: subs w11, w11, #1
891 ; -O0: bl __atomic_compare_exchange
893 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
894 ; -O1: ldp x0, x1, [x0]
895 ; -O1: adds x8, x0, x21
896 ; -O1: bl __atomic_compare_exchange
897 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
901 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
902 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
903 ; -O0: adds x9, x8, x9
904 ; -O0: and w11, w8, #0x1
905 ; -O0: subs w11, w11, #1
906 ; -O0: bl __atomic_compare_exchange
908 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
909 ; -O1: ldp x0, x1, [x0]
910 ; -O1: adds x8, x0, x21
911 ; -O1: bl __atomic_compare_exchange
912 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
916 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
917 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
918 ; -O0: adds x9, x8, x9
919 ; -O0: and w11, w8, #0x1
920 ; -O0: subs w11, w11, #1
921 ; -O0: bl __atomic_compare_exchange
923 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
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 release, align 1
931 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
932 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
933 ; -O0: adds x9, x8, x9
934 ; -O0: and w11, w8, #0x1
935 ; -O0: subs w11, w11, #1
936 ; -O0: bl __atomic_compare_exchange
938 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
939 ; -O1: ldp x0, x1, [x0]
940 ; -O1: adds x8, x0, x21
941 ; -O1: bl __atomic_compare_exchange
942 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
946 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
947 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
948 ; -O0: adds x9, x8, x9
949 ; -O0: and w11, w8, #0x1
950 ; -O0: subs w11, w11, #1
951 ; -O0: bl __atomic_compare_exchange
953 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
954 ; -O1: ldp x0, x1, [x0]
955 ; -O1: adds x8, x0, x21
956 ; -O1: bl __atomic_compare_exchange
957 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
961 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
962 ; -O0-LABEL: atomicrmw_sub_i8_aligned_monotonic:
963 ; -O0: subs w0, w8, w9
964 ; -O0: bl __aarch64_ldadd1_relax
966 ; -O1-LABEL: atomicrmw_sub_i8_aligned_monotonic:
967 ; -O1: bl __aarch64_ldadd1_relax
968 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
972 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
973 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acquire:
974 ; -O0: subs w0, w8, w9
975 ; -O0: bl __aarch64_ldadd1_acq
977 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acquire:
978 ; -O1: bl __aarch64_ldadd1_acq
979 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
983 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
984 ; -O0-LABEL: atomicrmw_sub_i8_aligned_release:
985 ; -O0: subs w0, w8, w9
986 ; -O0: bl __aarch64_ldadd1_rel
988 ; -O1-LABEL: atomicrmw_sub_i8_aligned_release:
989 ; -O1: bl __aarch64_ldadd1_rel
990 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
994 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
995 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
996 ; -O0: subs w0, w8, w9
997 ; -O0: bl __aarch64_ldadd1_acq_rel
999 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
1000 ; -O1: bl __aarch64_ldadd1_acq_rel
1001 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1005 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1006 ; -O0-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
1007 ; -O0: subs w0, w8, w9
1008 ; -O0: bl __aarch64_ldadd1_acq_rel
1010 ; -O1-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
1011 ; -O1: bl __aarch64_ldadd1_acq_rel
1012 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1016 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1017 ; -O0-LABEL: atomicrmw_sub_i16_aligned_monotonic:
1018 ; -O0: subs w0, w8, w9
1019 ; -O0: bl __aarch64_ldadd2_relax
1021 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
1022 ; -O1: bl __aarch64_ldadd2_relax
1023 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
1027 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
1028 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
1029 ; -O0: subs w0, w8, w9
1030 ; -O0: bl __aarch64_ldadd2_acq
1032 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
1033 ; -O1: bl __aarch64_ldadd2_acq
1034 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
1038 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
1039 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
1040 ; -O0: subs w0, w8, w9
1041 ; -O0: bl __aarch64_ldadd2_rel
1043 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
1044 ; -O1: bl __aarch64_ldadd2_rel
1045 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
1049 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1050 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1051 ; -O0: subs w0, w8, w9
1052 ; -O0: bl __aarch64_ldadd2_acq_rel
1054 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1055 ; -O1: bl __aarch64_ldadd2_acq_rel
1056 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
1060 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1061 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1062 ; -O0: subs w0, w8, w9
1063 ; -O0: bl __aarch64_ldadd2_acq_rel
1065 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1066 ; -O1: bl __aarch64_ldadd2_acq_rel
1067 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1071 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1072 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1073 ; -O0: subs w0, w8, w9
1074 ; -O0: bl __aarch64_ldadd4_relax
1076 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1077 ; -O1: bl __aarch64_ldadd4_relax
1078 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1082 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1083 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
1084 ; -O0: subs w0, w8, w9
1085 ; -O0: bl __aarch64_ldadd4_acq
1087 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1088 ; -O1: bl __aarch64_ldadd4_acq
1089 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1093 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1094 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1095 ; -O0: subs w0, w8, w9
1096 ; -O0: bl __aarch64_ldadd4_rel
1098 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1099 ; -O1: bl __aarch64_ldadd4_rel
1100 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1104 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1105 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1106 ; -O0: subs w0, w8, w9
1107 ; -O0: bl __aarch64_ldadd4_acq_rel
1109 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1110 ; -O1: bl __aarch64_ldadd4_acq_rel
1111 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1115 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1116 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1117 ; -O0: subs w0, w8, w9
1118 ; -O0: bl __aarch64_ldadd4_acq_rel
1120 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1121 ; -O1: bl __aarch64_ldadd4_acq_rel
1122 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1126 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1127 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1128 ; -O0: subs x0, x8, x9
1129 ; -O0: bl __aarch64_ldadd8_relax
1131 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1132 ; -O1: bl __aarch64_ldadd8_relax
1133 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1137 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1138 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1139 ; -O0: subs x0, x8, x9
1140 ; -O0: bl __aarch64_ldadd8_acq
1142 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1143 ; -O1: bl __aarch64_ldadd8_acq
1144 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1148 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1149 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1150 ; -O0: subs x0, x8, x9
1151 ; -O0: bl __aarch64_ldadd8_rel
1153 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1154 ; -O1: bl __aarch64_ldadd8_rel
1155 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1159 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1160 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1161 ; -O0: subs x0, x8, x9
1162 ; -O0: bl __aarch64_ldadd8_acq_rel
1164 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1165 ; -O1: bl __aarch64_ldadd8_acq_rel
1166 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1170 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1171 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1172 ; -O0: subs x0, x8, x9
1173 ; -O0: bl __aarch64_ldadd8_acq_rel
1175 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1176 ; -O1: bl __aarch64_ldadd8_acq_rel
1177 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1181 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1182 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1183 ; -O0: subs x14, x8, x10
1184 ; -O0: and w10, w8, #0x1
1185 ; -O0: ldxp x10, x9, [x11]
1188 ; -O0: stxp w8, x14, x15, [x11]
1189 ; -O0: stxp w8, x10, x9, [x11]
1190 ; -O0: eor x8, x10, x8
1191 ; -O0: eor x11, x9, x11
1192 ; -O0: orr x8, x8, x11
1193 ; -O0: subs x8, x8, #0
1195 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1196 ; -O1: ldxp x0, x1, [x8]
1197 ; -O1: subs x9, x0, x2
1198 ; -O1: stxp w11, x9, x10, [x8]
1199 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1203 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1204 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1205 ; -O0: subs x14, x8, x10
1206 ; -O0: and w10, w8, #0x1
1207 ; -O0: ldaxp x10, x9, [x11]
1210 ; -O0: stxp w8, x14, x15, [x11]
1211 ; -O0: stxp w8, x10, x9, [x11]
1212 ; -O0: eor x8, x10, x8
1213 ; -O0: eor x11, x9, x11
1214 ; -O0: orr x8, x8, x11
1215 ; -O0: subs x8, x8, #0
1217 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1218 ; -O1: ldaxp x0, x1, [x8]
1219 ; -O1: subs x9, x0, x2
1220 ; -O1: stxp w11, x9, x10, [x8]
1221 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1225 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1226 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1227 ; -O0: subs x14, x8, x10
1228 ; -O0: and w10, w8, #0x1
1229 ; -O0: ldxp x10, x9, [x11]
1232 ; -O0: stlxp w8, x14, x15, [x11]
1233 ; -O0: stlxp w8, x10, x9, [x11]
1234 ; -O0: eor x8, x10, x8
1235 ; -O0: eor x11, x9, x11
1236 ; -O0: orr x8, x8, x11
1237 ; -O0: subs x8, x8, #0
1239 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1240 ; -O1: ldxp x0, x1, [x8]
1241 ; -O1: subs x9, x0, x2
1242 ; -O1: stlxp w11, x9, x10, [x8]
1243 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1247 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1248 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1249 ; -O0: subs x14, x8, x10
1250 ; -O0: and w10, w8, #0x1
1251 ; -O0: ldaxp x10, x9, [x11]
1254 ; -O0: stlxp w8, x14, x15, [x11]
1255 ; -O0: stlxp w8, x10, x9, [x11]
1256 ; -O0: eor x8, x10, x8
1257 ; -O0: eor x11, x9, x11
1258 ; -O0: orr x8, x8, x11
1259 ; -O0: subs x8, x8, #0
1261 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1262 ; -O1: ldaxp x0, x1, [x8]
1263 ; -O1: subs x9, x0, x2
1264 ; -O1: stlxp w11, x9, x10, [x8]
1265 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1269 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1270 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1271 ; -O0: subs x14, x8, x10
1272 ; -O0: and w10, w8, #0x1
1273 ; -O0: ldaxp x10, x9, [x11]
1276 ; -O0: stlxp w8, x14, x15, [x11]
1277 ; -O0: stlxp w8, x10, x9, [x11]
1278 ; -O0: eor x8, x10, x8
1279 ; -O0: eor x11, x9, x11
1280 ; -O0: orr x8, x8, x11
1281 ; -O0: subs x8, x8, #0
1283 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1284 ; -O1: ldaxp x0, x1, [x8]
1285 ; -O1: subs x9, x0, x2
1286 ; -O1: stlxp w11, x9, x10, [x8]
1287 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1291 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1292 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1293 ; -O0: subs w0, w8, w9
1294 ; -O0: bl __aarch64_ldadd1_relax
1296 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1297 ; -O1: bl __aarch64_ldadd1_relax
1298 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1302 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1303 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1304 ; -O0: subs w0, w8, w9
1305 ; -O0: bl __aarch64_ldadd1_acq
1307 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1308 ; -O1: bl __aarch64_ldadd1_acq
1309 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1313 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1314 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1315 ; -O0: subs w0, w8, w9
1316 ; -O0: bl __aarch64_ldadd1_rel
1318 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1319 ; -O1: bl __aarch64_ldadd1_rel
1320 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1324 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1325 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1326 ; -O0: subs w0, w8, w9
1327 ; -O0: bl __aarch64_ldadd1_acq_rel
1329 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1330 ; -O1: bl __aarch64_ldadd1_acq_rel
1331 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1335 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1336 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1337 ; -O0: subs w0, w8, w9
1338 ; -O0: bl __aarch64_ldadd1_acq_rel
1340 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1341 ; -O1: bl __aarch64_ldadd1_acq_rel
1342 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1346 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1347 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1348 ; -O0: subs w8, w9, w8
1349 ; -O0: bl __atomic_compare_exchange
1351 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1352 ; -O1: sub w8, w0, w20
1353 ; -O1: bl __atomic_compare_exchange
1354 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1358 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1359 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1360 ; -O0: subs w8, w9, w8
1361 ; -O0: bl __atomic_compare_exchange
1363 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1364 ; -O1: sub w8, w0, w20
1365 ; -O1: bl __atomic_compare_exchange
1366 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1370 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1371 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1372 ; -O0: subs w8, w9, w8
1373 ; -O0: bl __atomic_compare_exchange
1375 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1376 ; -O1: sub w8, w0, w20
1377 ; -O1: bl __atomic_compare_exchange
1378 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1382 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1383 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1384 ; -O0: subs w8, w9, w8
1385 ; -O0: bl __atomic_compare_exchange
1387 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1388 ; -O1: sub w8, w0, w20
1389 ; -O1: bl __atomic_compare_exchange
1390 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1394 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1395 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1396 ; -O0: subs w8, w9, w8
1397 ; -O0: bl __atomic_compare_exchange
1399 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1400 ; -O1: sub w8, w0, w20
1401 ; -O1: bl __atomic_compare_exchange
1402 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1406 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1407 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1408 ; -O0: subs w8, w9, w8
1409 ; -O0: bl __atomic_compare_exchange
1411 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1412 ; -O1: sub w8, w0, w20
1413 ; -O1: bl __atomic_compare_exchange
1414 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1418 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1419 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1420 ; -O0: subs w8, w9, w8
1421 ; -O0: bl __atomic_compare_exchange
1423 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1424 ; -O1: sub w8, w0, w20
1425 ; -O1: bl __atomic_compare_exchange
1426 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1430 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1431 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1432 ; -O0: subs w8, w9, w8
1433 ; -O0: bl __atomic_compare_exchange
1435 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1436 ; -O1: sub w8, w0, w20
1437 ; -O1: bl __atomic_compare_exchange
1438 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1442 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1443 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1444 ; -O0: subs w8, w9, w8
1445 ; -O0: bl __atomic_compare_exchange
1447 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1448 ; -O1: sub w8, w0, w20
1449 ; -O1: bl __atomic_compare_exchange
1450 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1454 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1455 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1456 ; -O0: subs w8, w9, w8
1457 ; -O0: bl __atomic_compare_exchange
1459 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1460 ; -O1: sub w8, w0, w20
1461 ; -O1: bl __atomic_compare_exchange
1462 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1466 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1467 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1468 ; -O0: subs x8, x9, x8
1469 ; -O0: bl __atomic_compare_exchange
1471 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1472 ; -O1: sub x8, x0, x20
1473 ; -O1: bl __atomic_compare_exchange
1474 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1478 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1479 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1480 ; -O0: subs x8, x9, x8
1481 ; -O0: bl __atomic_compare_exchange
1483 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1484 ; -O1: sub x8, x0, x20
1485 ; -O1: bl __atomic_compare_exchange
1486 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1490 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1491 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1492 ; -O0: subs x8, x9, x8
1493 ; -O0: bl __atomic_compare_exchange
1495 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1496 ; -O1: sub x8, x0, x20
1497 ; -O1: bl __atomic_compare_exchange
1498 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1502 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1503 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1504 ; -O0: subs x8, x9, x8
1505 ; -O0: bl __atomic_compare_exchange
1507 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1508 ; -O1: sub x8, x0, x20
1509 ; -O1: bl __atomic_compare_exchange
1510 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1514 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1515 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1516 ; -O0: subs x8, x9, x8
1517 ; -O0: bl __atomic_compare_exchange
1519 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1520 ; -O1: sub x8, x0, x20
1521 ; -O1: bl __atomic_compare_exchange
1522 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1526 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1527 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1528 ; -O0: subs x9, x8, x9
1529 ; -O0: and w11, w8, #0x1
1530 ; -O0: bl __atomic_compare_exchange
1532 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1533 ; -O1: ldp x0, x1, [x0]
1534 ; -O1: subs x8, x0, x21
1535 ; -O1: bl __atomic_compare_exchange
1536 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1540 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1541 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1542 ; -O0: subs x9, x8, x9
1543 ; -O0: and w11, w8, #0x1
1544 ; -O0: bl __atomic_compare_exchange
1546 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1547 ; -O1: ldp x0, x1, [x0]
1548 ; -O1: subs x8, x0, x21
1549 ; -O1: bl __atomic_compare_exchange
1550 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1554 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1555 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1556 ; -O0: subs x9, x8, x9
1557 ; -O0: and w11, w8, #0x1
1558 ; -O0: bl __atomic_compare_exchange
1560 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1561 ; -O1: ldp x0, x1, [x0]
1562 ; -O1: subs x8, x0, x21
1563 ; -O1: bl __atomic_compare_exchange
1564 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1568 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1569 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1570 ; -O0: subs x9, x8, x9
1571 ; -O0: and w11, w8, #0x1
1572 ; -O0: bl __atomic_compare_exchange
1574 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1575 ; -O1: ldp x0, x1, [x0]
1576 ; -O1: subs x8, x0, x21
1577 ; -O1: bl __atomic_compare_exchange
1578 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1582 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1583 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1584 ; -O0: subs x9, x8, x9
1585 ; -O0: and w11, w8, #0x1
1586 ; -O0: bl __atomic_compare_exchange
1588 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1589 ; -O1: ldp x0, x1, [x0]
1590 ; -O1: subs x8, x0, x21
1591 ; -O1: bl __atomic_compare_exchange
1592 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1596 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1597 ; -O0-LABEL: atomicrmw_and_i8_aligned_monotonic:
1599 ; -O0: bl __aarch64_ldclr1_relax
1601 ; -O1-LABEL: atomicrmw_and_i8_aligned_monotonic:
1603 ; -O1: bl __aarch64_ldclr1_relax
1604 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1608 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1609 ; -O0-LABEL: atomicrmw_and_i8_aligned_acquire:
1611 ; -O0: bl __aarch64_ldclr1_acq
1613 ; -O1-LABEL: atomicrmw_and_i8_aligned_acquire:
1615 ; -O1: bl __aarch64_ldclr1_acq
1616 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1620 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1621 ; -O0-LABEL: atomicrmw_and_i8_aligned_release:
1623 ; -O0: bl __aarch64_ldclr1_rel
1625 ; -O1-LABEL: atomicrmw_and_i8_aligned_release:
1627 ; -O1: bl __aarch64_ldclr1_rel
1628 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1632 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1633 ; -O0-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1635 ; -O0: bl __aarch64_ldclr1_acq_rel
1637 ; -O1-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1639 ; -O1: bl __aarch64_ldclr1_acq_rel
1640 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1644 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1645 ; -O0-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1647 ; -O0: bl __aarch64_ldclr1_acq_rel
1649 ; -O1-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1651 ; -O1: bl __aarch64_ldclr1_acq_rel
1652 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1656 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1657 ; -O0-LABEL: atomicrmw_and_i16_aligned_monotonic:
1659 ; -O0: bl __aarch64_ldclr2_relax
1661 ; -O1-LABEL: atomicrmw_and_i16_aligned_monotonic:
1663 ; -O1: bl __aarch64_ldclr2_relax
1664 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1668 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1669 ; -O0-LABEL: atomicrmw_and_i16_aligned_acquire:
1671 ; -O0: bl __aarch64_ldclr2_acq
1673 ; -O1-LABEL: atomicrmw_and_i16_aligned_acquire:
1675 ; -O1: bl __aarch64_ldclr2_acq
1676 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1680 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1681 ; -O0-LABEL: atomicrmw_and_i16_aligned_release:
1683 ; -O0: bl __aarch64_ldclr2_rel
1685 ; -O1-LABEL: atomicrmw_and_i16_aligned_release:
1687 ; -O1: bl __aarch64_ldclr2_rel
1688 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1692 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1693 ; -O0-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1695 ; -O0: bl __aarch64_ldclr2_acq_rel
1697 ; -O1-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1699 ; -O1: bl __aarch64_ldclr2_acq_rel
1700 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1704 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1705 ; -O0-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1707 ; -O0: bl __aarch64_ldclr2_acq_rel
1709 ; -O1-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1711 ; -O1: bl __aarch64_ldclr2_acq_rel
1712 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1716 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1717 ; -O0-LABEL: atomicrmw_and_i32_aligned_monotonic:
1719 ; -O0: bl __aarch64_ldclr4_relax
1721 ; -O1-LABEL: atomicrmw_and_i32_aligned_monotonic:
1723 ; -O1: bl __aarch64_ldclr4_relax
1724 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1728 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1729 ; -O0-LABEL: atomicrmw_and_i32_aligned_acquire:
1731 ; -O0: bl __aarch64_ldclr4_acq
1733 ; -O1-LABEL: atomicrmw_and_i32_aligned_acquire:
1735 ; -O1: bl __aarch64_ldclr4_acq
1736 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1740 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1741 ; -O0-LABEL: atomicrmw_and_i32_aligned_release:
1743 ; -O0: bl __aarch64_ldclr4_rel
1745 ; -O1-LABEL: atomicrmw_and_i32_aligned_release:
1747 ; -O1: bl __aarch64_ldclr4_rel
1748 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1752 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1753 ; -O0-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1755 ; -O0: bl __aarch64_ldclr4_acq_rel
1757 ; -O1-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1759 ; -O1: bl __aarch64_ldclr4_acq_rel
1760 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1764 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1765 ; -O0-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1767 ; -O0: bl __aarch64_ldclr4_acq_rel
1769 ; -O1-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1771 ; -O1: bl __aarch64_ldclr4_acq_rel
1772 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1776 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1777 ; -O0-LABEL: atomicrmw_and_i64_aligned_monotonic:
1779 ; -O0: bl __aarch64_ldclr8_relax
1781 ; -O1-LABEL: atomicrmw_and_i64_aligned_monotonic:
1783 ; -O1: bl __aarch64_ldclr8_relax
1784 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1788 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1789 ; -O0-LABEL: atomicrmw_and_i64_aligned_acquire:
1791 ; -O0: bl __aarch64_ldclr8_acq
1793 ; -O1-LABEL: atomicrmw_and_i64_aligned_acquire:
1795 ; -O1: bl __aarch64_ldclr8_acq
1796 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1800 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1801 ; -O0-LABEL: atomicrmw_and_i64_aligned_release:
1803 ; -O0: bl __aarch64_ldclr8_rel
1805 ; -O1-LABEL: atomicrmw_and_i64_aligned_release:
1807 ; -O1: bl __aarch64_ldclr8_rel
1808 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1812 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1813 ; -O0-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1815 ; -O0: bl __aarch64_ldclr8_acq_rel
1817 ; -O1-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1819 ; -O1: bl __aarch64_ldclr8_acq_rel
1820 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1824 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1825 ; -O0-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1827 ; -O0: bl __aarch64_ldclr8_acq_rel
1829 ; -O1-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1831 ; -O1: bl __aarch64_ldclr8_acq_rel
1832 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1836 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1837 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1838 ; -O0: and x14, x8, x10
1839 ; -O0: and x15, x8, x9
1840 ; -O0: ldxp x10, x9, [x11]
1843 ; -O0: stxp w8, x14, x15, [x11]
1844 ; -O0: stxp w8, x10, x9, [x11]
1845 ; -O0: eor x8, x10, x8
1846 ; -O0: eor x11, x9, x11
1847 ; -O0: orr x8, x8, x11
1848 ; -O0: subs x8, x8, #0
1850 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1851 ; -O1: ldxp x0, x1, [x8]
1852 ; -O1: and x9, x1, x3
1853 ; -O1: and x10, x0, x2
1854 ; -O1: stxp w11, x10, x9, [x8]
1855 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1859 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1860 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1861 ; -O0: and x14, x8, x10
1862 ; -O0: and x15, x8, x9
1863 ; -O0: ldaxp x10, x9, [x11]
1866 ; -O0: stxp w8, x14, x15, [x11]
1867 ; -O0: stxp w8, x10, x9, [x11]
1868 ; -O0: eor x8, x10, x8
1869 ; -O0: eor x11, x9, x11
1870 ; -O0: orr x8, x8, x11
1871 ; -O0: subs x8, x8, #0
1873 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1874 ; -O1: ldaxp x0, x1, [x8]
1875 ; -O1: and x9, x1, x3
1876 ; -O1: and x10, x0, x2
1877 ; -O1: stxp w11, x10, x9, [x8]
1878 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1882 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1883 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1884 ; -O0: and x14, x8, x10
1885 ; -O0: and x15, x8, x9
1886 ; -O0: ldxp x10, x9, [x11]
1889 ; -O0: stlxp w8, x14, x15, [x11]
1890 ; -O0: stlxp w8, x10, x9, [x11]
1891 ; -O0: eor x8, x10, x8
1892 ; -O0: eor x11, x9, x11
1893 ; -O0: orr x8, x8, x11
1894 ; -O0: subs x8, x8, #0
1896 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1897 ; -O1: ldxp x0, x1, [x8]
1898 ; -O1: and x9, x1, x3
1899 ; -O1: and x10, x0, x2
1900 ; -O1: stlxp w11, x10, x9, [x8]
1901 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1905 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1906 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1907 ; -O0: and x14, x8, x10
1908 ; -O0: and x15, x8, x9
1909 ; -O0: ldaxp x10, x9, [x11]
1912 ; -O0: stlxp w8, x14, x15, [x11]
1913 ; -O0: stlxp w8, x10, x9, [x11]
1914 ; -O0: eor x8, x10, x8
1915 ; -O0: eor x11, x9, x11
1916 ; -O0: orr x8, x8, x11
1917 ; -O0: subs x8, x8, #0
1919 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1920 ; -O1: ldaxp x0, x1, [x8]
1921 ; -O1: and x9, x1, x3
1922 ; -O1: and x10, x0, x2
1923 ; -O1: stlxp w11, x10, x9, [x8]
1924 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1928 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1929 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1930 ; -O0: and x14, x8, x10
1931 ; -O0: and x15, x8, x9
1932 ; -O0: ldaxp x10, x9, [x11]
1935 ; -O0: stlxp w8, x14, x15, [x11]
1936 ; -O0: stlxp w8, x10, x9, [x11]
1937 ; -O0: eor x8, x10, x8
1938 ; -O0: eor x11, x9, x11
1939 ; -O0: orr x8, x8, x11
1940 ; -O0: subs x8, x8, #0
1942 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1943 ; -O1: ldaxp x0, x1, [x8]
1944 ; -O1: and x9, x1, x3
1945 ; -O1: and x10, x0, x2
1946 ; -O1: stlxp w11, x10, x9, [x8]
1947 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1951 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1952 ; -O0-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1954 ; -O0: bl __aarch64_ldclr1_relax
1956 ; -O1-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1958 ; -O1: bl __aarch64_ldclr1_relax
1959 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1963 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1964 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acquire:
1966 ; -O0: bl __aarch64_ldclr1_acq
1968 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acquire:
1970 ; -O1: bl __aarch64_ldclr1_acq
1971 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1975 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1976 ; -O0-LABEL: atomicrmw_and_i8_unaligned_release:
1978 ; -O0: bl __aarch64_ldclr1_rel
1980 ; -O1-LABEL: atomicrmw_and_i8_unaligned_release:
1982 ; -O1: bl __aarch64_ldclr1_rel
1983 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1987 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1988 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1990 ; -O0: bl __aarch64_ldclr1_acq_rel
1992 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1994 ; -O1: bl __aarch64_ldclr1_acq_rel
1995 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1999 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2000 ; -O0-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2002 ; -O0: bl __aarch64_ldclr1_acq_rel
2004 ; -O1-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2006 ; -O1: bl __aarch64_ldclr1_acq_rel
2007 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
2011 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2012 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2013 ; -O0: and w8, w9, w8
2014 ; -O0: bl __atomic_compare_exchange
2016 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2017 ; -O1: and w8, w0, w20
2018 ; -O1: bl __atomic_compare_exchange
2019 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
2023 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2024 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
2025 ; -O0: and w8, w9, w8
2026 ; -O0: bl __atomic_compare_exchange
2028 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
2029 ; -O1: and w8, w0, w20
2030 ; -O1: bl __atomic_compare_exchange
2031 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
2035 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
2036 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
2037 ; -O0: and w8, w9, w8
2038 ; -O0: bl __atomic_compare_exchange
2040 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
2041 ; -O1: and w8, w0, w20
2042 ; -O1: bl __atomic_compare_exchange
2043 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
2047 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2048 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2049 ; -O0: and w8, w9, w8
2050 ; -O0: bl __atomic_compare_exchange
2052 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2053 ; -O1: and w8, w0, w20
2054 ; -O1: bl __atomic_compare_exchange
2055 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
2059 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2060 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2061 ; -O0: and w8, w9, w8
2062 ; -O0: bl __atomic_compare_exchange
2064 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2065 ; -O1: and w8, w0, w20
2066 ; -O1: bl __atomic_compare_exchange
2067 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
2071 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2072 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2073 ; -O0: and w8, w9, w8
2074 ; -O0: bl __atomic_compare_exchange
2076 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2077 ; -O1: and w8, w0, w20
2078 ; -O1: bl __atomic_compare_exchange
2079 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
2083 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2084 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
2085 ; -O0: and w8, w9, w8
2086 ; -O0: bl __atomic_compare_exchange
2088 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
2089 ; -O1: and w8, w0, w20
2090 ; -O1: bl __atomic_compare_exchange
2091 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
2095 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
2096 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
2097 ; -O0: and w8, w9, w8
2098 ; -O0: bl __atomic_compare_exchange
2100 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
2101 ; -O1: and w8, w0, w20
2102 ; -O1: bl __atomic_compare_exchange
2103 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
2107 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2108 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2109 ; -O0: and w8, w9, w8
2110 ; -O0: bl __atomic_compare_exchange
2112 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2113 ; -O1: and w8, w0, w20
2114 ; -O1: bl __atomic_compare_exchange
2115 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
2119 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2120 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2121 ; -O0: and w8, w9, w8
2122 ; -O0: bl __atomic_compare_exchange
2124 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2125 ; -O1: and w8, w0, w20
2126 ; -O1: bl __atomic_compare_exchange
2127 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
2131 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2132 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2133 ; -O0: and x8, x9, x8
2134 ; -O0: bl __atomic_compare_exchange
2136 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2137 ; -O1: and x8, x0, x20
2138 ; -O1: bl __atomic_compare_exchange
2139 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
2143 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2144 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
2145 ; -O0: and x8, x9, x8
2146 ; -O0: bl __atomic_compare_exchange
2148 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
2149 ; -O1: and x8, x0, x20
2150 ; -O1: bl __atomic_compare_exchange
2151 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
2155 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
2156 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
2157 ; -O0: and x8, x9, x8
2158 ; -O0: bl __atomic_compare_exchange
2160 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
2161 ; -O1: and x8, x0, x20
2162 ; -O1: bl __atomic_compare_exchange
2163 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
2167 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2168 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2169 ; -O0: and x8, x9, x8
2170 ; -O0: bl __atomic_compare_exchange
2172 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2173 ; -O1: and x8, x0, x20
2174 ; -O1: bl __atomic_compare_exchange
2175 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
2179 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2180 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2181 ; -O0: and x8, x9, x8
2182 ; -O0: bl __atomic_compare_exchange
2184 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2185 ; -O1: and x8, x0, x20
2186 ; -O1: bl __atomic_compare_exchange
2187 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
2191 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2192 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2193 ; -O0: and x9, x8, x9
2194 ; -O0: and x8, x8, x10
2195 ; -O0: bl __atomic_compare_exchange
2197 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2198 ; -O1: ldp x0, x1, [x0]
2199 ; -O1: and x8, x1, x19
2200 ; -O1: and x9, x0, x21
2201 ; -O1: bl __atomic_compare_exchange
2202 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
2206 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2207 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
2208 ; -O0: and x9, x8, x9
2209 ; -O0: and x8, x8, x10
2210 ; -O0: bl __atomic_compare_exchange
2212 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
2213 ; -O1: ldp x0, x1, [x0]
2214 ; -O1: and x8, x1, x19
2215 ; -O1: and x9, x0, x21
2216 ; -O1: bl __atomic_compare_exchange
2217 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
2221 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
2222 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
2223 ; -O0: and x9, x8, x9
2224 ; -O0: and x8, x8, x10
2225 ; -O0: bl __atomic_compare_exchange
2227 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
2228 ; -O1: ldp x0, x1, [x0]
2229 ; -O1: and x8, x1, x19
2230 ; -O1: and x9, x0, x21
2231 ; -O1: bl __atomic_compare_exchange
2232 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
2236 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2237 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2238 ; -O0: and x9, x8, x9
2239 ; -O0: and x8, x8, x10
2240 ; -O0: bl __atomic_compare_exchange
2242 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2243 ; -O1: ldp x0, x1, [x0]
2244 ; -O1: and x8, x1, x19
2245 ; -O1: and x9, x0, x21
2246 ; -O1: bl __atomic_compare_exchange
2247 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2251 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2252 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2253 ; -O0: and x9, x8, x9
2254 ; -O0: and x8, x8, x10
2255 ; -O0: bl __atomic_compare_exchange
2257 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2258 ; -O1: ldp x0, x1, [x0]
2259 ; -O1: and x8, x1, x19
2260 ; -O1: and x9, x0, x21
2261 ; -O1: bl __atomic_compare_exchange
2262 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2266 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2267 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2268 ; -O0: and w8, w10, w8
2270 ; -O0: ldaxrb w9, [x11]
2271 ; -O0: cmp w9, w10, uxtb
2272 ; -O0: stlxrb w8, w12, [x11]
2273 ; -O0: and w8, w9, #0xff
2274 ; -O0: subs w8, w8, w10, uxtb
2276 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2277 ; -O1: ldxrb w8, [x0]
2278 ; -O1: and w9, w8, w1
2280 ; -O1: stxrb w10, w9, [x0]
2281 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2285 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2286 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2287 ; -O0: and w8, w10, w8
2289 ; -O0: ldaxrb w9, [x11]
2290 ; -O0: cmp w9, w10, uxtb
2291 ; -O0: stlxrb w8, w12, [x11]
2292 ; -O0: and w8, w9, #0xff
2293 ; -O0: subs w8, w8, w10, uxtb
2295 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2296 ; -O1: ldaxrb w8, [x0]
2297 ; -O1: and w9, w8, w1
2299 ; -O1: stxrb w10, w9, [x0]
2300 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2304 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2305 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2306 ; -O0: and w8, w10, w8
2308 ; -O0: ldaxrb w9, [x11]
2309 ; -O0: cmp w9, w10, uxtb
2310 ; -O0: stlxrb w8, w12, [x11]
2311 ; -O0: and w8, w9, #0xff
2312 ; -O0: subs w8, w8, w10, uxtb
2314 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2315 ; -O1: ldxrb w8, [x0]
2316 ; -O1: and w9, w8, w1
2318 ; -O1: stlxrb w10, w9, [x0]
2319 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2323 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2324 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2325 ; -O0: and w8, w10, w8
2327 ; -O0: ldaxrb w9, [x11]
2328 ; -O0: cmp w9, w10, uxtb
2329 ; -O0: stlxrb w8, w12, [x11]
2330 ; -O0: and w8, w9, #0xff
2331 ; -O0: subs w8, w8, w10, uxtb
2333 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2334 ; -O1: ldaxrb w8, [x0]
2335 ; -O1: and w9, w8, w1
2337 ; -O1: stlxrb w10, w9, [x0]
2338 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2342 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2343 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2344 ; -O0: and w8, w10, w8
2346 ; -O0: ldaxrb w9, [x11]
2347 ; -O0: cmp w9, w10, uxtb
2348 ; -O0: stlxrb w8, w12, [x11]
2349 ; -O0: and w8, w9, #0xff
2350 ; -O0: subs w8, w8, w10, uxtb
2352 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2353 ; -O1: ldaxrb w8, [x0]
2354 ; -O1: and w9, w8, w1
2356 ; -O1: stlxrb w10, w9, [x0]
2357 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2361 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2362 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2363 ; -O0: and w9, w8, w9
2365 ; -O0: ldaxrh w9, [x11]
2366 ; -O0: cmp w9, w8, uxth
2367 ; -O0: stlxrh w10, w12, [x11]
2368 ; -O0: subs w8, w8, w9, uxth
2370 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2371 ; -O1: ldxrh w8, [x0]
2372 ; -O1: and w9, w8, w1
2374 ; -O1: stxrh w10, w9, [x0]
2375 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2379 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2380 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2381 ; -O0: and w9, w8, w9
2383 ; -O0: ldaxrh w9, [x11]
2384 ; -O0: cmp w9, w8, uxth
2385 ; -O0: stlxrh w10, w12, [x11]
2386 ; -O0: subs w8, w8, w9, uxth
2388 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2389 ; -O1: ldaxrh w8, [x0]
2390 ; -O1: and w9, w8, w1
2392 ; -O1: stxrh w10, w9, [x0]
2393 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2397 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2398 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2399 ; -O0: and w9, w8, w9
2401 ; -O0: ldaxrh w9, [x11]
2402 ; -O0: cmp w9, w8, uxth
2403 ; -O0: stlxrh w10, w12, [x11]
2404 ; -O0: subs w8, w8, w9, uxth
2406 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2407 ; -O1: ldxrh w8, [x0]
2408 ; -O1: and w9, w8, w1
2410 ; -O1: stlxrh w10, w9, [x0]
2411 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2415 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2416 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2417 ; -O0: and w9, w8, w9
2419 ; -O0: ldaxrh w9, [x11]
2420 ; -O0: cmp w9, w8, uxth
2421 ; -O0: stlxrh w10, w12, [x11]
2422 ; -O0: subs w8, w8, w9, uxth
2424 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2425 ; -O1: ldaxrh w8, [x0]
2426 ; -O1: and w9, w8, w1
2428 ; -O1: stlxrh w10, w9, [x0]
2429 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2433 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2434 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2435 ; -O0: and w9, w8, w9
2437 ; -O0: ldaxrh w9, [x11]
2438 ; -O0: cmp w9, w8, uxth
2439 ; -O0: stlxrh w10, w12, [x11]
2440 ; -O0: subs w8, w8, w9, uxth
2442 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2443 ; -O1: ldaxrh w8, [x0]
2444 ; -O1: and w9, w8, w1
2446 ; -O1: stlxrh w10, w9, [x0]
2447 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2451 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2452 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2453 ; -O0: and w9, w8, w9
2455 ; -O0: ldaxr w9, [x11]
2457 ; -O0: stlxr w10, w12, [x11]
2458 ; -O0: subs w8, w9, w8
2460 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2461 ; -O1: ldxr w8, [x0]
2462 ; -O1: and w9, w8, w1
2464 ; -O1: stxr w10, w9, [x0]
2465 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2469 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2470 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2471 ; -O0: and w9, w8, w9
2473 ; -O0: ldaxr w9, [x11]
2475 ; -O0: stlxr w10, w12, [x11]
2476 ; -O0: subs w8, w9, w8
2478 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2479 ; -O1: ldaxr w8, [x0]
2480 ; -O1: and w9, w8, w1
2482 ; -O1: stxr w10, w9, [x0]
2483 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2487 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2488 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2489 ; -O0: and w9, w8, w9
2491 ; -O0: ldaxr w9, [x11]
2493 ; -O0: stlxr w10, w12, [x11]
2494 ; -O0: subs w8, w9, w8
2496 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2497 ; -O1: ldxr w8, [x0]
2498 ; -O1: and w9, w8, w1
2500 ; -O1: stlxr w10, w9, [x0]
2501 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2505 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2506 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2507 ; -O0: and w9, w8, w9
2509 ; -O0: ldaxr w9, [x11]
2511 ; -O0: stlxr w10, w12, [x11]
2512 ; -O0: subs w8, w9, w8
2514 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2515 ; -O1: ldaxr w8, [x0]
2516 ; -O1: and w9, w8, w1
2518 ; -O1: stlxr w10, w9, [x0]
2519 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2523 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2524 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2525 ; -O0: and w9, w8, w9
2527 ; -O0: ldaxr w9, [x11]
2529 ; -O0: stlxr w10, w12, [x11]
2530 ; -O0: subs w8, w9, w8
2532 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2533 ; -O1: ldaxr w8, [x0]
2534 ; -O1: and w9, w8, w1
2536 ; -O1: stlxr w10, w9, [x0]
2537 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2541 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2542 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2543 ; -O0: and x9, x8, x9
2545 ; -O0: ldaxr x9, [x11]
2547 ; -O0: stlxr w10, x12, [x11]
2548 ; -O0: subs x8, x9, x8
2550 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2551 ; -O1: ldxr x0, [x8]
2552 ; -O1: and x9, x0, x1
2554 ; -O1: stxr w10, x9, [x8]
2555 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2559 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2560 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2561 ; -O0: and x9, x8, x9
2563 ; -O0: ldaxr x9, [x11]
2565 ; -O0: stlxr w10, x12, [x11]
2566 ; -O0: subs x8, x9, x8
2568 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2569 ; -O1: ldaxr x0, [x8]
2570 ; -O1: and x9, x0, x1
2572 ; -O1: stxr w10, x9, [x8]
2573 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2577 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2578 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2579 ; -O0: and x9, x8, x9
2581 ; -O0: ldaxr x9, [x11]
2583 ; -O0: stlxr w10, x12, [x11]
2584 ; -O0: subs x8, x9, x8
2586 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2587 ; -O1: ldxr x0, [x8]
2588 ; -O1: and x9, x0, x1
2590 ; -O1: stlxr w10, x9, [x8]
2591 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2595 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2596 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2597 ; -O0: and x9, x8, x9
2599 ; -O0: ldaxr x9, [x11]
2601 ; -O0: stlxr w10, x12, [x11]
2602 ; -O0: subs x8, x9, x8
2604 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2605 ; -O1: ldaxr x0, [x8]
2606 ; -O1: and x9, x0, x1
2608 ; -O1: stlxr w10, x9, [x8]
2609 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2613 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2614 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2615 ; -O0: and x9, x8, x9
2617 ; -O0: ldaxr x9, [x11]
2619 ; -O0: stlxr w10, x12, [x11]
2620 ; -O0: subs x8, x9, x8
2622 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2623 ; -O1: ldaxr x0, [x8]
2624 ; -O1: and x9, x0, x1
2626 ; -O1: stlxr w10, x9, [x8]
2627 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2631 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2632 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2633 ; -O0: and x9, x8, x9
2634 ; -O0: and x8, x8, x10
2637 ; -O0: ldxp x10, x9, [x11]
2640 ; -O0: stxp w8, x14, x15, [x11]
2641 ; -O0: stxp w8, x10, x9, [x11]
2642 ; -O0: eor x8, x10, x8
2643 ; -O0: eor x11, x9, x11
2644 ; -O0: orr x8, x8, x11
2645 ; -O0: subs x8, x8, #0
2647 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2648 ; -O1: ldxp x0, x1, [x8]
2649 ; -O1: and x9, x0, x2
2650 ; -O1: and x10, x1, x3
2653 ; -O1: stxp w11, x9, x10, [x8]
2654 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2658 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2659 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2660 ; -O0: and x9, x8, x9
2661 ; -O0: and x8, x8, x10
2664 ; -O0: ldaxp x10, x9, [x11]
2667 ; -O0: stxp w8, x14, x15, [x11]
2668 ; -O0: stxp w8, x10, x9, [x11]
2669 ; -O0: eor x8, x10, x8
2670 ; -O0: eor x11, x9, x11
2671 ; -O0: orr x8, x8, x11
2672 ; -O0: subs x8, x8, #0
2674 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2675 ; -O1: ldaxp x0, x1, [x8]
2676 ; -O1: and x9, x0, x2
2677 ; -O1: and x10, x1, x3
2680 ; -O1: stxp w11, x9, x10, [x8]
2681 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2685 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2686 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2687 ; -O0: and x9, x8, x9
2688 ; -O0: and x8, x8, x10
2691 ; -O0: ldxp x10, x9, [x11]
2694 ; -O0: stlxp w8, x14, x15, [x11]
2695 ; -O0: stlxp w8, x10, x9, [x11]
2696 ; -O0: eor x8, x10, x8
2697 ; -O0: eor x11, x9, x11
2698 ; -O0: orr x8, x8, x11
2699 ; -O0: subs x8, x8, #0
2701 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2702 ; -O1: ldxp x0, x1, [x8]
2703 ; -O1: and x9, x0, x2
2704 ; -O1: and x10, x1, x3
2707 ; -O1: stlxp w11, x9, x10, [x8]
2708 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2712 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2713 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2714 ; -O0: and x9, x8, x9
2715 ; -O0: and x8, x8, x10
2718 ; -O0: ldaxp x10, x9, [x11]
2721 ; -O0: stlxp w8, x14, x15, [x11]
2722 ; -O0: stlxp w8, x10, x9, [x11]
2723 ; -O0: eor x8, x10, x8
2724 ; -O0: eor x11, x9, x11
2725 ; -O0: orr x8, x8, x11
2726 ; -O0: subs x8, x8, #0
2728 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2729 ; -O1: ldaxp x0, x1, [x8]
2730 ; -O1: and x9, x0, x2
2731 ; -O1: and x10, x1, x3
2734 ; -O1: stlxp w11, x9, x10, [x8]
2735 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2739 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2740 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2741 ; -O0: and x9, x8, x9
2742 ; -O0: and x8, x8, x10
2745 ; -O0: ldaxp x10, x9, [x11]
2748 ; -O0: stlxp w8, x14, x15, [x11]
2749 ; -O0: stlxp w8, x10, x9, [x11]
2750 ; -O0: eor x8, x10, x8
2751 ; -O0: eor x11, x9, x11
2752 ; -O0: orr x8, x8, x11
2753 ; -O0: subs x8, x8, #0
2755 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2756 ; -O1: ldaxp x0, x1, [x8]
2757 ; -O1: and x9, x0, x2
2758 ; -O1: and x10, x1, x3
2761 ; -O1: stlxp w11, x9, x10, [x8]
2762 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2766 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2767 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2768 ; -O0: and w8, w10, w8
2770 ; -O0: ldaxrb w9, [x11]
2771 ; -O0: cmp w9, w10, uxtb
2772 ; -O0: stlxrb w8, w12, [x11]
2773 ; -O0: and w8, w9, #0xff
2774 ; -O0: subs w8, w8, w10, uxtb
2776 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2777 ; -O1: ldxrb w8, [x0]
2778 ; -O1: and w9, w8, w1
2780 ; -O1: stxrb w10, w9, [x0]
2781 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2785 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2786 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2787 ; -O0: and w8, w10, w8
2789 ; -O0: ldaxrb w9, [x11]
2790 ; -O0: cmp w9, w10, uxtb
2791 ; -O0: stlxrb w8, w12, [x11]
2792 ; -O0: and w8, w9, #0xff
2793 ; -O0: subs w8, w8, w10, uxtb
2795 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2796 ; -O1: ldaxrb w8, [x0]
2797 ; -O1: and w9, w8, w1
2799 ; -O1: stxrb w10, w9, [x0]
2800 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2804 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2805 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2806 ; -O0: and w8, w10, w8
2808 ; -O0: ldaxrb w9, [x11]
2809 ; -O0: cmp w9, w10, uxtb
2810 ; -O0: stlxrb w8, w12, [x11]
2811 ; -O0: and w8, w9, #0xff
2812 ; -O0: subs w8, w8, w10, uxtb
2814 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2815 ; -O1: ldxrb w8, [x0]
2816 ; -O1: and w9, w8, w1
2818 ; -O1: stlxrb w10, w9, [x0]
2819 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2823 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2824 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2825 ; -O0: and w8, w10, w8
2827 ; -O0: ldaxrb w9, [x11]
2828 ; -O0: cmp w9, w10, uxtb
2829 ; -O0: stlxrb w8, w12, [x11]
2830 ; -O0: and w8, w9, #0xff
2831 ; -O0: subs w8, w8, w10, uxtb
2833 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2834 ; -O1: ldaxrb w8, [x0]
2835 ; -O1: and w9, w8, w1
2837 ; -O1: stlxrb w10, w9, [x0]
2838 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2842 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2843 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2844 ; -O0: and w8, w10, w8
2846 ; -O0: ldaxrb w9, [x11]
2847 ; -O0: cmp w9, w10, uxtb
2848 ; -O0: stlxrb w8, w12, [x11]
2849 ; -O0: and w8, w9, #0xff
2850 ; -O0: subs w8, w8, w10, uxtb
2852 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2853 ; -O1: ldaxrb w8, [x0]
2854 ; -O1: and w9, w8, w1
2856 ; -O1: stlxrb w10, w9, [x0]
2857 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2861 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2862 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2863 ; -O0: and w8, w9, w8
2865 ; -O0: bl __atomic_compare_exchange
2867 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2868 ; -O1: and w8, w0, w20
2870 ; -O1: bl __atomic_compare_exchange
2871 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2875 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2876 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2877 ; -O0: and w8, w9, w8
2879 ; -O0: bl __atomic_compare_exchange
2881 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2882 ; -O1: and w8, w0, w20
2884 ; -O1: bl __atomic_compare_exchange
2885 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2889 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2890 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2891 ; -O0: and w8, w9, w8
2893 ; -O0: bl __atomic_compare_exchange
2895 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2896 ; -O1: and w8, w0, w20
2898 ; -O1: bl __atomic_compare_exchange
2899 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2903 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2904 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2905 ; -O0: and w8, w9, w8
2907 ; -O0: bl __atomic_compare_exchange
2909 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2910 ; -O1: and w8, w0, w20
2912 ; -O1: bl __atomic_compare_exchange
2913 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2917 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2918 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2919 ; -O0: and w8, w9, w8
2921 ; -O0: bl __atomic_compare_exchange
2923 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2924 ; -O1: and w8, w0, w20
2926 ; -O1: bl __atomic_compare_exchange
2927 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2931 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2932 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2933 ; -O0: and w8, w9, w8
2935 ; -O0: bl __atomic_compare_exchange
2937 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2938 ; -O1: and w8, w0, w20
2940 ; -O1: bl __atomic_compare_exchange
2941 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2945 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2946 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2947 ; -O0: and w8, w9, w8
2949 ; -O0: bl __atomic_compare_exchange
2951 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2952 ; -O1: and w8, w0, w20
2954 ; -O1: bl __atomic_compare_exchange
2955 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2959 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2960 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2961 ; -O0: and w8, w9, w8
2963 ; -O0: bl __atomic_compare_exchange
2965 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2966 ; -O1: and w8, w0, w20
2968 ; -O1: bl __atomic_compare_exchange
2969 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2973 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2974 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2975 ; -O0: and w8, w9, w8
2977 ; -O0: bl __atomic_compare_exchange
2979 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2980 ; -O1: and w8, w0, w20
2982 ; -O1: bl __atomic_compare_exchange
2983 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2987 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2988 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2989 ; -O0: and w8, w9, w8
2991 ; -O0: bl __atomic_compare_exchange
2993 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2994 ; -O1: and w8, w0, w20
2996 ; -O1: bl __atomic_compare_exchange
2997 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
3001 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3002 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3003 ; -O0: and x8, x9, x8
3005 ; -O0: bl __atomic_compare_exchange
3007 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3008 ; -O1: and x8, x0, x20
3010 ; -O1: bl __atomic_compare_exchange
3011 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
3015 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3016 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3017 ; -O0: and x8, x9, x8
3019 ; -O0: bl __atomic_compare_exchange
3021 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3022 ; -O1: and x8, x0, x20
3024 ; -O1: bl __atomic_compare_exchange
3025 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
3029 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
3030 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
3031 ; -O0: and x8, x9, x8
3033 ; -O0: bl __atomic_compare_exchange
3035 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
3036 ; -O1: and x8, x0, x20
3038 ; -O1: bl __atomic_compare_exchange
3039 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
3043 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3044 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3045 ; -O0: and x8, x9, x8
3047 ; -O0: bl __atomic_compare_exchange
3049 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3050 ; -O1: and x8, x0, x20
3052 ; -O1: bl __atomic_compare_exchange
3053 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
3057 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3058 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3059 ; -O0: and x8, x9, x8
3061 ; -O0: bl __atomic_compare_exchange
3063 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3064 ; -O1: and x8, x0, x20
3066 ; -O1: bl __atomic_compare_exchange
3067 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
3071 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3072 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3073 ; -O0: and x9, x8, x9
3074 ; -O0: and x8, x8, x10
3077 ; -O0: bl __atomic_compare_exchange
3079 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3080 ; -O1: ldp x0, x1, [x0]
3081 ; -O1: and x8, x1, x19
3082 ; -O1: and x9, x0, x21
3085 ; -O1: bl __atomic_compare_exchange
3086 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
3090 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3091 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3092 ; -O0: and x9, x8, x9
3093 ; -O0: and x8, x8, x10
3096 ; -O0: bl __atomic_compare_exchange
3098 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3099 ; -O1: ldp x0, x1, [x0]
3100 ; -O1: and x8, x1, x19
3101 ; -O1: and x9, x0, x21
3104 ; -O1: bl __atomic_compare_exchange
3105 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
3109 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
3110 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
3111 ; -O0: and x9, x8, x9
3112 ; -O0: and x8, x8, x10
3115 ; -O0: bl __atomic_compare_exchange
3117 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
3118 ; -O1: ldp x0, x1, [x0]
3119 ; -O1: and x8, x1, x19
3120 ; -O1: and x9, x0, x21
3123 ; -O1: bl __atomic_compare_exchange
3124 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
3128 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3129 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3130 ; -O0: and x9, x8, x9
3131 ; -O0: and x8, x8, x10
3134 ; -O0: bl __atomic_compare_exchange
3136 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3137 ; -O1: ldp x0, x1, [x0]
3138 ; -O1: and x8, x1, x19
3139 ; -O1: and x9, x0, x21
3142 ; -O1: bl __atomic_compare_exchange
3143 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
3147 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3148 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3149 ; -O0: and x9, x8, x9
3150 ; -O0: and x8, x8, x10
3153 ; -O0: bl __atomic_compare_exchange
3155 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3156 ; -O1: ldp x0, x1, [x0]
3157 ; -O1: and x8, x1, x19
3158 ; -O1: and x9, x0, x21
3161 ; -O1: bl __atomic_compare_exchange
3162 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
3166 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3167 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
3168 ; CHECK: bl __aarch64_ldset1_relax
3169 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3173 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
3174 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
3175 ; CHECK: bl __aarch64_ldset1_acq
3176 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3180 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
3181 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
3182 ; CHECK: bl __aarch64_ldset1_rel
3183 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3187 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3188 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3189 ; CHECK: bl __aarch64_ldset1_acq_rel
3190 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3194 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3195 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3196 ; CHECK: bl __aarch64_ldset1_acq_rel
3197 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3201 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3202 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
3203 ; CHECK: bl __aarch64_ldset2_relax
3204 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
3208 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
3209 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
3210 ; CHECK: bl __aarch64_ldset2_acq
3211 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
3215 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
3216 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
3217 ; CHECK: bl __aarch64_ldset2_rel
3218 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
3222 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3223 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3224 ; CHECK: bl __aarch64_ldset2_acq_rel
3225 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
3229 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3230 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3231 ; CHECK: bl __aarch64_ldset2_acq_rel
3232 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
3236 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3237 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
3238 ; CHECK: bl __aarch64_ldset4_relax
3239 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
3243 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
3244 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
3245 ; CHECK: bl __aarch64_ldset4_acq
3246 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
3250 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
3251 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
3252 ; CHECK: bl __aarch64_ldset4_rel
3253 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
3257 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3258 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
3259 ; CHECK: bl __aarch64_ldset4_acq_rel
3260 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
3264 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3265 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
3266 ; CHECK: bl __aarch64_ldset4_acq_rel
3267 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
3271 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3272 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
3273 ; CHECK: bl __aarch64_ldset8_relax
3274 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
3278 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
3279 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
3280 ; CHECK: bl __aarch64_ldset8_acq
3281 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
3285 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
3286 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
3287 ; CHECK: bl __aarch64_ldset8_rel
3288 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
3292 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3293 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
3294 ; CHECK: bl __aarch64_ldset8_acq_rel
3295 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
3299 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3300 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
3301 ; CHECK: bl __aarch64_ldset8_acq_rel
3302 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
3306 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3307 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
3308 ; -O0: orr x14, x8, x10
3309 ; -O0: orr x15, x8, x9
3310 ; -O0: ldxp x10, x9, [x11]
3313 ; -O0: stxp w8, x14, x15, [x11]
3314 ; -O0: stxp w8, x10, x9, [x11]
3315 ; -O0: eor x8, x10, x8
3316 ; -O0: eor x11, x9, x11
3317 ; -O0: orr x8, x8, x11
3318 ; -O0: subs x8, x8, #0
3320 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
3321 ; -O1: ldxp x0, x1, [x8]
3322 ; -O1: orr x9, x1, x3
3323 ; -O1: orr x10, x0, x2
3324 ; -O1: stxp w11, x10, x9, [x8]
3325 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
3329 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
3330 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
3331 ; -O0: orr x14, x8, x10
3332 ; -O0: orr x15, x8, x9
3333 ; -O0: ldaxp x10, x9, [x11]
3336 ; -O0: stxp w8, x14, x15, [x11]
3337 ; -O0: stxp w8, x10, x9, [x11]
3338 ; -O0: eor x8, x10, x8
3339 ; -O0: eor x11, x9, x11
3340 ; -O0: orr x8, x8, x11
3341 ; -O0: subs x8, x8, #0
3343 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
3344 ; -O1: ldaxp x0, x1, [x8]
3345 ; -O1: orr x9, x1, x3
3346 ; -O1: orr x10, x0, x2
3347 ; -O1: stxp w11, x10, x9, [x8]
3348 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
3352 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
3353 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
3354 ; -O0: orr x14, x8, x10
3355 ; -O0: orr x15, x8, x9
3356 ; -O0: ldxp x10, x9, [x11]
3359 ; -O0: stlxp w8, x14, x15, [x11]
3360 ; -O0: stlxp w8, x10, x9, [x11]
3361 ; -O0: eor x8, x10, x8
3362 ; -O0: eor x11, x9, x11
3363 ; -O0: orr x8, x8, x11
3364 ; -O0: subs x8, x8, #0
3366 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
3367 ; -O1: ldxp x0, x1, [x8]
3368 ; -O1: orr x9, x1, x3
3369 ; -O1: orr x10, x0, x2
3370 ; -O1: stlxp w11, x10, x9, [x8]
3371 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
3375 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3376 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3377 ; -O0: orr x14, x8, x10
3378 ; -O0: orr x15, x8, x9
3379 ; -O0: ldaxp x10, x9, [x11]
3382 ; -O0: stlxp w8, x14, x15, [x11]
3383 ; -O0: stlxp w8, x10, x9, [x11]
3384 ; -O0: eor x8, x10, x8
3385 ; -O0: eor x11, x9, x11
3386 ; -O0: orr x8, x8, x11
3387 ; -O0: subs x8, x8, #0
3389 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3390 ; -O1: ldaxp x0, x1, [x8]
3391 ; -O1: orr x9, x1, x3
3392 ; -O1: orr x10, x0, x2
3393 ; -O1: stlxp w11, x10, x9, [x8]
3394 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
3398 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3399 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3400 ; -O0: orr x14, x8, x10
3401 ; -O0: orr x15, x8, x9
3402 ; -O0: ldaxp x10, x9, [x11]
3405 ; -O0: stlxp w8, x14, x15, [x11]
3406 ; -O0: stlxp w8, x10, x9, [x11]
3407 ; -O0: eor x8, x10, x8
3408 ; -O0: eor x11, x9, x11
3409 ; -O0: orr x8, x8, x11
3410 ; -O0: subs x8, x8, #0
3412 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3413 ; -O1: ldaxp x0, x1, [x8]
3414 ; -O1: orr x9, x1, x3
3415 ; -O1: orr x10, x0, x2
3416 ; -O1: stlxp w11, x10, x9, [x8]
3417 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
3421 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3422 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
3423 ; CHECK: bl __aarch64_ldset1_relax
3424 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3428 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3429 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
3430 ; CHECK: bl __aarch64_ldset1_acq
3431 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3435 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3436 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3437 ; CHECK: bl __aarch64_ldset1_rel
3438 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3442 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3443 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3444 ; CHECK: bl __aarch64_ldset1_acq_rel
3445 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3449 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3450 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3451 ; CHECK: bl __aarch64_ldset1_acq_rel
3452 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3456 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3457 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3458 ; -O0: orr w8, w9, w8
3459 ; -O0: bl __atomic_compare_exchange
3461 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3462 ; -O1: orr w8, w0, w20
3463 ; -O1: bl __atomic_compare_exchange
3464 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3468 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3469 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3470 ; -O0: orr w8, w9, w8
3471 ; -O0: bl __atomic_compare_exchange
3473 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3474 ; -O1: orr w8, w0, w20
3475 ; -O1: bl __atomic_compare_exchange
3476 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3480 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3481 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3482 ; -O0: orr w8, w9, w8
3483 ; -O0: bl __atomic_compare_exchange
3485 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3486 ; -O1: orr w8, w0, w20
3487 ; -O1: bl __atomic_compare_exchange
3488 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3492 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3493 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3494 ; -O0: orr w8, w9, w8
3495 ; -O0: bl __atomic_compare_exchange
3497 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3498 ; -O1: orr w8, w0, w20
3499 ; -O1: bl __atomic_compare_exchange
3500 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3504 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3505 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3506 ; -O0: orr w8, w9, w8
3507 ; -O0: bl __atomic_compare_exchange
3509 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3510 ; -O1: orr w8, w0, w20
3511 ; -O1: bl __atomic_compare_exchange
3512 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3516 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3517 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3518 ; -O0: orr w8, w9, w8
3519 ; -O0: bl __atomic_compare_exchange
3521 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3522 ; -O1: orr w8, w0, w20
3523 ; -O1: bl __atomic_compare_exchange
3524 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3528 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3529 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3530 ; -O0: orr w8, w9, w8
3531 ; -O0: bl __atomic_compare_exchange
3533 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3534 ; -O1: orr w8, w0, w20
3535 ; -O1: bl __atomic_compare_exchange
3536 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3540 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3541 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3542 ; -O0: orr w8, w9, w8
3543 ; -O0: bl __atomic_compare_exchange
3545 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3546 ; -O1: orr w8, w0, w20
3547 ; -O1: bl __atomic_compare_exchange
3548 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3552 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3553 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3554 ; -O0: orr w8, w9, w8
3555 ; -O0: bl __atomic_compare_exchange
3557 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3558 ; -O1: orr w8, w0, w20
3559 ; -O1: bl __atomic_compare_exchange
3560 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3564 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3565 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3566 ; -O0: orr w8, w9, w8
3567 ; -O0: bl __atomic_compare_exchange
3569 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3570 ; -O1: orr w8, w0, w20
3571 ; -O1: bl __atomic_compare_exchange
3572 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3576 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3577 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3578 ; -O0: orr x8, x9, x8
3579 ; -O0: bl __atomic_compare_exchange
3581 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3582 ; -O1: orr x8, x0, x20
3583 ; -O1: bl __atomic_compare_exchange
3584 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3588 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3589 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3590 ; -O0: orr x8, x9, x8
3591 ; -O0: bl __atomic_compare_exchange
3593 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3594 ; -O1: orr x8, x0, x20
3595 ; -O1: bl __atomic_compare_exchange
3596 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3600 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3601 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3602 ; -O0: orr x8, x9, x8
3603 ; -O0: bl __atomic_compare_exchange
3605 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3606 ; -O1: orr x8, x0, x20
3607 ; -O1: bl __atomic_compare_exchange
3608 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3612 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3613 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3614 ; -O0: orr x8, x9, x8
3615 ; -O0: bl __atomic_compare_exchange
3617 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3618 ; -O1: orr x8, x0, x20
3619 ; -O1: bl __atomic_compare_exchange
3620 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3624 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3625 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3626 ; -O0: orr x8, x9, x8
3627 ; -O0: bl __atomic_compare_exchange
3629 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3630 ; -O1: orr x8, x0, x20
3631 ; -O1: bl __atomic_compare_exchange
3632 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3636 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3637 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3638 ; -O0: orr x9, x8, x9
3639 ; -O0: orr x8, x8, x10
3640 ; -O0: bl __atomic_compare_exchange
3642 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3643 ; -O1: ldp x0, x1, [x0]
3644 ; -O1: orr x8, x1, x19
3645 ; -O1: orr x9, x0, x21
3646 ; -O1: bl __atomic_compare_exchange
3647 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3651 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3652 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3653 ; -O0: orr x9, x8, x9
3654 ; -O0: orr x8, x8, x10
3655 ; -O0: bl __atomic_compare_exchange
3657 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3658 ; -O1: ldp x0, x1, [x0]
3659 ; -O1: orr x8, x1, x19
3660 ; -O1: orr x9, x0, x21
3661 ; -O1: bl __atomic_compare_exchange
3662 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3666 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3667 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3668 ; -O0: orr x9, x8, x9
3669 ; -O0: orr x8, x8, x10
3670 ; -O0: bl __atomic_compare_exchange
3672 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3673 ; -O1: ldp x0, x1, [x0]
3674 ; -O1: orr x8, x1, x19
3675 ; -O1: orr x9, x0, x21
3676 ; -O1: bl __atomic_compare_exchange
3677 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3681 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3682 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3683 ; -O0: orr x9, x8, x9
3684 ; -O0: orr x8, x8, x10
3685 ; -O0: bl __atomic_compare_exchange
3687 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3688 ; -O1: ldp x0, x1, [x0]
3689 ; -O1: orr x8, x1, x19
3690 ; -O1: orr x9, x0, x21
3691 ; -O1: bl __atomic_compare_exchange
3692 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3696 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3697 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3698 ; -O0: orr x9, x8, x9
3699 ; -O0: orr x8, x8, x10
3700 ; -O0: bl __atomic_compare_exchange
3702 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3703 ; -O1: ldp x0, x1, [x0]
3704 ; -O1: orr x8, x1, x19
3705 ; -O1: orr x9, x0, x21
3706 ; -O1: bl __atomic_compare_exchange
3707 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3711 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3712 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3713 ; CHECK: bl __aarch64_ldeor1_relax
3714 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3718 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3719 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3720 ; CHECK: bl __aarch64_ldeor1_acq
3721 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3725 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3726 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3727 ; CHECK: bl __aarch64_ldeor1_rel
3728 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3732 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3733 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3734 ; CHECK: bl __aarch64_ldeor1_acq_rel
3735 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3739 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3740 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3741 ; CHECK: bl __aarch64_ldeor1_acq_rel
3742 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3746 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3747 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3748 ; CHECK: bl __aarch64_ldeor2_relax
3749 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3753 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3754 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3755 ; CHECK: bl __aarch64_ldeor2_acq
3756 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3760 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3761 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3762 ; CHECK: bl __aarch64_ldeor2_rel
3763 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3767 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3768 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3769 ; CHECK: bl __aarch64_ldeor2_acq_rel
3770 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3774 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3775 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3776 ; CHECK: bl __aarch64_ldeor2_acq_rel
3777 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3781 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3782 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3783 ; CHECK: bl __aarch64_ldeor4_relax
3784 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3788 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3789 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3790 ; CHECK: bl __aarch64_ldeor4_acq
3791 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3795 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3796 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3797 ; CHECK: bl __aarch64_ldeor4_rel
3798 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3802 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3803 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3804 ; CHECK: bl __aarch64_ldeor4_acq_rel
3805 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3809 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3810 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3811 ; CHECK: bl __aarch64_ldeor4_acq_rel
3812 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3816 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3817 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3818 ; CHECK: bl __aarch64_ldeor8_relax
3819 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3823 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3824 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3825 ; CHECK: bl __aarch64_ldeor8_acq
3826 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3830 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3831 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3832 ; CHECK: bl __aarch64_ldeor8_rel
3833 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3837 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3838 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3839 ; CHECK: bl __aarch64_ldeor8_acq_rel
3840 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3844 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3845 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3846 ; CHECK: bl __aarch64_ldeor8_acq_rel
3847 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3851 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3852 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3853 ; -O0: eor x14, x8, x10
3854 ; -O0: eor x15, x8, x9
3855 ; -O0: ldxp x10, x9, [x11]
3858 ; -O0: stxp w8, x14, x15, [x11]
3859 ; -O0: stxp w8, x10, x9, [x11]
3860 ; -O0: eor x8, x10, x8
3861 ; -O0: eor x11, x9, x11
3862 ; -O0: orr x8, x8, x11
3863 ; -O0: subs x8, x8, #0
3865 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3866 ; -O1: ldxp x0, x1, [x8]
3867 ; -O1: eor x9, x1, x3
3868 ; -O1: eor x10, x0, x2
3869 ; -O1: stxp w11, x10, x9, [x8]
3870 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3874 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3875 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3876 ; -O0: eor x14, x8, x10
3877 ; -O0: eor x15, x8, x9
3878 ; -O0: ldaxp x10, x9, [x11]
3881 ; -O0: stxp w8, x14, x15, [x11]
3882 ; -O0: stxp w8, x10, x9, [x11]
3883 ; -O0: eor x8, x10, x8
3884 ; -O0: eor x11, x9, x11
3885 ; -O0: orr x8, x8, x11
3886 ; -O0: subs x8, x8, #0
3888 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3889 ; -O1: ldaxp x0, x1, [x8]
3890 ; -O1: eor x9, x1, x3
3891 ; -O1: eor x10, x0, x2
3892 ; -O1: stxp w11, x10, x9, [x8]
3893 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3897 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3898 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3899 ; -O0: eor x14, x8, x10
3900 ; -O0: eor x15, x8, x9
3901 ; -O0: ldxp x10, x9, [x11]
3904 ; -O0: stlxp w8, x14, x15, [x11]
3905 ; -O0: stlxp w8, x10, x9, [x11]
3906 ; -O0: eor x8, x10, x8
3907 ; -O0: eor x11, x9, x11
3908 ; -O0: orr x8, x8, x11
3909 ; -O0: subs x8, x8, #0
3911 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3912 ; -O1: ldxp x0, x1, [x8]
3913 ; -O1: eor x9, x1, x3
3914 ; -O1: eor x10, x0, x2
3915 ; -O1: stlxp w11, x10, x9, [x8]
3916 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3920 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3921 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3922 ; -O0: eor x14, x8, x10
3923 ; -O0: eor x15, x8, x9
3924 ; -O0: ldaxp x10, x9, [x11]
3927 ; -O0: stlxp w8, x14, x15, [x11]
3928 ; -O0: stlxp w8, x10, x9, [x11]
3929 ; -O0: eor x8, x10, x8
3930 ; -O0: eor x11, x9, x11
3931 ; -O0: orr x8, x8, x11
3932 ; -O0: subs x8, x8, #0
3934 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3935 ; -O1: ldaxp x0, x1, [x8]
3936 ; -O1: eor x9, x1, x3
3937 ; -O1: eor x10, x0, x2
3938 ; -O1: stlxp w11, x10, x9, [x8]
3939 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3943 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3944 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3945 ; -O0: eor x14, x8, x10
3946 ; -O0: eor x15, x8, x9
3947 ; -O0: ldaxp x10, x9, [x11]
3950 ; -O0: stlxp w8, x14, x15, [x11]
3951 ; -O0: stlxp w8, x10, x9, [x11]
3952 ; -O0: eor x8, x10, x8
3953 ; -O0: eor x11, x9, x11
3954 ; -O0: orr x8, x8, x11
3955 ; -O0: subs x8, x8, #0
3957 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3958 ; -O1: ldaxp x0, x1, [x8]
3959 ; -O1: eor x9, x1, x3
3960 ; -O1: eor x10, x0, x2
3961 ; -O1: stlxp w11, x10, x9, [x8]
3962 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3966 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3967 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3968 ; CHECK: bl __aarch64_ldeor1_relax
3969 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3973 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3974 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3975 ; CHECK: bl __aarch64_ldeor1_acq
3976 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3980 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3981 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3982 ; CHECK: bl __aarch64_ldeor1_rel
3983 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3987 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3988 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3989 ; CHECK: bl __aarch64_ldeor1_acq_rel
3990 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3994 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3995 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3996 ; CHECK: bl __aarch64_ldeor1_acq_rel
3997 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
4001 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4002 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
4003 ; -O0: eor w8, w9, w8
4004 ; -O0: bl __atomic_compare_exchange
4006 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
4007 ; -O1: eor w8, w0, w20
4008 ; -O1: bl __atomic_compare_exchange
4009 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
4013 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4014 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
4015 ; -O0: eor w8, w9, w8
4016 ; -O0: bl __atomic_compare_exchange
4018 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
4019 ; -O1: eor w8, w0, w20
4020 ; -O1: bl __atomic_compare_exchange
4021 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
4025 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
4026 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
4027 ; -O0: eor w8, w9, w8
4028 ; -O0: bl __atomic_compare_exchange
4030 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
4031 ; -O1: eor w8, w0, w20
4032 ; -O1: bl __atomic_compare_exchange
4033 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
4037 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4038 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
4039 ; -O0: eor w8, w9, w8
4040 ; -O0: bl __atomic_compare_exchange
4042 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
4043 ; -O1: eor w8, w0, w20
4044 ; -O1: bl __atomic_compare_exchange
4045 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
4049 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4050 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
4051 ; -O0: eor w8, w9, w8
4052 ; -O0: bl __atomic_compare_exchange
4054 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
4055 ; -O1: eor w8, w0, w20
4056 ; -O1: bl __atomic_compare_exchange
4057 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
4061 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4062 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
4063 ; -O0: eor w8, w9, w8
4064 ; -O0: bl __atomic_compare_exchange
4066 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
4067 ; -O1: eor w8, w0, w20
4068 ; -O1: bl __atomic_compare_exchange
4069 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
4073 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4074 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
4075 ; -O0: eor w8, w9, w8
4076 ; -O0: bl __atomic_compare_exchange
4078 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
4079 ; -O1: eor w8, w0, w20
4080 ; -O1: bl __atomic_compare_exchange
4081 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
4085 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
4086 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
4087 ; -O0: eor w8, w9, w8
4088 ; -O0: bl __atomic_compare_exchange
4090 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
4091 ; -O1: eor w8, w0, w20
4092 ; -O1: bl __atomic_compare_exchange
4093 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
4097 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4098 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
4099 ; -O0: eor w8, w9, w8
4100 ; -O0: bl __atomic_compare_exchange
4102 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
4103 ; -O1: eor w8, w0, w20
4104 ; -O1: bl __atomic_compare_exchange
4105 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
4109 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4110 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
4111 ; -O0: eor w8, w9, w8
4112 ; -O0: bl __atomic_compare_exchange
4114 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
4115 ; -O1: eor w8, w0, w20
4116 ; -O1: bl __atomic_compare_exchange
4117 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
4121 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4122 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
4123 ; -O0: eor x8, x9, x8
4124 ; -O0: bl __atomic_compare_exchange
4126 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
4127 ; -O1: eor x8, x0, x20
4128 ; -O1: bl __atomic_compare_exchange
4129 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
4133 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4134 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
4135 ; -O0: eor x8, x9, x8
4136 ; -O0: bl __atomic_compare_exchange
4138 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
4139 ; -O1: eor x8, x0, x20
4140 ; -O1: bl __atomic_compare_exchange
4141 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
4145 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
4146 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
4147 ; -O0: eor x8, x9, x8
4148 ; -O0: bl __atomic_compare_exchange
4150 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
4151 ; -O1: eor x8, x0, x20
4152 ; -O1: bl __atomic_compare_exchange
4153 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
4157 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4158 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
4159 ; -O0: eor x8, x9, x8
4160 ; -O0: bl __atomic_compare_exchange
4162 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
4163 ; -O1: eor x8, x0, x20
4164 ; -O1: bl __atomic_compare_exchange
4165 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
4169 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4170 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
4171 ; -O0: eor x8, x9, x8
4172 ; -O0: bl __atomic_compare_exchange
4174 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
4175 ; -O1: eor x8, x0, x20
4176 ; -O1: bl __atomic_compare_exchange
4177 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
4181 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4182 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
4183 ; -O0: eor x9, x8, x9
4184 ; -O0: eor x8, x8, x10
4185 ; -O0: bl __atomic_compare_exchange
4187 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
4188 ; -O1: ldp x0, x1, [x0]
4189 ; -O1: eor x8, x1, x19
4190 ; -O1: eor x9, x0, x21
4191 ; -O1: bl __atomic_compare_exchange
4192 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
4196 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4197 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
4198 ; -O0: eor x9, x8, x9
4199 ; -O0: eor x8, x8, x10
4200 ; -O0: bl __atomic_compare_exchange
4202 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
4203 ; -O1: ldp x0, x1, [x0]
4204 ; -O1: eor x8, x1, x19
4205 ; -O1: eor x9, x0, x21
4206 ; -O1: bl __atomic_compare_exchange
4207 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
4211 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
4212 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
4213 ; -O0: eor x9, x8, x9
4214 ; -O0: eor x8, x8, x10
4215 ; -O0: bl __atomic_compare_exchange
4217 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
4218 ; -O1: ldp x0, x1, [x0]
4219 ; -O1: eor x8, x1, x19
4220 ; -O1: eor x9, x0, x21
4221 ; -O1: bl __atomic_compare_exchange
4222 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
4226 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4227 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
4228 ; -O0: eor x9, x8, x9
4229 ; -O0: eor x8, x8, x10
4230 ; -O0: bl __atomic_compare_exchange
4232 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
4233 ; -O1: ldp x0, x1, [x0]
4234 ; -O1: eor x8, x1, x19
4235 ; -O1: eor x9, x0, x21
4236 ; -O1: bl __atomic_compare_exchange
4237 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
4241 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4242 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
4243 ; -O0: eor x9, x8, x9
4244 ; -O0: eor x8, x8, x10
4245 ; -O0: bl __atomic_compare_exchange
4247 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
4248 ; -O1: ldp x0, x1, [x0]
4249 ; -O1: eor x8, x1, x19
4250 ; -O1: eor x9, x0, x21
4251 ; -O1: bl __atomic_compare_exchange
4252 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
4256 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4257 ; -O0-LABEL: atomicrmw_max_i8_aligned_monotonic:
4259 ; -O0: subs w9, w9, w8, sxtb
4260 ; -O0: and w9, w9, #0x1
4261 ; -O0: ands w9, w9, #0x1
4262 ; -O0: csel w12, w10, w8, ne
4263 ; -O0: ldaxrb w9, [x11]
4264 ; -O0: cmp w9, w10, uxtb
4265 ; -O0: stlxrb w8, w12, [x11]
4266 ; -O0: and w8, w9, #0xff
4267 ; -O0: subs w8, w8, w10, uxtb
4269 ; -O1-LABEL: atomicrmw_max_i8_aligned_monotonic:
4270 ; -O1: ldxrb w9, [x0]
4272 ; -O1: cmp w8, w1, sxtb
4273 ; -O1: csel w9, w9, w1, gt
4274 ; -O1: stxrb w10, w9, [x0]
4275 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4279 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
4280 ; -O0-LABEL: atomicrmw_max_i8_aligned_acquire:
4282 ; -O0: subs w9, w9, w8, sxtb
4283 ; -O0: and w9, w9, #0x1
4284 ; -O0: ands w9, w9, #0x1
4285 ; -O0: csel w12, w10, w8, ne
4286 ; -O0: ldaxrb w9, [x11]
4287 ; -O0: cmp w9, w10, uxtb
4288 ; -O0: stlxrb w8, w12, [x11]
4289 ; -O0: and w8, w9, #0xff
4290 ; -O0: subs w8, w8, w10, uxtb
4292 ; -O1-LABEL: atomicrmw_max_i8_aligned_acquire:
4293 ; -O1: ldaxrb w9, [x0]
4295 ; -O1: cmp w8, w1, sxtb
4296 ; -O1: csel w9, w9, w1, gt
4297 ; -O1: stxrb w10, w9, [x0]
4298 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4302 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
4303 ; -O0-LABEL: atomicrmw_max_i8_aligned_release:
4305 ; -O0: subs w9, w9, w8, sxtb
4306 ; -O0: and w9, w9, #0x1
4307 ; -O0: ands w9, w9, #0x1
4308 ; -O0: csel w12, w10, w8, ne
4309 ; -O0: ldaxrb w9, [x11]
4310 ; -O0: cmp w9, w10, uxtb
4311 ; -O0: stlxrb w8, w12, [x11]
4312 ; -O0: and w8, w9, #0xff
4313 ; -O0: subs w8, w8, w10, uxtb
4315 ; -O1-LABEL: atomicrmw_max_i8_aligned_release:
4316 ; -O1: ldxrb w9, [x0]
4318 ; -O1: cmp w8, w1, sxtb
4319 ; -O1: csel w9, w9, w1, gt
4320 ; -O1: stlxrb w10, w9, [x0]
4321 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4325 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4326 ; -O0-LABEL: atomicrmw_max_i8_aligned_acq_rel:
4328 ; -O0: subs w9, w9, w8, sxtb
4329 ; -O0: and w9, w9, #0x1
4330 ; -O0: ands w9, w9, #0x1
4331 ; -O0: csel w12, w10, w8, ne
4332 ; -O0: ldaxrb w9, [x11]
4333 ; -O0: cmp w9, w10, uxtb
4334 ; -O0: stlxrb w8, w12, [x11]
4335 ; -O0: and w8, w9, #0xff
4336 ; -O0: subs w8, w8, w10, uxtb
4338 ; -O1-LABEL: atomicrmw_max_i8_aligned_acq_rel:
4339 ; -O1: ldaxrb w9, [x0]
4341 ; -O1: cmp w8, w1, sxtb
4342 ; -O1: csel w9, w9, w1, gt
4343 ; -O1: stlxrb w10, w9, [x0]
4344 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4348 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4349 ; -O0-LABEL: atomicrmw_max_i8_aligned_seq_cst:
4351 ; -O0: subs w9, w9, w8, sxtb
4352 ; -O0: and w9, w9, #0x1
4353 ; -O0: ands w9, w9, #0x1
4354 ; -O0: csel w12, w10, w8, ne
4355 ; -O0: ldaxrb w9, [x11]
4356 ; -O0: cmp w9, w10, uxtb
4357 ; -O0: stlxrb w8, w12, [x11]
4358 ; -O0: and w8, w9, #0xff
4359 ; -O0: subs w8, w8, w10, uxtb
4361 ; -O1-LABEL: atomicrmw_max_i8_aligned_seq_cst:
4362 ; -O1: ldaxrb w9, [x0]
4364 ; -O1: cmp w8, w1, sxtb
4365 ; -O1: csel w9, w9, w1, gt
4366 ; -O1: stlxrb w10, w9, [x0]
4367 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4371 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4372 ; -O0-LABEL: atomicrmw_max_i16_aligned_monotonic:
4374 ; -O0: subs w10, w10, w9, sxth
4375 ; -O0: and w10, w10, #0x1
4376 ; -O0: ands w10, w10, #0x1
4377 ; -O0: csel w12, w8, w9, ne
4378 ; -O0: ldaxrh w9, [x11]
4379 ; -O0: cmp w9, w8, uxth
4380 ; -O0: stlxrh w10, w12, [x11]
4381 ; -O0: subs w8, w8, w9, uxth
4383 ; -O1-LABEL: atomicrmw_max_i16_aligned_monotonic:
4384 ; -O1: ldxrh w9, [x0]
4386 ; -O1: cmp w8, w1, sxth
4387 ; -O1: csel w9, w9, w1, gt
4388 ; -O1: stxrh w10, w9, [x0]
4389 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
4393 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
4394 ; -O0-LABEL: atomicrmw_max_i16_aligned_acquire:
4396 ; -O0: subs w10, w10, w9, sxth
4397 ; -O0: and w10, w10, #0x1
4398 ; -O0: ands w10, w10, #0x1
4399 ; -O0: csel w12, w8, w9, ne
4400 ; -O0: ldaxrh w9, [x11]
4401 ; -O0: cmp w9, w8, uxth
4402 ; -O0: stlxrh w10, w12, [x11]
4403 ; -O0: subs w8, w8, w9, uxth
4405 ; -O1-LABEL: atomicrmw_max_i16_aligned_acquire:
4406 ; -O1: ldaxrh w9, [x0]
4408 ; -O1: cmp w8, w1, sxth
4409 ; -O1: csel w9, w9, w1, gt
4410 ; -O1: stxrh w10, w9, [x0]
4411 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
4415 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
4416 ; -O0-LABEL: atomicrmw_max_i16_aligned_release:
4418 ; -O0: subs w10, w10, w9, sxth
4419 ; -O0: and w10, w10, #0x1
4420 ; -O0: ands w10, w10, #0x1
4421 ; -O0: csel w12, w8, w9, ne
4422 ; -O0: ldaxrh w9, [x11]
4423 ; -O0: cmp w9, w8, uxth
4424 ; -O0: stlxrh w10, w12, [x11]
4425 ; -O0: subs w8, w8, w9, uxth
4427 ; -O1-LABEL: atomicrmw_max_i16_aligned_release:
4428 ; -O1: ldxrh w9, [x0]
4430 ; -O1: cmp w8, w1, sxth
4431 ; -O1: csel w9, w9, w1, gt
4432 ; -O1: stlxrh w10, w9, [x0]
4433 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
4437 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4438 ; -O0-LABEL: atomicrmw_max_i16_aligned_acq_rel:
4440 ; -O0: subs w10, w10, w9, sxth
4441 ; -O0: and w10, w10, #0x1
4442 ; -O0: ands w10, w10, #0x1
4443 ; -O0: csel w12, w8, w9, ne
4444 ; -O0: ldaxrh w9, [x11]
4445 ; -O0: cmp w9, w8, uxth
4446 ; -O0: stlxrh w10, w12, [x11]
4447 ; -O0: subs w8, w8, w9, uxth
4449 ; -O1-LABEL: atomicrmw_max_i16_aligned_acq_rel:
4450 ; -O1: ldaxrh w9, [x0]
4452 ; -O1: cmp w8, w1, sxth
4453 ; -O1: csel w9, w9, w1, gt
4454 ; -O1: stlxrh w10, w9, [x0]
4455 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
4459 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4460 ; -O0-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4462 ; -O0: subs w10, w10, w9, sxth
4463 ; -O0: and w10, w10, #0x1
4464 ; -O0: ands w10, w10, #0x1
4465 ; -O0: csel w12, w8, w9, ne
4466 ; -O0: ldaxrh w9, [x11]
4467 ; -O0: cmp w9, w8, uxth
4468 ; -O0: stlxrh w10, w12, [x11]
4469 ; -O0: subs w8, w8, w9, uxth
4471 ; -O1-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4472 ; -O1: ldaxrh w9, [x0]
4474 ; -O1: cmp w8, w1, sxth
4475 ; -O1: csel w9, w9, w1, gt
4476 ; -O1: stlxrh w10, w9, [x0]
4477 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
4481 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4482 ; -O0-LABEL: atomicrmw_max_i32_aligned_monotonic:
4483 ; -O0: subs w10, w8, w9
4484 ; -O0: and w10, w10, #0x1
4485 ; -O0: ands w10, w10, #0x1
4486 ; -O0: csel w12, w8, w9, ne
4487 ; -O0: ldaxr w9, [x11]
4489 ; -O0: stlxr w10, w12, [x11]
4490 ; -O0: subs w8, w9, w8
4492 ; -O1-LABEL: atomicrmw_max_i32_aligned_monotonic:
4493 ; -O1: ldxr w8, [x0]
4495 ; -O1: csel w9, w8, w1, gt
4496 ; -O1: stxr w10, w9, [x0]
4497 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
4501 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
4502 ; -O0-LABEL: atomicrmw_max_i32_aligned_acquire:
4503 ; -O0: subs w10, w8, w9
4504 ; -O0: and w10, w10, #0x1
4505 ; -O0: ands w10, w10, #0x1
4506 ; -O0: csel w12, w8, w9, ne
4507 ; -O0: ldaxr w9, [x11]
4509 ; -O0: stlxr w10, w12, [x11]
4510 ; -O0: subs w8, w9, w8
4512 ; -O1-LABEL: atomicrmw_max_i32_aligned_acquire:
4513 ; -O1: ldaxr w8, [x0]
4515 ; -O1: csel w9, w8, w1, gt
4516 ; -O1: stxr w10, w9, [x0]
4517 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
4521 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
4522 ; -O0-LABEL: atomicrmw_max_i32_aligned_release:
4523 ; -O0: subs w10, w8, w9
4524 ; -O0: and w10, w10, #0x1
4525 ; -O0: ands w10, w10, #0x1
4526 ; -O0: csel w12, w8, w9, ne
4527 ; -O0: ldaxr w9, [x11]
4529 ; -O0: stlxr w10, w12, [x11]
4530 ; -O0: subs w8, w9, w8
4532 ; -O1-LABEL: atomicrmw_max_i32_aligned_release:
4533 ; -O1: ldxr w8, [x0]
4535 ; -O1: csel w9, w8, w1, gt
4536 ; -O1: stlxr w10, w9, [x0]
4537 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
4541 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4542 ; -O0-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4543 ; -O0: subs w10, w8, w9
4544 ; -O0: and w10, w10, #0x1
4545 ; -O0: ands w10, w10, #0x1
4546 ; -O0: csel w12, w8, w9, ne
4547 ; -O0: ldaxr w9, [x11]
4549 ; -O0: stlxr w10, w12, [x11]
4550 ; -O0: subs w8, w9, w8
4552 ; -O1-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4553 ; -O1: ldaxr w8, [x0]
4555 ; -O1: csel w9, w8, w1, gt
4556 ; -O1: stlxr w10, w9, [x0]
4557 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
4561 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4562 ; -O0-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4563 ; -O0: subs w10, w8, w9
4564 ; -O0: and w10, w10, #0x1
4565 ; -O0: ands w10, w10, #0x1
4566 ; -O0: csel w12, w8, w9, ne
4567 ; -O0: ldaxr w9, [x11]
4569 ; -O0: stlxr w10, w12, [x11]
4570 ; -O0: subs w8, w9, w8
4572 ; -O1-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4573 ; -O1: ldaxr w8, [x0]
4575 ; -O1: csel w9, w8, w1, gt
4576 ; -O1: stlxr w10, w9, [x0]
4577 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
4581 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4582 ; -O0-LABEL: atomicrmw_max_i64_aligned_monotonic:
4583 ; -O0: subs x10, x8, x9
4584 ; -O0: and w10, w10, #0x1
4585 ; -O0: ands w10, w10, #0x1
4586 ; -O0: csel x12, x8, x9, ne
4587 ; -O0: ldaxr x9, [x11]
4589 ; -O0: stlxr w10, x12, [x11]
4590 ; -O0: subs x8, x9, x8
4592 ; -O1-LABEL: atomicrmw_max_i64_aligned_monotonic:
4593 ; -O1: ldxr x0, [x8]
4595 ; -O1: csel x9, x0, x1, gt
4596 ; -O1: stxr w10, x9, [x8]
4597 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
4601 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
4602 ; -O0-LABEL: atomicrmw_max_i64_aligned_acquire:
4603 ; -O0: subs x10, x8, x9
4604 ; -O0: and w10, w10, #0x1
4605 ; -O0: ands w10, w10, #0x1
4606 ; -O0: csel x12, x8, x9, ne
4607 ; -O0: ldaxr x9, [x11]
4609 ; -O0: stlxr w10, x12, [x11]
4610 ; -O0: subs x8, x9, x8
4612 ; -O1-LABEL: atomicrmw_max_i64_aligned_acquire:
4613 ; -O1: ldaxr x0, [x8]
4615 ; -O1: csel x9, x0, x1, gt
4616 ; -O1: stxr w10, x9, [x8]
4617 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
4621 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
4622 ; -O0-LABEL: atomicrmw_max_i64_aligned_release:
4623 ; -O0: subs x10, x8, x9
4624 ; -O0: and w10, w10, #0x1
4625 ; -O0: ands w10, w10, #0x1
4626 ; -O0: csel x12, x8, x9, ne
4627 ; -O0: ldaxr x9, [x11]
4629 ; -O0: stlxr w10, x12, [x11]
4630 ; -O0: subs x8, x9, x8
4632 ; -O1-LABEL: atomicrmw_max_i64_aligned_release:
4633 ; -O1: ldxr x0, [x8]
4635 ; -O1: csel x9, x0, x1, gt
4636 ; -O1: stlxr w10, x9, [x8]
4637 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
4641 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4642 ; -O0-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4643 ; -O0: subs x10, x8, x9
4644 ; -O0: and w10, w10, #0x1
4645 ; -O0: ands w10, w10, #0x1
4646 ; -O0: csel x12, x8, x9, ne
4647 ; -O0: ldaxr x9, [x11]
4649 ; -O0: stlxr w10, x12, [x11]
4650 ; -O0: subs x8, x9, x8
4652 ; -O1-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4653 ; -O1: ldaxr x0, [x8]
4655 ; -O1: csel x9, x0, x1, gt
4656 ; -O1: stlxr w10, x9, [x8]
4657 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
4661 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4662 ; -O0-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4663 ; -O0: subs x10, x8, x9
4664 ; -O0: and w10, w10, #0x1
4665 ; -O0: ands w10, w10, #0x1
4666 ; -O0: csel x12, x8, x9, ne
4667 ; -O0: ldaxr x9, [x11]
4669 ; -O0: stlxr w10, x12, [x11]
4670 ; -O0: subs x8, x9, x8
4672 ; -O1-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4673 ; -O1: ldaxr x0, [x8]
4675 ; -O1: csel x9, x0, x1, gt
4676 ; -O1: stlxr w10, x9, [x8]
4677 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
4681 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4682 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
4683 ; -O0: subs x8, x8, x9
4684 ; -O0: subs x8, x8, x9
4685 ; -O0: subs x8, x8, x12
4686 ; -O0: and w13, w13, #0x1
4687 ; -O0: ands w13, w13, #0x1
4688 ; -O0: csel w8, w8, w10, ne
4689 ; -O0: and w13, w8, #0x1
4690 ; -O0: ands w13, w13, #0x1
4691 ; -O0: csel x14, x10, x12, ne
4692 ; -O0: and w10, w8, #0x1
4693 ; -O0: ands w10, w10, #0x1
4694 ; -O0: csel x15, x8, x9, ne
4695 ; -O0: ldxp x10, x9, [x11]
4698 ; -O0: stxp w8, x14, x15, [x11]
4699 ; -O0: stxp w8, x10, x9, [x11]
4700 ; -O0: eor x8, x10, x8
4701 ; -O0: eor x11, x9, x11
4702 ; -O0: orr x8, x8, x11
4703 ; -O0: subs x8, x8, #0
4705 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
4706 ; -O1: ldxp x0, x1, [x8]
4708 ; -O1: csel x9, x1, x3, lt
4709 ; -O1: csel x10, x0, x2, lt
4710 ; -O1: stxp w11, x10, x9, [x8]
4711 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
4715 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
4716 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
4717 ; -O0: subs x8, x8, x9
4718 ; -O0: subs x8, x8, x9
4719 ; -O0: subs x8, x8, x12
4720 ; -O0: and w13, w13, #0x1
4721 ; -O0: ands w13, w13, #0x1
4722 ; -O0: csel w8, w8, w10, ne
4723 ; -O0: and w13, w8, #0x1
4724 ; -O0: ands w13, w13, #0x1
4725 ; -O0: csel x14, x10, x12, ne
4726 ; -O0: and w10, w8, #0x1
4727 ; -O0: ands w10, w10, #0x1
4728 ; -O0: csel x15, x8, x9, ne
4729 ; -O0: ldaxp x10, x9, [x11]
4732 ; -O0: stxp w8, x14, x15, [x11]
4733 ; -O0: stxp w8, x10, x9, [x11]
4734 ; -O0: eor x8, x10, x8
4735 ; -O0: eor x11, x9, x11
4736 ; -O0: orr x8, x8, x11
4737 ; -O0: subs x8, x8, #0
4739 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
4740 ; -O1: ldaxp x0, x1, [x8]
4742 ; -O1: csel x9, x1, x3, lt
4743 ; -O1: csel x10, x0, x2, lt
4744 ; -O1: stxp w11, x10, x9, [x8]
4745 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4749 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4750 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4751 ; -O0: subs x8, x8, x9
4752 ; -O0: subs x8, x8, x9
4753 ; -O0: subs x8, x8, x12
4754 ; -O0: and w13, w13, #0x1
4755 ; -O0: ands w13, w13, #0x1
4756 ; -O0: csel w8, w8, w10, ne
4757 ; -O0: and w13, w8, #0x1
4758 ; -O0: ands w13, w13, #0x1
4759 ; -O0: csel x14, x10, x12, ne
4760 ; -O0: and w10, w8, #0x1
4761 ; -O0: ands w10, w10, #0x1
4762 ; -O0: csel x15, x8, x9, ne
4763 ; -O0: ldxp x10, x9, [x11]
4766 ; -O0: stlxp w8, x14, x15, [x11]
4767 ; -O0: stlxp w8, x10, x9, [x11]
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_max_i128_aligned_release:
4774 ; -O1: ldxp x0, x1, [x8]
4776 ; -O1: csel x9, x1, x3, lt
4777 ; -O1: csel x10, x0, x2, lt
4778 ; -O1: stlxp w11, x10, x9, [x8]
4779 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4783 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4784 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4785 ; -O0: subs x8, x8, x9
4786 ; -O0: subs x8, x8, x9
4787 ; -O0: subs x8, x8, x12
4788 ; -O0: and w13, w13, #0x1
4789 ; -O0: ands w13, w13, #0x1
4790 ; -O0: csel w8, w8, w10, ne
4791 ; -O0: and w13, w8, #0x1
4792 ; -O0: ands w13, w13, #0x1
4793 ; -O0: csel x14, x10, x12, ne
4794 ; -O0: and w10, w8, #0x1
4795 ; -O0: ands w10, w10, #0x1
4796 ; -O0: csel x15, x8, x9, ne
4797 ; -O0: ldaxp x10, x9, [x11]
4800 ; -O0: stlxp w8, x14, x15, [x11]
4801 ; -O0: stlxp w8, x10, x9, [x11]
4802 ; -O0: eor x8, x10, x8
4803 ; -O0: eor x11, x9, x11
4804 ; -O0: orr x8, x8, x11
4805 ; -O0: subs x8, x8, #0
4807 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4808 ; -O1: ldaxp x0, x1, [x8]
4810 ; -O1: csel x9, x1, x3, lt
4811 ; -O1: csel x10, x0, x2, lt
4812 ; -O1: stlxp w11, x10, x9, [x8]
4813 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4817 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4818 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4819 ; -O0: subs x8, x8, x9
4820 ; -O0: subs x8, x8, x9
4821 ; -O0: subs x8, x8, x12
4822 ; -O0: and w13, w13, #0x1
4823 ; -O0: ands w13, w13, #0x1
4824 ; -O0: csel w8, w8, w10, ne
4825 ; -O0: and w13, w8, #0x1
4826 ; -O0: ands w13, w13, #0x1
4827 ; -O0: csel x14, x10, x12, ne
4828 ; -O0: and w10, w8, #0x1
4829 ; -O0: ands w10, w10, #0x1
4830 ; -O0: csel x15, x8, x9, ne
4831 ; -O0: ldaxp x10, x9, [x11]
4834 ; -O0: stlxp w8, x14, x15, [x11]
4835 ; -O0: stlxp w8, x10, x9, [x11]
4836 ; -O0: eor x8, x10, x8
4837 ; -O0: eor x11, x9, x11
4838 ; -O0: orr x8, x8, x11
4839 ; -O0: subs x8, x8, #0
4841 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4842 ; -O1: ldaxp x0, x1, [x8]
4844 ; -O1: csel x9, x1, x3, lt
4845 ; -O1: csel x10, x0, x2, lt
4846 ; -O1: stlxp w11, x10, x9, [x8]
4847 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4851 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4852 ; -O0-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4854 ; -O0: subs w9, w9, w8, sxtb
4855 ; -O0: and w9, w9, #0x1
4856 ; -O0: ands w9, w9, #0x1
4857 ; -O0: csel w12, w10, w8, ne
4858 ; -O0: ldaxrb w9, [x11]
4859 ; -O0: cmp w9, w10, uxtb
4860 ; -O0: stlxrb w8, w12, [x11]
4861 ; -O0: and w8, w9, #0xff
4862 ; -O0: subs w8, w8, w10, uxtb
4864 ; -O1-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4865 ; -O1: ldxrb w9, [x0]
4867 ; -O1: cmp w8, w1, sxtb
4868 ; -O1: csel w9, w9, w1, gt
4869 ; -O1: stxrb w10, w9, [x0]
4870 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4874 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4875 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acquire:
4877 ; -O0: subs w9, w9, w8, sxtb
4878 ; -O0: and w9, w9, #0x1
4879 ; -O0: ands w9, w9, #0x1
4880 ; -O0: csel w12, w10, w8, ne
4881 ; -O0: ldaxrb w9, [x11]
4882 ; -O0: cmp w9, w10, uxtb
4883 ; -O0: stlxrb w8, w12, [x11]
4884 ; -O0: and w8, w9, #0xff
4885 ; -O0: subs w8, w8, w10, uxtb
4887 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acquire:
4888 ; -O1: ldaxrb w9, [x0]
4890 ; -O1: cmp w8, w1, sxtb
4891 ; -O1: csel w9, w9, w1, gt
4892 ; -O1: stxrb w10, w9, [x0]
4893 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4897 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4898 ; -O0-LABEL: atomicrmw_max_i8_unaligned_release:
4900 ; -O0: subs w9, w9, w8, sxtb
4901 ; -O0: and w9, w9, #0x1
4902 ; -O0: ands w9, w9, #0x1
4903 ; -O0: csel w12, w10, w8, ne
4904 ; -O0: ldaxrb w9, [x11]
4905 ; -O0: cmp w9, w10, uxtb
4906 ; -O0: stlxrb w8, w12, [x11]
4907 ; -O0: and w8, w9, #0xff
4908 ; -O0: subs w8, w8, w10, uxtb
4910 ; -O1-LABEL: atomicrmw_max_i8_unaligned_release:
4911 ; -O1: ldxrb w9, [x0]
4913 ; -O1: cmp w8, w1, sxtb
4914 ; -O1: csel w9, w9, w1, gt
4915 ; -O1: stlxrb w10, w9, [x0]
4916 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4920 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4921 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4923 ; -O0: subs w9, w9, w8, sxtb
4924 ; -O0: and w9, w9, #0x1
4925 ; -O0: ands w9, w9, #0x1
4926 ; -O0: csel w12, w10, w8, ne
4927 ; -O0: ldaxrb w9, [x11]
4928 ; -O0: cmp w9, w10, uxtb
4929 ; -O0: stlxrb w8, w12, [x11]
4930 ; -O0: and w8, w9, #0xff
4931 ; -O0: subs w8, w8, w10, uxtb
4933 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4934 ; -O1: ldaxrb w9, [x0]
4936 ; -O1: cmp w8, w1, sxtb
4937 ; -O1: csel w9, w9, w1, gt
4938 ; -O1: stlxrb w10, w9, [x0]
4939 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4943 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4944 ; -O0-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4946 ; -O0: subs w9, w9, w8, sxtb
4947 ; -O0: and w9, w9, #0x1
4948 ; -O0: ands w9, w9, #0x1
4949 ; -O0: csel w12, w10, w8, ne
4950 ; -O0: ldaxrb w9, [x11]
4951 ; -O0: cmp w9, w10, uxtb
4952 ; -O0: stlxrb w8, w12, [x11]
4953 ; -O0: and w8, w9, #0xff
4954 ; -O0: subs w8, w8, w10, uxtb
4956 ; -O1-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4957 ; -O1: ldaxrb w9, [x0]
4959 ; -O1: cmp w8, w1, sxtb
4960 ; -O1: csel w9, w9, w1, gt
4961 ; -O1: stlxrb w10, w9, [x0]
4962 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4966 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4967 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4969 ; -O0: subs w10, w10, w8, sxth
4970 ; -O0: and w10, w10, #0x1
4971 ; -O0: ands w10, w10, #0x1
4972 ; -O0: csel w8, w9, w8, ne
4973 ; -O0: bl __atomic_compare_exchange
4975 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4977 ; -O1: cmp w8, w20, sxth
4978 ; -O1: csel w8, w0, w20, gt
4979 ; -O1: bl __atomic_compare_exchange
4980 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4984 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4985 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4987 ; -O0: subs w10, w10, w8, sxth
4988 ; -O0: and w10, w10, #0x1
4989 ; -O0: ands w10, w10, #0x1
4990 ; -O0: csel w8, w9, w8, ne
4991 ; -O0: bl __atomic_compare_exchange
4993 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4995 ; -O1: cmp w8, w20, sxth
4996 ; -O1: csel w8, w0, w20, gt
4997 ; -O1: bl __atomic_compare_exchange
4998 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
5002 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
5003 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
5005 ; -O0: subs w10, w10, w8, sxth
5006 ; -O0: and w10, w10, #0x1
5007 ; -O0: ands w10, w10, #0x1
5008 ; -O0: csel w8, w9, w8, ne
5009 ; -O0: bl __atomic_compare_exchange
5011 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
5013 ; -O1: cmp w8, w20, sxth
5014 ; -O1: csel w8, w0, w20, gt
5015 ; -O1: bl __atomic_compare_exchange
5016 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
5020 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5021 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
5023 ; -O0: subs w10, w10, w8, sxth
5024 ; -O0: and w10, w10, #0x1
5025 ; -O0: ands w10, w10, #0x1
5026 ; -O0: csel w8, w9, w8, ne
5027 ; -O0: bl __atomic_compare_exchange
5029 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
5031 ; -O1: cmp w8, w20, sxth
5032 ; -O1: csel w8, w0, w20, gt
5033 ; -O1: bl __atomic_compare_exchange
5034 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
5038 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5039 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
5041 ; -O0: subs w10, w10, w8, sxth
5042 ; -O0: and w10, w10, #0x1
5043 ; -O0: ands w10, w10, #0x1
5044 ; -O0: csel w8, w9, w8, ne
5045 ; -O0: bl __atomic_compare_exchange
5047 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
5049 ; -O1: cmp w8, w20, sxth
5050 ; -O1: csel w8, w0, w20, gt
5051 ; -O1: bl __atomic_compare_exchange
5052 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
5056 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5057 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
5058 ; -O0: subs w10, w9, w8
5059 ; -O0: and w10, w10, #0x1
5060 ; -O0: ands w10, w10, #0x1
5061 ; -O0: csel w8, w9, w8, ne
5062 ; -O0: bl __atomic_compare_exchange
5064 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
5066 ; -O1: csel w8, w0, w20, gt
5067 ; -O1: bl __atomic_compare_exchange
5068 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
5072 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5073 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
5074 ; -O0: subs w10, w9, w8
5075 ; -O0: and w10, w10, #0x1
5076 ; -O0: ands w10, w10, #0x1
5077 ; -O0: csel w8, w9, w8, ne
5078 ; -O0: bl __atomic_compare_exchange
5080 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
5082 ; -O1: csel w8, w0, w20, gt
5083 ; -O1: bl __atomic_compare_exchange
5084 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
5088 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
5089 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
5090 ; -O0: subs w10, w9, w8
5091 ; -O0: and w10, w10, #0x1
5092 ; -O0: ands w10, w10, #0x1
5093 ; -O0: csel w8, w9, w8, ne
5094 ; -O0: bl __atomic_compare_exchange
5096 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
5098 ; -O1: csel w8, w0, w20, gt
5099 ; -O1: bl __atomic_compare_exchange
5100 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
5104 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5105 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
5106 ; -O0: subs w10, w9, w8
5107 ; -O0: and w10, w10, #0x1
5108 ; -O0: ands w10, w10, #0x1
5109 ; -O0: csel w8, w9, w8, ne
5110 ; -O0: bl __atomic_compare_exchange
5112 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
5114 ; -O1: csel w8, w0, w20, gt
5115 ; -O1: bl __atomic_compare_exchange
5116 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
5120 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5121 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
5122 ; -O0: subs w10, w9, w8
5123 ; -O0: and w10, w10, #0x1
5124 ; -O0: ands w10, w10, #0x1
5125 ; -O0: csel w8, w9, w8, ne
5126 ; -O0: bl __atomic_compare_exchange
5128 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
5130 ; -O1: csel w8, w0, w20, gt
5131 ; -O1: bl __atomic_compare_exchange
5132 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
5136 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5137 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
5138 ; -O0: subs x10, x9, x8
5139 ; -O0: and w10, w10, #0x1
5140 ; -O0: ands w10, w10, #0x1
5141 ; -O0: csel x8, x9, x8, ne
5142 ; -O0: bl __atomic_compare_exchange
5144 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
5146 ; -O1: csel x8, x0, x20, gt
5147 ; -O1: bl __atomic_compare_exchange
5148 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
5152 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5153 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
5154 ; -O0: subs x10, x9, x8
5155 ; -O0: and w10, w10, #0x1
5156 ; -O0: ands w10, w10, #0x1
5157 ; -O0: csel x8, x9, x8, ne
5158 ; -O0: bl __atomic_compare_exchange
5160 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
5162 ; -O1: csel x8, x0, x20, gt
5163 ; -O1: bl __atomic_compare_exchange
5164 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
5168 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
5169 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
5170 ; -O0: subs x10, x9, x8
5171 ; -O0: and w10, w10, #0x1
5172 ; -O0: ands w10, w10, #0x1
5173 ; -O0: csel x8, x9, x8, ne
5174 ; -O0: bl __atomic_compare_exchange
5176 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
5178 ; -O1: csel x8, x0, x20, gt
5179 ; -O1: bl __atomic_compare_exchange
5180 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
5184 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5185 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
5186 ; -O0: subs x10, x9, x8
5187 ; -O0: and w10, w10, #0x1
5188 ; -O0: ands w10, w10, #0x1
5189 ; -O0: csel x8, x9, x8, ne
5190 ; -O0: bl __atomic_compare_exchange
5192 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
5194 ; -O1: csel x8, x0, x20, gt
5195 ; -O1: bl __atomic_compare_exchange
5196 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
5200 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5201 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
5202 ; -O0: subs x10, x9, x8
5203 ; -O0: and w10, w10, #0x1
5204 ; -O0: ands w10, w10, #0x1
5205 ; -O0: csel x8, x9, x8, ne
5206 ; -O0: bl __atomic_compare_exchange
5208 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
5210 ; -O1: csel x8, x0, x20, gt
5211 ; -O1: bl __atomic_compare_exchange
5212 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
5216 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5217 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
5218 ; -O0: subs x8, x8, x10
5219 ; -O0: subs x8, x8, x10
5220 ; -O0: subs x8, x8, x11
5221 ; -O0: and w12, w12, #0x1
5222 ; -O0: ands w12, w12, #0x1
5223 ; -O0: csel w8, w8, w9, ne
5224 ; -O0: and w12, w8, #0x1
5225 ; -O0: ands w12, w12, #0x1
5226 ; -O0: csel x9, x9, x11, ne
5227 ; -O0: and w11, w8, #0x1
5228 ; -O0: ands w11, w11, #0x1
5229 ; -O0: csel x8, x8, x10, ne
5230 ; -O0: bl __atomic_compare_exchange
5232 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
5233 ; -O1: ldp x0, x1, [x0]
5235 ; -O1: csel x8, x1, x19, lt
5236 ; -O1: csel x9, x0, x21, lt
5237 ; -O1: bl __atomic_compare_exchange
5238 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
5242 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5243 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
5244 ; -O0: subs x8, x8, x10
5245 ; -O0: subs x8, x8, x10
5246 ; -O0: subs x8, x8, x11
5247 ; -O0: and w12, w12, #0x1
5248 ; -O0: ands w12, w12, #0x1
5249 ; -O0: csel w8, w8, w9, ne
5250 ; -O0: and w12, w8, #0x1
5251 ; -O0: ands w12, w12, #0x1
5252 ; -O0: csel x9, x9, x11, ne
5253 ; -O0: and w11, w8, #0x1
5254 ; -O0: ands w11, w11, #0x1
5255 ; -O0: csel x8, x8, x10, ne
5256 ; -O0: bl __atomic_compare_exchange
5258 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
5259 ; -O1: ldp x0, x1, [x0]
5261 ; -O1: csel x8, x1, x19, lt
5262 ; -O1: csel x9, x0, x21, lt
5263 ; -O1: bl __atomic_compare_exchange
5264 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
5268 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
5269 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
5270 ; -O0: subs x8, x8, x10
5271 ; -O0: subs x8, x8, x10
5272 ; -O0: subs x8, x8, x11
5273 ; -O0: and w12, w12, #0x1
5274 ; -O0: ands w12, w12, #0x1
5275 ; -O0: csel w8, w8, w9, ne
5276 ; -O0: and w12, w8, #0x1
5277 ; -O0: ands w12, w12, #0x1
5278 ; -O0: csel x9, x9, x11, ne
5279 ; -O0: and w11, w8, #0x1
5280 ; -O0: ands w11, w11, #0x1
5281 ; -O0: csel x8, x8, x10, ne
5282 ; -O0: bl __atomic_compare_exchange
5284 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
5285 ; -O1: ldp x0, x1, [x0]
5287 ; -O1: csel x8, x1, x19, lt
5288 ; -O1: csel x9, x0, x21, lt
5289 ; -O1: bl __atomic_compare_exchange
5290 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
5294 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5295 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
5296 ; -O0: subs x8, x8, x10
5297 ; -O0: subs x8, x8, x10
5298 ; -O0: subs x8, x8, x11
5299 ; -O0: and w12, w12, #0x1
5300 ; -O0: ands w12, w12, #0x1
5301 ; -O0: csel w8, w8, w9, ne
5302 ; -O0: and w12, w8, #0x1
5303 ; -O0: ands w12, w12, #0x1
5304 ; -O0: csel x9, x9, x11, ne
5305 ; -O0: and w11, w8, #0x1
5306 ; -O0: ands w11, w11, #0x1
5307 ; -O0: csel x8, x8, x10, ne
5308 ; -O0: bl __atomic_compare_exchange
5310 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
5311 ; -O1: ldp x0, x1, [x0]
5313 ; -O1: csel x8, x1, x19, lt
5314 ; -O1: csel x9, x0, x21, lt
5315 ; -O1: bl __atomic_compare_exchange
5316 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
5320 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5321 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
5322 ; -O0: subs x8, x8, x10
5323 ; -O0: subs x8, x8, x10
5324 ; -O0: subs x8, x8, x11
5325 ; -O0: and w12, w12, #0x1
5326 ; -O0: ands w12, w12, #0x1
5327 ; -O0: csel w8, w8, w9, ne
5328 ; -O0: and w12, w8, #0x1
5329 ; -O0: ands w12, w12, #0x1
5330 ; -O0: csel x9, x9, x11, ne
5331 ; -O0: and w11, w8, #0x1
5332 ; -O0: ands w11, w11, #0x1
5333 ; -O0: csel x8, x8, x10, ne
5334 ; -O0: bl __atomic_compare_exchange
5336 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
5337 ; -O1: ldp x0, x1, [x0]
5339 ; -O1: csel x8, x1, x19, lt
5340 ; -O1: csel x9, x0, x21, lt
5341 ; -O1: bl __atomic_compare_exchange
5342 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
5346 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5347 ; -O0-LABEL: atomicrmw_min_i8_aligned_monotonic:
5349 ; -O0: subs w9, w9, w8, sxtb
5350 ; -O0: and w9, w9, #0x1
5351 ; -O0: ands w9, w9, #0x1
5352 ; -O0: csel w12, w10, w8, ne
5353 ; -O0: ldaxrb w9, [x11]
5354 ; -O0: cmp w9, w10, uxtb
5355 ; -O0: stlxrb w8, w12, [x11]
5356 ; -O0: and w8, w9, #0xff
5357 ; -O0: subs w8, w8, w10, uxtb
5359 ; -O1-LABEL: atomicrmw_min_i8_aligned_monotonic:
5360 ; -O1: ldxrb w9, [x0]
5362 ; -O1: cmp w8, w1, sxtb
5363 ; -O1: csel w9, w9, w1, le
5364 ; -O1: stxrb w10, w9, [x0]
5365 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
5369 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
5370 ; -O0-LABEL: atomicrmw_min_i8_aligned_acquire:
5372 ; -O0: subs w9, w9, w8, sxtb
5373 ; -O0: and w9, w9, #0x1
5374 ; -O0: ands w9, w9, #0x1
5375 ; -O0: csel w12, w10, w8, ne
5376 ; -O0: ldaxrb w9, [x11]
5377 ; -O0: cmp w9, w10, uxtb
5378 ; -O0: stlxrb w8, w12, [x11]
5379 ; -O0: and w8, w9, #0xff
5380 ; -O0: subs w8, w8, w10, uxtb
5382 ; -O1-LABEL: atomicrmw_min_i8_aligned_acquire:
5383 ; -O1: ldaxrb w9, [x0]
5385 ; -O1: cmp w8, w1, sxtb
5386 ; -O1: csel w9, w9, w1, le
5387 ; -O1: stxrb w10, w9, [x0]
5388 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
5392 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
5393 ; -O0-LABEL: atomicrmw_min_i8_aligned_release:
5395 ; -O0: subs w9, w9, w8, sxtb
5396 ; -O0: and w9, w9, #0x1
5397 ; -O0: ands w9, w9, #0x1
5398 ; -O0: csel w12, w10, w8, ne
5399 ; -O0: ldaxrb w9, [x11]
5400 ; -O0: cmp w9, w10, uxtb
5401 ; -O0: stlxrb w8, w12, [x11]
5402 ; -O0: and w8, w9, #0xff
5403 ; -O0: subs w8, w8, w10, uxtb
5405 ; -O1-LABEL: atomicrmw_min_i8_aligned_release:
5406 ; -O1: ldxrb w9, [x0]
5408 ; -O1: cmp w8, w1, sxtb
5409 ; -O1: csel w9, w9, w1, le
5410 ; -O1: stlxrb w10, w9, [x0]
5411 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
5415 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5416 ; -O0-LABEL: atomicrmw_min_i8_aligned_acq_rel:
5418 ; -O0: subs w9, w9, w8, sxtb
5419 ; -O0: and w9, w9, #0x1
5420 ; -O0: ands w9, w9, #0x1
5421 ; -O0: csel w12, w10, w8, ne
5422 ; -O0: ldaxrb w9, [x11]
5423 ; -O0: cmp w9, w10, uxtb
5424 ; -O0: stlxrb w8, w12, [x11]
5425 ; -O0: and w8, w9, #0xff
5426 ; -O0: subs w8, w8, w10, uxtb
5428 ; -O1-LABEL: atomicrmw_min_i8_aligned_acq_rel:
5429 ; -O1: ldaxrb w9, [x0]
5431 ; -O1: cmp w8, w1, sxtb
5432 ; -O1: csel w9, w9, w1, le
5433 ; -O1: stlxrb w10, w9, [x0]
5434 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
5438 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5439 ; -O0-LABEL: atomicrmw_min_i8_aligned_seq_cst:
5441 ; -O0: subs w9, w9, w8, sxtb
5442 ; -O0: and w9, w9, #0x1
5443 ; -O0: ands w9, w9, #0x1
5444 ; -O0: csel w12, w10, w8, ne
5445 ; -O0: ldaxrb w9, [x11]
5446 ; -O0: cmp w9, w10, uxtb
5447 ; -O0: stlxrb w8, w12, [x11]
5448 ; -O0: and w8, w9, #0xff
5449 ; -O0: subs w8, w8, w10, uxtb
5451 ; -O1-LABEL: atomicrmw_min_i8_aligned_seq_cst:
5452 ; -O1: ldaxrb w9, [x0]
5454 ; -O1: cmp w8, w1, sxtb
5455 ; -O1: csel w9, w9, w1, le
5456 ; -O1: stlxrb w10, w9, [x0]
5457 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
5461 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5462 ; -O0-LABEL: atomicrmw_min_i16_aligned_monotonic:
5464 ; -O0: subs w10, w10, w9, sxth
5465 ; -O0: and w10, w10, #0x1
5466 ; -O0: ands w10, w10, #0x1
5467 ; -O0: csel w12, w8, w9, ne
5468 ; -O0: ldaxrh w9, [x11]
5469 ; -O0: cmp w9, w8, uxth
5470 ; -O0: stlxrh w10, w12, [x11]
5471 ; -O0: subs w8, w8, w9, uxth
5473 ; -O1-LABEL: atomicrmw_min_i16_aligned_monotonic:
5474 ; -O1: ldxrh w9, [x0]
5476 ; -O1: cmp w8, w1, sxth
5477 ; -O1: csel w9, w9, w1, le
5478 ; -O1: stxrh w10, w9, [x0]
5479 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
5483 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
5484 ; -O0-LABEL: atomicrmw_min_i16_aligned_acquire:
5486 ; -O0: subs w10, w10, w9, sxth
5487 ; -O0: and w10, w10, #0x1
5488 ; -O0: ands w10, w10, #0x1
5489 ; -O0: csel w12, w8, w9, ne
5490 ; -O0: ldaxrh w9, [x11]
5491 ; -O0: cmp w9, w8, uxth
5492 ; -O0: stlxrh w10, w12, [x11]
5493 ; -O0: subs w8, w8, w9, uxth
5495 ; -O1-LABEL: atomicrmw_min_i16_aligned_acquire:
5496 ; -O1: ldaxrh w9, [x0]
5498 ; -O1: cmp w8, w1, sxth
5499 ; -O1: csel w9, w9, w1, le
5500 ; -O1: stxrh w10, w9, [x0]
5501 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
5505 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
5506 ; -O0-LABEL: atomicrmw_min_i16_aligned_release:
5508 ; -O0: subs w10, w10, w9, sxth
5509 ; -O0: and w10, w10, #0x1
5510 ; -O0: ands w10, w10, #0x1
5511 ; -O0: csel w12, w8, w9, ne
5512 ; -O0: ldaxrh w9, [x11]
5513 ; -O0: cmp w9, w8, uxth
5514 ; -O0: stlxrh w10, w12, [x11]
5515 ; -O0: subs w8, w8, w9, uxth
5517 ; -O1-LABEL: atomicrmw_min_i16_aligned_release:
5518 ; -O1: ldxrh w9, [x0]
5520 ; -O1: cmp w8, w1, sxth
5521 ; -O1: csel w9, w9, w1, le
5522 ; -O1: stlxrh w10, w9, [x0]
5523 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
5527 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5528 ; -O0-LABEL: atomicrmw_min_i16_aligned_acq_rel:
5530 ; -O0: subs w10, w10, w9, sxth
5531 ; -O0: and w10, w10, #0x1
5532 ; -O0: ands w10, w10, #0x1
5533 ; -O0: csel w12, w8, w9, ne
5534 ; -O0: ldaxrh w9, [x11]
5535 ; -O0: cmp w9, w8, uxth
5536 ; -O0: stlxrh w10, w12, [x11]
5537 ; -O0: subs w8, w8, w9, uxth
5539 ; -O1-LABEL: atomicrmw_min_i16_aligned_acq_rel:
5540 ; -O1: ldaxrh w9, [x0]
5542 ; -O1: cmp w8, w1, sxth
5543 ; -O1: csel w9, w9, w1, le
5544 ; -O1: stlxrh w10, w9, [x0]
5545 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
5549 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5550 ; -O0-LABEL: atomicrmw_min_i16_aligned_seq_cst:
5552 ; -O0: subs w10, w10, w9, sxth
5553 ; -O0: and w10, w10, #0x1
5554 ; -O0: ands w10, w10, #0x1
5555 ; -O0: csel w12, w8, w9, ne
5556 ; -O0: ldaxrh w9, [x11]
5557 ; -O0: cmp w9, w8, uxth
5558 ; -O0: stlxrh w10, w12, [x11]
5559 ; -O0: subs w8, w8, w9, uxth
5561 ; -O1-LABEL: atomicrmw_min_i16_aligned_seq_cst:
5562 ; -O1: ldaxrh w9, [x0]
5564 ; -O1: cmp w8, w1, sxth
5565 ; -O1: csel w9, w9, w1, le
5566 ; -O1: stlxrh w10, w9, [x0]
5567 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
5571 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5572 ; -O0-LABEL: atomicrmw_min_i32_aligned_monotonic:
5573 ; -O0: subs w10, w8, w9
5574 ; -O0: and w10, w10, #0x1
5575 ; -O0: ands w10, w10, #0x1
5576 ; -O0: csel w12, w8, w9, ne
5577 ; -O0: ldaxr w9, [x11]
5579 ; -O0: stlxr w10, w12, [x11]
5580 ; -O0: subs w8, w9, w8
5582 ; -O1-LABEL: atomicrmw_min_i32_aligned_monotonic:
5583 ; -O1: ldxr w8, [x0]
5585 ; -O1: csel w9, w8, w1, le
5586 ; -O1: stxr w10, w9, [x0]
5587 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
5591 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
5592 ; -O0-LABEL: atomicrmw_min_i32_aligned_acquire:
5593 ; -O0: subs w10, w8, w9
5594 ; -O0: and w10, w10, #0x1
5595 ; -O0: ands w10, w10, #0x1
5596 ; -O0: csel w12, w8, w9, ne
5597 ; -O0: ldaxr w9, [x11]
5599 ; -O0: stlxr w10, w12, [x11]
5600 ; -O0: subs w8, w9, w8
5602 ; -O1-LABEL: atomicrmw_min_i32_aligned_acquire:
5603 ; -O1: ldaxr w8, [x0]
5605 ; -O1: csel w9, w8, w1, le
5606 ; -O1: stxr w10, w9, [x0]
5607 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
5611 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
5612 ; -O0-LABEL: atomicrmw_min_i32_aligned_release:
5613 ; -O0: subs w10, w8, w9
5614 ; -O0: and w10, w10, #0x1
5615 ; -O0: ands w10, w10, #0x1
5616 ; -O0: csel w12, w8, w9, ne
5617 ; -O0: ldaxr w9, [x11]
5619 ; -O0: stlxr w10, w12, [x11]
5620 ; -O0: subs w8, w9, w8
5622 ; -O1-LABEL: atomicrmw_min_i32_aligned_release:
5623 ; -O1: ldxr w8, [x0]
5625 ; -O1: csel w9, w8, w1, le
5626 ; -O1: stlxr w10, w9, [x0]
5627 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
5631 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5632 ; -O0-LABEL: atomicrmw_min_i32_aligned_acq_rel:
5633 ; -O0: subs w10, w8, w9
5634 ; -O0: and w10, w10, #0x1
5635 ; -O0: ands w10, w10, #0x1
5636 ; -O0: csel w12, w8, w9, ne
5637 ; -O0: ldaxr w9, [x11]
5639 ; -O0: stlxr w10, w12, [x11]
5640 ; -O0: subs w8, w9, w8
5642 ; -O1-LABEL: atomicrmw_min_i32_aligned_acq_rel:
5643 ; -O1: ldaxr w8, [x0]
5645 ; -O1: csel w9, w8, w1, le
5646 ; -O1: stlxr w10, w9, [x0]
5647 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
5651 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5652 ; -O0-LABEL: atomicrmw_min_i32_aligned_seq_cst:
5653 ; -O0: subs w10, w8, w9
5654 ; -O0: and w10, w10, #0x1
5655 ; -O0: ands w10, w10, #0x1
5656 ; -O0: csel w12, w8, w9, ne
5657 ; -O0: ldaxr w9, [x11]
5659 ; -O0: stlxr w10, w12, [x11]
5660 ; -O0: subs w8, w9, w8
5662 ; -O1-LABEL: atomicrmw_min_i32_aligned_seq_cst:
5663 ; -O1: ldaxr w8, [x0]
5665 ; -O1: csel w9, w8, w1, le
5666 ; -O1: stlxr w10, w9, [x0]
5667 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
5671 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5672 ; -O0-LABEL: atomicrmw_min_i64_aligned_monotonic:
5673 ; -O0: subs x10, x8, x9
5674 ; -O0: and w10, w10, #0x1
5675 ; -O0: ands w10, w10, #0x1
5676 ; -O0: csel x12, x8, x9, ne
5677 ; -O0: ldaxr x9, [x11]
5679 ; -O0: stlxr w10, x12, [x11]
5680 ; -O0: subs x8, x9, x8
5682 ; -O1-LABEL: atomicrmw_min_i64_aligned_monotonic:
5683 ; -O1: ldxr x0, [x8]
5685 ; -O1: csel x9, x0, x1, le
5686 ; -O1: stxr w10, x9, [x8]
5687 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
5691 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
5692 ; -O0-LABEL: atomicrmw_min_i64_aligned_acquire:
5693 ; -O0: subs x10, x8, x9
5694 ; -O0: and w10, w10, #0x1
5695 ; -O0: ands w10, w10, #0x1
5696 ; -O0: csel x12, x8, x9, ne
5697 ; -O0: ldaxr x9, [x11]
5699 ; -O0: stlxr w10, x12, [x11]
5700 ; -O0: subs x8, x9, x8
5702 ; -O1-LABEL: atomicrmw_min_i64_aligned_acquire:
5703 ; -O1: ldaxr x0, [x8]
5705 ; -O1: csel x9, x0, x1, le
5706 ; -O1: stxr w10, x9, [x8]
5707 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
5711 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
5712 ; -O0-LABEL: atomicrmw_min_i64_aligned_release:
5713 ; -O0: subs x10, x8, x9
5714 ; -O0: and w10, w10, #0x1
5715 ; -O0: ands w10, w10, #0x1
5716 ; -O0: csel x12, x8, x9, ne
5717 ; -O0: ldaxr x9, [x11]
5719 ; -O0: stlxr w10, x12, [x11]
5720 ; -O0: subs x8, x9, x8
5722 ; -O1-LABEL: atomicrmw_min_i64_aligned_release:
5723 ; -O1: ldxr x0, [x8]
5725 ; -O1: csel x9, x0, x1, le
5726 ; -O1: stlxr w10, x9, [x8]
5727 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
5731 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5732 ; -O0-LABEL: atomicrmw_min_i64_aligned_acq_rel:
5733 ; -O0: subs x10, x8, x9
5734 ; -O0: and w10, w10, #0x1
5735 ; -O0: ands w10, w10, #0x1
5736 ; -O0: csel x12, x8, x9, ne
5737 ; -O0: ldaxr x9, [x11]
5739 ; -O0: stlxr w10, x12, [x11]
5740 ; -O0: subs x8, x9, x8
5742 ; -O1-LABEL: atomicrmw_min_i64_aligned_acq_rel:
5743 ; -O1: ldaxr x0, [x8]
5745 ; -O1: csel x9, x0, x1, le
5746 ; -O1: stlxr w10, x9, [x8]
5747 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
5751 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5752 ; -O0-LABEL: atomicrmw_min_i64_aligned_seq_cst:
5753 ; -O0: subs x10, x8, x9
5754 ; -O0: and w10, w10, #0x1
5755 ; -O0: ands w10, w10, #0x1
5756 ; -O0: csel x12, x8, x9, ne
5757 ; -O0: ldaxr x9, [x11]
5759 ; -O0: stlxr w10, x12, [x11]
5760 ; -O0: subs x8, x9, x8
5762 ; -O1-LABEL: atomicrmw_min_i64_aligned_seq_cst:
5763 ; -O1: ldaxr x0, [x8]
5765 ; -O1: csel x9, x0, x1, le
5766 ; -O1: stlxr w10, x9, [x8]
5767 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
5771 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5772 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
5773 ; -O0: subs x8, x8, x9
5774 ; -O0: subs x8, x8, x9
5775 ; -O0: subs x8, x8, x12
5776 ; -O0: and w13, w13, #0x1
5777 ; -O0: ands w13, w13, #0x1
5778 ; -O0: csel w8, w8, w10, ne
5779 ; -O0: and w13, w8, #0x1
5780 ; -O0: ands w13, w13, #0x1
5781 ; -O0: csel x14, x10, x12, ne
5782 ; -O0: and w10, w8, #0x1
5783 ; -O0: ands w10, w10, #0x1
5784 ; -O0: csel x15, x8, x9, ne
5785 ; -O0: ldxp x10, x9, [x11]
5788 ; -O0: stxp w8, x14, x15, [x11]
5789 ; -O0: stxp w8, x10, x9, [x11]
5790 ; -O0: eor x8, x10, x8
5791 ; -O0: eor x11, x9, x11
5792 ; -O0: orr x8, x8, x11
5793 ; -O0: subs x8, x8, #0
5795 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
5796 ; -O1: ldxp x0, x1, [x8]
5798 ; -O1: csel x9, x1, x3, ge
5799 ; -O1: csel x10, x0, x2, ge
5800 ; -O1: stxp w11, x10, x9, [x8]
5801 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
5805 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
5806 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
5807 ; -O0: subs x8, x8, x9
5808 ; -O0: subs x8, x8, x9
5809 ; -O0: subs x8, x8, x12
5810 ; -O0: and w13, w13, #0x1
5811 ; -O0: ands w13, w13, #0x1
5812 ; -O0: csel w8, w8, w10, ne
5813 ; -O0: and w13, w8, #0x1
5814 ; -O0: ands w13, w13, #0x1
5815 ; -O0: csel x14, x10, x12, ne
5816 ; -O0: and w10, w8, #0x1
5817 ; -O0: ands w10, w10, #0x1
5818 ; -O0: csel x15, x8, x9, ne
5819 ; -O0: ldaxp x10, x9, [x11]
5822 ; -O0: stxp w8, x14, x15, [x11]
5823 ; -O0: stxp w8, x10, x9, [x11]
5824 ; -O0: eor x8, x10, x8
5825 ; -O0: eor x11, x9, x11
5826 ; -O0: orr x8, x8, x11
5827 ; -O0: subs x8, x8, #0
5829 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
5830 ; -O1: ldaxp x0, x1, [x8]
5832 ; -O1: csel x9, x1, x3, ge
5833 ; -O1: csel x10, x0, x2, ge
5834 ; -O1: stxp w11, x10, x9, [x8]
5835 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
5839 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
5840 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
5841 ; -O0: subs x8, x8, x9
5842 ; -O0: subs x8, x8, x9
5843 ; -O0: subs x8, x8, x12
5844 ; -O0: and w13, w13, #0x1
5845 ; -O0: ands w13, w13, #0x1
5846 ; -O0: csel w8, w8, w10, ne
5847 ; -O0: and w13, w8, #0x1
5848 ; -O0: ands w13, w13, #0x1
5849 ; -O0: csel x14, x10, x12, ne
5850 ; -O0: and w10, w8, #0x1
5851 ; -O0: ands w10, w10, #0x1
5852 ; -O0: csel x15, x8, x9, ne
5853 ; -O0: ldxp x10, x9, [x11]
5856 ; -O0: stlxp w8, x14, x15, [x11]
5857 ; -O0: stlxp w8, x10, x9, [x11]
5858 ; -O0: eor x8, x10, x8
5859 ; -O0: eor x11, x9, x11
5860 ; -O0: orr x8, x8, x11
5861 ; -O0: subs x8, x8, #0
5863 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
5864 ; -O1: ldxp x0, x1, [x8]
5866 ; -O1: csel x9, x1, x3, ge
5867 ; -O1: csel x10, x0, x2, ge
5868 ; -O1: stlxp w11, x10, x9, [x8]
5869 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
5873 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5874 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
5875 ; -O0: subs x8, x8, x9
5876 ; -O0: subs x8, x8, x9
5877 ; -O0: subs x8, x8, x12
5878 ; -O0: and w13, w13, #0x1
5879 ; -O0: ands w13, w13, #0x1
5880 ; -O0: csel w8, w8, w10, ne
5881 ; -O0: and w13, w8, #0x1
5882 ; -O0: ands w13, w13, #0x1
5883 ; -O0: csel x14, x10, x12, ne
5884 ; -O0: and w10, w8, #0x1
5885 ; -O0: ands w10, w10, #0x1
5886 ; -O0: csel x15, x8, x9, ne
5887 ; -O0: ldaxp x10, x9, [x11]
5890 ; -O0: stlxp w8, x14, x15, [x11]
5891 ; -O0: stlxp w8, x10, x9, [x11]
5892 ; -O0: eor x8, x10, x8
5893 ; -O0: eor x11, x9, x11
5894 ; -O0: orr x8, x8, x11
5895 ; -O0: subs x8, x8, #0
5897 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
5898 ; -O1: ldaxp x0, x1, [x8]
5900 ; -O1: csel x9, x1, x3, ge
5901 ; -O1: csel x10, x0, x2, ge
5902 ; -O1: stlxp w11, x10, x9, [x8]
5903 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
5907 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5908 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
5909 ; -O0: subs x8, x8, x9
5910 ; -O0: subs x8, x8, x9
5911 ; -O0: subs x8, x8, x12
5912 ; -O0: and w13, w13, #0x1
5913 ; -O0: ands w13, w13, #0x1
5914 ; -O0: csel w8, w8, w10, ne
5915 ; -O0: and w13, w8, #0x1
5916 ; -O0: ands w13, w13, #0x1
5917 ; -O0: csel x14, x10, x12, ne
5918 ; -O0: and w10, w8, #0x1
5919 ; -O0: ands w10, w10, #0x1
5920 ; -O0: csel x15, x8, x9, ne
5921 ; -O0: ldaxp x10, x9, [x11]
5924 ; -O0: stlxp w8, x14, x15, [x11]
5925 ; -O0: stlxp w8, x10, x9, [x11]
5926 ; -O0: eor x8, x10, x8
5927 ; -O0: eor x11, x9, x11
5928 ; -O0: orr x8, x8, x11
5929 ; -O0: subs x8, x8, #0
5931 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
5932 ; -O1: ldaxp x0, x1, [x8]
5934 ; -O1: csel x9, x1, x3, ge
5935 ; -O1: csel x10, x0, x2, ge
5936 ; -O1: stlxp w11, x10, x9, [x8]
5937 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
5941 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5942 ; -O0-LABEL: atomicrmw_min_i8_unaligned_monotonic:
5944 ; -O0: subs w9, w9, w8, sxtb
5945 ; -O0: and w9, w9, #0x1
5946 ; -O0: ands w9, w9, #0x1
5947 ; -O0: csel w12, w10, w8, ne
5948 ; -O0: ldaxrb w9, [x11]
5949 ; -O0: cmp w9, w10, uxtb
5950 ; -O0: stlxrb w8, w12, [x11]
5951 ; -O0: and w8, w9, #0xff
5952 ; -O0: subs w8, w8, w10, uxtb
5954 ; -O1-LABEL: atomicrmw_min_i8_unaligned_monotonic:
5955 ; -O1: ldxrb w9, [x0]
5957 ; -O1: cmp w8, w1, sxtb
5958 ; -O1: csel w9, w9, w1, le
5959 ; -O1: stxrb w10, w9, [x0]
5960 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
5964 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5965 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acquire:
5967 ; -O0: subs w9, w9, w8, sxtb
5968 ; -O0: and w9, w9, #0x1
5969 ; -O0: ands w9, w9, #0x1
5970 ; -O0: csel w12, w10, w8, ne
5971 ; -O0: ldaxrb w9, [x11]
5972 ; -O0: cmp w9, w10, uxtb
5973 ; -O0: stlxrb w8, w12, [x11]
5974 ; -O0: and w8, w9, #0xff
5975 ; -O0: subs w8, w8, w10, uxtb
5977 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acquire:
5978 ; -O1: ldaxrb w9, [x0]
5980 ; -O1: cmp w8, w1, sxtb
5981 ; -O1: csel w9, w9, w1, le
5982 ; -O1: stxrb w10, w9, [x0]
5983 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
5987 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
5988 ; -O0-LABEL: atomicrmw_min_i8_unaligned_release:
5990 ; -O0: subs w9, w9, w8, sxtb
5991 ; -O0: and w9, w9, #0x1
5992 ; -O0: ands w9, w9, #0x1
5993 ; -O0: csel w12, w10, w8, ne
5994 ; -O0: ldaxrb w9, [x11]
5995 ; -O0: cmp w9, w10, uxtb
5996 ; -O0: stlxrb w8, w12, [x11]
5997 ; -O0: and w8, w9, #0xff
5998 ; -O0: subs w8, w8, w10, uxtb
6000 ; -O1-LABEL: atomicrmw_min_i8_unaligned_release:
6001 ; -O1: ldxrb w9, [x0]
6003 ; -O1: cmp w8, w1, sxtb
6004 ; -O1: csel w9, w9, w1, le
6005 ; -O1: stlxrb w10, w9, [x0]
6006 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
6010 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6011 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
6013 ; -O0: subs w9, w9, w8, sxtb
6014 ; -O0: and w9, w9, #0x1
6015 ; -O0: ands w9, w9, #0x1
6016 ; -O0: csel w12, w10, w8, ne
6017 ; -O0: ldaxrb w9, [x11]
6018 ; -O0: cmp w9, w10, uxtb
6019 ; -O0: stlxrb w8, w12, [x11]
6020 ; -O0: and w8, w9, #0xff
6021 ; -O0: subs w8, w8, w10, uxtb
6023 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
6024 ; -O1: ldaxrb w9, [x0]
6026 ; -O1: cmp w8, w1, sxtb
6027 ; -O1: csel w9, w9, w1, le
6028 ; -O1: stlxrb w10, w9, [x0]
6029 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
6033 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6034 ; -O0-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
6036 ; -O0: subs w9, w9, w8, sxtb
6037 ; -O0: and w9, w9, #0x1
6038 ; -O0: ands w9, w9, #0x1
6039 ; -O0: csel w12, w10, w8, ne
6040 ; -O0: ldaxrb w9, [x11]
6041 ; -O0: cmp w9, w10, uxtb
6042 ; -O0: stlxrb w8, w12, [x11]
6043 ; -O0: and w8, w9, #0xff
6044 ; -O0: subs w8, w8, w10, uxtb
6046 ; -O1-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
6047 ; -O1: ldaxrb w9, [x0]
6049 ; -O1: cmp w8, w1, sxtb
6050 ; -O1: csel w9, w9, w1, le
6051 ; -O1: stlxrb w10, w9, [x0]
6052 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
6056 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6057 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
6059 ; -O0: subs w10, w10, w8, sxth
6060 ; -O0: and w10, w10, #0x1
6061 ; -O0: ands w10, w10, #0x1
6062 ; -O0: csel w8, w9, w8, ne
6063 ; -O0: bl __atomic_compare_exchange
6065 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
6067 ; -O1: cmp w8, w20, sxth
6068 ; -O1: csel w8, w0, w20, le
6069 ; -O1: bl __atomic_compare_exchange
6070 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
6074 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6075 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
6077 ; -O0: subs w10, w10, w8, sxth
6078 ; -O0: and w10, w10, #0x1
6079 ; -O0: ands w10, w10, #0x1
6080 ; -O0: csel w8, w9, w8, ne
6081 ; -O0: bl __atomic_compare_exchange
6083 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
6085 ; -O1: cmp w8, w20, sxth
6086 ; -O1: csel w8, w0, w20, le
6087 ; -O1: bl __atomic_compare_exchange
6088 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
6092 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
6093 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
6095 ; -O0: subs w10, w10, w8, sxth
6096 ; -O0: and w10, w10, #0x1
6097 ; -O0: ands w10, w10, #0x1
6098 ; -O0: csel w8, w9, w8, ne
6099 ; -O0: bl __atomic_compare_exchange
6101 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
6103 ; -O1: cmp w8, w20, sxth
6104 ; -O1: csel w8, w0, w20, le
6105 ; -O1: bl __atomic_compare_exchange
6106 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
6110 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6111 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
6113 ; -O0: subs w10, w10, w8, sxth
6114 ; -O0: and w10, w10, #0x1
6115 ; -O0: ands w10, w10, #0x1
6116 ; -O0: csel w8, w9, w8, ne
6117 ; -O0: bl __atomic_compare_exchange
6119 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
6121 ; -O1: cmp w8, w20, sxth
6122 ; -O1: csel w8, w0, w20, le
6123 ; -O1: bl __atomic_compare_exchange
6124 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
6128 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6129 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
6131 ; -O0: subs w10, w10, w8, sxth
6132 ; -O0: and w10, w10, #0x1
6133 ; -O0: ands w10, w10, #0x1
6134 ; -O0: csel w8, w9, w8, ne
6135 ; -O0: bl __atomic_compare_exchange
6137 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
6139 ; -O1: cmp w8, w20, sxth
6140 ; -O1: csel w8, w0, w20, le
6141 ; -O1: bl __atomic_compare_exchange
6142 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
6146 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6147 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
6148 ; -O0: subs w10, w9, w8
6149 ; -O0: and w10, w10, #0x1
6150 ; -O0: ands w10, w10, #0x1
6151 ; -O0: csel w8, w9, w8, ne
6152 ; -O0: bl __atomic_compare_exchange
6154 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
6156 ; -O1: csel w8, w0, w20, le
6157 ; -O1: bl __atomic_compare_exchange
6158 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
6162 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6163 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
6164 ; -O0: subs w10, w9, w8
6165 ; -O0: and w10, w10, #0x1
6166 ; -O0: ands w10, w10, #0x1
6167 ; -O0: csel w8, w9, w8, ne
6168 ; -O0: bl __atomic_compare_exchange
6170 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
6172 ; -O1: csel w8, w0, w20, le
6173 ; -O1: bl __atomic_compare_exchange
6174 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
6178 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
6179 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
6180 ; -O0: subs w10, w9, w8
6181 ; -O0: and w10, w10, #0x1
6182 ; -O0: ands w10, w10, #0x1
6183 ; -O0: csel w8, w9, w8, ne
6184 ; -O0: bl __atomic_compare_exchange
6186 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
6188 ; -O1: csel w8, w0, w20, le
6189 ; -O1: bl __atomic_compare_exchange
6190 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
6194 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6195 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
6196 ; -O0: subs w10, w9, w8
6197 ; -O0: and w10, w10, #0x1
6198 ; -O0: ands w10, w10, #0x1
6199 ; -O0: csel w8, w9, w8, ne
6200 ; -O0: bl __atomic_compare_exchange
6202 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
6204 ; -O1: csel w8, w0, w20, le
6205 ; -O1: bl __atomic_compare_exchange
6206 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
6210 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6211 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
6212 ; -O0: subs w10, w9, w8
6213 ; -O0: and w10, w10, #0x1
6214 ; -O0: ands w10, w10, #0x1
6215 ; -O0: csel w8, w9, w8, ne
6216 ; -O0: bl __atomic_compare_exchange
6218 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
6220 ; -O1: csel w8, w0, w20, le
6221 ; -O1: bl __atomic_compare_exchange
6222 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
6226 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6227 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
6228 ; -O0: subs x10, x9, x8
6229 ; -O0: and w10, w10, #0x1
6230 ; -O0: ands w10, w10, #0x1
6231 ; -O0: csel x8, x9, x8, ne
6232 ; -O0: bl __atomic_compare_exchange
6234 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
6236 ; -O1: csel x8, x0, x20, le
6237 ; -O1: bl __atomic_compare_exchange
6238 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
6242 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6243 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
6244 ; -O0: subs x10, x9, x8
6245 ; -O0: and w10, w10, #0x1
6246 ; -O0: ands w10, w10, #0x1
6247 ; -O0: csel x8, x9, x8, ne
6248 ; -O0: bl __atomic_compare_exchange
6250 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
6252 ; -O1: csel x8, x0, x20, le
6253 ; -O1: bl __atomic_compare_exchange
6254 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
6258 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
6259 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
6260 ; -O0: subs x10, x9, x8
6261 ; -O0: and w10, w10, #0x1
6262 ; -O0: ands w10, w10, #0x1
6263 ; -O0: csel x8, x9, x8, ne
6264 ; -O0: bl __atomic_compare_exchange
6266 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
6268 ; -O1: csel x8, x0, x20, le
6269 ; -O1: bl __atomic_compare_exchange
6270 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
6274 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6275 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
6276 ; -O0: subs x10, x9, x8
6277 ; -O0: and w10, w10, #0x1
6278 ; -O0: ands w10, w10, #0x1
6279 ; -O0: csel x8, x9, x8, ne
6280 ; -O0: bl __atomic_compare_exchange
6282 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
6284 ; -O1: csel x8, x0, x20, le
6285 ; -O1: bl __atomic_compare_exchange
6286 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
6290 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6291 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
6292 ; -O0: subs x10, x9, x8
6293 ; -O0: and w10, w10, #0x1
6294 ; -O0: ands w10, w10, #0x1
6295 ; -O0: csel x8, x9, x8, ne
6296 ; -O0: bl __atomic_compare_exchange
6298 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
6300 ; -O1: csel x8, x0, x20, le
6301 ; -O1: bl __atomic_compare_exchange
6302 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
6306 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6307 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
6308 ; -O0: subs x8, x8, x10
6309 ; -O0: subs x8, x8, x10
6310 ; -O0: subs x8, x8, x11
6311 ; -O0: and w12, w12, #0x1
6312 ; -O0: ands w12, w12, #0x1
6313 ; -O0: csel w8, w8, w9, ne
6314 ; -O0: and w12, w8, #0x1
6315 ; -O0: ands w12, w12, #0x1
6316 ; -O0: csel x9, x9, x11, ne
6317 ; -O0: and w11, w8, #0x1
6318 ; -O0: ands w11, w11, #0x1
6319 ; -O0: csel x8, x8, x10, ne
6320 ; -O0: bl __atomic_compare_exchange
6322 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
6323 ; -O1: ldp x0, x1, [x0]
6325 ; -O1: csel x8, x1, x19, ge
6326 ; -O1: csel x9, x0, x21, ge
6327 ; -O1: bl __atomic_compare_exchange
6328 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
6332 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6333 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
6334 ; -O0: subs x8, x8, x10
6335 ; -O0: subs x8, x8, x10
6336 ; -O0: subs x8, x8, x11
6337 ; -O0: and w12, w12, #0x1
6338 ; -O0: ands w12, w12, #0x1
6339 ; -O0: csel w8, w8, w9, ne
6340 ; -O0: and w12, w8, #0x1
6341 ; -O0: ands w12, w12, #0x1
6342 ; -O0: csel x9, x9, x11, ne
6343 ; -O0: and w11, w8, #0x1
6344 ; -O0: ands w11, w11, #0x1
6345 ; -O0: csel x8, x8, x10, ne
6346 ; -O0: bl __atomic_compare_exchange
6348 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
6349 ; -O1: ldp x0, x1, [x0]
6351 ; -O1: csel x8, x1, x19, ge
6352 ; -O1: csel x9, x0, x21, ge
6353 ; -O1: bl __atomic_compare_exchange
6354 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
6358 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
6359 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
6360 ; -O0: subs x8, x8, x10
6361 ; -O0: subs x8, x8, x10
6362 ; -O0: subs x8, x8, x11
6363 ; -O0: and w12, w12, #0x1
6364 ; -O0: ands w12, w12, #0x1
6365 ; -O0: csel w8, w8, w9, ne
6366 ; -O0: and w12, w8, #0x1
6367 ; -O0: ands w12, w12, #0x1
6368 ; -O0: csel x9, x9, x11, ne
6369 ; -O0: and w11, w8, #0x1
6370 ; -O0: ands w11, w11, #0x1
6371 ; -O0: csel x8, x8, x10, ne
6372 ; -O0: bl __atomic_compare_exchange
6374 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
6375 ; -O1: ldp x0, x1, [x0]
6377 ; -O1: csel x8, x1, x19, ge
6378 ; -O1: csel x9, x0, x21, ge
6379 ; -O1: bl __atomic_compare_exchange
6380 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
6384 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6385 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
6386 ; -O0: subs x8, x8, x10
6387 ; -O0: subs x8, x8, x10
6388 ; -O0: subs x8, x8, x11
6389 ; -O0: and w12, w12, #0x1
6390 ; -O0: ands w12, w12, #0x1
6391 ; -O0: csel w8, w8, w9, ne
6392 ; -O0: and w12, w8, #0x1
6393 ; -O0: ands w12, w12, #0x1
6394 ; -O0: csel x9, x9, x11, ne
6395 ; -O0: and w11, w8, #0x1
6396 ; -O0: ands w11, w11, #0x1
6397 ; -O0: csel x8, x8, x10, ne
6398 ; -O0: bl __atomic_compare_exchange
6400 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
6401 ; -O1: ldp x0, x1, [x0]
6403 ; -O1: csel x8, x1, x19, ge
6404 ; -O1: csel x9, x0, x21, ge
6405 ; -O1: bl __atomic_compare_exchange
6406 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
6410 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6411 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
6412 ; -O0: subs x8, x8, x10
6413 ; -O0: subs x8, x8, x10
6414 ; -O0: subs x8, x8, x11
6415 ; -O0: and w12, w12, #0x1
6416 ; -O0: ands w12, w12, #0x1
6417 ; -O0: csel w8, w8, w9, ne
6418 ; -O0: and w12, w8, #0x1
6419 ; -O0: ands w12, w12, #0x1
6420 ; -O0: csel x9, x9, x11, ne
6421 ; -O0: and w11, w8, #0x1
6422 ; -O0: ands w11, w11, #0x1
6423 ; -O0: csel x8, x8, x10, ne
6424 ; -O0: bl __atomic_compare_exchange
6426 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
6427 ; -O1: ldp x0, x1, [x0]
6429 ; -O1: csel x8, x1, x19, ge
6430 ; -O1: csel x9, x0, x21, ge
6431 ; -O1: bl __atomic_compare_exchange
6432 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
6436 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
6437 ; -O0-LABEL: atomicrmw_umax_i8_aligned_monotonic:
6438 ; -O0: and w9, w10, #0xff
6439 ; -O0: subs w9, w9, w8, uxtb
6440 ; -O0: and w9, w9, #0x1
6441 ; -O0: ands w9, w9, #0x1
6442 ; -O0: csel w12, w10, w8, ne
6443 ; -O0: ldaxrb w9, [x11]
6444 ; -O0: cmp w9, w10, uxtb
6445 ; -O0: stlxrb w8, w12, [x11]
6446 ; -O0: and w8, w9, #0xff
6447 ; -O0: subs w8, w8, w10, uxtb
6449 ; -O1-LABEL: atomicrmw_umax_i8_aligned_monotonic:
6450 ; -O1: and w9, w1, #0xff
6451 ; -O1: ldxrb w8, [x0]
6453 ; -O1: csel w10, w8, w9, hi
6454 ; -O1: stxrb w11, w10, [x0]
6455 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
6459 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
6460 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acquire:
6461 ; -O0: and w9, w10, #0xff
6462 ; -O0: subs w9, w9, w8, uxtb
6463 ; -O0: and w9, w9, #0x1
6464 ; -O0: ands w9, w9, #0x1
6465 ; -O0: csel w12, w10, w8, ne
6466 ; -O0: ldaxrb w9, [x11]
6467 ; -O0: cmp w9, w10, uxtb
6468 ; -O0: stlxrb w8, w12, [x11]
6469 ; -O0: and w8, w9, #0xff
6470 ; -O0: subs w8, w8, w10, uxtb
6472 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acquire:
6473 ; -O1: and w9, w1, #0xff
6474 ; -O1: ldaxrb w8, [x0]
6476 ; -O1: csel w10, w8, w9, hi
6477 ; -O1: stxrb w11, w10, [x0]
6478 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
6482 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
6483 ; -O0-LABEL: atomicrmw_umax_i8_aligned_release:
6484 ; -O0: and w9, w10, #0xff
6485 ; -O0: subs w9, w9, w8, uxtb
6486 ; -O0: and w9, w9, #0x1
6487 ; -O0: ands w9, w9, #0x1
6488 ; -O0: csel w12, w10, w8, ne
6489 ; -O0: ldaxrb w9, [x11]
6490 ; -O0: cmp w9, w10, uxtb
6491 ; -O0: stlxrb w8, w12, [x11]
6492 ; -O0: and w8, w9, #0xff
6493 ; -O0: subs w8, w8, w10, uxtb
6495 ; -O1-LABEL: atomicrmw_umax_i8_aligned_release:
6496 ; -O1: and w9, w1, #0xff
6497 ; -O1: ldxrb w8, [x0]
6499 ; -O1: csel w10, w8, w9, hi
6500 ; -O1: stlxrb w11, w10, [x0]
6501 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
6505 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
6506 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
6507 ; -O0: and w9, w10, #0xff
6508 ; -O0: subs w9, w9, w8, uxtb
6509 ; -O0: and w9, w9, #0x1
6510 ; -O0: ands w9, w9, #0x1
6511 ; -O0: csel w12, w10, w8, ne
6512 ; -O0: ldaxrb w9, [x11]
6513 ; -O0: cmp w9, w10, uxtb
6514 ; -O0: stlxrb w8, w12, [x11]
6515 ; -O0: and w8, w9, #0xff
6516 ; -O0: subs w8, w8, w10, uxtb
6518 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
6519 ; -O1: and w9, w1, #0xff
6520 ; -O1: ldaxrb w8, [x0]
6522 ; -O1: csel w10, w8, w9, hi
6523 ; -O1: stlxrb w11, w10, [x0]
6524 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
6528 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
6529 ; -O0-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
6530 ; -O0: and w9, w10, #0xff
6531 ; -O0: subs w9, w9, w8, uxtb
6532 ; -O0: and w9, w9, #0x1
6533 ; -O0: ands w9, w9, #0x1
6534 ; -O0: csel w12, w10, w8, ne
6535 ; -O0: ldaxrb w9, [x11]
6536 ; -O0: cmp w9, w10, uxtb
6537 ; -O0: stlxrb w8, w12, [x11]
6538 ; -O0: and w8, w9, #0xff
6539 ; -O0: subs w8, w8, w10, uxtb
6541 ; -O1-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
6542 ; -O1: and w9, w1, #0xff
6543 ; -O1: ldaxrb w8, [x0]
6545 ; -O1: csel w10, w8, w9, hi
6546 ; -O1: stlxrb w11, w10, [x0]
6547 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
6551 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
6552 ; -O0-LABEL: atomicrmw_umax_i16_aligned_monotonic:
6553 ; -O0: subs w10, w10, w9, uxth
6554 ; -O0: and w10, w10, #0x1
6555 ; -O0: ands w10, w10, #0x1
6556 ; -O0: csel w12, w8, w9, ne
6557 ; -O0: ldaxrh w9, [x11]
6558 ; -O0: cmp w9, w8, uxth
6559 ; -O0: stlxrh w10, w12, [x11]
6560 ; -O0: subs w8, w8, w9, uxth
6562 ; -O1-LABEL: atomicrmw_umax_i16_aligned_monotonic:
6563 ; -O1: and w9, w1, #0xffff
6564 ; -O1: ldxrh w8, [x0]
6566 ; -O1: csel w10, w8, w9, hi
6567 ; -O1: stxrh w11, w10, [x0]
6568 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
6572 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
6573 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acquire:
6574 ; -O0: subs w10, w10, w9, uxth
6575 ; -O0: and w10, w10, #0x1
6576 ; -O0: ands w10, w10, #0x1
6577 ; -O0: csel w12, w8, w9, ne
6578 ; -O0: ldaxrh w9, [x11]
6579 ; -O0: cmp w9, w8, uxth
6580 ; -O0: stlxrh w10, w12, [x11]
6581 ; -O0: subs w8, w8, w9, uxth
6583 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acquire:
6584 ; -O1: and w9, w1, #0xffff
6585 ; -O1: ldaxrh w8, [x0]
6587 ; -O1: csel w10, w8, w9, hi
6588 ; -O1: stxrh w11, w10, [x0]
6589 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
6593 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
6594 ; -O0-LABEL: atomicrmw_umax_i16_aligned_release:
6595 ; -O0: subs w10, w10, w9, uxth
6596 ; -O0: and w10, w10, #0x1
6597 ; -O0: ands w10, w10, #0x1
6598 ; -O0: csel w12, w8, w9, ne
6599 ; -O0: ldaxrh w9, [x11]
6600 ; -O0: cmp w9, w8, uxth
6601 ; -O0: stlxrh w10, w12, [x11]
6602 ; -O0: subs w8, w8, w9, uxth
6604 ; -O1-LABEL: atomicrmw_umax_i16_aligned_release:
6605 ; -O1: and w9, w1, #0xffff
6606 ; -O1: ldxrh w8, [x0]
6608 ; -O1: csel w10, w8, w9, hi
6609 ; -O1: stlxrh w11, w10, [x0]
6610 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
6614 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6615 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
6616 ; -O0: subs w10, w10, w9, uxth
6617 ; -O0: and w10, w10, #0x1
6618 ; -O0: ands w10, w10, #0x1
6619 ; -O0: csel w12, w8, w9, ne
6620 ; -O0: ldaxrh w9, [x11]
6621 ; -O0: cmp w9, w8, uxth
6622 ; -O0: stlxrh w10, w12, [x11]
6623 ; -O0: subs w8, w8, w9, uxth
6625 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
6626 ; -O1: and w9, w1, #0xffff
6627 ; -O1: ldaxrh w8, [x0]
6629 ; -O1: csel w10, w8, w9, hi
6630 ; -O1: stlxrh w11, w10, [x0]
6631 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
6635 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6636 ; -O0-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
6637 ; -O0: subs w10, w10, w9, uxth
6638 ; -O0: and w10, w10, #0x1
6639 ; -O0: ands w10, w10, #0x1
6640 ; -O0: csel w12, w8, w9, ne
6641 ; -O0: ldaxrh w9, [x11]
6642 ; -O0: cmp w9, w8, uxth
6643 ; -O0: stlxrh w10, w12, [x11]
6644 ; -O0: subs w8, w8, w9, uxth
6646 ; -O1-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
6647 ; -O1: and w9, w1, #0xffff
6648 ; -O1: ldaxrh w8, [x0]
6650 ; -O1: csel w10, w8, w9, hi
6651 ; -O1: stlxrh w11, w10, [x0]
6652 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
6656 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6657 ; -O0-LABEL: atomicrmw_umax_i32_aligned_monotonic:
6658 ; -O0: subs w10, w8, w9
6659 ; -O0: and w10, w10, #0x1
6660 ; -O0: ands w10, w10, #0x1
6661 ; -O0: csel w12, w8, w9, ne
6662 ; -O0: ldaxr w9, [x11]
6664 ; -O0: stlxr w10, w12, [x11]
6665 ; -O0: subs w8, w9, w8
6667 ; -O1-LABEL: atomicrmw_umax_i32_aligned_monotonic:
6668 ; -O1: ldxr w8, [x0]
6670 ; -O1: csel w9, w8, w1, hi
6671 ; -O1: stxr w10, w9, [x0]
6672 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
6676 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
6677 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acquire:
6678 ; -O0: subs w10, w8, w9
6679 ; -O0: and w10, w10, #0x1
6680 ; -O0: ands w10, w10, #0x1
6681 ; -O0: csel w12, w8, w9, ne
6682 ; -O0: ldaxr w9, [x11]
6684 ; -O0: stlxr w10, w12, [x11]
6685 ; -O0: subs w8, w9, w8
6687 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acquire:
6688 ; -O1: ldaxr w8, [x0]
6690 ; -O1: csel w9, w8, w1, hi
6691 ; -O1: stxr w10, w9, [x0]
6692 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
6696 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
6697 ; -O0-LABEL: atomicrmw_umax_i32_aligned_release:
6698 ; -O0: subs w10, w8, w9
6699 ; -O0: and w10, w10, #0x1
6700 ; -O0: ands w10, w10, #0x1
6701 ; -O0: csel w12, w8, w9, ne
6702 ; -O0: ldaxr w9, [x11]
6704 ; -O0: stlxr w10, w12, [x11]
6705 ; -O0: subs w8, w9, w8
6707 ; -O1-LABEL: atomicrmw_umax_i32_aligned_release:
6708 ; -O1: ldxr w8, [x0]
6710 ; -O1: csel w9, w8, w1, hi
6711 ; -O1: stlxr w10, w9, [x0]
6712 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
6716 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6717 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
6718 ; -O0: subs w10, w8, w9
6719 ; -O0: and w10, w10, #0x1
6720 ; -O0: ands w10, w10, #0x1
6721 ; -O0: csel w12, w8, w9, ne
6722 ; -O0: ldaxr w9, [x11]
6724 ; -O0: stlxr w10, w12, [x11]
6725 ; -O0: subs w8, w9, w8
6727 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
6728 ; -O1: ldaxr w8, [x0]
6730 ; -O1: csel w9, w8, w1, hi
6731 ; -O1: stlxr w10, w9, [x0]
6732 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
6736 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6737 ; -O0-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
6738 ; -O0: subs w10, w8, w9
6739 ; -O0: and w10, w10, #0x1
6740 ; -O0: ands w10, w10, #0x1
6741 ; -O0: csel w12, w8, w9, ne
6742 ; -O0: ldaxr w9, [x11]
6744 ; -O0: stlxr w10, w12, [x11]
6745 ; -O0: subs w8, w9, w8
6747 ; -O1-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
6748 ; -O1: ldaxr w8, [x0]
6750 ; -O1: csel w9, w8, w1, hi
6751 ; -O1: stlxr w10, w9, [x0]
6752 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
6756 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6757 ; -O0-LABEL: atomicrmw_umax_i64_aligned_monotonic:
6758 ; -O0: subs x10, x8, x9
6759 ; -O0: and w10, w10, #0x1
6760 ; -O0: ands w10, w10, #0x1
6761 ; -O0: csel x12, x8, x9, ne
6762 ; -O0: ldaxr x9, [x11]
6764 ; -O0: stlxr w10, x12, [x11]
6765 ; -O0: subs x8, x9, x8
6767 ; -O1-LABEL: atomicrmw_umax_i64_aligned_monotonic:
6768 ; -O1: ldxr x0, [x8]
6770 ; -O1: csel x9, x0, x1, hi
6771 ; -O1: stxr w10, x9, [x8]
6772 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
6776 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
6777 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acquire:
6778 ; -O0: subs x10, x8, x9
6779 ; -O0: and w10, w10, #0x1
6780 ; -O0: ands w10, w10, #0x1
6781 ; -O0: csel x12, x8, x9, ne
6782 ; -O0: ldaxr x9, [x11]
6784 ; -O0: stlxr w10, x12, [x11]
6785 ; -O0: subs x8, x9, x8
6787 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acquire:
6788 ; -O1: ldaxr x0, [x8]
6790 ; -O1: csel x9, x0, x1, hi
6791 ; -O1: stxr w10, x9, [x8]
6792 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
6796 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
6797 ; -O0-LABEL: atomicrmw_umax_i64_aligned_release:
6798 ; -O0: subs x10, x8, x9
6799 ; -O0: and w10, w10, #0x1
6800 ; -O0: ands w10, w10, #0x1
6801 ; -O0: csel x12, x8, x9, ne
6802 ; -O0: ldaxr x9, [x11]
6804 ; -O0: stlxr w10, x12, [x11]
6805 ; -O0: subs x8, x9, x8
6807 ; -O1-LABEL: atomicrmw_umax_i64_aligned_release:
6808 ; -O1: ldxr x0, [x8]
6810 ; -O1: csel x9, x0, x1, hi
6811 ; -O1: stlxr w10, x9, [x8]
6812 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
6816 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6817 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
6818 ; -O0: subs x10, x8, x9
6819 ; -O0: and w10, w10, #0x1
6820 ; -O0: ands w10, w10, #0x1
6821 ; -O0: csel x12, x8, x9, ne
6822 ; -O0: ldaxr x9, [x11]
6824 ; -O0: stlxr w10, x12, [x11]
6825 ; -O0: subs x8, x9, x8
6827 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
6828 ; -O1: ldaxr x0, [x8]
6830 ; -O1: csel x9, x0, x1, hi
6831 ; -O1: stlxr w10, x9, [x8]
6832 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
6836 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6837 ; -O0-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
6838 ; -O0: subs x10, x8, x9
6839 ; -O0: and w10, w10, #0x1
6840 ; -O0: ands w10, w10, #0x1
6841 ; -O0: csel x12, x8, x9, ne
6842 ; -O0: ldaxr x9, [x11]
6844 ; -O0: stlxr w10, x12, [x11]
6845 ; -O0: subs x8, x9, x8
6847 ; -O1-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
6848 ; -O1: ldaxr x0, [x8]
6850 ; -O1: csel x9, x0, x1, hi
6851 ; -O1: stlxr w10, x9, [x8]
6852 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
6856 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6857 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
6858 ; -O0: subs x8, x8, x9
6859 ; -O0: subs x8, x8, x9
6860 ; -O0: subs x8, x8, x12
6861 ; -O0: and w13, w13, #0x1
6862 ; -O0: ands w13, w13, #0x1
6863 ; -O0: csel w8, w8, w10, ne
6864 ; -O0: and w13, w8, #0x1
6865 ; -O0: ands w13, w13, #0x1
6866 ; -O0: csel x14, x10, x12, ne
6867 ; -O0: and w10, w8, #0x1
6868 ; -O0: ands w10, w10, #0x1
6869 ; -O0: csel x15, x8, x9, ne
6870 ; -O0: ldxp x10, x9, [x11]
6873 ; -O0: stxp w8, x14, x15, [x11]
6874 ; -O0: stxp w8, x10, x9, [x11]
6875 ; -O0: eor x8, x10, x8
6876 ; -O0: eor x11, x9, x11
6877 ; -O0: orr x8, x8, x11
6878 ; -O0: subs x8, x8, #0
6880 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
6881 ; -O1: ldxp x0, x1, [x8]
6883 ; -O1: csel x9, x1, x3, lo
6884 ; -O1: csel x10, x0, x2, lo
6885 ; -O1: stxp w11, x10, x9, [x8]
6886 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
6890 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
6891 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
6892 ; -O0: subs x8, x8, x9
6893 ; -O0: subs x8, x8, x9
6894 ; -O0: subs x8, x8, x12
6895 ; -O0: and w13, w13, #0x1
6896 ; -O0: ands w13, w13, #0x1
6897 ; -O0: csel w8, w8, w10, ne
6898 ; -O0: and w13, w8, #0x1
6899 ; -O0: ands w13, w13, #0x1
6900 ; -O0: csel x14, x10, x12, ne
6901 ; -O0: and w10, w8, #0x1
6902 ; -O0: ands w10, w10, #0x1
6903 ; -O0: csel x15, x8, x9, ne
6904 ; -O0: ldaxp x10, x9, [x11]
6907 ; -O0: stxp w8, x14, x15, [x11]
6908 ; -O0: stxp w8, x10, x9, [x11]
6909 ; -O0: eor x8, x10, x8
6910 ; -O0: eor x11, x9, x11
6911 ; -O0: orr x8, x8, x11
6912 ; -O0: subs x8, x8, #0
6914 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
6915 ; -O1: ldaxp x0, x1, [x8]
6917 ; -O1: csel x9, x1, x3, lo
6918 ; -O1: csel x10, x0, x2, lo
6919 ; -O1: stxp w11, x10, x9, [x8]
6920 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
6924 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
6925 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
6926 ; -O0: subs x8, x8, x9
6927 ; -O0: subs x8, x8, x9
6928 ; -O0: subs x8, x8, x12
6929 ; -O0: and w13, w13, #0x1
6930 ; -O0: ands w13, w13, #0x1
6931 ; -O0: csel w8, w8, w10, ne
6932 ; -O0: and w13, w8, #0x1
6933 ; -O0: ands w13, w13, #0x1
6934 ; -O0: csel x14, x10, x12, ne
6935 ; -O0: and w10, w8, #0x1
6936 ; -O0: ands w10, w10, #0x1
6937 ; -O0: csel x15, x8, x9, ne
6938 ; -O0: ldxp x10, x9, [x11]
6941 ; -O0: stlxp w8, x14, x15, [x11]
6942 ; -O0: stlxp w8, x10, x9, [x11]
6943 ; -O0: eor x8, x10, x8
6944 ; -O0: eor x11, x9, x11
6945 ; -O0: orr x8, x8, x11
6946 ; -O0: subs x8, x8, #0
6948 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
6949 ; -O1: ldxp x0, x1, [x8]
6951 ; -O1: csel x9, x1, x3, lo
6952 ; -O1: csel x10, x0, x2, lo
6953 ; -O1: stlxp w11, x10, x9, [x8]
6954 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
6958 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6959 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
6960 ; -O0: subs x8, x8, x9
6961 ; -O0: subs x8, x8, x9
6962 ; -O0: subs x8, x8, x12
6963 ; -O0: and w13, w13, #0x1
6964 ; -O0: ands w13, w13, #0x1
6965 ; -O0: csel w8, w8, w10, ne
6966 ; -O0: and w13, w8, #0x1
6967 ; -O0: ands w13, w13, #0x1
6968 ; -O0: csel x14, x10, x12, ne
6969 ; -O0: and w10, w8, #0x1
6970 ; -O0: ands w10, w10, #0x1
6971 ; -O0: csel x15, x8, x9, ne
6972 ; -O0: ldaxp x10, x9, [x11]
6975 ; -O0: stlxp w8, x14, x15, [x11]
6976 ; -O0: stlxp w8, x10, x9, [x11]
6977 ; -O0: eor x8, x10, x8
6978 ; -O0: eor x11, x9, x11
6979 ; -O0: orr x8, x8, x11
6980 ; -O0: subs x8, x8, #0
6982 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
6983 ; -O1: ldaxp x0, x1, [x8]
6985 ; -O1: csel x9, x1, x3, lo
6986 ; -O1: csel x10, x0, x2, lo
6987 ; -O1: stlxp w11, x10, x9, [x8]
6988 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
6992 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6993 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
6994 ; -O0: subs x8, x8, x9
6995 ; -O0: subs x8, x8, x9
6996 ; -O0: subs x8, x8, x12
6997 ; -O0: and w13, w13, #0x1
6998 ; -O0: ands w13, w13, #0x1
6999 ; -O0: csel w8, w8, w10, ne
7000 ; -O0: and w13, w8, #0x1
7001 ; -O0: ands w13, w13, #0x1
7002 ; -O0: csel x14, x10, x12, ne
7003 ; -O0: and w10, w8, #0x1
7004 ; -O0: ands w10, w10, #0x1
7005 ; -O0: csel x15, x8, x9, ne
7006 ; -O0: ldaxp x10, x9, [x11]
7009 ; -O0: stlxp w8, x14, x15, [x11]
7010 ; -O0: stlxp w8, x10, x9, [x11]
7011 ; -O0: eor x8, x10, x8
7012 ; -O0: eor x11, x9, x11
7013 ; -O0: orr x8, x8, x11
7014 ; -O0: subs x8, x8, #0
7016 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
7017 ; -O1: ldaxp x0, x1, [x8]
7019 ; -O1: csel x9, x1, x3, lo
7020 ; -O1: csel x10, x0, x2, lo
7021 ; -O1: stlxp w11, x10, x9, [x8]
7022 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
7026 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
7027 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
7028 ; -O0: and w9, w10, #0xff
7029 ; -O0: subs w9, w9, w8, uxtb
7030 ; -O0: and w9, w9, #0x1
7031 ; -O0: ands w9, w9, #0x1
7032 ; -O0: csel w12, w10, w8, ne
7033 ; -O0: ldaxrb w9, [x11]
7034 ; -O0: cmp w9, w10, uxtb
7035 ; -O0: stlxrb w8, w12, [x11]
7036 ; -O0: and w8, w9, #0xff
7037 ; -O0: subs w8, w8, w10, uxtb
7039 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
7040 ; -O1: and w9, w1, #0xff
7041 ; -O1: ldxrb w8, [x0]
7043 ; -O1: csel w10, w8, w9, hi
7044 ; -O1: stxrb w11, w10, [x0]
7045 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
7049 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
7050 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acquire:
7051 ; -O0: and w9, w10, #0xff
7052 ; -O0: subs w9, w9, w8, uxtb
7053 ; -O0: and w9, w9, #0x1
7054 ; -O0: ands w9, w9, #0x1
7055 ; -O0: csel w12, w10, w8, ne
7056 ; -O0: ldaxrb w9, [x11]
7057 ; -O0: cmp w9, w10, uxtb
7058 ; -O0: stlxrb w8, w12, [x11]
7059 ; -O0: and w8, w9, #0xff
7060 ; -O0: subs w8, w8, w10, uxtb
7062 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acquire:
7063 ; -O1: and w9, w1, #0xff
7064 ; -O1: ldaxrb w8, [x0]
7066 ; -O1: csel w10, w8, w9, hi
7067 ; -O1: stxrb w11, w10, [x0]
7068 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
7072 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
7073 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_release:
7074 ; -O0: and w9, w10, #0xff
7075 ; -O0: subs w9, w9, w8, uxtb
7076 ; -O0: and w9, w9, #0x1
7077 ; -O0: ands w9, w9, #0x1
7078 ; -O0: csel w12, w10, w8, ne
7079 ; -O0: ldaxrb w9, [x11]
7080 ; -O0: cmp w9, w10, uxtb
7081 ; -O0: stlxrb w8, w12, [x11]
7082 ; -O0: and w8, w9, #0xff
7083 ; -O0: subs w8, w8, w10, uxtb
7085 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_release:
7086 ; -O1: and w9, w1, #0xff
7087 ; -O1: ldxrb w8, [x0]
7089 ; -O1: csel w10, w8, w9, hi
7090 ; -O1: stlxrb w11, w10, [x0]
7091 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
7095 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
7096 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
7097 ; -O0: and w9, w10, #0xff
7098 ; -O0: subs w9, w9, w8, uxtb
7099 ; -O0: and w9, w9, #0x1
7100 ; -O0: ands w9, w9, #0x1
7101 ; -O0: csel w12, w10, w8, ne
7102 ; -O0: ldaxrb w9, [x11]
7103 ; -O0: cmp w9, w10, uxtb
7104 ; -O0: stlxrb w8, w12, [x11]
7105 ; -O0: and w8, w9, #0xff
7106 ; -O0: subs w8, w8, w10, uxtb
7108 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
7109 ; -O1: and w9, w1, #0xff
7110 ; -O1: ldaxrb w8, [x0]
7112 ; -O1: csel w10, w8, w9, hi
7113 ; -O1: stlxrb w11, w10, [x0]
7114 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
7118 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
7119 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
7120 ; -O0: and w9, w10, #0xff
7121 ; -O0: subs w9, w9, w8, uxtb
7122 ; -O0: and w9, w9, #0x1
7123 ; -O0: ands w9, w9, #0x1
7124 ; -O0: csel w12, w10, w8, ne
7125 ; -O0: ldaxrb w9, [x11]
7126 ; -O0: cmp w9, w10, uxtb
7127 ; -O0: stlxrb w8, w12, [x11]
7128 ; -O0: and w8, w9, #0xff
7129 ; -O0: subs w8, w8, w10, uxtb
7131 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
7132 ; -O1: and w9, w1, #0xff
7133 ; -O1: ldaxrb w8, [x0]
7135 ; -O1: csel w10, w8, w9, hi
7136 ; -O1: stlxrb w11, w10, [x0]
7137 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
7141 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
7142 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
7143 ; -O0: subs w10, w10, w8, uxth
7144 ; -O0: and w10, w10, #0x1
7145 ; -O0: ands w10, w10, #0x1
7146 ; -O0: csel w8, w9, w8, ne
7147 ; -O0: bl __atomic_compare_exchange
7149 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
7150 ; -O1: and w8, w0, #0xffff
7151 ; -O1: cmp w8, w20, uxth
7152 ; -O1: csel w8, w0, w20, hi
7153 ; -O1: bl __atomic_compare_exchange
7154 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
7158 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
7159 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
7160 ; -O0: subs w10, w10, w8, uxth
7161 ; -O0: and w10, w10, #0x1
7162 ; -O0: ands w10, w10, #0x1
7163 ; -O0: csel w8, w9, w8, ne
7164 ; -O0: bl __atomic_compare_exchange
7166 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
7167 ; -O1: and w8, w0, #0xffff
7168 ; -O1: cmp w8, w20, uxth
7169 ; -O1: csel w8, w0, w20, hi
7170 ; -O1: bl __atomic_compare_exchange
7171 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
7175 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
7176 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
7177 ; -O0: subs w10, w10, w8, uxth
7178 ; -O0: and w10, w10, #0x1
7179 ; -O0: ands w10, w10, #0x1
7180 ; -O0: csel w8, w9, w8, ne
7181 ; -O0: bl __atomic_compare_exchange
7183 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
7184 ; -O1: and w8, w0, #0xffff
7185 ; -O1: cmp w8, w20, uxth
7186 ; -O1: csel w8, w0, w20, hi
7187 ; -O1: bl __atomic_compare_exchange
7188 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
7192 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
7193 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
7194 ; -O0: subs w10, w10, w8, uxth
7195 ; -O0: and w10, w10, #0x1
7196 ; -O0: ands w10, w10, #0x1
7197 ; -O0: csel w8, w9, w8, ne
7198 ; -O0: bl __atomic_compare_exchange
7200 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
7201 ; -O1: and w8, w0, #0xffff
7202 ; -O1: cmp w8, w20, uxth
7203 ; -O1: csel w8, w0, w20, hi
7204 ; -O1: bl __atomic_compare_exchange
7205 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
7209 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
7210 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
7211 ; -O0: subs w10, w10, w8, uxth
7212 ; -O0: and w10, w10, #0x1
7213 ; -O0: ands w10, w10, #0x1
7214 ; -O0: csel w8, w9, w8, ne
7215 ; -O0: bl __atomic_compare_exchange
7217 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
7218 ; -O1: and w8, w0, #0xffff
7219 ; -O1: cmp w8, w20, uxth
7220 ; -O1: csel w8, w0, w20, hi
7221 ; -O1: bl __atomic_compare_exchange
7222 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
7226 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
7227 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
7228 ; -O0: subs w10, w9, w8
7229 ; -O0: and w10, w10, #0x1
7230 ; -O0: ands w10, w10, #0x1
7231 ; -O0: csel w8, w9, w8, ne
7232 ; -O0: bl __atomic_compare_exchange
7234 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
7236 ; -O1: csel w8, w0, w20, hi
7237 ; -O1: bl __atomic_compare_exchange
7238 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
7242 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
7243 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
7244 ; -O0: subs w10, w9, w8
7245 ; -O0: and w10, w10, #0x1
7246 ; -O0: ands w10, w10, #0x1
7247 ; -O0: csel w8, w9, w8, ne
7248 ; -O0: bl __atomic_compare_exchange
7250 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
7252 ; -O1: csel w8, w0, w20, hi
7253 ; -O1: bl __atomic_compare_exchange
7254 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
7258 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
7259 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
7260 ; -O0: subs w10, w9, w8
7261 ; -O0: and w10, w10, #0x1
7262 ; -O0: ands w10, w10, #0x1
7263 ; -O0: csel w8, w9, w8, ne
7264 ; -O0: bl __atomic_compare_exchange
7266 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
7268 ; -O1: csel w8, w0, w20, hi
7269 ; -O1: bl __atomic_compare_exchange
7270 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
7274 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
7275 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
7276 ; -O0: subs w10, w9, w8
7277 ; -O0: and w10, w10, #0x1
7278 ; -O0: ands w10, w10, #0x1
7279 ; -O0: csel w8, w9, w8, ne
7280 ; -O0: bl __atomic_compare_exchange
7282 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
7284 ; -O1: csel w8, w0, w20, hi
7285 ; -O1: bl __atomic_compare_exchange
7286 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
7290 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
7291 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
7292 ; -O0: subs w10, w9, w8
7293 ; -O0: and w10, w10, #0x1
7294 ; -O0: ands w10, w10, #0x1
7295 ; -O0: csel w8, w9, w8, ne
7296 ; -O0: bl __atomic_compare_exchange
7298 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
7300 ; -O1: csel w8, w0, w20, hi
7301 ; -O1: bl __atomic_compare_exchange
7302 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
7306 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
7307 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
7308 ; -O0: subs x10, x9, x8
7309 ; -O0: and w10, w10, #0x1
7310 ; -O0: ands w10, w10, #0x1
7311 ; -O0: csel x8, x9, x8, ne
7312 ; -O0: bl __atomic_compare_exchange
7314 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
7316 ; -O1: csel x8, x0, x20, hi
7317 ; -O1: bl __atomic_compare_exchange
7318 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
7322 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
7323 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
7324 ; -O0: subs x10, x9, x8
7325 ; -O0: and w10, w10, #0x1
7326 ; -O0: ands w10, w10, #0x1
7327 ; -O0: csel x8, x9, x8, ne
7328 ; -O0: bl __atomic_compare_exchange
7330 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
7332 ; -O1: csel x8, x0, x20, hi
7333 ; -O1: bl __atomic_compare_exchange
7334 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
7338 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
7339 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
7340 ; -O0: subs x10, x9, x8
7341 ; -O0: and w10, w10, #0x1
7342 ; -O0: ands w10, w10, #0x1
7343 ; -O0: csel x8, x9, x8, ne
7344 ; -O0: bl __atomic_compare_exchange
7346 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
7348 ; -O1: csel x8, x0, x20, hi
7349 ; -O1: bl __atomic_compare_exchange
7350 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
7354 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
7355 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
7356 ; -O0: subs x10, x9, x8
7357 ; -O0: and w10, w10, #0x1
7358 ; -O0: ands w10, w10, #0x1
7359 ; -O0: csel x8, x9, x8, ne
7360 ; -O0: bl __atomic_compare_exchange
7362 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
7364 ; -O1: csel x8, x0, x20, hi
7365 ; -O1: bl __atomic_compare_exchange
7366 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
7370 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
7371 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
7372 ; -O0: subs x10, x9, x8
7373 ; -O0: and w10, w10, #0x1
7374 ; -O0: ands w10, w10, #0x1
7375 ; -O0: csel x8, x9, x8, ne
7376 ; -O0: bl __atomic_compare_exchange
7378 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
7380 ; -O1: csel x8, x0, x20, hi
7381 ; -O1: bl __atomic_compare_exchange
7382 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
7386 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
7387 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
7388 ; -O0: subs x8, x8, x10
7389 ; -O0: subs x8, x8, x10
7390 ; -O0: subs x8, x8, x11
7391 ; -O0: and w12, w12, #0x1
7392 ; -O0: ands w12, w12, #0x1
7393 ; -O0: csel w8, w8, w9, ne
7394 ; -O0: and w12, w8, #0x1
7395 ; -O0: ands w12, w12, #0x1
7396 ; -O0: csel x9, x9, x11, ne
7397 ; -O0: and w11, w8, #0x1
7398 ; -O0: ands w11, w11, #0x1
7399 ; -O0: csel x8, x8, x10, ne
7400 ; -O0: bl __atomic_compare_exchange
7402 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
7403 ; -O1: ldp x0, x1, [x0]
7405 ; -O1: csel x8, x1, x19, lo
7406 ; -O1: csel x9, x0, x21, lo
7407 ; -O1: bl __atomic_compare_exchange
7408 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
7412 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
7413 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
7414 ; -O0: subs x8, x8, x10
7415 ; -O0: subs x8, x8, x10
7416 ; -O0: subs x8, x8, x11
7417 ; -O0: and w12, w12, #0x1
7418 ; -O0: ands w12, w12, #0x1
7419 ; -O0: csel w8, w8, w9, ne
7420 ; -O0: and w12, w8, #0x1
7421 ; -O0: ands w12, w12, #0x1
7422 ; -O0: csel x9, x9, x11, ne
7423 ; -O0: and w11, w8, #0x1
7424 ; -O0: ands w11, w11, #0x1
7425 ; -O0: csel x8, x8, x10, ne
7426 ; -O0: bl __atomic_compare_exchange
7428 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
7429 ; -O1: ldp x0, x1, [x0]
7431 ; -O1: csel x8, x1, x19, lo
7432 ; -O1: csel x9, x0, x21, lo
7433 ; -O1: bl __atomic_compare_exchange
7434 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
7438 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
7439 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
7440 ; -O0: subs x8, x8, x10
7441 ; -O0: subs x8, x8, x10
7442 ; -O0: subs x8, x8, x11
7443 ; -O0: and w12, w12, #0x1
7444 ; -O0: ands w12, w12, #0x1
7445 ; -O0: csel w8, w8, w9, ne
7446 ; -O0: and w12, w8, #0x1
7447 ; -O0: ands w12, w12, #0x1
7448 ; -O0: csel x9, x9, x11, ne
7449 ; -O0: and w11, w8, #0x1
7450 ; -O0: ands w11, w11, #0x1
7451 ; -O0: csel x8, x8, x10, ne
7452 ; -O0: bl __atomic_compare_exchange
7454 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
7455 ; -O1: ldp x0, x1, [x0]
7457 ; -O1: csel x8, x1, x19, lo
7458 ; -O1: csel x9, x0, x21, lo
7459 ; -O1: bl __atomic_compare_exchange
7460 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
7464 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
7465 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
7466 ; -O0: subs x8, x8, x10
7467 ; -O0: subs x8, x8, x10
7468 ; -O0: subs x8, x8, x11
7469 ; -O0: and w12, w12, #0x1
7470 ; -O0: ands w12, w12, #0x1
7471 ; -O0: csel w8, w8, w9, ne
7472 ; -O0: and w12, w8, #0x1
7473 ; -O0: ands w12, w12, #0x1
7474 ; -O0: csel x9, x9, x11, ne
7475 ; -O0: and w11, w8, #0x1
7476 ; -O0: ands w11, w11, #0x1
7477 ; -O0: csel x8, x8, x10, ne
7478 ; -O0: bl __atomic_compare_exchange
7480 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
7481 ; -O1: ldp x0, x1, [x0]
7483 ; -O1: csel x8, x1, x19, lo
7484 ; -O1: csel x9, x0, x21, lo
7485 ; -O1: bl __atomic_compare_exchange
7486 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
7490 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
7491 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
7492 ; -O0: subs x8, x8, x10
7493 ; -O0: subs x8, x8, x10
7494 ; -O0: subs x8, x8, x11
7495 ; -O0: and w12, w12, #0x1
7496 ; -O0: ands w12, w12, #0x1
7497 ; -O0: csel w8, w8, w9, ne
7498 ; -O0: and w12, w8, #0x1
7499 ; -O0: ands w12, w12, #0x1
7500 ; -O0: csel x9, x9, x11, ne
7501 ; -O0: and w11, w8, #0x1
7502 ; -O0: ands w11, w11, #0x1
7503 ; -O0: csel x8, x8, x10, ne
7504 ; -O0: bl __atomic_compare_exchange
7506 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
7507 ; -O1: ldp x0, x1, [x0]
7509 ; -O1: csel x8, x1, x19, lo
7510 ; -O1: csel x9, x0, x21, lo
7511 ; -O1: bl __atomic_compare_exchange
7512 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
7516 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
7517 ; -O0-LABEL: atomicrmw_umin_i8_aligned_monotonic:
7518 ; -O0: and w9, w10, #0xff
7519 ; -O0: subs w9, w9, w8, uxtb
7520 ; -O0: and w9, w9, #0x1
7521 ; -O0: ands w9, w9, #0x1
7522 ; -O0: csel w12, w10, w8, ne
7523 ; -O0: ldaxrb w9, [x11]
7524 ; -O0: cmp w9, w10, uxtb
7525 ; -O0: stlxrb w8, w12, [x11]
7526 ; -O0: and w8, w9, #0xff
7527 ; -O0: subs w8, w8, w10, uxtb
7529 ; -O1-LABEL: atomicrmw_umin_i8_aligned_monotonic:
7530 ; -O1: and w9, w1, #0xff
7531 ; -O1: ldxrb w8, [x0]
7533 ; -O1: csel w10, w8, w9, ls
7534 ; -O1: stxrb w11, w10, [x0]
7535 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
7539 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
7540 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acquire:
7541 ; -O0: and w9, w10, #0xff
7542 ; -O0: subs w9, w9, w8, uxtb
7543 ; -O0: and w9, w9, #0x1
7544 ; -O0: ands w9, w9, #0x1
7545 ; -O0: csel w12, w10, w8, ne
7546 ; -O0: ldaxrb w9, [x11]
7547 ; -O0: cmp w9, w10, uxtb
7548 ; -O0: stlxrb w8, w12, [x11]
7549 ; -O0: and w8, w9, #0xff
7550 ; -O0: subs w8, w8, w10, uxtb
7552 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acquire:
7553 ; -O1: and w9, w1, #0xff
7554 ; -O1: ldaxrb w8, [x0]
7556 ; -O1: csel w10, w8, w9, ls
7557 ; -O1: stxrb w11, w10, [x0]
7558 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
7562 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
7563 ; -O0-LABEL: atomicrmw_umin_i8_aligned_release:
7564 ; -O0: and w9, w10, #0xff
7565 ; -O0: subs w9, w9, w8, uxtb
7566 ; -O0: and w9, w9, #0x1
7567 ; -O0: ands w9, w9, #0x1
7568 ; -O0: csel w12, w10, w8, ne
7569 ; -O0: ldaxrb w9, [x11]
7570 ; -O0: cmp w9, w10, uxtb
7571 ; -O0: stlxrb w8, w12, [x11]
7572 ; -O0: and w8, w9, #0xff
7573 ; -O0: subs w8, w8, w10, uxtb
7575 ; -O1-LABEL: atomicrmw_umin_i8_aligned_release:
7576 ; -O1: and w9, w1, #0xff
7577 ; -O1: ldxrb w8, [x0]
7579 ; -O1: csel w10, w8, w9, ls
7580 ; -O1: stlxrb w11, w10, [x0]
7581 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
7585 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
7586 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
7587 ; -O0: and w9, w10, #0xff
7588 ; -O0: subs w9, w9, w8, uxtb
7589 ; -O0: and w9, w9, #0x1
7590 ; -O0: ands w9, w9, #0x1
7591 ; -O0: csel w12, w10, w8, ne
7592 ; -O0: ldaxrb w9, [x11]
7593 ; -O0: cmp w9, w10, uxtb
7594 ; -O0: stlxrb w8, w12, [x11]
7595 ; -O0: and w8, w9, #0xff
7596 ; -O0: subs w8, w8, w10, uxtb
7598 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
7599 ; -O1: and w9, w1, #0xff
7600 ; -O1: ldaxrb w8, [x0]
7602 ; -O1: csel w10, w8, w9, ls
7603 ; -O1: stlxrb w11, w10, [x0]
7604 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
7608 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
7609 ; -O0-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
7610 ; -O0: and w9, w10, #0xff
7611 ; -O0: subs w9, w9, w8, uxtb
7612 ; -O0: and w9, w9, #0x1
7613 ; -O0: ands w9, w9, #0x1
7614 ; -O0: csel w12, w10, w8, ne
7615 ; -O0: ldaxrb w9, [x11]
7616 ; -O0: cmp w9, w10, uxtb
7617 ; -O0: stlxrb w8, w12, [x11]
7618 ; -O0: and w8, w9, #0xff
7619 ; -O0: subs w8, w8, w10, uxtb
7621 ; -O1-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
7622 ; -O1: and w9, w1, #0xff
7623 ; -O1: ldaxrb w8, [x0]
7625 ; -O1: csel w10, w8, w9, ls
7626 ; -O1: stlxrb w11, w10, [x0]
7627 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
7631 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
7632 ; -O0-LABEL: atomicrmw_umin_i16_aligned_monotonic:
7633 ; -O0: subs w10, w10, w9, uxth
7634 ; -O0: and w10, w10, #0x1
7635 ; -O0: ands w10, w10, #0x1
7636 ; -O0: csel w12, w8, w9, ne
7637 ; -O0: ldaxrh w9, [x11]
7638 ; -O0: cmp w9, w8, uxth
7639 ; -O0: stlxrh w10, w12, [x11]
7640 ; -O0: subs w8, w8, w9, uxth
7642 ; -O1-LABEL: atomicrmw_umin_i16_aligned_monotonic:
7643 ; -O1: and w9, w1, #0xffff
7644 ; -O1: ldxrh w8, [x0]
7646 ; -O1: csel w10, w8, w9, ls
7647 ; -O1: stxrh w11, w10, [x0]
7648 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
7652 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
7653 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acquire:
7654 ; -O0: subs w10, w10, w9, uxth
7655 ; -O0: and w10, w10, #0x1
7656 ; -O0: ands w10, w10, #0x1
7657 ; -O0: csel w12, w8, w9, ne
7658 ; -O0: ldaxrh w9, [x11]
7659 ; -O0: cmp w9, w8, uxth
7660 ; -O0: stlxrh w10, w12, [x11]
7661 ; -O0: subs w8, w8, w9, uxth
7663 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acquire:
7664 ; -O1: and w9, w1, #0xffff
7665 ; -O1: ldaxrh w8, [x0]
7667 ; -O1: csel w10, w8, w9, ls
7668 ; -O1: stxrh w11, w10, [x0]
7669 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
7673 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
7674 ; -O0-LABEL: atomicrmw_umin_i16_aligned_release:
7675 ; -O0: subs w10, w10, w9, uxth
7676 ; -O0: and w10, w10, #0x1
7677 ; -O0: ands w10, w10, #0x1
7678 ; -O0: csel w12, w8, w9, ne
7679 ; -O0: ldaxrh w9, [x11]
7680 ; -O0: cmp w9, w8, uxth
7681 ; -O0: stlxrh w10, w12, [x11]
7682 ; -O0: subs w8, w8, w9, uxth
7684 ; -O1-LABEL: atomicrmw_umin_i16_aligned_release:
7685 ; -O1: and w9, w1, #0xffff
7686 ; -O1: ldxrh w8, [x0]
7688 ; -O1: csel w10, w8, w9, ls
7689 ; -O1: stlxrh w11, w10, [x0]
7690 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
7694 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
7695 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
7696 ; -O0: subs w10, w10, w9, uxth
7697 ; -O0: and w10, w10, #0x1
7698 ; -O0: ands w10, w10, #0x1
7699 ; -O0: csel w12, w8, w9, ne
7700 ; -O0: ldaxrh w9, [x11]
7701 ; -O0: cmp w9, w8, uxth
7702 ; -O0: stlxrh w10, w12, [x11]
7703 ; -O0: subs w8, w8, w9, uxth
7705 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
7706 ; -O1: and w9, w1, #0xffff
7707 ; -O1: ldaxrh w8, [x0]
7709 ; -O1: csel w10, w8, w9, ls
7710 ; -O1: stlxrh w11, w10, [x0]
7711 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
7715 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
7716 ; -O0-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
7717 ; -O0: subs w10, w10, w9, uxth
7718 ; -O0: and w10, w10, #0x1
7719 ; -O0: ands w10, w10, #0x1
7720 ; -O0: csel w12, w8, w9, ne
7721 ; -O0: ldaxrh w9, [x11]
7722 ; -O0: cmp w9, w8, uxth
7723 ; -O0: stlxrh w10, w12, [x11]
7724 ; -O0: subs w8, w8, w9, uxth
7726 ; -O1-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
7727 ; -O1: and w9, w1, #0xffff
7728 ; -O1: ldaxrh w8, [x0]
7730 ; -O1: csel w10, w8, w9, ls
7731 ; -O1: stlxrh w11, w10, [x0]
7732 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
7736 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
7737 ; -O0-LABEL: atomicrmw_umin_i32_aligned_monotonic:
7738 ; -O0: subs w10, w8, w9
7739 ; -O0: and w10, w10, #0x1
7740 ; -O0: ands w10, w10, #0x1
7741 ; -O0: csel w12, w8, w9, ne
7742 ; -O0: ldaxr w9, [x11]
7744 ; -O0: stlxr w10, w12, [x11]
7745 ; -O0: subs w8, w9, w8
7747 ; -O1-LABEL: atomicrmw_umin_i32_aligned_monotonic:
7748 ; -O1: ldxr w8, [x0]
7750 ; -O1: csel w9, w8, w1, ls
7751 ; -O1: stxr w10, w9, [x0]
7752 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
7756 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
7757 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acquire:
7758 ; -O0: subs w10, w8, w9
7759 ; -O0: and w10, w10, #0x1
7760 ; -O0: ands w10, w10, #0x1
7761 ; -O0: csel w12, w8, w9, ne
7762 ; -O0: ldaxr w9, [x11]
7764 ; -O0: stlxr w10, w12, [x11]
7765 ; -O0: subs w8, w9, w8
7767 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acquire:
7768 ; -O1: ldaxr w8, [x0]
7770 ; -O1: csel w9, w8, w1, ls
7771 ; -O1: stxr w10, w9, [x0]
7772 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
7776 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
7777 ; -O0-LABEL: atomicrmw_umin_i32_aligned_release:
7778 ; -O0: subs w10, w8, w9
7779 ; -O0: and w10, w10, #0x1
7780 ; -O0: ands w10, w10, #0x1
7781 ; -O0: csel w12, w8, w9, ne
7782 ; -O0: ldaxr w9, [x11]
7784 ; -O0: stlxr w10, w12, [x11]
7785 ; -O0: subs w8, w9, w8
7787 ; -O1-LABEL: atomicrmw_umin_i32_aligned_release:
7788 ; -O1: ldxr w8, [x0]
7790 ; -O1: csel w9, w8, w1, ls
7791 ; -O1: stlxr w10, w9, [x0]
7792 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
7796 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
7797 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
7798 ; -O0: subs w10, w8, w9
7799 ; -O0: and w10, w10, #0x1
7800 ; -O0: ands w10, w10, #0x1
7801 ; -O0: csel w12, w8, w9, ne
7802 ; -O0: ldaxr w9, [x11]
7804 ; -O0: stlxr w10, w12, [x11]
7805 ; -O0: subs w8, w9, w8
7807 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
7808 ; -O1: ldaxr w8, [x0]
7810 ; -O1: csel w9, w8, w1, ls
7811 ; -O1: stlxr w10, w9, [x0]
7812 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
7816 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
7817 ; -O0-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
7818 ; -O0: subs w10, w8, w9
7819 ; -O0: and w10, w10, #0x1
7820 ; -O0: ands w10, w10, #0x1
7821 ; -O0: csel w12, w8, w9, ne
7822 ; -O0: ldaxr w9, [x11]
7824 ; -O0: stlxr w10, w12, [x11]
7825 ; -O0: subs w8, w9, w8
7827 ; -O1-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
7828 ; -O1: ldaxr w8, [x0]
7830 ; -O1: csel w9, w8, w1, ls
7831 ; -O1: stlxr w10, w9, [x0]
7832 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
7836 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
7837 ; -O0-LABEL: atomicrmw_umin_i64_aligned_monotonic:
7838 ; -O0: subs x10, x8, x9
7839 ; -O0: and w10, w10, #0x1
7840 ; -O0: ands w10, w10, #0x1
7841 ; -O0: csel x12, x8, x9, ne
7842 ; -O0: ldaxr x9, [x11]
7844 ; -O0: stlxr w10, x12, [x11]
7845 ; -O0: subs x8, x9, x8
7847 ; -O1-LABEL: atomicrmw_umin_i64_aligned_monotonic:
7848 ; -O1: ldxr x0, [x8]
7850 ; -O1: csel x9, x0, x1, ls
7851 ; -O1: stxr w10, x9, [x8]
7852 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
7856 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
7857 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acquire:
7858 ; -O0: subs x10, x8, x9
7859 ; -O0: and w10, w10, #0x1
7860 ; -O0: ands w10, w10, #0x1
7861 ; -O0: csel x12, x8, x9, ne
7862 ; -O0: ldaxr x9, [x11]
7864 ; -O0: stlxr w10, x12, [x11]
7865 ; -O0: subs x8, x9, x8
7867 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acquire:
7868 ; -O1: ldaxr x0, [x8]
7870 ; -O1: csel x9, x0, x1, ls
7871 ; -O1: stxr w10, x9, [x8]
7872 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
7876 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
7877 ; -O0-LABEL: atomicrmw_umin_i64_aligned_release:
7878 ; -O0: subs x10, x8, x9
7879 ; -O0: and w10, w10, #0x1
7880 ; -O0: ands w10, w10, #0x1
7881 ; -O0: csel x12, x8, x9, ne
7882 ; -O0: ldaxr x9, [x11]
7884 ; -O0: stlxr w10, x12, [x11]
7885 ; -O0: subs x8, x9, x8
7887 ; -O1-LABEL: atomicrmw_umin_i64_aligned_release:
7888 ; -O1: ldxr x0, [x8]
7890 ; -O1: csel x9, x0, x1, ls
7891 ; -O1: stlxr w10, x9, [x8]
7892 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
7896 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
7897 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
7898 ; -O0: subs x10, x8, x9
7899 ; -O0: and w10, w10, #0x1
7900 ; -O0: ands w10, w10, #0x1
7901 ; -O0: csel x12, x8, x9, ne
7902 ; -O0: ldaxr x9, [x11]
7904 ; -O0: stlxr w10, x12, [x11]
7905 ; -O0: subs x8, x9, x8
7907 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
7908 ; -O1: ldaxr x0, [x8]
7910 ; -O1: csel x9, x0, x1, ls
7911 ; -O1: stlxr w10, x9, [x8]
7912 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
7916 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
7917 ; -O0-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
7918 ; -O0: subs x10, x8, x9
7919 ; -O0: and w10, w10, #0x1
7920 ; -O0: ands w10, w10, #0x1
7921 ; -O0: csel x12, x8, x9, ne
7922 ; -O0: ldaxr x9, [x11]
7924 ; -O0: stlxr w10, x12, [x11]
7925 ; -O0: subs x8, x9, x8
7927 ; -O1-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
7928 ; -O1: ldaxr x0, [x8]
7930 ; -O1: csel x9, x0, x1, ls
7931 ; -O1: stlxr w10, x9, [x8]
7932 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
7936 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
7937 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
7938 ; -O0: subs x8, x8, x9
7939 ; -O0: subs x8, x8, x9
7940 ; -O0: subs x8, x8, x12
7941 ; -O0: and w13, w13, #0x1
7942 ; -O0: ands w13, w13, #0x1
7943 ; -O0: csel w8, w8, w10, ne
7944 ; -O0: and w13, w8, #0x1
7945 ; -O0: ands w13, w13, #0x1
7946 ; -O0: csel x14, x10, x12, ne
7947 ; -O0: and w10, w8, #0x1
7948 ; -O0: ands w10, w10, #0x1
7949 ; -O0: csel x15, x8, x9, ne
7950 ; -O0: ldxp x10, x9, [x11]
7953 ; -O0: stxp w8, x14, x15, [x11]
7954 ; -O0: stxp w8, x10, x9, [x11]
7955 ; -O0: eor x8, x10, x8
7956 ; -O0: eor x11, x9, x11
7957 ; -O0: orr x8, x8, x11
7958 ; -O0: subs x8, x8, #0
7960 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
7961 ; -O1: ldxp x0, x1, [x8]
7963 ; -O1: csel x9, x1, x3, hs
7964 ; -O1: csel x10, x0, x2, hs
7965 ; -O1: stxp w11, x10, x9, [x8]
7966 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
7970 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
7971 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
7972 ; -O0: subs x8, x8, x9
7973 ; -O0: subs x8, x8, x9
7974 ; -O0: subs x8, x8, x12
7975 ; -O0: and w13, w13, #0x1
7976 ; -O0: ands w13, w13, #0x1
7977 ; -O0: csel w8, w8, w10, ne
7978 ; -O0: and w13, w8, #0x1
7979 ; -O0: ands w13, w13, #0x1
7980 ; -O0: csel x14, x10, x12, ne
7981 ; -O0: and w10, w8, #0x1
7982 ; -O0: ands w10, w10, #0x1
7983 ; -O0: csel x15, x8, x9, ne
7984 ; -O0: ldaxp x10, x9, [x11]
7987 ; -O0: stxp w8, x14, x15, [x11]
7988 ; -O0: stxp w8, x10, x9, [x11]
7989 ; -O0: eor x8, x10, x8
7990 ; -O0: eor x11, x9, x11
7991 ; -O0: orr x8, x8, x11
7992 ; -O0: subs x8, x8, #0
7994 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
7995 ; -O1: ldaxp x0, x1, [x8]
7997 ; -O1: csel x9, x1, x3, hs
7998 ; -O1: csel x10, x0, x2, hs
7999 ; -O1: stxp w11, x10, x9, [x8]
8000 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
8004 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
8005 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
8006 ; -O0: subs x8, x8, x9
8007 ; -O0: subs x8, x8, x9
8008 ; -O0: subs x8, x8, x12
8009 ; -O0: and w13, w13, #0x1
8010 ; -O0: ands w13, w13, #0x1
8011 ; -O0: csel w8, w8, w10, ne
8012 ; -O0: and w13, w8, #0x1
8013 ; -O0: ands w13, w13, #0x1
8014 ; -O0: csel x14, x10, x12, ne
8015 ; -O0: and w10, w8, #0x1
8016 ; -O0: ands w10, w10, #0x1
8017 ; -O0: csel x15, x8, x9, ne
8018 ; -O0: ldxp x10, x9, [x11]
8021 ; -O0: stlxp w8, x14, x15, [x11]
8022 ; -O0: stlxp w8, x10, x9, [x11]
8023 ; -O0: eor x8, x10, x8
8024 ; -O0: eor x11, x9, x11
8025 ; -O0: orr x8, x8, x11
8026 ; -O0: subs x8, x8, #0
8028 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
8029 ; -O1: ldxp x0, x1, [x8]
8031 ; -O1: csel x9, x1, x3, hs
8032 ; -O1: csel x10, x0, x2, hs
8033 ; -O1: stlxp w11, x10, x9, [x8]
8034 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
8038 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
8039 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
8040 ; -O0: subs x8, x8, x9
8041 ; -O0: subs x8, x8, x9
8042 ; -O0: subs x8, x8, x12
8043 ; -O0: and w13, w13, #0x1
8044 ; -O0: ands w13, w13, #0x1
8045 ; -O0: csel w8, w8, w10, ne
8046 ; -O0: and w13, w8, #0x1
8047 ; -O0: ands w13, w13, #0x1
8048 ; -O0: csel x14, x10, x12, ne
8049 ; -O0: and w10, w8, #0x1
8050 ; -O0: ands w10, w10, #0x1
8051 ; -O0: csel x15, x8, x9, ne
8052 ; -O0: ldaxp x10, x9, [x11]
8055 ; -O0: stlxp w8, x14, x15, [x11]
8056 ; -O0: stlxp w8, x10, x9, [x11]
8057 ; -O0: eor x8, x10, x8
8058 ; -O0: eor x11, x9, x11
8059 ; -O0: orr x8, x8, x11
8060 ; -O0: subs x8, x8, #0
8062 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
8063 ; -O1: ldaxp x0, x1, [x8]
8065 ; -O1: csel x9, x1, x3, hs
8066 ; -O1: csel x10, x0, x2, hs
8067 ; -O1: stlxp w11, x10, x9, [x8]
8068 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
8072 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
8073 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
8074 ; -O0: subs x8, x8, x9
8075 ; -O0: subs x8, x8, x9
8076 ; -O0: subs x8, x8, x12
8077 ; -O0: and w13, w13, #0x1
8078 ; -O0: ands w13, w13, #0x1
8079 ; -O0: csel w8, w8, w10, ne
8080 ; -O0: and w13, w8, #0x1
8081 ; -O0: ands w13, w13, #0x1
8082 ; -O0: csel x14, x10, x12, ne
8083 ; -O0: and w10, w8, #0x1
8084 ; -O0: ands w10, w10, #0x1
8085 ; -O0: csel x15, x8, x9, ne
8086 ; -O0: ldaxp x10, x9, [x11]
8089 ; -O0: stlxp w8, x14, x15, [x11]
8090 ; -O0: stlxp w8, x10, x9, [x11]
8091 ; -O0: eor x8, x10, x8
8092 ; -O0: eor x11, x9, x11
8093 ; -O0: orr x8, x8, x11
8094 ; -O0: subs x8, x8, #0
8096 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
8097 ; -O1: ldaxp x0, x1, [x8]
8099 ; -O1: csel x9, x1, x3, hs
8100 ; -O1: csel x10, x0, x2, hs
8101 ; -O1: stlxp w11, x10, x9, [x8]
8102 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
8106 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
8107 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
8108 ; -O0: and w9, w10, #0xff
8109 ; -O0: subs w9, w9, w8, uxtb
8110 ; -O0: and w9, w9, #0x1
8111 ; -O0: ands w9, w9, #0x1
8112 ; -O0: csel w12, w10, w8, ne
8113 ; -O0: ldaxrb w9, [x11]
8114 ; -O0: cmp w9, w10, uxtb
8115 ; -O0: stlxrb w8, w12, [x11]
8116 ; -O0: and w8, w9, #0xff
8117 ; -O0: subs w8, w8, w10, uxtb
8119 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
8120 ; -O1: and w9, w1, #0xff
8121 ; -O1: ldxrb w8, [x0]
8123 ; -O1: csel w10, w8, w9, ls
8124 ; -O1: stxrb w11, w10, [x0]
8125 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
8129 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
8130 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acquire:
8131 ; -O0: and w9, w10, #0xff
8132 ; -O0: subs w9, w9, w8, uxtb
8133 ; -O0: and w9, w9, #0x1
8134 ; -O0: ands w9, w9, #0x1
8135 ; -O0: csel w12, w10, w8, ne
8136 ; -O0: ldaxrb w9, [x11]
8137 ; -O0: cmp w9, w10, uxtb
8138 ; -O0: stlxrb w8, w12, [x11]
8139 ; -O0: and w8, w9, #0xff
8140 ; -O0: subs w8, w8, w10, uxtb
8142 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acquire:
8143 ; -O1: and w9, w1, #0xff
8144 ; -O1: ldaxrb w8, [x0]
8146 ; -O1: csel w10, w8, w9, ls
8147 ; -O1: stxrb w11, w10, [x0]
8148 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
8152 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
8153 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_release:
8154 ; -O0: and w9, w10, #0xff
8155 ; -O0: subs w9, w9, w8, uxtb
8156 ; -O0: and w9, w9, #0x1
8157 ; -O0: ands w9, w9, #0x1
8158 ; -O0: csel w12, w10, w8, ne
8159 ; -O0: ldaxrb w9, [x11]
8160 ; -O0: cmp w9, w10, uxtb
8161 ; -O0: stlxrb w8, w12, [x11]
8162 ; -O0: and w8, w9, #0xff
8163 ; -O0: subs w8, w8, w10, uxtb
8165 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_release:
8166 ; -O1: and w9, w1, #0xff
8167 ; -O1: ldxrb w8, [x0]
8169 ; -O1: csel w10, w8, w9, ls
8170 ; -O1: stlxrb w11, w10, [x0]
8171 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
8175 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
8176 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
8177 ; -O0: and w9, w10, #0xff
8178 ; -O0: subs w9, w9, w8, uxtb
8179 ; -O0: and w9, w9, #0x1
8180 ; -O0: ands w9, w9, #0x1
8181 ; -O0: csel w12, w10, w8, ne
8182 ; -O0: ldaxrb w9, [x11]
8183 ; -O0: cmp w9, w10, uxtb
8184 ; -O0: stlxrb w8, w12, [x11]
8185 ; -O0: and w8, w9, #0xff
8186 ; -O0: subs w8, w8, w10, uxtb
8188 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
8189 ; -O1: and w9, w1, #0xff
8190 ; -O1: ldaxrb w8, [x0]
8192 ; -O1: csel w10, w8, w9, ls
8193 ; -O1: stlxrb w11, w10, [x0]
8194 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
8198 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
8199 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
8200 ; -O0: and w9, w10, #0xff
8201 ; -O0: subs w9, w9, w8, uxtb
8202 ; -O0: and w9, w9, #0x1
8203 ; -O0: ands w9, w9, #0x1
8204 ; -O0: csel w12, w10, w8, ne
8205 ; -O0: ldaxrb w9, [x11]
8206 ; -O0: cmp w9, w10, uxtb
8207 ; -O0: stlxrb w8, w12, [x11]
8208 ; -O0: and w8, w9, #0xff
8209 ; -O0: subs w8, w8, w10, uxtb
8211 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
8212 ; -O1: and w9, w1, #0xff
8213 ; -O1: ldaxrb w8, [x0]
8215 ; -O1: csel w10, w8, w9, ls
8216 ; -O1: stlxrb w11, w10, [x0]
8217 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
8221 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
8222 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
8223 ; -O0: subs w10, w10, w8, uxth
8224 ; -O0: and w10, w10, #0x1
8225 ; -O0: ands w10, w10, #0x1
8226 ; -O0: csel w8, w9, w8, ne
8227 ; -O0: bl __atomic_compare_exchange
8229 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
8230 ; -O1: and w8, w0, #0xffff
8231 ; -O1: cmp w8, w20, uxth
8232 ; -O1: csel w8, w0, w20, ls
8233 ; -O1: bl __atomic_compare_exchange
8234 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
8238 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
8239 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
8240 ; -O0: subs w10, w10, w8, uxth
8241 ; -O0: and w10, w10, #0x1
8242 ; -O0: ands w10, w10, #0x1
8243 ; -O0: csel w8, w9, w8, ne
8244 ; -O0: bl __atomic_compare_exchange
8246 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
8247 ; -O1: and w8, w0, #0xffff
8248 ; -O1: cmp w8, w20, uxth
8249 ; -O1: csel w8, w0, w20, ls
8250 ; -O1: bl __atomic_compare_exchange
8251 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
8255 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
8256 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
8257 ; -O0: subs w10, w10, w8, uxth
8258 ; -O0: and w10, w10, #0x1
8259 ; -O0: ands w10, w10, #0x1
8260 ; -O0: csel w8, w9, w8, ne
8261 ; -O0: bl __atomic_compare_exchange
8263 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
8264 ; -O1: and w8, w0, #0xffff
8265 ; -O1: cmp w8, w20, uxth
8266 ; -O1: csel w8, w0, w20, ls
8267 ; -O1: bl __atomic_compare_exchange
8268 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
8272 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
8273 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
8274 ; -O0: subs w10, w10, w8, uxth
8275 ; -O0: and w10, w10, #0x1
8276 ; -O0: ands w10, w10, #0x1
8277 ; -O0: csel w8, w9, w8, ne
8278 ; -O0: bl __atomic_compare_exchange
8280 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
8281 ; -O1: and w8, w0, #0xffff
8282 ; -O1: cmp w8, w20, uxth
8283 ; -O1: csel w8, w0, w20, ls
8284 ; -O1: bl __atomic_compare_exchange
8285 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
8289 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
8290 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
8291 ; -O0: subs w10, w10, w8, uxth
8292 ; -O0: and w10, w10, #0x1
8293 ; -O0: ands w10, w10, #0x1
8294 ; -O0: csel w8, w9, w8, ne
8295 ; -O0: bl __atomic_compare_exchange
8297 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
8298 ; -O1: and w8, w0, #0xffff
8299 ; -O1: cmp w8, w20, uxth
8300 ; -O1: csel w8, w0, w20, ls
8301 ; -O1: bl __atomic_compare_exchange
8302 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
8306 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
8307 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
8308 ; -O0: subs w10, w9, w8
8309 ; -O0: and w10, w10, #0x1
8310 ; -O0: ands w10, w10, #0x1
8311 ; -O0: csel w8, w9, w8, ne
8312 ; -O0: bl __atomic_compare_exchange
8314 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
8316 ; -O1: csel w8, w0, w20, ls
8317 ; -O1: bl __atomic_compare_exchange
8318 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
8322 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
8323 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
8324 ; -O0: subs w10, w9, w8
8325 ; -O0: and w10, w10, #0x1
8326 ; -O0: ands w10, w10, #0x1
8327 ; -O0: csel w8, w9, w8, ne
8328 ; -O0: bl __atomic_compare_exchange
8330 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
8332 ; -O1: csel w8, w0, w20, ls
8333 ; -O1: bl __atomic_compare_exchange
8334 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
8338 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
8339 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
8340 ; -O0: subs w10, w9, w8
8341 ; -O0: and w10, w10, #0x1
8342 ; -O0: ands w10, w10, #0x1
8343 ; -O0: csel w8, w9, w8, ne
8344 ; -O0: bl __atomic_compare_exchange
8346 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
8348 ; -O1: csel w8, w0, w20, ls
8349 ; -O1: bl __atomic_compare_exchange
8350 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
8354 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
8355 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
8356 ; -O0: subs w10, w9, w8
8357 ; -O0: and w10, w10, #0x1
8358 ; -O0: ands w10, w10, #0x1
8359 ; -O0: csel w8, w9, w8, ne
8360 ; -O0: bl __atomic_compare_exchange
8362 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
8364 ; -O1: csel w8, w0, w20, ls
8365 ; -O1: bl __atomic_compare_exchange
8366 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
8370 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
8371 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
8372 ; -O0: subs w10, w9, w8
8373 ; -O0: and w10, w10, #0x1
8374 ; -O0: ands w10, w10, #0x1
8375 ; -O0: csel w8, w9, w8, ne
8376 ; -O0: bl __atomic_compare_exchange
8378 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
8380 ; -O1: csel w8, w0, w20, ls
8381 ; -O1: bl __atomic_compare_exchange
8382 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
8386 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
8387 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
8388 ; -O0: subs x10, x9, x8
8389 ; -O0: and w10, w10, #0x1
8390 ; -O0: ands w10, w10, #0x1
8391 ; -O0: csel x8, x9, x8, ne
8392 ; -O0: bl __atomic_compare_exchange
8394 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
8396 ; -O1: csel x8, x0, x20, ls
8397 ; -O1: bl __atomic_compare_exchange
8398 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
8402 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
8403 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
8404 ; -O0: subs x10, x9, x8
8405 ; -O0: and w10, w10, #0x1
8406 ; -O0: ands w10, w10, #0x1
8407 ; -O0: csel x8, x9, x8, ne
8408 ; -O0: bl __atomic_compare_exchange
8410 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
8412 ; -O1: csel x8, x0, x20, ls
8413 ; -O1: bl __atomic_compare_exchange
8414 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
8418 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
8419 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
8420 ; -O0: subs x10, x9, x8
8421 ; -O0: and w10, w10, #0x1
8422 ; -O0: ands w10, w10, #0x1
8423 ; -O0: csel x8, x9, x8, ne
8424 ; -O0: bl __atomic_compare_exchange
8426 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
8428 ; -O1: csel x8, x0, x20, ls
8429 ; -O1: bl __atomic_compare_exchange
8430 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
8434 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
8435 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
8436 ; -O0: subs x10, x9, x8
8437 ; -O0: and w10, w10, #0x1
8438 ; -O0: ands w10, w10, #0x1
8439 ; -O0: csel x8, x9, x8, ne
8440 ; -O0: bl __atomic_compare_exchange
8442 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
8444 ; -O1: csel x8, x0, x20, ls
8445 ; -O1: bl __atomic_compare_exchange
8446 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
8450 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
8451 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
8452 ; -O0: subs x10, x9, x8
8453 ; -O0: and w10, w10, #0x1
8454 ; -O0: ands w10, w10, #0x1
8455 ; -O0: csel x8, x9, x8, ne
8456 ; -O0: bl __atomic_compare_exchange
8458 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
8460 ; -O1: csel x8, x0, x20, ls
8461 ; -O1: bl __atomic_compare_exchange
8462 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
8466 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
8467 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
8468 ; -O0: subs x8, x8, x10
8469 ; -O0: subs x8, x8, x10
8470 ; -O0: subs x8, x8, x11
8471 ; -O0: and w12, w12, #0x1
8472 ; -O0: ands w12, w12, #0x1
8473 ; -O0: csel w8, w8, w9, ne
8474 ; -O0: and w12, w8, #0x1
8475 ; -O0: ands w12, w12, #0x1
8476 ; -O0: csel x9, x9, x11, ne
8477 ; -O0: and w11, w8, #0x1
8478 ; -O0: ands w11, w11, #0x1
8479 ; -O0: csel x8, x8, x10, ne
8480 ; -O0: bl __atomic_compare_exchange
8482 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
8483 ; -O1: ldp x0, x1, [x0]
8485 ; -O1: csel x8, x1, x19, hs
8486 ; -O1: csel x9, x0, x21, hs
8487 ; -O1: bl __atomic_compare_exchange
8488 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
8492 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
8493 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
8494 ; -O0: subs x8, x8, x10
8495 ; -O0: subs x8, x8, x10
8496 ; -O0: subs x8, x8, x11
8497 ; -O0: and w12, w12, #0x1
8498 ; -O0: ands w12, w12, #0x1
8499 ; -O0: csel w8, w8, w9, ne
8500 ; -O0: and w12, w8, #0x1
8501 ; -O0: ands w12, w12, #0x1
8502 ; -O0: csel x9, x9, x11, ne
8503 ; -O0: and w11, w8, #0x1
8504 ; -O0: ands w11, w11, #0x1
8505 ; -O0: csel x8, x8, x10, ne
8506 ; -O0: bl __atomic_compare_exchange
8508 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
8509 ; -O1: ldp x0, x1, [x0]
8511 ; -O1: csel x8, x1, x19, hs
8512 ; -O1: csel x9, x0, x21, hs
8513 ; -O1: bl __atomic_compare_exchange
8514 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
8518 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
8519 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
8520 ; -O0: subs x8, x8, x10
8521 ; -O0: subs x8, x8, x10
8522 ; -O0: subs x8, x8, x11
8523 ; -O0: and w12, w12, #0x1
8524 ; -O0: ands w12, w12, #0x1
8525 ; -O0: csel w8, w8, w9, ne
8526 ; -O0: and w12, w8, #0x1
8527 ; -O0: ands w12, w12, #0x1
8528 ; -O0: csel x9, x9, x11, ne
8529 ; -O0: and w11, w8, #0x1
8530 ; -O0: ands w11, w11, #0x1
8531 ; -O0: csel x8, x8, x10, ne
8532 ; -O0: bl __atomic_compare_exchange
8534 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
8535 ; -O1: ldp x0, x1, [x0]
8537 ; -O1: csel x8, x1, x19, hs
8538 ; -O1: csel x9, x0, x21, hs
8539 ; -O1: bl __atomic_compare_exchange
8540 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
8544 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
8545 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
8546 ; -O0: subs x8, x8, x10
8547 ; -O0: subs x8, x8, x10
8548 ; -O0: subs x8, x8, x11
8549 ; -O0: and w12, w12, #0x1
8550 ; -O0: ands w12, w12, #0x1
8551 ; -O0: csel w8, w8, w9, ne
8552 ; -O0: and w12, w8, #0x1
8553 ; -O0: ands w12, w12, #0x1
8554 ; -O0: csel x9, x9, x11, ne
8555 ; -O0: and w11, w8, #0x1
8556 ; -O0: ands w11, w11, #0x1
8557 ; -O0: csel x8, x8, x10, ne
8558 ; -O0: bl __atomic_compare_exchange
8560 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
8561 ; -O1: ldp x0, x1, [x0]
8563 ; -O1: csel x8, x1, x19, hs
8564 ; -O1: csel x9, x0, x21, hs
8565 ; -O1: bl __atomic_compare_exchange
8566 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
8570 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
8571 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
8572 ; -O0: subs x8, x8, x10
8573 ; -O0: subs x8, x8, x10
8574 ; -O0: subs x8, x8, x11
8575 ; -O0: and w12, w12, #0x1
8576 ; -O0: ands w12, w12, #0x1
8577 ; -O0: csel w8, w8, w9, ne
8578 ; -O0: and w12, w8, #0x1
8579 ; -O0: ands w12, w12, #0x1
8580 ; -O0: csel x9, x9, x11, ne
8581 ; -O0: and w11, w8, #0x1
8582 ; -O0: ands w11, w11, #0x1
8583 ; -O0: csel x8, x8, x10, ne
8584 ; -O0: bl __atomic_compare_exchange
8586 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
8587 ; -O1: ldp x0, x1, [x0]
8589 ; -O1: csel x8, x1, x19, hs
8590 ; -O1: csel x9, x0, x21, hs
8591 ; -O1: bl __atomic_compare_exchange
8592 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1