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: bl __aarch64_cas16_relax
149 ; -O0: eor x8, x0, x8
150 ; -O0: eor x9, x1, x9
151 ; -O0: orr x8, x8, x9
152 ; -O0: subs x8, x8, #0
154 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
155 ; -O1: ldxp x8, x1, [x0]
156 ; -O1: stxp w9, x2, x3, [x0]
157 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
161 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
162 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
163 ; -O0: bl __aarch64_cas16_acq
164 ; -O0: eor x8, x0, x8
165 ; -O0: eor x9, x1, x9
166 ; -O0: orr x8, x8, x9
167 ; -O0: subs x8, x8, #0
169 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
170 ; -O1: ldaxp x8, x1, [x0]
171 ; -O1: stxp w9, x2, x3, [x0]
172 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
176 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
177 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
178 ; -O0: bl __aarch64_cas16_rel
179 ; -O0: eor x8, x0, x8
180 ; -O0: eor x9, x1, x9
181 ; -O0: orr x8, x8, x9
182 ; -O0: subs x8, x8, #0
184 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
185 ; -O1: ldxp x8, x1, [x0]
186 ; -O1: stlxp w9, x2, x3, [x0]
187 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
191 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
192 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
193 ; -O0: bl __aarch64_cas16_acq_rel
194 ; -O0: eor x8, x0, x8
195 ; -O0: eor x9, x1, x9
196 ; -O0: orr x8, x8, x9
197 ; -O0: subs x8, x8, #0
199 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
200 ; -O1: ldaxp x8, x1, [x0]
201 ; -O1: stlxp w9, x2, x3, [x0]
202 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
206 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
207 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
208 ; -O0: bl __aarch64_cas16_acq_rel
209 ; -O0: eor x8, x0, x8
210 ; -O0: eor x9, x1, x9
211 ; -O0: orr x8, x8, x9
212 ; -O0: subs x8, x8, #0
214 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
215 ; -O1: ldaxp x8, x1, [x0]
216 ; -O1: stlxp w9, x2, x3, [x0]
217 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
221 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
222 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
223 ; CHECK: bl __aarch64_swp1_relax
224 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
228 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
229 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
230 ; CHECK: bl __aarch64_swp1_acq
231 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
235 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
236 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_release:
237 ; CHECK: bl __aarch64_swp1_rel
238 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
242 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
243 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
244 ; CHECK: bl __aarch64_swp1_acq_rel
245 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
249 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
250 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
251 ; CHECK: bl __aarch64_swp1_acq_rel
252 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
256 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
257 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
258 ; CHECK: bl __atomic_exchange
259 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
263 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
264 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
265 ; CHECK: bl __atomic_exchange
266 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
270 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
271 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
272 ; CHECK: bl __atomic_exchange
273 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
277 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
278 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
279 ; CHECK: bl __atomic_exchange
280 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
284 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
285 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
286 ; CHECK: bl __atomic_exchange
287 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
291 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
292 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
293 ; CHECK: bl __atomic_exchange
294 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
298 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
299 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
300 ; CHECK: bl __atomic_exchange
301 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
305 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
306 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
307 ; CHECK: bl __atomic_exchange
308 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
312 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
313 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
314 ; CHECK: bl __atomic_exchange
315 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
319 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
320 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
321 ; CHECK: bl __atomic_exchange
322 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
326 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
327 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
328 ; CHECK: bl __atomic_exchange
329 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
333 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
334 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
335 ; CHECK: bl __atomic_exchange
336 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
340 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
341 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
342 ; CHECK: bl __atomic_exchange
343 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
347 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
348 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
349 ; CHECK: bl __atomic_exchange
350 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
354 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
355 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
356 ; CHECK: bl __atomic_exchange
357 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
361 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
362 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
363 ; CHECK: bl __atomic_exchange
364 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
368 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
369 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
370 ; CHECK: bl __atomic_exchange
371 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
375 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
376 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
377 ; CHECK: bl __atomic_exchange
378 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
382 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
383 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
384 ; CHECK: bl __atomic_exchange
385 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
389 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
390 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
391 ; CHECK: bl __atomic_exchange
392 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
396 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
397 ; CHECK-LABEL: atomicrmw_add_i8_aligned_monotonic:
398 ; CHECK: bl __aarch64_ldadd1_relax
399 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
403 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
404 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acquire:
405 ; CHECK: bl __aarch64_ldadd1_acq
406 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
410 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
411 ; CHECK-LABEL: atomicrmw_add_i8_aligned_release:
412 ; CHECK: bl __aarch64_ldadd1_rel
413 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
417 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
418 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acq_rel:
419 ; CHECK: bl __aarch64_ldadd1_acq_rel
420 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
424 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
425 ; CHECK-LABEL: atomicrmw_add_i8_aligned_seq_cst:
426 ; CHECK: bl __aarch64_ldadd1_acq_rel
427 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
431 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
432 ; CHECK-LABEL: atomicrmw_add_i16_aligned_monotonic:
433 ; CHECK: bl __aarch64_ldadd2_relax
434 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
438 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
439 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acquire:
440 ; CHECK: bl __aarch64_ldadd2_acq
441 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
445 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
446 ; CHECK-LABEL: atomicrmw_add_i16_aligned_release:
447 ; CHECK: bl __aarch64_ldadd2_rel
448 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
452 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
453 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acq_rel:
454 ; CHECK: bl __aarch64_ldadd2_acq_rel
455 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
459 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
460 ; CHECK-LABEL: atomicrmw_add_i16_aligned_seq_cst:
461 ; CHECK: bl __aarch64_ldadd2_acq_rel
462 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
466 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
467 ; CHECK-LABEL: atomicrmw_add_i32_aligned_monotonic:
468 ; CHECK: bl __aarch64_ldadd4_relax
469 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
473 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
474 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acquire:
475 ; CHECK: bl __aarch64_ldadd4_acq
476 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
480 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
481 ; CHECK-LABEL: atomicrmw_add_i32_aligned_release:
482 ; CHECK: bl __aarch64_ldadd4_rel
483 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
487 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
488 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acq_rel:
489 ; CHECK: bl __aarch64_ldadd4_acq_rel
490 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
494 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
495 ; CHECK-LABEL: atomicrmw_add_i32_aligned_seq_cst:
496 ; CHECK: bl __aarch64_ldadd4_acq_rel
497 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
501 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
502 ; CHECK-LABEL: atomicrmw_add_i64_aligned_monotonic:
503 ; CHECK: bl __aarch64_ldadd8_relax
504 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
508 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
509 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acquire:
510 ; CHECK: bl __aarch64_ldadd8_acq
511 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
515 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
516 ; CHECK-LABEL: atomicrmw_add_i64_aligned_release:
517 ; CHECK: bl __aarch64_ldadd8_rel
518 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
522 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
523 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acq_rel:
524 ; CHECK: bl __aarch64_ldadd8_acq_rel
525 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
529 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
530 ; CHECK-LABEL: atomicrmw_add_i64_aligned_seq_cst:
531 ; CHECK: bl __aarch64_ldadd8_acq_rel
532 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
536 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
537 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
538 ; -O0: adds x2, x8, x10
539 ; -O0: subs w10, w10, #1
540 ; -O0: bl __aarch64_cas16_relax
541 ; -O0: eor x8, x0, x8
542 ; -O0: eor x9, x1, x9
543 ; -O0: orr x8, x8, x9
544 ; -O0: subs x8, x8, #0
546 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
547 ; -O1: ldxp x0, x1, [x8]
548 ; -O1: adds x9, x0, x2
549 ; -O1: stxp w11, x9, x10, [x8]
550 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
554 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
555 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
556 ; -O0: adds x2, x8, x10
557 ; -O0: subs w10, w10, #1
558 ; -O0: bl __aarch64_cas16_acq
559 ; -O0: eor x8, x0, x8
560 ; -O0: eor x9, x1, x9
561 ; -O0: orr x8, x8, x9
562 ; -O0: subs x8, x8, #0
564 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
565 ; -O1: ldaxp x0, x1, [x8]
566 ; -O1: adds x9, x0, x2
567 ; -O1: stxp w11, x9, x10, [x8]
568 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
572 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
573 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
574 ; -O0: adds x2, x8, x10
575 ; -O0: subs w10, w10, #1
576 ; -O0: bl __aarch64_cas16_rel
577 ; -O0: eor x8, x0, x8
578 ; -O0: eor x9, x1, x9
579 ; -O0: orr x8, x8, x9
580 ; -O0: subs x8, x8, #0
582 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
583 ; -O1: ldxp x0, x1, [x8]
584 ; -O1: adds x9, x0, x2
585 ; -O1: stlxp w11, x9, x10, [x8]
586 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
590 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
591 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
592 ; -O0: adds x2, x8, x10
593 ; -O0: subs w10, w10, #1
594 ; -O0: bl __aarch64_cas16_acq_rel
595 ; -O0: eor x8, x0, x8
596 ; -O0: eor x9, x1, x9
597 ; -O0: orr x8, x8, x9
598 ; -O0: subs x8, x8, #0
600 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
601 ; -O1: ldaxp x0, x1, [x8]
602 ; -O1: adds x9, x0, x2
603 ; -O1: stlxp w11, x9, x10, [x8]
604 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
608 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
609 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
610 ; -O0: adds x2, x8, x10
611 ; -O0: subs w10, w10, #1
612 ; -O0: bl __aarch64_cas16_acq_rel
613 ; -O0: eor x8, x0, x8
614 ; -O0: eor x9, x1, x9
615 ; -O0: orr x8, x8, x9
616 ; -O0: subs x8, x8, #0
618 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
619 ; -O1: ldaxp x0, x1, [x8]
620 ; -O1: adds x9, x0, x2
621 ; -O1: stlxp w11, x9, x10, [x8]
622 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
626 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
627 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
628 ; CHECK: bl __aarch64_ldadd1_relax
629 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
633 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
634 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
635 ; CHECK: bl __aarch64_ldadd1_acq
636 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
640 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
641 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
642 ; CHECK: bl __aarch64_ldadd1_rel
643 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
647 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
648 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
649 ; CHECK: bl __aarch64_ldadd1_acq_rel
650 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
654 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
655 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
656 ; CHECK: bl __aarch64_ldadd1_acq_rel
657 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
661 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
662 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
663 ; -O0: add w8, w8, w9, uxth
664 ; -O0: bl __atomic_compare_exchange
666 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
667 ; -O1: add w8, w0, w20
668 ; -O1: bl __atomic_compare_exchange
669 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
673 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
674 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
675 ; -O0: add w8, w8, w9, uxth
676 ; -O0: bl __atomic_compare_exchange
678 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
679 ; -O1: add w8, w0, w20
680 ; -O1: bl __atomic_compare_exchange
681 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
685 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
686 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
687 ; -O0: add w8, w8, w9, uxth
688 ; -O0: bl __atomic_compare_exchange
690 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
691 ; -O1: add w8, w0, w20
692 ; -O1: bl __atomic_compare_exchange
693 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
697 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
698 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
699 ; -O0: add w8, w8, w9, uxth
700 ; -O0: bl __atomic_compare_exchange
702 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
703 ; -O1: add w8, w0, w20
704 ; -O1: bl __atomic_compare_exchange
705 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
709 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
710 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
711 ; -O0: add w8, w8, w9, uxth
712 ; -O0: bl __atomic_compare_exchange
714 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
715 ; -O1: add w8, w0, w20
716 ; -O1: bl __atomic_compare_exchange
717 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
721 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
722 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
723 ; -O0: add w8, w9, w8
724 ; -O0: bl __atomic_compare_exchange
726 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
727 ; -O1: add w8, w0, w20
728 ; -O1: bl __atomic_compare_exchange
729 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
733 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
734 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
735 ; -O0: add w8, w9, w8
736 ; -O0: bl __atomic_compare_exchange
738 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
739 ; -O1: add w8, w0, w20
740 ; -O1: bl __atomic_compare_exchange
741 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
745 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
746 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
747 ; -O0: add w8, w9, w8
748 ; -O0: bl __atomic_compare_exchange
750 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
751 ; -O1: add w8, w0, w20
752 ; -O1: bl __atomic_compare_exchange
753 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
757 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
758 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
759 ; -O0: add w8, w9, w8
760 ; -O0: bl __atomic_compare_exchange
762 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
763 ; -O1: add w8, w0, w20
764 ; -O1: bl __atomic_compare_exchange
765 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
769 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
770 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
771 ; -O0: add w8, w9, w8
772 ; -O0: bl __atomic_compare_exchange
774 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
775 ; -O1: add w8, w0, w20
776 ; -O1: bl __atomic_compare_exchange
777 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
781 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
782 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
783 ; -O0: add x8, x9, x8
784 ; -O0: bl __atomic_compare_exchange
786 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
787 ; -O1: add x8, x0, x20
788 ; -O1: bl __atomic_compare_exchange
789 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
793 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
794 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
795 ; -O0: add x8, x9, x8
796 ; -O0: bl __atomic_compare_exchange
798 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
799 ; -O1: add x8, x0, x20
800 ; -O1: bl __atomic_compare_exchange
801 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
805 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
806 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
807 ; -O0: add x8, x9, x8
808 ; -O0: bl __atomic_compare_exchange
810 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
811 ; -O1: add x8, x0, x20
812 ; -O1: bl __atomic_compare_exchange
813 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
817 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
818 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
819 ; -O0: add x8, x9, x8
820 ; -O0: bl __atomic_compare_exchange
822 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
823 ; -O1: add x8, x0, x20
824 ; -O1: bl __atomic_compare_exchange
825 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
829 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
830 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
831 ; -O0: add x8, x9, x8
832 ; -O0: bl __atomic_compare_exchange
834 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
835 ; -O1: add x8, x0, x20
836 ; -O1: bl __atomic_compare_exchange
837 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
841 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
842 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
843 ; -O0: adds x9, x8, x9
844 ; -O0: subs w11, w11, #1
845 ; -O0: bl __atomic_compare_exchange
847 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
848 ; -O1: ldp x0, x1, [x0]
849 ; -O1: adds x8, x0, x21
850 ; -O1: bl __atomic_compare_exchange
851 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
855 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
856 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
857 ; -O0: adds x9, x8, x9
858 ; -O0: subs w11, w11, #1
859 ; -O0: bl __atomic_compare_exchange
861 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
862 ; -O1: ldp x0, x1, [x0]
863 ; -O1: adds x8, x0, x21
864 ; -O1: bl __atomic_compare_exchange
865 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
869 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
870 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
871 ; -O0: adds x9, x8, x9
872 ; -O0: subs w11, w11, #1
873 ; -O0: bl __atomic_compare_exchange
875 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
876 ; -O1: ldp x0, x1, [x0]
877 ; -O1: adds x8, x0, x21
878 ; -O1: bl __atomic_compare_exchange
879 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
883 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
884 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
885 ; -O0: adds x9, x8, x9
886 ; -O0: subs w11, w11, #1
887 ; -O0: bl __atomic_compare_exchange
889 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
890 ; -O1: ldp x0, x1, [x0]
891 ; -O1: adds x8, x0, x21
892 ; -O1: bl __atomic_compare_exchange
893 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
897 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
898 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
899 ; -O0: adds x9, x8, x9
900 ; -O0: subs w11, w11, #1
901 ; -O0: bl __atomic_compare_exchange
903 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
904 ; -O1: ldp x0, x1, [x0]
905 ; -O1: adds x8, x0, x21
906 ; -O1: bl __atomic_compare_exchange
907 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
911 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
912 ; -O0-LABEL: atomicrmw_sub_i8_aligned_monotonic:
913 ; -O0: subs w0, w8, w9
914 ; -O0: bl __aarch64_ldadd1_relax
916 ; -O1-LABEL: atomicrmw_sub_i8_aligned_monotonic:
917 ; -O1: bl __aarch64_ldadd1_relax
918 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
922 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
923 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acquire:
924 ; -O0: subs w0, w8, w9
925 ; -O0: bl __aarch64_ldadd1_acq
927 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acquire:
928 ; -O1: bl __aarch64_ldadd1_acq
929 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
933 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
934 ; -O0-LABEL: atomicrmw_sub_i8_aligned_release:
935 ; -O0: subs w0, w8, w9
936 ; -O0: bl __aarch64_ldadd1_rel
938 ; -O1-LABEL: atomicrmw_sub_i8_aligned_release:
939 ; -O1: bl __aarch64_ldadd1_rel
940 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
944 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
945 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
946 ; -O0: subs w0, w8, w9
947 ; -O0: bl __aarch64_ldadd1_acq_rel
949 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
950 ; -O1: bl __aarch64_ldadd1_acq_rel
951 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
955 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
956 ; -O0-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
957 ; -O0: subs w0, w8, w9
958 ; -O0: bl __aarch64_ldadd1_acq_rel
960 ; -O1-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
961 ; -O1: bl __aarch64_ldadd1_acq_rel
962 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
966 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
967 ; -O0-LABEL: atomicrmw_sub_i16_aligned_monotonic:
968 ; -O0: subs w0, w8, w9
969 ; -O0: bl __aarch64_ldadd2_relax
971 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
972 ; -O1: bl __aarch64_ldadd2_relax
973 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
977 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
978 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
979 ; -O0: subs w0, w8, w9
980 ; -O0: bl __aarch64_ldadd2_acq
982 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
983 ; -O1: bl __aarch64_ldadd2_acq
984 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
988 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
989 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
990 ; -O0: subs w0, w8, w9
991 ; -O0: bl __aarch64_ldadd2_rel
993 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
994 ; -O1: bl __aarch64_ldadd2_rel
995 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
999 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1000 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1001 ; -O0: subs w0, w8, w9
1002 ; -O0: bl __aarch64_ldadd2_acq_rel
1004 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1005 ; -O1: bl __aarch64_ldadd2_acq_rel
1006 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
1010 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1011 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1012 ; -O0: subs w0, w8, w9
1013 ; -O0: bl __aarch64_ldadd2_acq_rel
1015 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1016 ; -O1: bl __aarch64_ldadd2_acq_rel
1017 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1021 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1022 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1023 ; -O0: subs w0, w8, w9
1024 ; -O0: bl __aarch64_ldadd4_relax
1026 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1027 ; -O1: bl __aarch64_ldadd4_relax
1028 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1032 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1033 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
1034 ; -O0: subs w0, w8, w9
1035 ; -O0: bl __aarch64_ldadd4_acq
1037 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1038 ; -O1: bl __aarch64_ldadd4_acq
1039 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1043 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1044 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1045 ; -O0: subs w0, w8, w9
1046 ; -O0: bl __aarch64_ldadd4_rel
1048 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1049 ; -O1: bl __aarch64_ldadd4_rel
1050 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1054 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1055 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1056 ; -O0: subs w0, w8, w9
1057 ; -O0: bl __aarch64_ldadd4_acq_rel
1059 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1060 ; -O1: bl __aarch64_ldadd4_acq_rel
1061 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1065 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1066 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1067 ; -O0: subs w0, w8, w9
1068 ; -O0: bl __aarch64_ldadd4_acq_rel
1070 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1071 ; -O1: bl __aarch64_ldadd4_acq_rel
1072 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1076 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1077 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1078 ; -O0: subs x0, x8, x9
1079 ; -O0: bl __aarch64_ldadd8_relax
1081 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1082 ; -O1: bl __aarch64_ldadd8_relax
1083 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1087 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1088 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1089 ; -O0: subs x0, x8, x9
1090 ; -O0: bl __aarch64_ldadd8_acq
1092 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1093 ; -O1: bl __aarch64_ldadd8_acq
1094 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1098 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1099 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1100 ; -O0: subs x0, x8, x9
1101 ; -O0: bl __aarch64_ldadd8_rel
1103 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1104 ; -O1: bl __aarch64_ldadd8_rel
1105 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1109 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1110 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1111 ; -O0: subs x0, x8, x9
1112 ; -O0: bl __aarch64_ldadd8_acq_rel
1114 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1115 ; -O1: bl __aarch64_ldadd8_acq_rel
1116 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1120 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1121 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1122 ; -O0: subs x0, x8, x9
1123 ; -O0: bl __aarch64_ldadd8_acq_rel
1125 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1126 ; -O1: bl __aarch64_ldadd8_acq_rel
1127 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1131 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1132 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1133 ; -O0: subs x2, x8, x10
1134 ; -O0: bl __aarch64_cas16_relax
1135 ; -O0: eor x8, x0, x8
1136 ; -O0: eor x9, x1, x9
1137 ; -O0: orr x8, x8, x9
1138 ; -O0: subs x8, x8, #0
1140 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1141 ; -O1: ldxp x0, x1, [x8]
1142 ; -O1: subs x9, x0, x2
1143 ; -O1: stxp w11, x9, x10, [x8]
1144 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1148 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1149 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1150 ; -O0: subs x2, x8, x10
1151 ; -O0: bl __aarch64_cas16_acq
1152 ; -O0: eor x8, x0, x8
1153 ; -O0: eor x9, x1, x9
1154 ; -O0: orr x8, x8, x9
1155 ; -O0: subs x8, x8, #0
1157 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1158 ; -O1: ldaxp x0, x1, [x8]
1159 ; -O1: subs x9, x0, x2
1160 ; -O1: stxp w11, x9, x10, [x8]
1161 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1165 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1166 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1167 ; -O0: subs x2, x8, x10
1168 ; -O0: bl __aarch64_cas16_rel
1169 ; -O0: eor x8, x0, x8
1170 ; -O0: eor x9, x1, x9
1171 ; -O0: orr x8, x8, x9
1172 ; -O0: subs x8, x8, #0
1174 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1175 ; -O1: ldxp x0, x1, [x8]
1176 ; -O1: subs x9, x0, x2
1177 ; -O1: stlxp w11, x9, x10, [x8]
1178 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1182 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1183 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1184 ; -O0: subs x2, x8, x10
1185 ; -O0: bl __aarch64_cas16_acq_rel
1186 ; -O0: eor x8, x0, x8
1187 ; -O0: eor x9, x1, x9
1188 ; -O0: orr x8, x8, x9
1189 ; -O0: subs x8, x8, #0
1191 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1192 ; -O1: ldaxp x0, x1, [x8]
1193 ; -O1: subs x9, x0, x2
1194 ; -O1: stlxp w11, x9, x10, [x8]
1195 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1199 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1200 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1201 ; -O0: subs x2, x8, x10
1202 ; -O0: bl __aarch64_cas16_acq_rel
1203 ; -O0: eor x8, x0, x8
1204 ; -O0: eor x9, x1, x9
1205 ; -O0: orr x8, x8, x9
1206 ; -O0: subs x8, x8, #0
1208 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1209 ; -O1: ldaxp x0, x1, [x8]
1210 ; -O1: subs x9, x0, x2
1211 ; -O1: stlxp w11, x9, x10, [x8]
1212 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1216 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1217 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1218 ; -O0: subs w0, w8, w9
1219 ; -O0: bl __aarch64_ldadd1_relax
1221 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1222 ; -O1: bl __aarch64_ldadd1_relax
1223 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1227 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1228 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1229 ; -O0: subs w0, w8, w9
1230 ; -O0: bl __aarch64_ldadd1_acq
1232 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1233 ; -O1: bl __aarch64_ldadd1_acq
1234 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1238 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1239 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1240 ; -O0: subs w0, w8, w9
1241 ; -O0: bl __aarch64_ldadd1_rel
1243 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1244 ; -O1: bl __aarch64_ldadd1_rel
1245 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1249 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1250 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1251 ; -O0: subs w0, w8, w9
1252 ; -O0: bl __aarch64_ldadd1_acq_rel
1254 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1255 ; -O1: bl __aarch64_ldadd1_acq_rel
1256 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1260 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1261 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1262 ; -O0: subs w0, w8, w9
1263 ; -O0: bl __aarch64_ldadd1_acq_rel
1265 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1266 ; -O1: bl __aarch64_ldadd1_acq_rel
1267 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1271 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1272 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1273 ; -O0: subs w8, w9, w8
1274 ; -O0: bl __atomic_compare_exchange
1276 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1277 ; -O1: sub w8, w0, w20
1278 ; -O1: bl __atomic_compare_exchange
1279 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1283 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1284 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1285 ; -O0: subs w8, w9, w8
1286 ; -O0: bl __atomic_compare_exchange
1288 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1289 ; -O1: sub w8, w0, w20
1290 ; -O1: bl __atomic_compare_exchange
1291 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1295 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1296 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1297 ; -O0: subs w8, w9, w8
1298 ; -O0: bl __atomic_compare_exchange
1300 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1301 ; -O1: sub w8, w0, w20
1302 ; -O1: bl __atomic_compare_exchange
1303 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1307 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1308 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1309 ; -O0: subs w8, w9, w8
1310 ; -O0: bl __atomic_compare_exchange
1312 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1313 ; -O1: sub w8, w0, w20
1314 ; -O1: bl __atomic_compare_exchange
1315 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1319 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1320 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1321 ; -O0: subs w8, w9, w8
1322 ; -O0: bl __atomic_compare_exchange
1324 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1325 ; -O1: sub w8, w0, w20
1326 ; -O1: bl __atomic_compare_exchange
1327 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1331 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1332 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1333 ; -O0: subs w8, w9, w8
1334 ; -O0: bl __atomic_compare_exchange
1336 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1337 ; -O1: sub w8, w0, w20
1338 ; -O1: bl __atomic_compare_exchange
1339 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1343 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1344 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1345 ; -O0: subs w8, w9, w8
1346 ; -O0: bl __atomic_compare_exchange
1348 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1349 ; -O1: sub w8, w0, w20
1350 ; -O1: bl __atomic_compare_exchange
1351 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1355 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1356 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1357 ; -O0: subs w8, w9, w8
1358 ; -O0: bl __atomic_compare_exchange
1360 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1361 ; -O1: sub w8, w0, w20
1362 ; -O1: bl __atomic_compare_exchange
1363 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1367 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1368 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1369 ; -O0: subs w8, w9, w8
1370 ; -O0: bl __atomic_compare_exchange
1372 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1373 ; -O1: sub w8, w0, w20
1374 ; -O1: bl __atomic_compare_exchange
1375 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1379 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1380 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1381 ; -O0: subs w8, w9, w8
1382 ; -O0: bl __atomic_compare_exchange
1384 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1385 ; -O1: sub w8, w0, w20
1386 ; -O1: bl __atomic_compare_exchange
1387 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1391 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1392 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1393 ; -O0: subs x8, x9, x8
1394 ; -O0: bl __atomic_compare_exchange
1396 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1397 ; -O1: sub x8, x0, x20
1398 ; -O1: bl __atomic_compare_exchange
1399 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1403 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1404 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1405 ; -O0: subs x8, x9, x8
1406 ; -O0: bl __atomic_compare_exchange
1408 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1409 ; -O1: sub x8, x0, x20
1410 ; -O1: bl __atomic_compare_exchange
1411 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1415 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1416 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1417 ; -O0: subs x8, x9, x8
1418 ; -O0: bl __atomic_compare_exchange
1420 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1421 ; -O1: sub x8, x0, x20
1422 ; -O1: bl __atomic_compare_exchange
1423 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1427 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1428 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1429 ; -O0: subs x8, x9, x8
1430 ; -O0: bl __atomic_compare_exchange
1432 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1433 ; -O1: sub x8, x0, x20
1434 ; -O1: bl __atomic_compare_exchange
1435 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1439 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1440 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1441 ; -O0: subs x8, x9, x8
1442 ; -O0: bl __atomic_compare_exchange
1444 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1445 ; -O1: sub x8, x0, x20
1446 ; -O1: bl __atomic_compare_exchange
1447 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1451 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1452 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1453 ; -O0: subs x9, x8, x9
1454 ; -O0: bl __atomic_compare_exchange
1456 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1457 ; -O1: ldp x0, x1, [x0]
1458 ; -O1: subs x8, x0, x21
1459 ; -O1: bl __atomic_compare_exchange
1460 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1464 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1465 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1466 ; -O0: subs x9, x8, x9
1467 ; -O0: bl __atomic_compare_exchange
1469 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1470 ; -O1: ldp x0, x1, [x0]
1471 ; -O1: subs x8, x0, x21
1472 ; -O1: bl __atomic_compare_exchange
1473 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1477 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1478 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1479 ; -O0: subs x9, x8, x9
1480 ; -O0: bl __atomic_compare_exchange
1482 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1483 ; -O1: ldp x0, x1, [x0]
1484 ; -O1: subs x8, x0, x21
1485 ; -O1: bl __atomic_compare_exchange
1486 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1490 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1491 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1492 ; -O0: subs x9, x8, x9
1493 ; -O0: bl __atomic_compare_exchange
1495 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1496 ; -O1: ldp x0, x1, [x0]
1497 ; -O1: subs x8, x0, x21
1498 ; -O1: bl __atomic_compare_exchange
1499 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1503 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1504 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1505 ; -O0: subs x9, x8, x9
1506 ; -O0: bl __atomic_compare_exchange
1508 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1509 ; -O1: ldp x0, x1, [x0]
1510 ; -O1: subs x8, x0, x21
1511 ; -O1: bl __atomic_compare_exchange
1512 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1516 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1517 ; -O0-LABEL: atomicrmw_and_i8_aligned_monotonic:
1518 ; -O0: eor w0, w8, w9
1519 ; -O0: bl __aarch64_ldclr1_relax
1521 ; -O1-LABEL: atomicrmw_and_i8_aligned_monotonic:
1523 ; -O1: bl __aarch64_ldclr1_relax
1524 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1528 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1529 ; -O0-LABEL: atomicrmw_and_i8_aligned_acquire:
1530 ; -O0: eor w0, w8, w9
1531 ; -O0: bl __aarch64_ldclr1_acq
1533 ; -O1-LABEL: atomicrmw_and_i8_aligned_acquire:
1535 ; -O1: bl __aarch64_ldclr1_acq
1536 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1540 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1541 ; -O0-LABEL: atomicrmw_and_i8_aligned_release:
1542 ; -O0: eor w0, w8, w9
1543 ; -O0: bl __aarch64_ldclr1_rel
1545 ; -O1-LABEL: atomicrmw_and_i8_aligned_release:
1547 ; -O1: bl __aarch64_ldclr1_rel
1548 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1552 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1553 ; -O0-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1554 ; -O0: eor w0, w8, w9
1555 ; -O0: bl __aarch64_ldclr1_acq_rel
1557 ; -O1-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1559 ; -O1: bl __aarch64_ldclr1_acq_rel
1560 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1564 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1565 ; -O0-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1566 ; -O0: eor w0, w8, w9
1567 ; -O0: bl __aarch64_ldclr1_acq_rel
1569 ; -O1-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1571 ; -O1: bl __aarch64_ldclr1_acq_rel
1572 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1576 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1577 ; -O0-LABEL: atomicrmw_and_i16_aligned_monotonic:
1578 ; -O0: eor w0, w8, w9
1579 ; -O0: bl __aarch64_ldclr2_relax
1581 ; -O1-LABEL: atomicrmw_and_i16_aligned_monotonic:
1583 ; -O1: bl __aarch64_ldclr2_relax
1584 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1588 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1589 ; -O0-LABEL: atomicrmw_and_i16_aligned_acquire:
1590 ; -O0: eor w0, w8, w9
1591 ; -O0: bl __aarch64_ldclr2_acq
1593 ; -O1-LABEL: atomicrmw_and_i16_aligned_acquire:
1595 ; -O1: bl __aarch64_ldclr2_acq
1596 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1600 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1601 ; -O0-LABEL: atomicrmw_and_i16_aligned_release:
1602 ; -O0: eor w0, w8, w9
1603 ; -O0: bl __aarch64_ldclr2_rel
1605 ; -O1-LABEL: atomicrmw_and_i16_aligned_release:
1607 ; -O1: bl __aarch64_ldclr2_rel
1608 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1612 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1613 ; -O0-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1614 ; -O0: eor w0, w8, w9
1615 ; -O0: bl __aarch64_ldclr2_acq_rel
1617 ; -O1-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1619 ; -O1: bl __aarch64_ldclr2_acq_rel
1620 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1624 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1625 ; -O0-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1626 ; -O0: eor w0, w8, w9
1627 ; -O0: bl __aarch64_ldclr2_acq_rel
1629 ; -O1-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1631 ; -O1: bl __aarch64_ldclr2_acq_rel
1632 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1636 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1637 ; -O0-LABEL: atomicrmw_and_i32_aligned_monotonic:
1638 ; -O0: eor w0, w8, w9
1639 ; -O0: bl __aarch64_ldclr4_relax
1641 ; -O1-LABEL: atomicrmw_and_i32_aligned_monotonic:
1643 ; -O1: bl __aarch64_ldclr4_relax
1644 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1648 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1649 ; -O0-LABEL: atomicrmw_and_i32_aligned_acquire:
1650 ; -O0: eor w0, w8, w9
1651 ; -O0: bl __aarch64_ldclr4_acq
1653 ; -O1-LABEL: atomicrmw_and_i32_aligned_acquire:
1655 ; -O1: bl __aarch64_ldclr4_acq
1656 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1660 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1661 ; -O0-LABEL: atomicrmw_and_i32_aligned_release:
1662 ; -O0: eor w0, w8, w9
1663 ; -O0: bl __aarch64_ldclr4_rel
1665 ; -O1-LABEL: atomicrmw_and_i32_aligned_release:
1667 ; -O1: bl __aarch64_ldclr4_rel
1668 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1672 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1673 ; -O0-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1674 ; -O0: eor w0, w8, w9
1675 ; -O0: bl __aarch64_ldclr4_acq_rel
1677 ; -O1-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1679 ; -O1: bl __aarch64_ldclr4_acq_rel
1680 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1684 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1685 ; -O0-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1686 ; -O0: eor w0, w8, w9
1687 ; -O0: bl __aarch64_ldclr4_acq_rel
1689 ; -O1-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1691 ; -O1: bl __aarch64_ldclr4_acq_rel
1692 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1696 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1697 ; -O0-LABEL: atomicrmw_and_i64_aligned_monotonic:
1698 ; -O0: eor x0, x8, x9
1699 ; -O0: bl __aarch64_ldclr8_relax
1701 ; -O1-LABEL: atomicrmw_and_i64_aligned_monotonic:
1703 ; -O1: bl __aarch64_ldclr8_relax
1704 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1708 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1709 ; -O0-LABEL: atomicrmw_and_i64_aligned_acquire:
1710 ; -O0: eor x0, x8, x9
1711 ; -O0: bl __aarch64_ldclr8_acq
1713 ; -O1-LABEL: atomicrmw_and_i64_aligned_acquire:
1715 ; -O1: bl __aarch64_ldclr8_acq
1716 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1720 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1721 ; -O0-LABEL: atomicrmw_and_i64_aligned_release:
1722 ; -O0: eor x0, x8, x9
1723 ; -O0: bl __aarch64_ldclr8_rel
1725 ; -O1-LABEL: atomicrmw_and_i64_aligned_release:
1727 ; -O1: bl __aarch64_ldclr8_rel
1728 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1732 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1733 ; -O0-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1734 ; -O0: eor x0, x8, x9
1735 ; -O0: bl __aarch64_ldclr8_acq_rel
1737 ; -O1-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1739 ; -O1: bl __aarch64_ldclr8_acq_rel
1740 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1744 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1745 ; -O0-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1746 ; -O0: eor x0, x8, x9
1747 ; -O0: bl __aarch64_ldclr8_acq_rel
1749 ; -O1-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1751 ; -O1: bl __aarch64_ldclr8_acq_rel
1752 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1756 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1757 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1758 ; -O0: and x2, x8, x10
1759 ; -O0: and x3, x8, x9
1760 ; -O0: bl __aarch64_cas16_relax
1761 ; -O0: eor x8, x0, x8
1762 ; -O0: eor x9, x1, x9
1763 ; -O0: orr x8, x8, x9
1764 ; -O0: subs x8, x8, #0
1766 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1767 ; -O1: ldxp x0, x1, [x8]
1768 ; -O1: and x9, x1, x3
1769 ; -O1: and x10, x0, x2
1770 ; -O1: stxp w11, x10, x9, [x8]
1771 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1775 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1776 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1777 ; -O0: and x2, x8, x10
1778 ; -O0: and x3, x8, x9
1779 ; -O0: bl __aarch64_cas16_acq
1780 ; -O0: eor x8, x0, x8
1781 ; -O0: eor x9, x1, x9
1782 ; -O0: orr x8, x8, x9
1783 ; -O0: subs x8, x8, #0
1785 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1786 ; -O1: ldaxp x0, x1, [x8]
1787 ; -O1: and x9, x1, x3
1788 ; -O1: and x10, x0, x2
1789 ; -O1: stxp w11, x10, x9, [x8]
1790 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1794 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1795 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1796 ; -O0: and x2, x8, x10
1797 ; -O0: and x3, x8, x9
1798 ; -O0: bl __aarch64_cas16_rel
1799 ; -O0: eor x8, x0, x8
1800 ; -O0: eor x9, x1, x9
1801 ; -O0: orr x8, x8, x9
1802 ; -O0: subs x8, x8, #0
1804 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1805 ; -O1: ldxp x0, x1, [x8]
1806 ; -O1: and x9, x1, x3
1807 ; -O1: and x10, x0, x2
1808 ; -O1: stlxp w11, x10, x9, [x8]
1809 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1813 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1814 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1815 ; -O0: and x2, x8, x10
1816 ; -O0: and x3, x8, x9
1817 ; -O0: bl __aarch64_cas16_acq_rel
1818 ; -O0: eor x8, x0, x8
1819 ; -O0: eor x9, x1, x9
1820 ; -O0: orr x8, x8, x9
1821 ; -O0: subs x8, x8, #0
1823 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1824 ; -O1: ldaxp x0, x1, [x8]
1825 ; -O1: and x9, x1, x3
1826 ; -O1: and x10, x0, x2
1827 ; -O1: stlxp w11, x10, x9, [x8]
1828 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1832 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1833 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1834 ; -O0: and x2, x8, x10
1835 ; -O0: and x3, x8, x9
1836 ; -O0: bl __aarch64_cas16_acq_rel
1837 ; -O0: eor x8, x0, x8
1838 ; -O0: eor x9, x1, x9
1839 ; -O0: orr x8, x8, x9
1840 ; -O0: subs x8, x8, #0
1842 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1843 ; -O1: ldaxp x0, x1, [x8]
1844 ; -O1: and x9, x1, x3
1845 ; -O1: and x10, x0, x2
1846 ; -O1: stlxp w11, x10, x9, [x8]
1847 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1851 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1852 ; -O0-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1853 ; -O0: eor w0, w8, w9
1854 ; -O0: bl __aarch64_ldclr1_relax
1856 ; -O1-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1858 ; -O1: bl __aarch64_ldclr1_relax
1859 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1863 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1864 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acquire:
1865 ; -O0: eor w0, w8, w9
1866 ; -O0: bl __aarch64_ldclr1_acq
1868 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acquire:
1870 ; -O1: bl __aarch64_ldclr1_acq
1871 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1875 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1876 ; -O0-LABEL: atomicrmw_and_i8_unaligned_release:
1877 ; -O0: eor w0, w8, w9
1878 ; -O0: bl __aarch64_ldclr1_rel
1880 ; -O1-LABEL: atomicrmw_and_i8_unaligned_release:
1882 ; -O1: bl __aarch64_ldclr1_rel
1883 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1887 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1888 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1889 ; -O0: eor w0, w8, w9
1890 ; -O0: bl __aarch64_ldclr1_acq_rel
1892 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1894 ; -O1: bl __aarch64_ldclr1_acq_rel
1895 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1899 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1900 ; -O0-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1901 ; -O0: eor w0, w8, w9
1902 ; -O0: bl __aarch64_ldclr1_acq_rel
1904 ; -O1-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1906 ; -O1: bl __aarch64_ldclr1_acq_rel
1907 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1911 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1912 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1913 ; -O0: and w8, w9, w8
1914 ; -O0: bl __atomic_compare_exchange
1916 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1917 ; -O1: and w8, w0, w20
1918 ; -O1: bl __atomic_compare_exchange
1919 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1923 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1924 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1925 ; -O0: and w8, w9, w8
1926 ; -O0: bl __atomic_compare_exchange
1928 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1929 ; -O1: and w8, w0, w20
1930 ; -O1: bl __atomic_compare_exchange
1931 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1935 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1936 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1937 ; -O0: and w8, w9, w8
1938 ; -O0: bl __atomic_compare_exchange
1940 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1941 ; -O1: and w8, w0, w20
1942 ; -O1: bl __atomic_compare_exchange
1943 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1947 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1948 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1949 ; -O0: and w8, w9, w8
1950 ; -O0: bl __atomic_compare_exchange
1952 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1953 ; -O1: and w8, w0, w20
1954 ; -O1: bl __atomic_compare_exchange
1955 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1959 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1960 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1961 ; -O0: and w8, w9, w8
1962 ; -O0: bl __atomic_compare_exchange
1964 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1965 ; -O1: and w8, w0, w20
1966 ; -O1: bl __atomic_compare_exchange
1967 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1971 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1972 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1973 ; -O0: and w8, w9, w8
1974 ; -O0: bl __atomic_compare_exchange
1976 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1977 ; -O1: and w8, w0, w20
1978 ; -O1: bl __atomic_compare_exchange
1979 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1983 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1984 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1985 ; -O0: and w8, w9, w8
1986 ; -O0: bl __atomic_compare_exchange
1988 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1989 ; -O1: and w8, w0, w20
1990 ; -O1: bl __atomic_compare_exchange
1991 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1995 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1996 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1997 ; -O0: and w8, w9, w8
1998 ; -O0: bl __atomic_compare_exchange
2000 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
2001 ; -O1: and w8, w0, w20
2002 ; -O1: bl __atomic_compare_exchange
2003 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
2007 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2008 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2009 ; -O0: and w8, w9, w8
2010 ; -O0: bl __atomic_compare_exchange
2012 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2013 ; -O1: and w8, w0, w20
2014 ; -O1: bl __atomic_compare_exchange
2015 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
2019 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2020 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2021 ; -O0: and w8, w9, w8
2022 ; -O0: bl __atomic_compare_exchange
2024 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2025 ; -O1: and w8, w0, w20
2026 ; -O1: bl __atomic_compare_exchange
2027 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
2031 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2032 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2033 ; -O0: and x8, x9, x8
2034 ; -O0: bl __atomic_compare_exchange
2036 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2037 ; -O1: and x8, x0, x20
2038 ; -O1: bl __atomic_compare_exchange
2039 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
2043 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2044 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
2045 ; -O0: and x8, x9, x8
2046 ; -O0: bl __atomic_compare_exchange
2048 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
2049 ; -O1: and x8, x0, x20
2050 ; -O1: bl __atomic_compare_exchange
2051 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
2055 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
2056 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
2057 ; -O0: and x8, x9, x8
2058 ; -O0: bl __atomic_compare_exchange
2060 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
2061 ; -O1: and x8, x0, x20
2062 ; -O1: bl __atomic_compare_exchange
2063 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
2067 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2068 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2069 ; -O0: and x8, x9, x8
2070 ; -O0: bl __atomic_compare_exchange
2072 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2073 ; -O1: and x8, x0, x20
2074 ; -O1: bl __atomic_compare_exchange
2075 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
2079 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2080 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2081 ; -O0: and x8, x9, x8
2082 ; -O0: bl __atomic_compare_exchange
2084 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2085 ; -O1: and x8, x0, x20
2086 ; -O1: bl __atomic_compare_exchange
2087 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
2091 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2092 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2093 ; -O0: and x9, x8, x9
2094 ; -O0: and x8, x8, x10
2095 ; -O0: bl __atomic_compare_exchange
2097 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2098 ; -O1: ldp x0, x1, [x0]
2099 ; -O1: and x8, x1, x19
2100 ; -O1: and x9, x0, x21
2101 ; -O1: bl __atomic_compare_exchange
2102 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
2106 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2107 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
2108 ; -O0: and x9, x8, x9
2109 ; -O0: and x8, x8, x10
2110 ; -O0: bl __atomic_compare_exchange
2112 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
2113 ; -O1: ldp x0, x1, [x0]
2114 ; -O1: and x8, x1, x19
2115 ; -O1: and x9, x0, x21
2116 ; -O1: bl __atomic_compare_exchange
2117 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
2121 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
2122 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
2123 ; -O0: and x9, x8, x9
2124 ; -O0: and x8, x8, x10
2125 ; -O0: bl __atomic_compare_exchange
2127 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
2128 ; -O1: ldp x0, x1, [x0]
2129 ; -O1: and x8, x1, x19
2130 ; -O1: and x9, x0, x21
2131 ; -O1: bl __atomic_compare_exchange
2132 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
2136 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2137 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2138 ; -O0: and x9, x8, x9
2139 ; -O0: and x8, x8, x10
2140 ; -O0: bl __atomic_compare_exchange
2142 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2143 ; -O1: ldp x0, x1, [x0]
2144 ; -O1: and x8, x1, x19
2145 ; -O1: and x9, x0, x21
2146 ; -O1: bl __atomic_compare_exchange
2147 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2151 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2152 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2153 ; -O0: and x9, x8, x9
2154 ; -O0: and x8, x8, x10
2155 ; -O0: bl __atomic_compare_exchange
2157 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2158 ; -O1: ldp x0, x1, [x0]
2159 ; -O1: and x8, x1, x19
2160 ; -O1: and x9, x0, x21
2161 ; -O1: bl __atomic_compare_exchange
2162 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2166 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2167 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2168 ; -O0: and w8, w0, w8
2170 ; -O0: bl __aarch64_cas1_relax
2171 ; -O0: and w8, w0, #0xff
2172 ; -O0: subs w8, w8, w9, uxtb
2174 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2175 ; -O1: ldxrb w8, [x0]
2176 ; -O1: and w9, w8, w1
2178 ; -O1: stxrb w10, w9, [x0]
2179 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2183 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2184 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2185 ; -O0: and w8, w0, w8
2187 ; -O0: bl __aarch64_cas1_acq
2188 ; -O0: and w8, w0, #0xff
2189 ; -O0: subs w8, w8, w9, uxtb
2191 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2192 ; -O1: ldaxrb w8, [x0]
2193 ; -O1: and w9, w8, w1
2195 ; -O1: stxrb w10, w9, [x0]
2196 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2200 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2201 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2202 ; -O0: and w8, w0, w8
2204 ; -O0: bl __aarch64_cas1_rel
2205 ; -O0: and w8, w0, #0xff
2206 ; -O0: subs w8, w8, w9, uxtb
2208 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2209 ; -O1: ldxrb w8, [x0]
2210 ; -O1: and w9, w8, w1
2212 ; -O1: stlxrb w10, w9, [x0]
2213 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2217 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2218 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2219 ; -O0: and w8, w0, w8
2221 ; -O0: bl __aarch64_cas1_acq_rel
2222 ; -O0: and w8, w0, #0xff
2223 ; -O0: subs w8, w8, w9, uxtb
2225 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2226 ; -O1: ldaxrb w8, [x0]
2227 ; -O1: and w9, w8, w1
2229 ; -O1: stlxrb w10, w9, [x0]
2230 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2234 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2235 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2236 ; -O0: and w8, w0, w8
2238 ; -O0: bl __aarch64_cas1_acq_rel
2239 ; -O0: and w8, w0, #0xff
2240 ; -O0: subs w8, w8, w9, uxtb
2242 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2243 ; -O1: ldaxrb w8, [x0]
2244 ; -O1: and w9, w8, w1
2246 ; -O1: stlxrb w10, w9, [x0]
2247 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2251 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2252 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2253 ; -O0: and w8, w0, w8
2255 ; -O0: bl __aarch64_cas2_relax
2256 ; -O0: subs w8, w8, w0, uxth
2258 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2259 ; -O1: ldxrh w8, [x0]
2260 ; -O1: and w9, w8, w1
2262 ; -O1: stxrh w10, w9, [x0]
2263 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2267 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2268 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2269 ; -O0: and w8, w0, w8
2271 ; -O0: bl __aarch64_cas2_acq
2272 ; -O0: subs w8, w8, w0, uxth
2274 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2275 ; -O1: ldaxrh w8, [x0]
2276 ; -O1: and w9, w8, w1
2278 ; -O1: stxrh w10, w9, [x0]
2279 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2283 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2284 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2285 ; -O0: and w8, w0, w8
2287 ; -O0: bl __aarch64_cas2_rel
2288 ; -O0: subs w8, w8, w0, uxth
2290 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2291 ; -O1: ldxrh w8, [x0]
2292 ; -O1: and w9, w8, w1
2294 ; -O1: stlxrh w10, w9, [x0]
2295 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2299 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2300 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2301 ; -O0: and w8, w0, w8
2303 ; -O0: bl __aarch64_cas2_acq_rel
2304 ; -O0: subs w8, w8, w0, uxth
2306 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2307 ; -O1: ldaxrh w8, [x0]
2308 ; -O1: and w9, w8, w1
2310 ; -O1: stlxrh w10, w9, [x0]
2311 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2315 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2316 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2317 ; -O0: and w8, w0, w8
2319 ; -O0: bl __aarch64_cas2_acq_rel
2320 ; -O0: subs w8, w8, w0, uxth
2322 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2323 ; -O1: ldaxrh w8, [x0]
2324 ; -O1: and w9, w8, w1
2326 ; -O1: stlxrh w10, w9, [x0]
2327 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2331 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2332 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2333 ; -O0: and w8, w0, w8
2335 ; -O0: bl __aarch64_cas4_relax
2336 ; -O0: subs w8, w0, w8
2338 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2339 ; -O1: ldxr w8, [x0]
2340 ; -O1: and w9, w8, w1
2342 ; -O1: stxr w10, w9, [x0]
2343 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2347 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2348 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2349 ; -O0: and w8, w0, w8
2351 ; -O0: bl __aarch64_cas4_acq
2352 ; -O0: subs w8, w0, w8
2354 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2355 ; -O1: ldaxr w8, [x0]
2356 ; -O1: and w9, w8, w1
2358 ; -O1: stxr w10, w9, [x0]
2359 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2363 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2364 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2365 ; -O0: and w8, w0, w8
2367 ; -O0: bl __aarch64_cas4_rel
2368 ; -O0: subs w8, w0, w8
2370 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2371 ; -O1: ldxr w8, [x0]
2372 ; -O1: and w9, w8, w1
2374 ; -O1: stlxr w10, w9, [x0]
2375 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2379 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2380 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2381 ; -O0: and w8, w0, w8
2383 ; -O0: bl __aarch64_cas4_acq_rel
2384 ; -O0: subs w8, w0, w8
2386 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2387 ; -O1: ldaxr w8, [x0]
2388 ; -O1: and w9, w8, w1
2390 ; -O1: stlxr w10, w9, [x0]
2391 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2395 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2396 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2397 ; -O0: and w8, w0, w8
2399 ; -O0: bl __aarch64_cas4_acq_rel
2400 ; -O0: subs w8, w0, w8
2402 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2403 ; -O1: ldaxr w8, [x0]
2404 ; -O1: and w9, w8, w1
2406 ; -O1: stlxr w10, w9, [x0]
2407 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2411 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2412 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2413 ; -O0: and x8, x0, x8
2415 ; -O0: bl __aarch64_cas8_relax
2416 ; -O0: subs x8, x0, x8
2418 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2419 ; -O1: ldxr x0, [x8]
2420 ; -O1: and x9, x0, x1
2422 ; -O1: stxr w10, x9, [x8]
2423 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2427 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2428 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2429 ; -O0: and x8, x0, x8
2431 ; -O0: bl __aarch64_cas8_acq
2432 ; -O0: subs x8, x0, x8
2434 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2435 ; -O1: ldaxr x0, [x8]
2436 ; -O1: and x9, x0, x1
2438 ; -O1: stxr w10, x9, [x8]
2439 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2443 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2444 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2445 ; -O0: and x8, x0, x8
2447 ; -O0: bl __aarch64_cas8_rel
2448 ; -O0: subs x8, x0, x8
2450 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2451 ; -O1: ldxr x0, [x8]
2452 ; -O1: and x9, x0, x1
2454 ; -O1: stlxr w10, x9, [x8]
2455 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2459 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2460 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2461 ; -O0: and x8, x0, x8
2463 ; -O0: bl __aarch64_cas8_acq_rel
2464 ; -O0: subs x8, x0, x8
2466 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2467 ; -O1: ldaxr x0, [x8]
2468 ; -O1: and x9, x0, x1
2470 ; -O1: stlxr w10, x9, [x8]
2471 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2475 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2476 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2477 ; -O0: and x8, x0, x8
2479 ; -O0: bl __aarch64_cas8_acq_rel
2480 ; -O0: subs x8, x0, x8
2482 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2483 ; -O1: ldaxr x0, [x8]
2484 ; -O1: and x9, x0, x1
2486 ; -O1: stlxr w10, x9, [x8]
2487 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2491 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2492 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2493 ; -O0: and x9, x8, x9
2494 ; -O0: and x8, x8, x10
2497 ; -O0: bl __aarch64_cas16_relax
2498 ; -O0: eor x8, x0, x8
2499 ; -O0: eor x9, x1, x9
2500 ; -O0: orr x8, x8, x9
2501 ; -O0: subs x8, x8, #0
2503 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2504 ; -O1: ldxp x0, x1, [x8]
2505 ; -O1: and x9, x0, x2
2506 ; -O1: and x10, x1, x3
2509 ; -O1: stxp w11, x9, x10, [x8]
2510 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2514 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2515 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2516 ; -O0: and x9, x8, x9
2517 ; -O0: and x8, x8, x10
2520 ; -O0: bl __aarch64_cas16_acq
2521 ; -O0: eor x8, x0, x8
2522 ; -O0: eor x9, x1, x9
2523 ; -O0: orr x8, x8, x9
2524 ; -O0: subs x8, x8, #0
2526 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2527 ; -O1: ldaxp x0, x1, [x8]
2528 ; -O1: and x9, x0, x2
2529 ; -O1: and x10, x1, x3
2532 ; -O1: stxp w11, x9, x10, [x8]
2533 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2537 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2538 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2539 ; -O0: and x9, x8, x9
2540 ; -O0: and x8, x8, x10
2543 ; -O0: bl __aarch64_cas16_rel
2544 ; -O0: eor x8, x0, x8
2545 ; -O0: eor x9, x1, x9
2546 ; -O0: orr x8, x8, x9
2547 ; -O0: subs x8, x8, #0
2549 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2550 ; -O1: ldxp x0, x1, [x8]
2551 ; -O1: and x9, x0, x2
2552 ; -O1: and x10, x1, x3
2555 ; -O1: stlxp w11, x9, x10, [x8]
2556 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2560 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2561 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2562 ; -O0: and x9, x8, x9
2563 ; -O0: and x8, x8, x10
2566 ; -O0: bl __aarch64_cas16_acq_rel
2567 ; -O0: eor x8, x0, x8
2568 ; -O0: eor x9, x1, x9
2569 ; -O0: orr x8, x8, x9
2570 ; -O0: subs x8, x8, #0
2572 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2573 ; -O1: ldaxp x0, x1, [x8]
2574 ; -O1: and x9, x0, x2
2575 ; -O1: and x10, x1, x3
2578 ; -O1: stlxp w11, x9, x10, [x8]
2579 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2583 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2584 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2585 ; -O0: and x9, x8, x9
2586 ; -O0: and x8, x8, x10
2589 ; -O0: bl __aarch64_cas16_acq_rel
2590 ; -O0: eor x8, x0, x8
2591 ; -O0: eor x9, x1, x9
2592 ; -O0: orr x8, x8, x9
2593 ; -O0: subs x8, x8, #0
2595 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2596 ; -O1: ldaxp x0, x1, [x8]
2597 ; -O1: and x9, x0, x2
2598 ; -O1: and x10, x1, x3
2601 ; -O1: stlxp w11, x9, x10, [x8]
2602 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2606 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2607 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2608 ; -O0: and w8, w0, w8
2610 ; -O0: bl __aarch64_cas1_relax
2611 ; -O0: and w8, w0, #0xff
2612 ; -O0: subs w8, w8, w9, uxtb
2614 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2615 ; -O1: ldxrb w8, [x0]
2616 ; -O1: and w9, w8, w1
2618 ; -O1: stxrb w10, w9, [x0]
2619 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2623 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2624 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2625 ; -O0: and w8, w0, w8
2627 ; -O0: bl __aarch64_cas1_acq
2628 ; -O0: and w8, w0, #0xff
2629 ; -O0: subs w8, w8, w9, uxtb
2631 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2632 ; -O1: ldaxrb w8, [x0]
2633 ; -O1: and w9, w8, w1
2635 ; -O1: stxrb w10, w9, [x0]
2636 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2640 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2641 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2642 ; -O0: and w8, w0, w8
2644 ; -O0: bl __aarch64_cas1_rel
2645 ; -O0: and w8, w0, #0xff
2646 ; -O0: subs w8, w8, w9, uxtb
2648 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2649 ; -O1: ldxrb w8, [x0]
2650 ; -O1: and w9, w8, w1
2652 ; -O1: stlxrb w10, w9, [x0]
2653 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2657 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2658 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2659 ; -O0: and w8, w0, w8
2661 ; -O0: bl __aarch64_cas1_acq_rel
2662 ; -O0: and w8, w0, #0xff
2663 ; -O0: subs w8, w8, w9, uxtb
2665 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2666 ; -O1: ldaxrb w8, [x0]
2667 ; -O1: and w9, w8, w1
2669 ; -O1: stlxrb w10, w9, [x0]
2670 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2674 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2675 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2676 ; -O0: and w8, w0, w8
2678 ; -O0: bl __aarch64_cas1_acq_rel
2679 ; -O0: and w8, w0, #0xff
2680 ; -O0: subs w8, w8, w9, uxtb
2682 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2683 ; -O1: ldaxrb w8, [x0]
2684 ; -O1: and w9, w8, w1
2686 ; -O1: stlxrb w10, w9, [x0]
2687 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2691 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2692 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2693 ; -O0: and w8, w9, w8
2695 ; -O0: bl __atomic_compare_exchange
2697 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2698 ; -O1: and w8, w0, w20
2700 ; -O1: bl __atomic_compare_exchange
2701 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2705 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2706 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2707 ; -O0: and w8, w9, w8
2709 ; -O0: bl __atomic_compare_exchange
2711 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2712 ; -O1: and w8, w0, w20
2714 ; -O1: bl __atomic_compare_exchange
2715 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2719 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2720 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2721 ; -O0: and w8, w9, w8
2723 ; -O0: bl __atomic_compare_exchange
2725 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2726 ; -O1: and w8, w0, w20
2728 ; -O1: bl __atomic_compare_exchange
2729 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2733 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2734 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2735 ; -O0: and w8, w9, w8
2737 ; -O0: bl __atomic_compare_exchange
2739 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2740 ; -O1: and w8, w0, w20
2742 ; -O1: bl __atomic_compare_exchange
2743 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2747 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2748 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2749 ; -O0: and w8, w9, w8
2751 ; -O0: bl __atomic_compare_exchange
2753 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2754 ; -O1: and w8, w0, w20
2756 ; -O1: bl __atomic_compare_exchange
2757 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2761 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2762 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2763 ; -O0: and w8, w9, w8
2765 ; -O0: bl __atomic_compare_exchange
2767 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2768 ; -O1: and w8, w0, w20
2770 ; -O1: bl __atomic_compare_exchange
2771 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2775 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2776 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2777 ; -O0: and w8, w9, w8
2779 ; -O0: bl __atomic_compare_exchange
2781 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2782 ; -O1: and w8, w0, w20
2784 ; -O1: bl __atomic_compare_exchange
2785 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2789 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2790 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2791 ; -O0: and w8, w9, w8
2793 ; -O0: bl __atomic_compare_exchange
2795 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2796 ; -O1: and w8, w0, w20
2798 ; -O1: bl __atomic_compare_exchange
2799 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2803 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2804 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2805 ; -O0: and w8, w9, w8
2807 ; -O0: bl __atomic_compare_exchange
2809 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2810 ; -O1: and w8, w0, w20
2812 ; -O1: bl __atomic_compare_exchange
2813 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2817 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2818 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2819 ; -O0: and w8, w9, w8
2821 ; -O0: bl __atomic_compare_exchange
2823 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2824 ; -O1: and w8, w0, w20
2826 ; -O1: bl __atomic_compare_exchange
2827 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2831 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2832 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2833 ; -O0: and x8, x9, x8
2835 ; -O0: bl __atomic_compare_exchange
2837 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2838 ; -O1: and x8, x0, x20
2840 ; -O1: bl __atomic_compare_exchange
2841 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2845 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2846 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2847 ; -O0: and x8, x9, x8
2849 ; -O0: bl __atomic_compare_exchange
2851 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2852 ; -O1: and x8, x0, x20
2854 ; -O1: bl __atomic_compare_exchange
2855 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2859 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2860 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2861 ; -O0: and x8, x9, x8
2863 ; -O0: bl __atomic_compare_exchange
2865 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2866 ; -O1: and x8, x0, x20
2868 ; -O1: bl __atomic_compare_exchange
2869 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2873 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2874 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2875 ; -O0: and x8, x9, x8
2877 ; -O0: bl __atomic_compare_exchange
2879 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2880 ; -O1: and x8, x0, x20
2882 ; -O1: bl __atomic_compare_exchange
2883 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2887 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2888 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2889 ; -O0: and x8, x9, x8
2891 ; -O0: bl __atomic_compare_exchange
2893 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2894 ; -O1: and x8, x0, x20
2896 ; -O1: bl __atomic_compare_exchange
2897 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2901 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2902 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2903 ; -O0: and x9, x8, x9
2904 ; -O0: and x8, x8, x10
2907 ; -O0: bl __atomic_compare_exchange
2909 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2910 ; -O1: ldp x0, x1, [x0]
2911 ; -O1: and x8, x1, x19
2912 ; -O1: and x9, x0, x21
2915 ; -O1: bl __atomic_compare_exchange
2916 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2920 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2921 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2922 ; -O0: and x9, x8, x9
2923 ; -O0: and x8, x8, x10
2926 ; -O0: bl __atomic_compare_exchange
2928 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2929 ; -O1: ldp x0, x1, [x0]
2930 ; -O1: and x8, x1, x19
2931 ; -O1: and x9, x0, x21
2934 ; -O1: bl __atomic_compare_exchange
2935 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2939 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2940 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2941 ; -O0: and x9, x8, x9
2942 ; -O0: and x8, x8, x10
2945 ; -O0: bl __atomic_compare_exchange
2947 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2948 ; -O1: ldp x0, x1, [x0]
2949 ; -O1: and x8, x1, x19
2950 ; -O1: and x9, x0, x21
2953 ; -O1: bl __atomic_compare_exchange
2954 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2958 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2959 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2960 ; -O0: and x9, x8, x9
2961 ; -O0: and x8, x8, x10
2964 ; -O0: bl __atomic_compare_exchange
2966 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2967 ; -O1: ldp x0, x1, [x0]
2968 ; -O1: and x8, x1, x19
2969 ; -O1: and x9, x0, x21
2972 ; -O1: bl __atomic_compare_exchange
2973 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2977 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2978 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2979 ; -O0: and x9, x8, x9
2980 ; -O0: and x8, x8, x10
2983 ; -O0: bl __atomic_compare_exchange
2985 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2986 ; -O1: ldp x0, x1, [x0]
2987 ; -O1: and x8, x1, x19
2988 ; -O1: and x9, x0, x21
2991 ; -O1: bl __atomic_compare_exchange
2992 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2996 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2997 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2998 ; CHECK: bl __aarch64_ldset1_relax
2999 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3003 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
3004 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
3005 ; CHECK: bl __aarch64_ldset1_acq
3006 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3010 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
3011 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
3012 ; CHECK: bl __aarch64_ldset1_rel
3013 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3017 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3018 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3019 ; CHECK: bl __aarch64_ldset1_acq_rel
3020 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3024 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3025 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3026 ; CHECK: bl __aarch64_ldset1_acq_rel
3027 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3031 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3032 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
3033 ; CHECK: bl __aarch64_ldset2_relax
3034 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
3038 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
3039 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
3040 ; CHECK: bl __aarch64_ldset2_acq
3041 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
3045 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
3046 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
3047 ; CHECK: bl __aarch64_ldset2_rel
3048 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
3052 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3053 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3054 ; CHECK: bl __aarch64_ldset2_acq_rel
3055 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
3059 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3060 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3061 ; CHECK: bl __aarch64_ldset2_acq_rel
3062 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
3066 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3067 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
3068 ; CHECK: bl __aarch64_ldset4_relax
3069 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
3073 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
3074 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
3075 ; CHECK: bl __aarch64_ldset4_acq
3076 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
3080 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
3081 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
3082 ; CHECK: bl __aarch64_ldset4_rel
3083 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
3087 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3088 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
3089 ; CHECK: bl __aarch64_ldset4_acq_rel
3090 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
3094 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3095 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
3096 ; CHECK: bl __aarch64_ldset4_acq_rel
3097 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
3101 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3102 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
3103 ; CHECK: bl __aarch64_ldset8_relax
3104 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
3108 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
3109 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
3110 ; CHECK: bl __aarch64_ldset8_acq
3111 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
3115 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
3116 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
3117 ; CHECK: bl __aarch64_ldset8_rel
3118 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
3122 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3123 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
3124 ; CHECK: bl __aarch64_ldset8_acq_rel
3125 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
3129 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3130 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
3131 ; CHECK: bl __aarch64_ldset8_acq_rel
3132 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
3136 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3137 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
3138 ; -O0: orr x2, x8, x10
3139 ; -O0: orr x3, x8, x9
3140 ; -O0: bl __aarch64_cas16_relax
3141 ; -O0: eor x8, x0, x8
3142 ; -O0: eor x9, x1, x9
3143 ; -O0: orr x8, x8, x9
3144 ; -O0: subs x8, x8, #0
3146 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
3147 ; -O1: ldxp x0, x1, [x8]
3148 ; -O1: orr x9, x1, x3
3149 ; -O1: orr x10, x0, x2
3150 ; -O1: stxp w11, x10, x9, [x8]
3151 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
3155 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
3156 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
3157 ; -O0: orr x2, x8, x10
3158 ; -O0: orr x3, x8, x9
3159 ; -O0: bl __aarch64_cas16_acq
3160 ; -O0: eor x8, x0, x8
3161 ; -O0: eor x9, x1, x9
3162 ; -O0: orr x8, x8, x9
3163 ; -O0: subs x8, x8, #0
3165 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
3166 ; -O1: ldaxp x0, x1, [x8]
3167 ; -O1: orr x9, x1, x3
3168 ; -O1: orr x10, x0, x2
3169 ; -O1: stxp w11, x10, x9, [x8]
3170 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
3174 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
3175 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
3176 ; -O0: orr x2, x8, x10
3177 ; -O0: orr x3, x8, x9
3178 ; -O0: bl __aarch64_cas16_rel
3179 ; -O0: eor x8, x0, x8
3180 ; -O0: eor x9, x1, x9
3181 ; -O0: orr x8, x8, x9
3182 ; -O0: subs x8, x8, #0
3184 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
3185 ; -O1: ldxp x0, x1, [x8]
3186 ; -O1: orr x9, x1, x3
3187 ; -O1: orr x10, x0, x2
3188 ; -O1: stlxp w11, x10, x9, [x8]
3189 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
3193 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3194 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3195 ; -O0: orr x2, x8, x10
3196 ; -O0: orr x3, x8, x9
3197 ; -O0: bl __aarch64_cas16_acq_rel
3198 ; -O0: eor x8, x0, x8
3199 ; -O0: eor x9, x1, x9
3200 ; -O0: orr x8, x8, x9
3201 ; -O0: subs x8, x8, #0
3203 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3204 ; -O1: ldaxp x0, x1, [x8]
3205 ; -O1: orr x9, x1, x3
3206 ; -O1: orr x10, x0, x2
3207 ; -O1: stlxp w11, x10, x9, [x8]
3208 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
3212 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3213 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3214 ; -O0: orr x2, x8, x10
3215 ; -O0: orr x3, x8, x9
3216 ; -O0: bl __aarch64_cas16_acq_rel
3217 ; -O0: eor x8, x0, x8
3218 ; -O0: eor x9, x1, x9
3219 ; -O0: orr x8, x8, x9
3220 ; -O0: subs x8, x8, #0
3222 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3223 ; -O1: ldaxp x0, x1, [x8]
3224 ; -O1: orr x9, x1, x3
3225 ; -O1: orr x10, x0, x2
3226 ; -O1: stlxp w11, x10, x9, [x8]
3227 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
3231 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3232 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
3233 ; CHECK: bl __aarch64_ldset1_relax
3234 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3238 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3239 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
3240 ; CHECK: bl __aarch64_ldset1_acq
3241 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3245 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3246 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3247 ; CHECK: bl __aarch64_ldset1_rel
3248 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3252 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3253 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3254 ; CHECK: bl __aarch64_ldset1_acq_rel
3255 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3259 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3260 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3261 ; CHECK: bl __aarch64_ldset1_acq_rel
3262 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3266 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3267 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3268 ; -O0: orr w8, w9, w8
3269 ; -O0: bl __atomic_compare_exchange
3271 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3272 ; -O1: orr w8, w0, w20
3273 ; -O1: bl __atomic_compare_exchange
3274 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3278 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3279 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3280 ; -O0: orr w8, w9, w8
3281 ; -O0: bl __atomic_compare_exchange
3283 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3284 ; -O1: orr w8, w0, w20
3285 ; -O1: bl __atomic_compare_exchange
3286 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3290 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3291 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3292 ; -O0: orr w8, w9, w8
3293 ; -O0: bl __atomic_compare_exchange
3295 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3296 ; -O1: orr w8, w0, w20
3297 ; -O1: bl __atomic_compare_exchange
3298 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3302 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3303 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3304 ; -O0: orr w8, w9, w8
3305 ; -O0: bl __atomic_compare_exchange
3307 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3308 ; -O1: orr w8, w0, w20
3309 ; -O1: bl __atomic_compare_exchange
3310 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3314 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3315 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3316 ; -O0: orr w8, w9, w8
3317 ; -O0: bl __atomic_compare_exchange
3319 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3320 ; -O1: orr w8, w0, w20
3321 ; -O1: bl __atomic_compare_exchange
3322 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3326 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3327 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3328 ; -O0: orr w8, w9, w8
3329 ; -O0: bl __atomic_compare_exchange
3331 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3332 ; -O1: orr w8, w0, w20
3333 ; -O1: bl __atomic_compare_exchange
3334 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3338 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3339 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3340 ; -O0: orr w8, w9, w8
3341 ; -O0: bl __atomic_compare_exchange
3343 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3344 ; -O1: orr w8, w0, w20
3345 ; -O1: bl __atomic_compare_exchange
3346 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3350 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3351 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3352 ; -O0: orr w8, w9, w8
3353 ; -O0: bl __atomic_compare_exchange
3355 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3356 ; -O1: orr w8, w0, w20
3357 ; -O1: bl __atomic_compare_exchange
3358 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3362 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3363 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3364 ; -O0: orr w8, w9, w8
3365 ; -O0: bl __atomic_compare_exchange
3367 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3368 ; -O1: orr w8, w0, w20
3369 ; -O1: bl __atomic_compare_exchange
3370 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3374 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3375 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3376 ; -O0: orr w8, w9, w8
3377 ; -O0: bl __atomic_compare_exchange
3379 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3380 ; -O1: orr w8, w0, w20
3381 ; -O1: bl __atomic_compare_exchange
3382 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3386 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3387 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3388 ; -O0: orr x8, x9, x8
3389 ; -O0: bl __atomic_compare_exchange
3391 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3392 ; -O1: orr x8, x0, x20
3393 ; -O1: bl __atomic_compare_exchange
3394 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3398 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3399 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3400 ; -O0: orr x8, x9, x8
3401 ; -O0: bl __atomic_compare_exchange
3403 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3404 ; -O1: orr x8, x0, x20
3405 ; -O1: bl __atomic_compare_exchange
3406 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3410 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3411 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3412 ; -O0: orr x8, x9, x8
3413 ; -O0: bl __atomic_compare_exchange
3415 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3416 ; -O1: orr x8, x0, x20
3417 ; -O1: bl __atomic_compare_exchange
3418 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3422 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3423 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3424 ; -O0: orr x8, x9, x8
3425 ; -O0: bl __atomic_compare_exchange
3427 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3428 ; -O1: orr x8, x0, x20
3429 ; -O1: bl __atomic_compare_exchange
3430 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3434 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3435 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3436 ; -O0: orr x8, x9, x8
3437 ; -O0: bl __atomic_compare_exchange
3439 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3440 ; -O1: orr x8, x0, x20
3441 ; -O1: bl __atomic_compare_exchange
3442 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3446 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3447 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3448 ; -O0: orr x9, x8, x9
3449 ; -O0: orr x8, x8, x10
3450 ; -O0: bl __atomic_compare_exchange
3452 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3453 ; -O1: ldp x0, x1, [x0]
3454 ; -O1: orr x8, x1, x19
3455 ; -O1: orr x9, x0, x21
3456 ; -O1: bl __atomic_compare_exchange
3457 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3461 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3462 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3463 ; -O0: orr x9, x8, x9
3464 ; -O0: orr x8, x8, x10
3465 ; -O0: bl __atomic_compare_exchange
3467 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3468 ; -O1: ldp x0, x1, [x0]
3469 ; -O1: orr x8, x1, x19
3470 ; -O1: orr x9, x0, x21
3471 ; -O1: bl __atomic_compare_exchange
3472 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3476 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3477 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3478 ; -O0: orr x9, x8, x9
3479 ; -O0: orr x8, x8, x10
3480 ; -O0: bl __atomic_compare_exchange
3482 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3483 ; -O1: ldp x0, x1, [x0]
3484 ; -O1: orr x8, x1, x19
3485 ; -O1: orr x9, x0, x21
3486 ; -O1: bl __atomic_compare_exchange
3487 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3491 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3492 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3493 ; -O0: orr x9, x8, x9
3494 ; -O0: orr x8, x8, x10
3495 ; -O0: bl __atomic_compare_exchange
3497 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3498 ; -O1: ldp x0, x1, [x0]
3499 ; -O1: orr x8, x1, x19
3500 ; -O1: orr x9, x0, x21
3501 ; -O1: bl __atomic_compare_exchange
3502 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3506 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3507 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3508 ; -O0: orr x9, x8, x9
3509 ; -O0: orr x8, x8, x10
3510 ; -O0: bl __atomic_compare_exchange
3512 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3513 ; -O1: ldp x0, x1, [x0]
3514 ; -O1: orr x8, x1, x19
3515 ; -O1: orr x9, x0, x21
3516 ; -O1: bl __atomic_compare_exchange
3517 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3521 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3522 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3523 ; CHECK: bl __aarch64_ldeor1_relax
3524 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3528 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3529 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3530 ; CHECK: bl __aarch64_ldeor1_acq
3531 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3535 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3536 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3537 ; CHECK: bl __aarch64_ldeor1_rel
3538 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3542 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3543 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3544 ; CHECK: bl __aarch64_ldeor1_acq_rel
3545 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3549 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3550 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3551 ; CHECK: bl __aarch64_ldeor1_acq_rel
3552 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3556 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3557 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3558 ; CHECK: bl __aarch64_ldeor2_relax
3559 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3563 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3564 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3565 ; CHECK: bl __aarch64_ldeor2_acq
3566 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3570 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3571 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3572 ; CHECK: bl __aarch64_ldeor2_rel
3573 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3577 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3578 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3579 ; CHECK: bl __aarch64_ldeor2_acq_rel
3580 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3584 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3585 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3586 ; CHECK: bl __aarch64_ldeor2_acq_rel
3587 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3591 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3592 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3593 ; CHECK: bl __aarch64_ldeor4_relax
3594 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3598 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3599 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3600 ; CHECK: bl __aarch64_ldeor4_acq
3601 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3605 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3606 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3607 ; CHECK: bl __aarch64_ldeor4_rel
3608 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3612 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3613 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3614 ; CHECK: bl __aarch64_ldeor4_acq_rel
3615 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3619 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3620 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3621 ; CHECK: bl __aarch64_ldeor4_acq_rel
3622 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3626 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3627 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3628 ; CHECK: bl __aarch64_ldeor8_relax
3629 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3633 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3634 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3635 ; CHECK: bl __aarch64_ldeor8_acq
3636 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3640 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3641 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3642 ; CHECK: bl __aarch64_ldeor8_rel
3643 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3647 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3648 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3649 ; CHECK: bl __aarch64_ldeor8_acq_rel
3650 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3654 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3655 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3656 ; CHECK: bl __aarch64_ldeor8_acq_rel
3657 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3661 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3662 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3663 ; -O0: eor x2, x8, x10
3664 ; -O0: eor x3, x8, x9
3665 ; -O0: bl __aarch64_cas16_relax
3666 ; -O0: eor x8, x0, x8
3667 ; -O0: eor x9, x1, x9
3668 ; -O0: orr x8, x8, x9
3669 ; -O0: subs x8, x8, #0
3671 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3672 ; -O1: ldxp x0, x1, [x8]
3673 ; -O1: eor x9, x1, x3
3674 ; -O1: eor x10, x0, x2
3675 ; -O1: stxp w11, x10, x9, [x8]
3676 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3680 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3681 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3682 ; -O0: eor x2, x8, x10
3683 ; -O0: eor x3, x8, x9
3684 ; -O0: bl __aarch64_cas16_acq
3685 ; -O0: eor x8, x0, x8
3686 ; -O0: eor x9, x1, x9
3687 ; -O0: orr x8, x8, x9
3688 ; -O0: subs x8, x8, #0
3690 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3691 ; -O1: ldaxp x0, x1, [x8]
3692 ; -O1: eor x9, x1, x3
3693 ; -O1: eor x10, x0, x2
3694 ; -O1: stxp w11, x10, x9, [x8]
3695 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3699 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3700 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3701 ; -O0: eor x2, x8, x10
3702 ; -O0: eor x3, x8, x9
3703 ; -O0: bl __aarch64_cas16_rel
3704 ; -O0: eor x8, x0, x8
3705 ; -O0: eor x9, x1, x9
3706 ; -O0: orr x8, x8, x9
3707 ; -O0: subs x8, x8, #0
3709 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3710 ; -O1: ldxp x0, x1, [x8]
3711 ; -O1: eor x9, x1, x3
3712 ; -O1: eor x10, x0, x2
3713 ; -O1: stlxp w11, x10, x9, [x8]
3714 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3718 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3719 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3720 ; -O0: eor x2, x8, x10
3721 ; -O0: eor x3, x8, x9
3722 ; -O0: bl __aarch64_cas16_acq_rel
3723 ; -O0: eor x8, x0, x8
3724 ; -O0: eor x9, x1, x9
3725 ; -O0: orr x8, x8, x9
3726 ; -O0: subs x8, x8, #0
3728 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3729 ; -O1: ldaxp x0, x1, [x8]
3730 ; -O1: eor x9, x1, x3
3731 ; -O1: eor x10, x0, x2
3732 ; -O1: stlxp w11, x10, x9, [x8]
3733 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3737 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3738 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3739 ; -O0: eor x2, x8, x10
3740 ; -O0: eor x3, x8, x9
3741 ; -O0: bl __aarch64_cas16_acq_rel
3742 ; -O0: eor x8, x0, x8
3743 ; -O0: eor x9, x1, x9
3744 ; -O0: orr x8, x8, x9
3745 ; -O0: subs x8, x8, #0
3747 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3748 ; -O1: ldaxp x0, x1, [x8]
3749 ; -O1: eor x9, x1, x3
3750 ; -O1: eor x10, x0, x2
3751 ; -O1: stlxp w11, x10, x9, [x8]
3752 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3756 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3757 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3758 ; CHECK: bl __aarch64_ldeor1_relax
3759 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3763 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3764 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3765 ; CHECK: bl __aarch64_ldeor1_acq
3766 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3770 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3771 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3772 ; CHECK: bl __aarch64_ldeor1_rel
3773 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3777 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3778 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3779 ; CHECK: bl __aarch64_ldeor1_acq_rel
3780 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3784 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3785 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3786 ; CHECK: bl __aarch64_ldeor1_acq_rel
3787 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3791 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3792 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3793 ; -O0: eor w8, w9, w8
3794 ; -O0: bl __atomic_compare_exchange
3796 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3797 ; -O1: eor w8, w0, w20
3798 ; -O1: bl __atomic_compare_exchange
3799 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3803 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3804 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3805 ; -O0: eor w8, w9, w8
3806 ; -O0: bl __atomic_compare_exchange
3808 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3809 ; -O1: eor w8, w0, w20
3810 ; -O1: bl __atomic_compare_exchange
3811 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3815 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3816 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3817 ; -O0: eor w8, w9, w8
3818 ; -O0: bl __atomic_compare_exchange
3820 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3821 ; -O1: eor w8, w0, w20
3822 ; -O1: bl __atomic_compare_exchange
3823 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3827 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3828 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3829 ; -O0: eor w8, w9, w8
3830 ; -O0: bl __atomic_compare_exchange
3832 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3833 ; -O1: eor w8, w0, w20
3834 ; -O1: bl __atomic_compare_exchange
3835 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3839 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3840 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3841 ; -O0: eor w8, w9, w8
3842 ; -O0: bl __atomic_compare_exchange
3844 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3845 ; -O1: eor w8, w0, w20
3846 ; -O1: bl __atomic_compare_exchange
3847 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3851 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3852 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3853 ; -O0: eor w8, w9, w8
3854 ; -O0: bl __atomic_compare_exchange
3856 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3857 ; -O1: eor w8, w0, w20
3858 ; -O1: bl __atomic_compare_exchange
3859 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3863 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3864 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3865 ; -O0: eor w8, w9, w8
3866 ; -O0: bl __atomic_compare_exchange
3868 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3869 ; -O1: eor w8, w0, w20
3870 ; -O1: bl __atomic_compare_exchange
3871 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3875 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3876 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3877 ; -O0: eor w8, w9, w8
3878 ; -O0: bl __atomic_compare_exchange
3880 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3881 ; -O1: eor w8, w0, w20
3882 ; -O1: bl __atomic_compare_exchange
3883 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3887 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3888 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3889 ; -O0: eor w8, w9, w8
3890 ; -O0: bl __atomic_compare_exchange
3892 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3893 ; -O1: eor w8, w0, w20
3894 ; -O1: bl __atomic_compare_exchange
3895 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3899 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3900 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3901 ; -O0: eor w8, w9, w8
3902 ; -O0: bl __atomic_compare_exchange
3904 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3905 ; -O1: eor w8, w0, w20
3906 ; -O1: bl __atomic_compare_exchange
3907 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3911 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3912 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3913 ; -O0: eor x8, x9, x8
3914 ; -O0: bl __atomic_compare_exchange
3916 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3917 ; -O1: eor x8, x0, x20
3918 ; -O1: bl __atomic_compare_exchange
3919 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3923 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3924 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3925 ; -O0: eor x8, x9, x8
3926 ; -O0: bl __atomic_compare_exchange
3928 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3929 ; -O1: eor x8, x0, x20
3930 ; -O1: bl __atomic_compare_exchange
3931 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3935 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3936 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3937 ; -O0: eor x8, x9, x8
3938 ; -O0: bl __atomic_compare_exchange
3940 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3941 ; -O1: eor x8, x0, x20
3942 ; -O1: bl __atomic_compare_exchange
3943 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3947 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3948 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3949 ; -O0: eor x8, x9, x8
3950 ; -O0: bl __atomic_compare_exchange
3952 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3953 ; -O1: eor x8, x0, x20
3954 ; -O1: bl __atomic_compare_exchange
3955 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3959 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3960 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3961 ; -O0: eor x8, x9, x8
3962 ; -O0: bl __atomic_compare_exchange
3964 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3965 ; -O1: eor x8, x0, x20
3966 ; -O1: bl __atomic_compare_exchange
3967 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3971 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3972 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3973 ; -O0: eor x9, x8, x9
3974 ; -O0: eor x8, x8, x10
3975 ; -O0: bl __atomic_compare_exchange
3977 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3978 ; -O1: ldp x0, x1, [x0]
3979 ; -O1: eor x8, x1, x19
3980 ; -O1: eor x9, x0, x21
3981 ; -O1: bl __atomic_compare_exchange
3982 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
3986 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3987 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3988 ; -O0: eor x9, x8, x9
3989 ; -O0: eor x8, x8, x10
3990 ; -O0: bl __atomic_compare_exchange
3992 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3993 ; -O1: ldp x0, x1, [x0]
3994 ; -O1: eor x8, x1, x19
3995 ; -O1: eor x9, x0, x21
3996 ; -O1: bl __atomic_compare_exchange
3997 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
4001 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
4002 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
4003 ; -O0: eor x9, x8, x9
4004 ; -O0: eor x8, x8, x10
4005 ; -O0: bl __atomic_compare_exchange
4007 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
4008 ; -O1: ldp x0, x1, [x0]
4009 ; -O1: eor x8, x1, x19
4010 ; -O1: eor x9, x0, x21
4011 ; -O1: bl __atomic_compare_exchange
4012 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
4016 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4017 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
4018 ; -O0: eor x9, x8, x9
4019 ; -O0: eor x8, x8, x10
4020 ; -O0: bl __atomic_compare_exchange
4022 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
4023 ; -O1: ldp x0, x1, [x0]
4024 ; -O1: eor x8, x1, x19
4025 ; -O1: eor x9, x0, x21
4026 ; -O1: bl __atomic_compare_exchange
4027 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
4031 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4032 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
4033 ; -O0: eor x9, x8, x9
4034 ; -O0: eor x8, x8, x10
4035 ; -O0: bl __atomic_compare_exchange
4037 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
4038 ; -O1: ldp x0, x1, [x0]
4039 ; -O1: eor x8, x1, x19
4040 ; -O1: eor x9, x0, x21
4041 ; -O1: bl __atomic_compare_exchange
4042 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
4046 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4047 ; -O0-LABEL: atomicrmw_max_i8_aligned_monotonic:
4049 ; -O0: subs w9, w9, w8, sxtb
4050 ; -O0: csel w1, w0, w8, gt
4051 ; -O0: bl __aarch64_cas1_relax
4052 ; -O0: and w8, w0, #0xff
4053 ; -O0: subs w8, w8, w9, uxtb
4055 ; -O1-LABEL: atomicrmw_max_i8_aligned_monotonic:
4056 ; -O1: ldxrb w9, [x0]
4058 ; -O1: cmp w8, w1, sxtb
4059 ; -O1: csel w9, w9, w1, gt
4060 ; -O1: stxrb w10, w9, [x0]
4061 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4065 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
4066 ; -O0-LABEL: atomicrmw_max_i8_aligned_acquire:
4068 ; -O0: subs w9, w9, w8, sxtb
4069 ; -O0: csel w1, w0, w8, gt
4070 ; -O0: bl __aarch64_cas1_acq
4071 ; -O0: and w8, w0, #0xff
4072 ; -O0: subs w8, w8, w9, uxtb
4074 ; -O1-LABEL: atomicrmw_max_i8_aligned_acquire:
4075 ; -O1: ldaxrb w9, [x0]
4077 ; -O1: cmp w8, w1, sxtb
4078 ; -O1: csel w9, w9, w1, gt
4079 ; -O1: stxrb w10, w9, [x0]
4080 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4084 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
4085 ; -O0-LABEL: atomicrmw_max_i8_aligned_release:
4087 ; -O0: subs w9, w9, w8, sxtb
4088 ; -O0: csel w1, w0, w8, gt
4089 ; -O0: bl __aarch64_cas1_rel
4090 ; -O0: and w8, w0, #0xff
4091 ; -O0: subs w8, w8, w9, uxtb
4093 ; -O1-LABEL: atomicrmw_max_i8_aligned_release:
4094 ; -O1: ldxrb w9, [x0]
4096 ; -O1: cmp w8, w1, sxtb
4097 ; -O1: csel w9, w9, w1, gt
4098 ; -O1: stlxrb w10, w9, [x0]
4099 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4103 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4104 ; -O0-LABEL: atomicrmw_max_i8_aligned_acq_rel:
4106 ; -O0: subs w9, w9, w8, sxtb
4107 ; -O0: csel w1, w0, w8, gt
4108 ; -O0: bl __aarch64_cas1_acq_rel
4109 ; -O0: and w8, w0, #0xff
4110 ; -O0: subs w8, w8, w9, uxtb
4112 ; -O1-LABEL: atomicrmw_max_i8_aligned_acq_rel:
4113 ; -O1: ldaxrb w9, [x0]
4115 ; -O1: cmp w8, w1, sxtb
4116 ; -O1: csel w9, w9, w1, gt
4117 ; -O1: stlxrb w10, w9, [x0]
4118 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4122 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4123 ; -O0-LABEL: atomicrmw_max_i8_aligned_seq_cst:
4125 ; -O0: subs w9, w9, w8, sxtb
4126 ; -O0: csel w1, w0, w8, gt
4127 ; -O0: bl __aarch64_cas1_acq_rel
4128 ; -O0: and w8, w0, #0xff
4129 ; -O0: subs w8, w8, w9, uxtb
4131 ; -O1-LABEL: atomicrmw_max_i8_aligned_seq_cst:
4132 ; -O1: ldaxrb w9, [x0]
4134 ; -O1: cmp w8, w1, sxtb
4135 ; -O1: csel w9, w9, w1, gt
4136 ; -O1: stlxrb w10, w9, [x0]
4137 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4141 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4142 ; -O0-LABEL: atomicrmw_max_i16_aligned_monotonic:
4144 ; -O0: subs w9, w9, w8, sxth
4145 ; -O0: csel w1, w0, w8, gt
4146 ; -O0: bl __aarch64_cas2_relax
4147 ; -O0: subs w8, w8, w0, uxth
4149 ; -O1-LABEL: atomicrmw_max_i16_aligned_monotonic:
4150 ; -O1: ldxrh w9, [x0]
4152 ; -O1: cmp w8, w1, sxth
4153 ; -O1: csel w9, w9, w1, gt
4154 ; -O1: stxrh w10, w9, [x0]
4155 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
4159 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
4160 ; -O0-LABEL: atomicrmw_max_i16_aligned_acquire:
4162 ; -O0: subs w9, w9, w8, sxth
4163 ; -O0: csel w1, w0, w8, gt
4164 ; -O0: bl __aarch64_cas2_acq
4165 ; -O0: subs w8, w8, w0, uxth
4167 ; -O1-LABEL: atomicrmw_max_i16_aligned_acquire:
4168 ; -O1: ldaxrh w9, [x0]
4170 ; -O1: cmp w8, w1, sxth
4171 ; -O1: csel w9, w9, w1, gt
4172 ; -O1: stxrh w10, w9, [x0]
4173 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
4177 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
4178 ; -O0-LABEL: atomicrmw_max_i16_aligned_release:
4180 ; -O0: subs w9, w9, w8, sxth
4181 ; -O0: csel w1, w0, w8, gt
4182 ; -O0: bl __aarch64_cas2_rel
4183 ; -O0: subs w8, w8, w0, uxth
4185 ; -O1-LABEL: atomicrmw_max_i16_aligned_release:
4186 ; -O1: ldxrh w9, [x0]
4188 ; -O1: cmp w8, w1, sxth
4189 ; -O1: csel w9, w9, w1, gt
4190 ; -O1: stlxrh w10, w9, [x0]
4191 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
4195 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4196 ; -O0-LABEL: atomicrmw_max_i16_aligned_acq_rel:
4198 ; -O0: subs w9, w9, w8, sxth
4199 ; -O0: csel w1, w0, w8, gt
4200 ; -O0: bl __aarch64_cas2_acq_rel
4201 ; -O0: subs w8, w8, w0, uxth
4203 ; -O1-LABEL: atomicrmw_max_i16_aligned_acq_rel:
4204 ; -O1: ldaxrh w9, [x0]
4206 ; -O1: cmp w8, w1, sxth
4207 ; -O1: csel w9, w9, w1, gt
4208 ; -O1: stlxrh w10, w9, [x0]
4209 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
4213 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4214 ; -O0-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4216 ; -O0: subs w9, w9, w8, sxth
4217 ; -O0: csel w1, w0, w8, gt
4218 ; -O0: bl __aarch64_cas2_acq_rel
4219 ; -O0: subs w8, w8, w0, uxth
4221 ; -O1-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4222 ; -O1: ldaxrh w9, [x0]
4224 ; -O1: cmp w8, w1, sxth
4225 ; -O1: csel w9, w9, w1, gt
4226 ; -O1: stlxrh w10, w9, [x0]
4227 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
4231 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4232 ; -O0-LABEL: atomicrmw_max_i32_aligned_monotonic:
4233 ; -O0: subs w9, w0, w8
4234 ; -O0: csel w1, w0, w8, gt
4235 ; -O0: bl __aarch64_cas4_relax
4236 ; -O0: subs w8, w0, w8
4238 ; -O1-LABEL: atomicrmw_max_i32_aligned_monotonic:
4239 ; -O1: ldxr w8, [x0]
4241 ; -O1: csel w9, w8, w1, gt
4242 ; -O1: stxr w10, w9, [x0]
4243 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
4247 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
4248 ; -O0-LABEL: atomicrmw_max_i32_aligned_acquire:
4249 ; -O0: subs w9, w0, w8
4250 ; -O0: csel w1, w0, w8, gt
4251 ; -O0: bl __aarch64_cas4_acq
4252 ; -O0: subs w8, w0, w8
4254 ; -O1-LABEL: atomicrmw_max_i32_aligned_acquire:
4255 ; -O1: ldaxr w8, [x0]
4257 ; -O1: csel w9, w8, w1, gt
4258 ; -O1: stxr w10, w9, [x0]
4259 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
4263 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
4264 ; -O0-LABEL: atomicrmw_max_i32_aligned_release:
4265 ; -O0: subs w9, w0, w8
4266 ; -O0: csel w1, w0, w8, gt
4267 ; -O0: bl __aarch64_cas4_rel
4268 ; -O0: subs w8, w0, w8
4270 ; -O1-LABEL: atomicrmw_max_i32_aligned_release:
4271 ; -O1: ldxr w8, [x0]
4273 ; -O1: csel w9, w8, w1, gt
4274 ; -O1: stlxr w10, w9, [x0]
4275 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
4279 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4280 ; -O0-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4281 ; -O0: subs w9, w0, w8
4282 ; -O0: csel w1, w0, w8, gt
4283 ; -O0: bl __aarch64_cas4_acq_rel
4284 ; -O0: subs w8, w0, w8
4286 ; -O1-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4287 ; -O1: ldaxr w8, [x0]
4289 ; -O1: csel w9, w8, w1, gt
4290 ; -O1: stlxr w10, w9, [x0]
4291 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
4295 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4296 ; -O0-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4297 ; -O0: subs w9, w0, w8
4298 ; -O0: csel w1, w0, w8, gt
4299 ; -O0: bl __aarch64_cas4_acq_rel
4300 ; -O0: subs w8, w0, w8
4302 ; -O1-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4303 ; -O1: ldaxr w8, [x0]
4305 ; -O1: csel w9, w8, w1, gt
4306 ; -O1: stlxr w10, w9, [x0]
4307 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
4311 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4312 ; -O0-LABEL: atomicrmw_max_i64_aligned_monotonic:
4313 ; -O0: subs x9, x0, x8
4314 ; -O0: csel x1, x0, x8, gt
4315 ; -O0: bl __aarch64_cas8_relax
4316 ; -O0: subs x8, x0, x8
4318 ; -O1-LABEL: atomicrmw_max_i64_aligned_monotonic:
4319 ; -O1: ldxr x0, [x8]
4321 ; -O1: csel x9, x0, x1, gt
4322 ; -O1: stxr w10, x9, [x8]
4323 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
4327 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
4328 ; -O0-LABEL: atomicrmw_max_i64_aligned_acquire:
4329 ; -O0: subs x9, x0, x8
4330 ; -O0: csel x1, x0, x8, gt
4331 ; -O0: bl __aarch64_cas8_acq
4332 ; -O0: subs x8, x0, x8
4334 ; -O1-LABEL: atomicrmw_max_i64_aligned_acquire:
4335 ; -O1: ldaxr x0, [x8]
4337 ; -O1: csel x9, x0, x1, gt
4338 ; -O1: stxr w10, x9, [x8]
4339 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
4343 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
4344 ; -O0-LABEL: atomicrmw_max_i64_aligned_release:
4345 ; -O0: subs x9, x0, x8
4346 ; -O0: csel x1, x0, x8, gt
4347 ; -O0: bl __aarch64_cas8_rel
4348 ; -O0: subs x8, x0, x8
4350 ; -O1-LABEL: atomicrmw_max_i64_aligned_release:
4351 ; -O1: ldxr x0, [x8]
4353 ; -O1: csel x9, x0, x1, gt
4354 ; -O1: stlxr w10, x9, [x8]
4355 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
4359 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4360 ; -O0-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4361 ; -O0: subs x9, x0, x8
4362 ; -O0: csel x1, x0, x8, gt
4363 ; -O0: bl __aarch64_cas8_acq_rel
4364 ; -O0: subs x8, x0, x8
4366 ; -O1-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4367 ; -O1: ldaxr x0, [x8]
4369 ; -O1: csel x9, x0, x1, gt
4370 ; -O1: stlxr w10, x9, [x8]
4371 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
4375 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4376 ; -O0-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4377 ; -O0: subs x9, x0, x8
4378 ; -O0: csel x1, x0, x8, gt
4379 ; -O0: bl __aarch64_cas8_acq_rel
4380 ; -O0: subs x8, x0, x8
4382 ; -O1-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4383 ; -O1: ldaxr x0, [x8]
4385 ; -O1: csel x9, x0, x1, gt
4386 ; -O1: stlxr w10, x9, [x8]
4387 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
4391 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4392 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
4393 ; -O0: subs x8, x8, x9
4394 ; -O0: subs x8, x8, x11
4395 ; -O0: subs x12, x12, x9
4396 ; -O0: csel w10, w8, w10, eq
4397 ; -O0: ands w12, w10, #0x1
4398 ; -O0: csel x2, x8, x11, ne
4399 ; -O0: ands w10, w10, #0x1
4400 ; -O0: csel x3, x8, x9, ne
4401 ; -O0: bl __aarch64_cas16_relax
4402 ; -O0: eor x8, x0, x8
4403 ; -O0: eor x9, x1, x9
4404 ; -O0: orr x8, x8, x9
4405 ; -O0: subs x8, x8, #0
4407 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
4408 ; -O1: ldxp x0, x1, [x8]
4410 ; -O1: csel x9, x1, x3, lt
4411 ; -O1: csel x10, x0, x2, lt
4412 ; -O1: stxp w11, x10, x9, [x8]
4413 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
4417 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
4418 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
4419 ; -O0: subs x8, x8, x9
4420 ; -O0: subs x8, x8, x11
4421 ; -O0: subs x12, x12, x9
4422 ; -O0: csel w10, w8, w10, eq
4423 ; -O0: ands w12, w10, #0x1
4424 ; -O0: csel x2, x8, x11, ne
4425 ; -O0: ands w10, w10, #0x1
4426 ; -O0: csel x3, x8, x9, ne
4427 ; -O0: bl __aarch64_cas16_acq
4428 ; -O0: eor x8, x0, x8
4429 ; -O0: eor x9, x1, x9
4430 ; -O0: orr x8, x8, x9
4431 ; -O0: subs x8, x8, #0
4433 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
4434 ; -O1: ldaxp x0, x1, [x8]
4436 ; -O1: csel x9, x1, x3, lt
4437 ; -O1: csel x10, x0, x2, lt
4438 ; -O1: stxp w11, x10, x9, [x8]
4439 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4443 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4444 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4445 ; -O0: subs x8, x8, x9
4446 ; -O0: subs x8, x8, x11
4447 ; -O0: subs x12, x12, x9
4448 ; -O0: csel w10, w8, w10, eq
4449 ; -O0: ands w12, w10, #0x1
4450 ; -O0: csel x2, x8, x11, ne
4451 ; -O0: ands w10, w10, #0x1
4452 ; -O0: csel x3, x8, x9, ne
4453 ; -O0: bl __aarch64_cas16_rel
4454 ; -O0: eor x8, x0, x8
4455 ; -O0: eor x9, x1, x9
4456 ; -O0: orr x8, x8, x9
4457 ; -O0: subs x8, x8, #0
4459 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
4460 ; -O1: ldxp x0, x1, [x8]
4462 ; -O1: csel x9, x1, x3, lt
4463 ; -O1: csel x10, x0, x2, lt
4464 ; -O1: stlxp w11, x10, x9, [x8]
4465 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4469 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4470 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4471 ; -O0: subs x8, x8, x9
4472 ; -O0: subs x8, x8, x11
4473 ; -O0: subs x12, x12, x9
4474 ; -O0: csel w10, w8, w10, eq
4475 ; -O0: ands w12, w10, #0x1
4476 ; -O0: csel x2, x8, x11, ne
4477 ; -O0: ands w10, w10, #0x1
4478 ; -O0: csel x3, x8, x9, ne
4479 ; -O0: bl __aarch64_cas16_acq_rel
4480 ; -O0: eor x8, x0, x8
4481 ; -O0: eor x9, x1, x9
4482 ; -O0: orr x8, x8, x9
4483 ; -O0: subs x8, x8, #0
4485 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4486 ; -O1: ldaxp x0, x1, [x8]
4488 ; -O1: csel x9, x1, x3, lt
4489 ; -O1: csel x10, x0, x2, lt
4490 ; -O1: stlxp w11, x10, x9, [x8]
4491 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4495 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4496 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4497 ; -O0: subs x8, x8, x9
4498 ; -O0: subs x8, x8, x11
4499 ; -O0: subs x12, x12, x9
4500 ; -O0: csel w10, w8, w10, eq
4501 ; -O0: ands w12, w10, #0x1
4502 ; -O0: csel x2, x8, x11, ne
4503 ; -O0: ands w10, w10, #0x1
4504 ; -O0: csel x3, x8, x9, ne
4505 ; -O0: bl __aarch64_cas16_acq_rel
4506 ; -O0: eor x8, x0, x8
4507 ; -O0: eor x9, x1, x9
4508 ; -O0: orr x8, x8, x9
4509 ; -O0: subs x8, x8, #0
4511 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4512 ; -O1: ldaxp x0, x1, [x8]
4514 ; -O1: csel x9, x1, x3, lt
4515 ; -O1: csel x10, x0, x2, lt
4516 ; -O1: stlxp w11, x10, x9, [x8]
4517 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4521 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4522 ; -O0-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4524 ; -O0: subs w9, w9, w8, sxtb
4525 ; -O0: csel w1, w0, w8, gt
4526 ; -O0: bl __aarch64_cas1_relax
4527 ; -O0: and w8, w0, #0xff
4528 ; -O0: subs w8, w8, w9, uxtb
4530 ; -O1-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4531 ; -O1: ldxrb w9, [x0]
4533 ; -O1: cmp w8, w1, sxtb
4534 ; -O1: csel w9, w9, w1, gt
4535 ; -O1: stxrb w10, w9, [x0]
4536 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4540 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4541 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acquire:
4543 ; -O0: subs w9, w9, w8, sxtb
4544 ; -O0: csel w1, w0, w8, gt
4545 ; -O0: bl __aarch64_cas1_acq
4546 ; -O0: and w8, w0, #0xff
4547 ; -O0: subs w8, w8, w9, uxtb
4549 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acquire:
4550 ; -O1: ldaxrb w9, [x0]
4552 ; -O1: cmp w8, w1, sxtb
4553 ; -O1: csel w9, w9, w1, gt
4554 ; -O1: stxrb w10, w9, [x0]
4555 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4559 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4560 ; -O0-LABEL: atomicrmw_max_i8_unaligned_release:
4562 ; -O0: subs w9, w9, w8, sxtb
4563 ; -O0: csel w1, w0, w8, gt
4564 ; -O0: bl __aarch64_cas1_rel
4565 ; -O0: and w8, w0, #0xff
4566 ; -O0: subs w8, w8, w9, uxtb
4568 ; -O1-LABEL: atomicrmw_max_i8_unaligned_release:
4569 ; -O1: ldxrb w9, [x0]
4571 ; -O1: cmp w8, w1, sxtb
4572 ; -O1: csel w9, w9, w1, gt
4573 ; -O1: stlxrb w10, w9, [x0]
4574 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4578 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4579 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4581 ; -O0: subs w9, w9, w8, sxtb
4582 ; -O0: csel w1, w0, w8, gt
4583 ; -O0: bl __aarch64_cas1_acq_rel
4584 ; -O0: and w8, w0, #0xff
4585 ; -O0: subs w8, w8, w9, uxtb
4587 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4588 ; -O1: ldaxrb w9, [x0]
4590 ; -O1: cmp w8, w1, sxtb
4591 ; -O1: csel w9, w9, w1, gt
4592 ; -O1: stlxrb w10, w9, [x0]
4593 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4597 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4598 ; -O0-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4600 ; -O0: subs w9, w9, w8, sxtb
4601 ; -O0: csel w1, w0, w8, gt
4602 ; -O0: bl __aarch64_cas1_acq_rel
4603 ; -O0: and w8, w0, #0xff
4604 ; -O0: subs w8, w8, w9, uxtb
4606 ; -O1-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4607 ; -O1: ldaxrb w9, [x0]
4609 ; -O1: cmp w8, w1, sxtb
4610 ; -O1: csel w9, w9, w1, gt
4611 ; -O1: stlxrb w10, w9, [x0]
4612 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4616 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4617 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4619 ; -O0: subs w10, w10, w8, sxth
4620 ; -O0: csel w8, w9, w8, gt
4621 ; -O0: bl __atomic_compare_exchange
4623 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4625 ; -O1: cmp w8, w20, sxth
4626 ; -O1: csel w8, w0, w20, gt
4627 ; -O1: bl __atomic_compare_exchange
4628 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4632 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4633 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4635 ; -O0: subs w10, w10, w8, sxth
4636 ; -O0: csel w8, w9, w8, gt
4637 ; -O0: bl __atomic_compare_exchange
4639 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4641 ; -O1: cmp w8, w20, sxth
4642 ; -O1: csel w8, w0, w20, gt
4643 ; -O1: bl __atomic_compare_exchange
4644 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4648 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4649 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4651 ; -O0: subs w10, w10, w8, sxth
4652 ; -O0: csel w8, w9, w8, gt
4653 ; -O0: bl __atomic_compare_exchange
4655 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4657 ; -O1: cmp w8, w20, sxth
4658 ; -O1: csel w8, w0, w20, gt
4659 ; -O1: bl __atomic_compare_exchange
4660 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4664 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4665 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4667 ; -O0: subs w10, w10, w8, sxth
4668 ; -O0: csel w8, w9, w8, gt
4669 ; -O0: bl __atomic_compare_exchange
4671 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4673 ; -O1: cmp w8, w20, sxth
4674 ; -O1: csel w8, w0, w20, gt
4675 ; -O1: bl __atomic_compare_exchange
4676 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
4680 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4681 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4683 ; -O0: subs w10, w10, w8, sxth
4684 ; -O0: csel w8, w9, w8, gt
4685 ; -O0: bl __atomic_compare_exchange
4687 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4689 ; -O1: cmp w8, w20, sxth
4690 ; -O1: csel w8, w0, w20, gt
4691 ; -O1: bl __atomic_compare_exchange
4692 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4696 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4697 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4698 ; -O0: subs w10, w9, w8
4699 ; -O0: csel w8, w9, w8, gt
4700 ; -O0: bl __atomic_compare_exchange
4702 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4704 ; -O1: csel w8, w0, w20, gt
4705 ; -O1: bl __atomic_compare_exchange
4706 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4710 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4711 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4712 ; -O0: subs w10, w9, w8
4713 ; -O0: csel w8, w9, w8, gt
4714 ; -O0: bl __atomic_compare_exchange
4716 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4718 ; -O1: csel w8, w0, w20, gt
4719 ; -O1: bl __atomic_compare_exchange
4720 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4724 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4725 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4726 ; -O0: subs w10, w9, w8
4727 ; -O0: csel w8, w9, w8, gt
4728 ; -O0: bl __atomic_compare_exchange
4730 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4732 ; -O1: csel w8, w0, w20, gt
4733 ; -O1: bl __atomic_compare_exchange
4734 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4738 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4739 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4740 ; -O0: subs w10, w9, w8
4741 ; -O0: csel w8, w9, w8, gt
4742 ; -O0: bl __atomic_compare_exchange
4744 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4746 ; -O1: csel w8, w0, w20, gt
4747 ; -O1: bl __atomic_compare_exchange
4748 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4752 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4753 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4754 ; -O0: subs w10, w9, w8
4755 ; -O0: csel w8, w9, w8, gt
4756 ; -O0: bl __atomic_compare_exchange
4758 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4760 ; -O1: csel w8, w0, w20, gt
4761 ; -O1: bl __atomic_compare_exchange
4762 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4766 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4767 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4768 ; -O0: subs x10, x9, x8
4769 ; -O0: csel x8, x9, x8, gt
4770 ; -O0: bl __atomic_compare_exchange
4772 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4774 ; -O1: csel x8, x0, x20, gt
4775 ; -O1: bl __atomic_compare_exchange
4776 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4780 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4781 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4782 ; -O0: subs x10, x9, x8
4783 ; -O0: csel x8, x9, x8, gt
4784 ; -O0: bl __atomic_compare_exchange
4786 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4788 ; -O1: csel x8, x0, x20, gt
4789 ; -O1: bl __atomic_compare_exchange
4790 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4794 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4795 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4796 ; -O0: subs x10, x9, x8
4797 ; -O0: csel x8, x9, x8, gt
4798 ; -O0: bl __atomic_compare_exchange
4800 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4802 ; -O1: csel x8, x0, x20, gt
4803 ; -O1: bl __atomic_compare_exchange
4804 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4808 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4809 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4810 ; -O0: subs x10, x9, x8
4811 ; -O0: csel x8, x9, x8, gt
4812 ; -O0: bl __atomic_compare_exchange
4814 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4816 ; -O1: csel x8, x0, x20, gt
4817 ; -O1: bl __atomic_compare_exchange
4818 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4822 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4823 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4824 ; -O0: subs x10, x9, x8
4825 ; -O0: csel x8, x9, x8, gt
4826 ; -O0: bl __atomic_compare_exchange
4828 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4830 ; -O1: csel x8, x0, x20, gt
4831 ; -O1: bl __atomic_compare_exchange
4832 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4836 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4837 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4838 ; -O0: subs x8, x8, x10
4839 ; -O0: subs x8, x8, x9
4840 ; -O0: subs x12, x12, x10
4841 ; -O0: csel w11, w8, w11, eq
4842 ; -O0: ands w12, w11, #0x1
4843 ; -O0: csel x9, x8, x9, ne
4844 ; -O0: ands w11, w11, #0x1
4845 ; -O0: csel x8, x8, x10, ne
4846 ; -O0: bl __atomic_compare_exchange
4848 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4849 ; -O1: ldp x0, x1, [x0]
4851 ; -O1: csel x8, x1, x19, lt
4852 ; -O1: csel x9, x0, x21, lt
4853 ; -O1: bl __atomic_compare_exchange
4854 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4858 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4859 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4860 ; -O0: subs x8, x8, x10
4861 ; -O0: subs x8, x8, x9
4862 ; -O0: subs x12, x12, x10
4863 ; -O0: csel w11, w8, w11, eq
4864 ; -O0: ands w12, w11, #0x1
4865 ; -O0: csel x9, x8, x9, ne
4866 ; -O0: ands w11, w11, #0x1
4867 ; -O0: csel x8, x8, x10, ne
4868 ; -O0: bl __atomic_compare_exchange
4870 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4871 ; -O1: ldp x0, x1, [x0]
4873 ; -O1: csel x8, x1, x19, lt
4874 ; -O1: csel x9, x0, x21, lt
4875 ; -O1: bl __atomic_compare_exchange
4876 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4880 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4881 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4882 ; -O0: subs x8, x8, x10
4883 ; -O0: subs x8, x8, x9
4884 ; -O0: subs x12, x12, x10
4885 ; -O0: csel w11, w8, w11, eq
4886 ; -O0: ands w12, w11, #0x1
4887 ; -O0: csel x9, x8, x9, ne
4888 ; -O0: ands w11, w11, #0x1
4889 ; -O0: csel x8, x8, x10, ne
4890 ; -O0: bl __atomic_compare_exchange
4892 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4893 ; -O1: ldp x0, x1, [x0]
4895 ; -O1: csel x8, x1, x19, lt
4896 ; -O1: csel x9, x0, x21, lt
4897 ; -O1: bl __atomic_compare_exchange
4898 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4902 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4903 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4904 ; -O0: subs x8, x8, x10
4905 ; -O0: subs x8, x8, x9
4906 ; -O0: subs x12, x12, x10
4907 ; -O0: csel w11, w8, w11, eq
4908 ; -O0: ands w12, w11, #0x1
4909 ; -O0: csel x9, x8, x9, ne
4910 ; -O0: ands w11, w11, #0x1
4911 ; -O0: csel x8, x8, x10, ne
4912 ; -O0: bl __atomic_compare_exchange
4914 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4915 ; -O1: ldp x0, x1, [x0]
4917 ; -O1: csel x8, x1, x19, lt
4918 ; -O1: csel x9, x0, x21, lt
4919 ; -O1: bl __atomic_compare_exchange
4920 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4924 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4925 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4926 ; -O0: subs x8, x8, x10
4927 ; -O0: subs x8, x8, x9
4928 ; -O0: subs x12, x12, x10
4929 ; -O0: csel w11, w8, w11, eq
4930 ; -O0: ands w12, w11, #0x1
4931 ; -O0: csel x9, x8, x9, ne
4932 ; -O0: ands w11, w11, #0x1
4933 ; -O0: csel x8, x8, x10, ne
4934 ; -O0: bl __atomic_compare_exchange
4936 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4937 ; -O1: ldp x0, x1, [x0]
4939 ; -O1: csel x8, x1, x19, lt
4940 ; -O1: csel x9, x0, x21, lt
4941 ; -O1: bl __atomic_compare_exchange
4942 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4946 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4947 ; -O0-LABEL: atomicrmw_min_i8_aligned_monotonic:
4949 ; -O0: subs w9, w9, w8, sxtb
4950 ; -O0: csel w1, w0, w8, le
4951 ; -O0: bl __aarch64_cas1_relax
4952 ; -O0: and w8, w0, #0xff
4953 ; -O0: subs w8, w8, w9, uxtb
4955 ; -O1-LABEL: atomicrmw_min_i8_aligned_monotonic:
4956 ; -O1: ldxrb w9, [x0]
4958 ; -O1: cmp w8, w1, sxtb
4959 ; -O1: csel w9, w9, w1, le
4960 ; -O1: stxrb w10, w9, [x0]
4961 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4965 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4966 ; -O0-LABEL: atomicrmw_min_i8_aligned_acquire:
4968 ; -O0: subs w9, w9, w8, sxtb
4969 ; -O0: csel w1, w0, w8, le
4970 ; -O0: bl __aarch64_cas1_acq
4971 ; -O0: and w8, w0, #0xff
4972 ; -O0: subs w8, w8, w9, uxtb
4974 ; -O1-LABEL: atomicrmw_min_i8_aligned_acquire:
4975 ; -O1: ldaxrb w9, [x0]
4977 ; -O1: cmp w8, w1, sxtb
4978 ; -O1: csel w9, w9, w1, le
4979 ; -O1: stxrb w10, w9, [x0]
4980 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4984 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4985 ; -O0-LABEL: atomicrmw_min_i8_aligned_release:
4987 ; -O0: subs w9, w9, w8, sxtb
4988 ; -O0: csel w1, w0, w8, le
4989 ; -O0: bl __aarch64_cas1_rel
4990 ; -O0: and w8, w0, #0xff
4991 ; -O0: subs w8, w8, w9, uxtb
4993 ; -O1-LABEL: atomicrmw_min_i8_aligned_release:
4994 ; -O1: ldxrb w9, [x0]
4996 ; -O1: cmp w8, w1, sxtb
4997 ; -O1: csel w9, w9, w1, le
4998 ; -O1: stlxrb w10, w9, [x0]
4999 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
5003 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5004 ; -O0-LABEL: atomicrmw_min_i8_aligned_acq_rel:
5006 ; -O0: subs w9, w9, w8, sxtb
5007 ; -O0: csel w1, w0, w8, le
5008 ; -O0: bl __aarch64_cas1_acq_rel
5009 ; -O0: and w8, w0, #0xff
5010 ; -O0: subs w8, w8, w9, uxtb
5012 ; -O1-LABEL: atomicrmw_min_i8_aligned_acq_rel:
5013 ; -O1: ldaxrb w9, [x0]
5015 ; -O1: cmp w8, w1, sxtb
5016 ; -O1: csel w9, w9, w1, le
5017 ; -O1: stlxrb w10, w9, [x0]
5018 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
5022 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5023 ; -O0-LABEL: atomicrmw_min_i8_aligned_seq_cst:
5025 ; -O0: subs w9, w9, w8, sxtb
5026 ; -O0: csel w1, w0, w8, le
5027 ; -O0: bl __aarch64_cas1_acq_rel
5028 ; -O0: and w8, w0, #0xff
5029 ; -O0: subs w8, w8, w9, uxtb
5031 ; -O1-LABEL: atomicrmw_min_i8_aligned_seq_cst:
5032 ; -O1: ldaxrb w9, [x0]
5034 ; -O1: cmp w8, w1, sxtb
5035 ; -O1: csel w9, w9, w1, le
5036 ; -O1: stlxrb w10, w9, [x0]
5037 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
5041 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5042 ; -O0-LABEL: atomicrmw_min_i16_aligned_monotonic:
5044 ; -O0: subs w9, w9, w8, sxth
5045 ; -O0: csel w1, w0, w8, le
5046 ; -O0: bl __aarch64_cas2_relax
5047 ; -O0: subs w8, w8, w0, uxth
5049 ; -O1-LABEL: atomicrmw_min_i16_aligned_monotonic:
5050 ; -O1: ldxrh w9, [x0]
5052 ; -O1: cmp w8, w1, sxth
5053 ; -O1: csel w9, w9, w1, le
5054 ; -O1: stxrh w10, w9, [x0]
5055 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
5059 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
5060 ; -O0-LABEL: atomicrmw_min_i16_aligned_acquire:
5062 ; -O0: subs w9, w9, w8, sxth
5063 ; -O0: csel w1, w0, w8, le
5064 ; -O0: bl __aarch64_cas2_acq
5065 ; -O0: subs w8, w8, w0, uxth
5067 ; -O1-LABEL: atomicrmw_min_i16_aligned_acquire:
5068 ; -O1: ldaxrh w9, [x0]
5070 ; -O1: cmp w8, w1, sxth
5071 ; -O1: csel w9, w9, w1, le
5072 ; -O1: stxrh w10, w9, [x0]
5073 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
5077 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
5078 ; -O0-LABEL: atomicrmw_min_i16_aligned_release:
5080 ; -O0: subs w9, w9, w8, sxth
5081 ; -O0: csel w1, w0, w8, le
5082 ; -O0: bl __aarch64_cas2_rel
5083 ; -O0: subs w8, w8, w0, uxth
5085 ; -O1-LABEL: atomicrmw_min_i16_aligned_release:
5086 ; -O1: ldxrh w9, [x0]
5088 ; -O1: cmp w8, w1, sxth
5089 ; -O1: csel w9, w9, w1, le
5090 ; -O1: stlxrh w10, w9, [x0]
5091 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
5095 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5096 ; -O0-LABEL: atomicrmw_min_i16_aligned_acq_rel:
5098 ; -O0: subs w9, w9, w8, sxth
5099 ; -O0: csel w1, w0, w8, le
5100 ; -O0: bl __aarch64_cas2_acq_rel
5101 ; -O0: subs w8, w8, w0, uxth
5103 ; -O1-LABEL: atomicrmw_min_i16_aligned_acq_rel:
5104 ; -O1: ldaxrh w9, [x0]
5106 ; -O1: cmp w8, w1, sxth
5107 ; -O1: csel w9, w9, w1, le
5108 ; -O1: stlxrh w10, w9, [x0]
5109 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
5113 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5114 ; -O0-LABEL: atomicrmw_min_i16_aligned_seq_cst:
5116 ; -O0: subs w9, w9, w8, sxth
5117 ; -O0: csel w1, w0, w8, le
5118 ; -O0: bl __aarch64_cas2_acq_rel
5119 ; -O0: subs w8, w8, w0, uxth
5121 ; -O1-LABEL: atomicrmw_min_i16_aligned_seq_cst:
5122 ; -O1: ldaxrh w9, [x0]
5124 ; -O1: cmp w8, w1, sxth
5125 ; -O1: csel w9, w9, w1, le
5126 ; -O1: stlxrh w10, w9, [x0]
5127 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
5131 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5132 ; -O0-LABEL: atomicrmw_min_i32_aligned_monotonic:
5133 ; -O0: subs w9, w0, w8
5134 ; -O0: csel w1, w0, w8, le
5135 ; -O0: bl __aarch64_cas4_relax
5136 ; -O0: subs w8, w0, w8
5138 ; -O1-LABEL: atomicrmw_min_i32_aligned_monotonic:
5139 ; -O1: ldxr w8, [x0]
5141 ; -O1: csel w9, w8, w1, le
5142 ; -O1: stxr w10, w9, [x0]
5143 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
5147 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
5148 ; -O0-LABEL: atomicrmw_min_i32_aligned_acquire:
5149 ; -O0: subs w9, w0, w8
5150 ; -O0: csel w1, w0, w8, le
5151 ; -O0: bl __aarch64_cas4_acq
5152 ; -O0: subs w8, w0, w8
5154 ; -O1-LABEL: atomicrmw_min_i32_aligned_acquire:
5155 ; -O1: ldaxr w8, [x0]
5157 ; -O1: csel w9, w8, w1, le
5158 ; -O1: stxr w10, w9, [x0]
5159 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
5163 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
5164 ; -O0-LABEL: atomicrmw_min_i32_aligned_release:
5165 ; -O0: subs w9, w0, w8
5166 ; -O0: csel w1, w0, w8, le
5167 ; -O0: bl __aarch64_cas4_rel
5168 ; -O0: subs w8, w0, w8
5170 ; -O1-LABEL: atomicrmw_min_i32_aligned_release:
5171 ; -O1: ldxr w8, [x0]
5173 ; -O1: csel w9, w8, w1, le
5174 ; -O1: stlxr w10, w9, [x0]
5175 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
5179 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5180 ; -O0-LABEL: atomicrmw_min_i32_aligned_acq_rel:
5181 ; -O0: subs w9, w0, w8
5182 ; -O0: csel w1, w0, w8, le
5183 ; -O0: bl __aarch64_cas4_acq_rel
5184 ; -O0: subs w8, w0, w8
5186 ; -O1-LABEL: atomicrmw_min_i32_aligned_acq_rel:
5187 ; -O1: ldaxr w8, [x0]
5189 ; -O1: csel w9, w8, w1, le
5190 ; -O1: stlxr w10, w9, [x0]
5191 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
5195 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5196 ; -O0-LABEL: atomicrmw_min_i32_aligned_seq_cst:
5197 ; -O0: subs w9, w0, w8
5198 ; -O0: csel w1, w0, w8, le
5199 ; -O0: bl __aarch64_cas4_acq_rel
5200 ; -O0: subs w8, w0, w8
5202 ; -O1-LABEL: atomicrmw_min_i32_aligned_seq_cst:
5203 ; -O1: ldaxr w8, [x0]
5205 ; -O1: csel w9, w8, w1, le
5206 ; -O1: stlxr w10, w9, [x0]
5207 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
5211 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5212 ; -O0-LABEL: atomicrmw_min_i64_aligned_monotonic:
5213 ; -O0: subs x9, x0, x8
5214 ; -O0: csel x1, x0, x8, le
5215 ; -O0: bl __aarch64_cas8_relax
5216 ; -O0: subs x8, x0, x8
5218 ; -O1-LABEL: atomicrmw_min_i64_aligned_monotonic:
5219 ; -O1: ldxr x0, [x8]
5221 ; -O1: csel x9, x0, x1, le
5222 ; -O1: stxr w10, x9, [x8]
5223 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
5227 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
5228 ; -O0-LABEL: atomicrmw_min_i64_aligned_acquire:
5229 ; -O0: subs x9, x0, x8
5230 ; -O0: csel x1, x0, x8, le
5231 ; -O0: bl __aarch64_cas8_acq
5232 ; -O0: subs x8, x0, x8
5234 ; -O1-LABEL: atomicrmw_min_i64_aligned_acquire:
5235 ; -O1: ldaxr x0, [x8]
5237 ; -O1: csel x9, x0, x1, le
5238 ; -O1: stxr w10, x9, [x8]
5239 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
5243 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
5244 ; -O0-LABEL: atomicrmw_min_i64_aligned_release:
5245 ; -O0: subs x9, x0, x8
5246 ; -O0: csel x1, x0, x8, le
5247 ; -O0: bl __aarch64_cas8_rel
5248 ; -O0: subs x8, x0, x8
5250 ; -O1-LABEL: atomicrmw_min_i64_aligned_release:
5251 ; -O1: ldxr x0, [x8]
5253 ; -O1: csel x9, x0, x1, le
5254 ; -O1: stlxr w10, x9, [x8]
5255 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
5259 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5260 ; -O0-LABEL: atomicrmw_min_i64_aligned_acq_rel:
5261 ; -O0: subs x9, x0, x8
5262 ; -O0: csel x1, x0, x8, le
5263 ; -O0: bl __aarch64_cas8_acq_rel
5264 ; -O0: subs x8, x0, x8
5266 ; -O1-LABEL: atomicrmw_min_i64_aligned_acq_rel:
5267 ; -O1: ldaxr x0, [x8]
5269 ; -O1: csel x9, x0, x1, le
5270 ; -O1: stlxr w10, x9, [x8]
5271 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
5275 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5276 ; -O0-LABEL: atomicrmw_min_i64_aligned_seq_cst:
5277 ; -O0: subs x9, x0, x8
5278 ; -O0: csel x1, x0, x8, le
5279 ; -O0: bl __aarch64_cas8_acq_rel
5280 ; -O0: subs x8, x0, x8
5282 ; -O1-LABEL: atomicrmw_min_i64_aligned_seq_cst:
5283 ; -O1: ldaxr x0, [x8]
5285 ; -O1: csel x9, x0, x1, le
5286 ; -O1: stlxr w10, x9, [x8]
5287 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
5291 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5292 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
5293 ; -O0: subs x8, x8, x9
5294 ; -O0: subs x8, x8, x11
5295 ; -O0: subs x12, x12, x9
5296 ; -O0: csel w10, w8, w10, eq
5297 ; -O0: ands w12, w10, #0x1
5298 ; -O0: csel x2, x8, x11, ne
5299 ; -O0: ands w10, w10, #0x1
5300 ; -O0: csel x3, x8, x9, ne
5301 ; -O0: bl __aarch64_cas16_relax
5302 ; -O0: eor x8, x0, x8
5303 ; -O0: eor x9, x1, x9
5304 ; -O0: orr x8, x8, x9
5305 ; -O0: subs x8, x8, #0
5307 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
5308 ; -O1: ldxp x0, x1, [x8]
5310 ; -O1: csel x9, x1, x3, ge
5311 ; -O1: csel x10, x0, x2, ge
5312 ; -O1: stxp w11, x10, x9, [x8]
5313 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
5317 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
5318 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
5319 ; -O0: subs x8, x8, x9
5320 ; -O0: subs x8, x8, x11
5321 ; -O0: subs x12, x12, x9
5322 ; -O0: csel w10, w8, w10, eq
5323 ; -O0: ands w12, w10, #0x1
5324 ; -O0: csel x2, x8, x11, ne
5325 ; -O0: ands w10, w10, #0x1
5326 ; -O0: csel x3, x8, x9, ne
5327 ; -O0: bl __aarch64_cas16_acq
5328 ; -O0: eor x8, x0, x8
5329 ; -O0: eor x9, x1, x9
5330 ; -O0: orr x8, x8, x9
5331 ; -O0: subs x8, x8, #0
5333 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
5334 ; -O1: ldaxp x0, x1, [x8]
5336 ; -O1: csel x9, x1, x3, ge
5337 ; -O1: csel x10, x0, x2, ge
5338 ; -O1: stxp w11, x10, x9, [x8]
5339 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
5343 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
5344 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
5345 ; -O0: subs x8, x8, x9
5346 ; -O0: subs x8, x8, x11
5347 ; -O0: subs x12, x12, x9
5348 ; -O0: csel w10, w8, w10, eq
5349 ; -O0: ands w12, w10, #0x1
5350 ; -O0: csel x2, x8, x11, ne
5351 ; -O0: ands w10, w10, #0x1
5352 ; -O0: csel x3, x8, x9, ne
5353 ; -O0: bl __aarch64_cas16_rel
5354 ; -O0: eor x8, x0, x8
5355 ; -O0: eor x9, x1, x9
5356 ; -O0: orr x8, x8, x9
5357 ; -O0: subs x8, x8, #0
5359 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
5360 ; -O1: ldxp x0, x1, [x8]
5362 ; -O1: csel x9, x1, x3, ge
5363 ; -O1: csel x10, x0, x2, ge
5364 ; -O1: stlxp w11, x10, x9, [x8]
5365 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
5369 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5370 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
5371 ; -O0: subs x8, x8, x9
5372 ; -O0: subs x8, x8, x11
5373 ; -O0: subs x12, x12, x9
5374 ; -O0: csel w10, w8, w10, eq
5375 ; -O0: ands w12, w10, #0x1
5376 ; -O0: csel x2, x8, x11, ne
5377 ; -O0: ands w10, w10, #0x1
5378 ; -O0: csel x3, x8, x9, ne
5379 ; -O0: bl __aarch64_cas16_acq_rel
5380 ; -O0: eor x8, x0, x8
5381 ; -O0: eor x9, x1, x9
5382 ; -O0: orr x8, x8, x9
5383 ; -O0: subs x8, x8, #0
5385 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
5386 ; -O1: ldaxp x0, x1, [x8]
5388 ; -O1: csel x9, x1, x3, ge
5389 ; -O1: csel x10, x0, x2, ge
5390 ; -O1: stlxp w11, x10, x9, [x8]
5391 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
5395 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5396 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
5397 ; -O0: subs x8, x8, x9
5398 ; -O0: subs x8, x8, x11
5399 ; -O0: subs x12, x12, x9
5400 ; -O0: csel w10, w8, w10, eq
5401 ; -O0: ands w12, w10, #0x1
5402 ; -O0: csel x2, x8, x11, ne
5403 ; -O0: ands w10, w10, #0x1
5404 ; -O0: csel x3, x8, x9, ne
5405 ; -O0: bl __aarch64_cas16_acq_rel
5406 ; -O0: eor x8, x0, x8
5407 ; -O0: eor x9, x1, x9
5408 ; -O0: orr x8, x8, x9
5409 ; -O0: subs x8, x8, #0
5411 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
5412 ; -O1: ldaxp x0, x1, [x8]
5414 ; -O1: csel x9, x1, x3, ge
5415 ; -O1: csel x10, x0, x2, ge
5416 ; -O1: stlxp w11, x10, x9, [x8]
5417 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
5421 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5422 ; -O0-LABEL: atomicrmw_min_i8_unaligned_monotonic:
5424 ; -O0: subs w9, w9, w8, sxtb
5425 ; -O0: csel w1, w0, w8, le
5426 ; -O0: bl __aarch64_cas1_relax
5427 ; -O0: and w8, w0, #0xff
5428 ; -O0: subs w8, w8, w9, uxtb
5430 ; -O1-LABEL: atomicrmw_min_i8_unaligned_monotonic:
5431 ; -O1: ldxrb w9, [x0]
5433 ; -O1: cmp w8, w1, sxtb
5434 ; -O1: csel w9, w9, w1, le
5435 ; -O1: stxrb w10, w9, [x0]
5436 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
5440 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5441 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acquire:
5443 ; -O0: subs w9, w9, w8, sxtb
5444 ; -O0: csel w1, w0, w8, le
5445 ; -O0: bl __aarch64_cas1_acq
5446 ; -O0: and w8, w0, #0xff
5447 ; -O0: subs w8, w8, w9, uxtb
5449 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acquire:
5450 ; -O1: ldaxrb w9, [x0]
5452 ; -O1: cmp w8, w1, sxtb
5453 ; -O1: csel w9, w9, w1, le
5454 ; -O1: stxrb w10, w9, [x0]
5455 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
5459 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
5460 ; -O0-LABEL: atomicrmw_min_i8_unaligned_release:
5462 ; -O0: subs w9, w9, w8, sxtb
5463 ; -O0: csel w1, w0, w8, le
5464 ; -O0: bl __aarch64_cas1_rel
5465 ; -O0: and w8, w0, #0xff
5466 ; -O0: subs w8, w8, w9, uxtb
5468 ; -O1-LABEL: atomicrmw_min_i8_unaligned_release:
5469 ; -O1: ldxrb w9, [x0]
5471 ; -O1: cmp w8, w1, sxtb
5472 ; -O1: csel w9, w9, w1, le
5473 ; -O1: stlxrb w10, w9, [x0]
5474 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
5478 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5479 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
5481 ; -O0: subs w9, w9, w8, sxtb
5482 ; -O0: csel w1, w0, w8, le
5483 ; -O0: bl __aarch64_cas1_acq_rel
5484 ; -O0: and w8, w0, #0xff
5485 ; -O0: subs w8, w8, w9, uxtb
5487 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
5488 ; -O1: ldaxrb w9, [x0]
5490 ; -O1: cmp w8, w1, sxtb
5491 ; -O1: csel w9, w9, w1, le
5492 ; -O1: stlxrb w10, w9, [x0]
5493 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
5497 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5498 ; -O0-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
5500 ; -O0: subs w9, w9, w8, sxtb
5501 ; -O0: csel w1, w0, w8, le
5502 ; -O0: bl __aarch64_cas1_acq_rel
5503 ; -O0: and w8, w0, #0xff
5504 ; -O0: subs w8, w8, w9, uxtb
5506 ; -O1-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
5507 ; -O1: ldaxrb w9, [x0]
5509 ; -O1: cmp w8, w1, sxtb
5510 ; -O1: csel w9, w9, w1, le
5511 ; -O1: stlxrb w10, w9, [x0]
5512 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
5516 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5517 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
5519 ; -O0: subs w10, w10, w8, sxth
5520 ; -O0: csel w8, w9, w8, le
5521 ; -O0: bl __atomic_compare_exchange
5523 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
5525 ; -O1: cmp w8, w20, sxth
5526 ; -O1: csel w8, w0, w20, le
5527 ; -O1: bl __atomic_compare_exchange
5528 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
5532 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5533 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
5535 ; -O0: subs w10, w10, w8, sxth
5536 ; -O0: csel w8, w9, w8, le
5537 ; -O0: bl __atomic_compare_exchange
5539 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
5541 ; -O1: cmp w8, w20, sxth
5542 ; -O1: csel w8, w0, w20, le
5543 ; -O1: bl __atomic_compare_exchange
5544 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
5548 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
5549 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
5551 ; -O0: subs w10, w10, w8, sxth
5552 ; -O0: csel w8, w9, w8, le
5553 ; -O0: bl __atomic_compare_exchange
5555 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
5557 ; -O1: cmp w8, w20, sxth
5558 ; -O1: csel w8, w0, w20, le
5559 ; -O1: bl __atomic_compare_exchange
5560 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
5564 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5565 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
5567 ; -O0: subs w10, w10, w8, sxth
5568 ; -O0: csel w8, w9, w8, le
5569 ; -O0: bl __atomic_compare_exchange
5571 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
5573 ; -O1: cmp w8, w20, sxth
5574 ; -O1: csel w8, w0, w20, le
5575 ; -O1: bl __atomic_compare_exchange
5576 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
5580 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5581 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
5583 ; -O0: subs w10, w10, w8, sxth
5584 ; -O0: csel w8, w9, w8, le
5585 ; -O0: bl __atomic_compare_exchange
5587 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
5589 ; -O1: cmp w8, w20, sxth
5590 ; -O1: csel w8, w0, w20, le
5591 ; -O1: bl __atomic_compare_exchange
5592 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
5596 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5597 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
5598 ; -O0: subs w10, w9, w8
5599 ; -O0: csel w8, w9, w8, le
5600 ; -O0: bl __atomic_compare_exchange
5602 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
5604 ; -O1: csel w8, w0, w20, le
5605 ; -O1: bl __atomic_compare_exchange
5606 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
5610 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5611 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
5612 ; -O0: subs w10, w9, w8
5613 ; -O0: csel w8, w9, w8, le
5614 ; -O0: bl __atomic_compare_exchange
5616 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
5618 ; -O1: csel w8, w0, w20, le
5619 ; -O1: bl __atomic_compare_exchange
5620 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
5624 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
5625 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
5626 ; -O0: subs w10, w9, w8
5627 ; -O0: csel w8, w9, w8, le
5628 ; -O0: bl __atomic_compare_exchange
5630 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
5632 ; -O1: csel w8, w0, w20, le
5633 ; -O1: bl __atomic_compare_exchange
5634 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
5638 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5639 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5640 ; -O0: subs w10, w9, w8
5641 ; -O0: csel w8, w9, w8, le
5642 ; -O0: bl __atomic_compare_exchange
5644 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5646 ; -O1: csel w8, w0, w20, le
5647 ; -O1: bl __atomic_compare_exchange
5648 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
5652 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5653 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5654 ; -O0: subs w10, w9, w8
5655 ; -O0: csel w8, w9, w8, le
5656 ; -O0: bl __atomic_compare_exchange
5658 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5660 ; -O1: csel w8, w0, w20, le
5661 ; -O1: bl __atomic_compare_exchange
5662 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
5666 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5667 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5668 ; -O0: subs x10, x9, x8
5669 ; -O0: csel x8, x9, x8, le
5670 ; -O0: bl __atomic_compare_exchange
5672 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5674 ; -O1: csel x8, x0, x20, le
5675 ; -O1: bl __atomic_compare_exchange
5676 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
5680 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5681 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
5682 ; -O0: subs x10, x9, x8
5683 ; -O0: csel x8, x9, x8, le
5684 ; -O0: bl __atomic_compare_exchange
5686 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
5688 ; -O1: csel x8, x0, x20, le
5689 ; -O1: bl __atomic_compare_exchange
5690 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
5694 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
5695 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
5696 ; -O0: subs x10, x9, x8
5697 ; -O0: csel x8, x9, x8, le
5698 ; -O0: bl __atomic_compare_exchange
5700 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
5702 ; -O1: csel x8, x0, x20, le
5703 ; -O1: bl __atomic_compare_exchange
5704 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
5708 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5709 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5710 ; -O0: subs x10, x9, x8
5711 ; -O0: csel x8, x9, x8, le
5712 ; -O0: bl __atomic_compare_exchange
5714 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5716 ; -O1: csel x8, x0, x20, le
5717 ; -O1: bl __atomic_compare_exchange
5718 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
5722 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5723 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5724 ; -O0: subs x10, x9, x8
5725 ; -O0: csel x8, x9, x8, le
5726 ; -O0: bl __atomic_compare_exchange
5728 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5730 ; -O1: csel x8, x0, x20, le
5731 ; -O1: bl __atomic_compare_exchange
5732 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
5736 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5737 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5738 ; -O0: subs x8, x8, x10
5739 ; -O0: subs x8, x8, x9
5740 ; -O0: subs x12, x12, x10
5741 ; -O0: csel w11, w8, w11, eq
5742 ; -O0: ands w12, w11, #0x1
5743 ; -O0: csel x9, x8, x9, ne
5744 ; -O0: ands w11, w11, #0x1
5745 ; -O0: csel x8, x8, x10, ne
5746 ; -O0: bl __atomic_compare_exchange
5748 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5749 ; -O1: ldp x0, x1, [x0]
5751 ; -O1: csel x8, x1, x19, ge
5752 ; -O1: csel x9, x0, x21, ge
5753 ; -O1: bl __atomic_compare_exchange
5754 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
5758 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5759 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
5760 ; -O0: subs x8, x8, x10
5761 ; -O0: subs x8, x8, x9
5762 ; -O0: subs x12, x12, x10
5763 ; -O0: csel w11, w8, w11, eq
5764 ; -O0: ands w12, w11, #0x1
5765 ; -O0: csel x9, x8, x9, ne
5766 ; -O0: ands w11, w11, #0x1
5767 ; -O0: csel x8, x8, x10, ne
5768 ; -O0: bl __atomic_compare_exchange
5770 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
5771 ; -O1: ldp x0, x1, [x0]
5773 ; -O1: csel x8, x1, x19, ge
5774 ; -O1: csel x9, x0, x21, ge
5775 ; -O1: bl __atomic_compare_exchange
5776 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
5780 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
5781 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
5782 ; -O0: subs x8, x8, x10
5783 ; -O0: subs x8, x8, x9
5784 ; -O0: subs x12, x12, x10
5785 ; -O0: csel w11, w8, w11, eq
5786 ; -O0: ands w12, w11, #0x1
5787 ; -O0: csel x9, x8, x9, ne
5788 ; -O0: ands w11, w11, #0x1
5789 ; -O0: csel x8, x8, x10, ne
5790 ; -O0: bl __atomic_compare_exchange
5792 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
5793 ; -O1: ldp x0, x1, [x0]
5795 ; -O1: csel x8, x1, x19, ge
5796 ; -O1: csel x9, x0, x21, ge
5797 ; -O1: bl __atomic_compare_exchange
5798 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
5802 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5803 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5804 ; -O0: subs x8, x8, x10
5805 ; -O0: subs x8, x8, x9
5806 ; -O0: subs x12, x12, x10
5807 ; -O0: csel w11, w8, w11, eq
5808 ; -O0: ands w12, w11, #0x1
5809 ; -O0: csel x9, x8, x9, ne
5810 ; -O0: ands w11, w11, #0x1
5811 ; -O0: csel x8, x8, x10, ne
5812 ; -O0: bl __atomic_compare_exchange
5814 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5815 ; -O1: ldp x0, x1, [x0]
5817 ; -O1: csel x8, x1, x19, ge
5818 ; -O1: csel x9, x0, x21, ge
5819 ; -O1: bl __atomic_compare_exchange
5820 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5824 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5825 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5826 ; -O0: subs x8, x8, x10
5827 ; -O0: subs x8, x8, x9
5828 ; -O0: subs x12, x12, x10
5829 ; -O0: csel w11, w8, w11, eq
5830 ; -O0: ands w12, w11, #0x1
5831 ; -O0: csel x9, x8, x9, ne
5832 ; -O0: ands w11, w11, #0x1
5833 ; -O0: csel x8, x8, x10, ne
5834 ; -O0: bl __atomic_compare_exchange
5836 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5837 ; -O1: ldp x0, x1, [x0]
5839 ; -O1: csel x8, x1, x19, ge
5840 ; -O1: csel x9, x0, x21, ge
5841 ; -O1: bl __atomic_compare_exchange
5842 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5846 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5847 ; -O0-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5848 ; -O0: and w9, w0, #0xff
5849 ; -O0: subs w9, w9, w8, uxtb
5850 ; -O0: csel w1, w0, w8, hi
5851 ; -O0: bl __aarch64_cas1_relax
5852 ; -O0: and w8, w0, #0xff
5853 ; -O0: subs w8, w8, w9, uxtb
5855 ; -O1-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5856 ; -O1: and w9, w1, #0xff
5857 ; -O1: ldxrb w8, [x0]
5859 ; -O1: csel w10, w8, w9, hi
5860 ; -O1: stxrb w11, w10, [x0]
5861 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5865 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5866 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acquire:
5867 ; -O0: and w9, w0, #0xff
5868 ; -O0: subs w9, w9, w8, uxtb
5869 ; -O0: csel w1, w0, w8, hi
5870 ; -O0: bl __aarch64_cas1_acq
5871 ; -O0: and w8, w0, #0xff
5872 ; -O0: subs w8, w8, w9, uxtb
5874 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acquire:
5875 ; -O1: and w9, w1, #0xff
5876 ; -O1: ldaxrb w8, [x0]
5878 ; -O1: csel w10, w8, w9, hi
5879 ; -O1: stxrb w11, w10, [x0]
5880 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5884 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5885 ; -O0-LABEL: atomicrmw_umax_i8_aligned_release:
5886 ; -O0: and w9, w0, #0xff
5887 ; -O0: subs w9, w9, w8, uxtb
5888 ; -O0: csel w1, w0, w8, hi
5889 ; -O0: bl __aarch64_cas1_rel
5890 ; -O0: and w8, w0, #0xff
5891 ; -O0: subs w8, w8, w9, uxtb
5893 ; -O1-LABEL: atomicrmw_umax_i8_aligned_release:
5894 ; -O1: and w9, w1, #0xff
5895 ; -O1: ldxrb w8, [x0]
5897 ; -O1: csel w10, w8, w9, hi
5898 ; -O1: stlxrb w11, w10, [x0]
5899 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5903 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5904 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5905 ; -O0: and w9, w0, #0xff
5906 ; -O0: subs w9, w9, w8, uxtb
5907 ; -O0: csel w1, w0, w8, hi
5908 ; -O0: bl __aarch64_cas1_acq_rel
5909 ; -O0: and w8, w0, #0xff
5910 ; -O0: subs w8, w8, w9, uxtb
5912 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5913 ; -O1: and w9, w1, #0xff
5914 ; -O1: ldaxrb w8, [x0]
5916 ; -O1: csel w10, w8, w9, hi
5917 ; -O1: stlxrb w11, w10, [x0]
5918 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5922 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5923 ; -O0-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5924 ; -O0: and w9, w0, #0xff
5925 ; -O0: subs w9, w9, w8, uxtb
5926 ; -O0: csel w1, w0, w8, hi
5927 ; -O0: bl __aarch64_cas1_acq_rel
5928 ; -O0: and w8, w0, #0xff
5929 ; -O0: subs w8, w8, w9, uxtb
5931 ; -O1-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5932 ; -O1: and w9, w1, #0xff
5933 ; -O1: ldaxrb w8, [x0]
5935 ; -O1: csel w10, w8, w9, hi
5936 ; -O1: stlxrb w11, w10, [x0]
5937 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5941 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5942 ; -O0-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5943 ; -O0: subs w9, w9, w8, uxth
5944 ; -O0: csel w1, w0, w8, hi
5945 ; -O0: bl __aarch64_cas2_relax
5946 ; -O0: subs w8, w8, w0, uxth
5948 ; -O1-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5949 ; -O1: and w9, w1, #0xffff
5950 ; -O1: ldxrh w8, [x0]
5952 ; -O1: csel w10, w8, w9, hi
5953 ; -O1: stxrh w11, w10, [x0]
5954 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5958 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5959 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acquire:
5960 ; -O0: subs w9, w9, w8, uxth
5961 ; -O0: csel w1, w0, w8, hi
5962 ; -O0: bl __aarch64_cas2_acq
5963 ; -O0: subs w8, w8, w0, uxth
5965 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acquire:
5966 ; -O1: and w9, w1, #0xffff
5967 ; -O1: ldaxrh w8, [x0]
5969 ; -O1: csel w10, w8, w9, hi
5970 ; -O1: stxrh w11, w10, [x0]
5971 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5975 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5976 ; -O0-LABEL: atomicrmw_umax_i16_aligned_release:
5977 ; -O0: subs w9, w9, w8, uxth
5978 ; -O0: csel w1, w0, w8, hi
5979 ; -O0: bl __aarch64_cas2_rel
5980 ; -O0: subs w8, w8, w0, uxth
5982 ; -O1-LABEL: atomicrmw_umax_i16_aligned_release:
5983 ; -O1: and w9, w1, #0xffff
5984 ; -O1: ldxrh w8, [x0]
5986 ; -O1: csel w10, w8, w9, hi
5987 ; -O1: stlxrh w11, w10, [x0]
5988 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5992 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5993 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5994 ; -O0: subs w9, w9, w8, uxth
5995 ; -O0: csel w1, w0, w8, hi
5996 ; -O0: bl __aarch64_cas2_acq_rel
5997 ; -O0: subs w8, w8, w0, uxth
5999 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
6000 ; -O1: and w9, w1, #0xffff
6001 ; -O1: ldaxrh w8, [x0]
6003 ; -O1: csel w10, w8, w9, hi
6004 ; -O1: stlxrh w11, w10, [x0]
6005 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
6009 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6010 ; -O0-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
6011 ; -O0: subs w9, w9, w8, uxth
6012 ; -O0: csel w1, w0, w8, hi
6013 ; -O0: bl __aarch64_cas2_acq_rel
6014 ; -O0: subs w8, w8, w0, uxth
6016 ; -O1-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
6017 ; -O1: and w9, w1, #0xffff
6018 ; -O1: ldaxrh w8, [x0]
6020 ; -O1: csel w10, w8, w9, hi
6021 ; -O1: stlxrh w11, w10, [x0]
6022 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
6026 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6027 ; -O0-LABEL: atomicrmw_umax_i32_aligned_monotonic:
6028 ; -O0: subs w9, w0, w8
6029 ; -O0: csel w1, w0, w8, hi
6030 ; -O0: bl __aarch64_cas4_relax
6031 ; -O0: subs w8, w0, w8
6033 ; -O1-LABEL: atomicrmw_umax_i32_aligned_monotonic:
6034 ; -O1: ldxr w8, [x0]
6036 ; -O1: csel w9, w8, w1, hi
6037 ; -O1: stxr w10, w9, [x0]
6038 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
6042 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
6043 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acquire:
6044 ; -O0: subs w9, w0, w8
6045 ; -O0: csel w1, w0, w8, hi
6046 ; -O0: bl __aarch64_cas4_acq
6047 ; -O0: subs w8, w0, w8
6049 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acquire:
6050 ; -O1: ldaxr w8, [x0]
6052 ; -O1: csel w9, w8, w1, hi
6053 ; -O1: stxr w10, w9, [x0]
6054 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
6058 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
6059 ; -O0-LABEL: atomicrmw_umax_i32_aligned_release:
6060 ; -O0: subs w9, w0, w8
6061 ; -O0: csel w1, w0, w8, hi
6062 ; -O0: bl __aarch64_cas4_rel
6063 ; -O0: subs w8, w0, w8
6065 ; -O1-LABEL: atomicrmw_umax_i32_aligned_release:
6066 ; -O1: ldxr w8, [x0]
6068 ; -O1: csel w9, w8, w1, hi
6069 ; -O1: stlxr w10, w9, [x0]
6070 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
6074 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6075 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
6076 ; -O0: subs w9, w0, w8
6077 ; -O0: csel w1, w0, w8, hi
6078 ; -O0: bl __aarch64_cas4_acq_rel
6079 ; -O0: subs w8, w0, w8
6081 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
6082 ; -O1: ldaxr w8, [x0]
6084 ; -O1: csel w9, w8, w1, hi
6085 ; -O1: stlxr w10, w9, [x0]
6086 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
6090 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6091 ; -O0-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
6092 ; -O0: subs w9, w0, w8
6093 ; -O0: csel w1, w0, w8, hi
6094 ; -O0: bl __aarch64_cas4_acq_rel
6095 ; -O0: subs w8, w0, w8
6097 ; -O1-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
6098 ; -O1: ldaxr w8, [x0]
6100 ; -O1: csel w9, w8, w1, hi
6101 ; -O1: stlxr w10, w9, [x0]
6102 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
6106 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6107 ; -O0-LABEL: atomicrmw_umax_i64_aligned_monotonic:
6108 ; -O0: subs x9, x0, x8
6109 ; -O0: csel x1, x0, x8, hi
6110 ; -O0: bl __aarch64_cas8_relax
6111 ; -O0: subs x8, x0, x8
6113 ; -O1-LABEL: atomicrmw_umax_i64_aligned_monotonic:
6114 ; -O1: ldxr x0, [x8]
6116 ; -O1: csel x9, x0, x1, hi
6117 ; -O1: stxr w10, x9, [x8]
6118 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
6122 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
6123 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acquire:
6124 ; -O0: subs x9, x0, x8
6125 ; -O0: csel x1, x0, x8, hi
6126 ; -O0: bl __aarch64_cas8_acq
6127 ; -O0: subs x8, x0, x8
6129 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acquire:
6130 ; -O1: ldaxr x0, [x8]
6132 ; -O1: csel x9, x0, x1, hi
6133 ; -O1: stxr w10, x9, [x8]
6134 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
6138 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
6139 ; -O0-LABEL: atomicrmw_umax_i64_aligned_release:
6140 ; -O0: subs x9, x0, x8
6141 ; -O0: csel x1, x0, x8, hi
6142 ; -O0: bl __aarch64_cas8_rel
6143 ; -O0: subs x8, x0, x8
6145 ; -O1-LABEL: atomicrmw_umax_i64_aligned_release:
6146 ; -O1: ldxr x0, [x8]
6148 ; -O1: csel x9, x0, x1, hi
6149 ; -O1: stlxr w10, x9, [x8]
6150 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
6154 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6155 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
6156 ; -O0: subs x9, x0, x8
6157 ; -O0: csel x1, x0, x8, hi
6158 ; -O0: bl __aarch64_cas8_acq_rel
6159 ; -O0: subs x8, x0, x8
6161 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
6162 ; -O1: ldaxr x0, [x8]
6164 ; -O1: csel x9, x0, x1, hi
6165 ; -O1: stlxr w10, x9, [x8]
6166 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
6170 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6171 ; -O0-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
6172 ; -O0: subs x9, x0, x8
6173 ; -O0: csel x1, x0, x8, hi
6174 ; -O0: bl __aarch64_cas8_acq_rel
6175 ; -O0: subs x8, x0, x8
6177 ; -O1-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
6178 ; -O1: ldaxr x0, [x8]
6180 ; -O1: csel x9, x0, x1, hi
6181 ; -O1: stlxr w10, x9, [x8]
6182 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
6186 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6187 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
6188 ; -O0: subs x8, x8, x9
6189 ; -O0: subs x8, x8, x11
6190 ; -O0: subs x12, x12, x9
6191 ; -O0: csel w10, w8, w10, eq
6192 ; -O0: ands w12, w10, #0x1
6193 ; -O0: csel x2, x8, x11, ne
6194 ; -O0: ands w10, w10, #0x1
6195 ; -O0: csel x3, x8, x9, ne
6196 ; -O0: bl __aarch64_cas16_relax
6197 ; -O0: eor x8, x0, x8
6198 ; -O0: eor x9, x1, x9
6199 ; -O0: orr x8, x8, x9
6200 ; -O0: subs x8, x8, #0
6202 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
6203 ; -O1: ldxp x0, x1, [x8]
6205 ; -O1: csel x9, x1, x3, lo
6206 ; -O1: csel x10, x0, x2, lo
6207 ; -O1: stxp w11, x10, x9, [x8]
6208 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
6212 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
6213 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
6214 ; -O0: subs x8, x8, x9
6215 ; -O0: subs x8, x8, x11
6216 ; -O0: subs x12, x12, x9
6217 ; -O0: csel w10, w8, w10, eq
6218 ; -O0: ands w12, w10, #0x1
6219 ; -O0: csel x2, x8, x11, ne
6220 ; -O0: ands w10, w10, #0x1
6221 ; -O0: csel x3, x8, x9, ne
6222 ; -O0: bl __aarch64_cas16_acq
6223 ; -O0: eor x8, x0, x8
6224 ; -O0: eor x9, x1, x9
6225 ; -O0: orr x8, x8, x9
6226 ; -O0: subs x8, x8, #0
6228 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
6229 ; -O1: ldaxp x0, x1, [x8]
6231 ; -O1: csel x9, x1, x3, lo
6232 ; -O1: csel x10, x0, x2, lo
6233 ; -O1: stxp w11, x10, x9, [x8]
6234 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
6238 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
6239 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
6240 ; -O0: subs x8, x8, x9
6241 ; -O0: subs x8, x8, x11
6242 ; -O0: subs x12, x12, x9
6243 ; -O0: csel w10, w8, w10, eq
6244 ; -O0: ands w12, w10, #0x1
6245 ; -O0: csel x2, x8, x11, ne
6246 ; -O0: ands w10, w10, #0x1
6247 ; -O0: csel x3, x8, x9, ne
6248 ; -O0: bl __aarch64_cas16_rel
6249 ; -O0: eor x8, x0, x8
6250 ; -O0: eor x9, x1, x9
6251 ; -O0: orr x8, x8, x9
6252 ; -O0: subs x8, x8, #0
6254 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
6255 ; -O1: ldxp x0, x1, [x8]
6257 ; -O1: csel x9, x1, x3, lo
6258 ; -O1: csel x10, x0, x2, lo
6259 ; -O1: stlxp w11, x10, x9, [x8]
6260 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
6264 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6265 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
6266 ; -O0: subs x8, x8, x9
6267 ; -O0: subs x8, x8, x11
6268 ; -O0: subs x12, x12, x9
6269 ; -O0: csel w10, w8, w10, eq
6270 ; -O0: ands w12, w10, #0x1
6271 ; -O0: csel x2, x8, x11, ne
6272 ; -O0: ands w10, w10, #0x1
6273 ; -O0: csel x3, x8, x9, ne
6274 ; -O0: bl __aarch64_cas16_acq_rel
6275 ; -O0: eor x8, x0, x8
6276 ; -O0: eor x9, x1, x9
6277 ; -O0: orr x8, x8, x9
6278 ; -O0: subs x8, x8, #0
6280 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
6281 ; -O1: ldaxp x0, x1, [x8]
6283 ; -O1: csel x9, x1, x3, lo
6284 ; -O1: csel x10, x0, x2, lo
6285 ; -O1: stlxp w11, x10, x9, [x8]
6286 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
6290 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6291 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
6292 ; -O0: subs x8, x8, x9
6293 ; -O0: subs x8, x8, x11
6294 ; -O0: subs x12, x12, x9
6295 ; -O0: csel w10, w8, w10, eq
6296 ; -O0: ands w12, w10, #0x1
6297 ; -O0: csel x2, x8, x11, ne
6298 ; -O0: ands w10, w10, #0x1
6299 ; -O0: csel x3, x8, x9, ne
6300 ; -O0: bl __aarch64_cas16_acq_rel
6301 ; -O0: eor x8, x0, x8
6302 ; -O0: eor x9, x1, x9
6303 ; -O0: orr x8, x8, x9
6304 ; -O0: subs x8, x8, #0
6306 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
6307 ; -O1: ldaxp x0, x1, [x8]
6309 ; -O1: csel x9, x1, x3, lo
6310 ; -O1: csel x10, x0, x2, lo
6311 ; -O1: stlxp w11, x10, x9, [x8]
6312 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
6316 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6317 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
6318 ; -O0: and w9, w0, #0xff
6319 ; -O0: subs w9, w9, w8, uxtb
6320 ; -O0: csel w1, w0, w8, hi
6321 ; -O0: bl __aarch64_cas1_relax
6322 ; -O0: and w8, w0, #0xff
6323 ; -O0: subs w8, w8, w9, uxtb
6325 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
6326 ; -O1: and w9, w1, #0xff
6327 ; -O1: ldxrb w8, [x0]
6329 ; -O1: csel w10, w8, w9, hi
6330 ; -O1: stxrb w11, w10, [x0]
6331 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
6335 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6336 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acquire:
6337 ; -O0: and w9, w0, #0xff
6338 ; -O0: subs w9, w9, w8, uxtb
6339 ; -O0: csel w1, w0, w8, hi
6340 ; -O0: bl __aarch64_cas1_acq
6341 ; -O0: and w8, w0, #0xff
6342 ; -O0: subs w8, w8, w9, uxtb
6344 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acquire:
6345 ; -O1: and w9, w1, #0xff
6346 ; -O1: ldaxrb w8, [x0]
6348 ; -O1: csel w10, w8, w9, hi
6349 ; -O1: stxrb w11, w10, [x0]
6350 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
6354 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
6355 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_release:
6356 ; -O0: and w9, w0, #0xff
6357 ; -O0: subs w9, w9, w8, uxtb
6358 ; -O0: csel w1, w0, w8, hi
6359 ; -O0: bl __aarch64_cas1_rel
6360 ; -O0: and w8, w0, #0xff
6361 ; -O0: subs w8, w8, w9, uxtb
6363 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_release:
6364 ; -O1: and w9, w1, #0xff
6365 ; -O1: ldxrb w8, [x0]
6367 ; -O1: csel w10, w8, w9, hi
6368 ; -O1: stlxrb w11, w10, [x0]
6369 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
6373 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6374 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
6375 ; -O0: and w9, w0, #0xff
6376 ; -O0: subs w9, w9, w8, uxtb
6377 ; -O0: csel w1, w0, w8, hi
6378 ; -O0: bl __aarch64_cas1_acq_rel
6379 ; -O0: and w8, w0, #0xff
6380 ; -O0: subs w8, w8, w9, uxtb
6382 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
6383 ; -O1: and w9, w1, #0xff
6384 ; -O1: ldaxrb w8, [x0]
6386 ; -O1: csel w10, w8, w9, hi
6387 ; -O1: stlxrb w11, w10, [x0]
6388 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
6392 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6393 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
6394 ; -O0: and w9, w0, #0xff
6395 ; -O0: subs w9, w9, w8, uxtb
6396 ; -O0: csel w1, w0, w8, hi
6397 ; -O0: bl __aarch64_cas1_acq_rel
6398 ; -O0: and w8, w0, #0xff
6399 ; -O0: subs w8, w8, w9, uxtb
6401 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
6402 ; -O1: and w9, w1, #0xff
6403 ; -O1: ldaxrb w8, [x0]
6405 ; -O1: csel w10, w8, w9, hi
6406 ; -O1: stlxrb w11, w10, [x0]
6407 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
6411 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6412 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
6413 ; -O0: subs w10, w10, w8, uxth
6414 ; -O0: csel w8, w9, w8, hi
6415 ; -O0: bl __atomic_compare_exchange
6417 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
6418 ; -O1: and w8, w0, #0xffff
6419 ; -O1: cmp w8, w20, uxth
6420 ; -O1: csel w8, w0, w20, hi
6421 ; -O1: bl __atomic_compare_exchange
6422 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
6426 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6427 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
6428 ; -O0: subs w10, w10, w8, uxth
6429 ; -O0: csel w8, w9, w8, hi
6430 ; -O0: bl __atomic_compare_exchange
6432 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
6433 ; -O1: and w8, w0, #0xffff
6434 ; -O1: cmp w8, w20, uxth
6435 ; -O1: csel w8, w0, w20, hi
6436 ; -O1: bl __atomic_compare_exchange
6437 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
6441 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
6442 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
6443 ; -O0: subs w10, w10, w8, uxth
6444 ; -O0: csel w8, w9, w8, hi
6445 ; -O0: bl __atomic_compare_exchange
6447 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
6448 ; -O1: and w8, w0, #0xffff
6449 ; -O1: cmp w8, w20, uxth
6450 ; -O1: csel w8, w0, w20, hi
6451 ; -O1: bl __atomic_compare_exchange
6452 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
6456 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6457 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
6458 ; -O0: subs w10, w10, w8, uxth
6459 ; -O0: csel w8, w9, w8, hi
6460 ; -O0: bl __atomic_compare_exchange
6462 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
6463 ; -O1: and w8, w0, #0xffff
6464 ; -O1: cmp w8, w20, uxth
6465 ; -O1: csel w8, w0, w20, hi
6466 ; -O1: bl __atomic_compare_exchange
6467 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
6471 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6472 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
6473 ; -O0: subs w10, w10, w8, uxth
6474 ; -O0: csel w8, w9, w8, hi
6475 ; -O0: bl __atomic_compare_exchange
6477 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
6478 ; -O1: and w8, w0, #0xffff
6479 ; -O1: cmp w8, w20, uxth
6480 ; -O1: csel w8, w0, w20, hi
6481 ; -O1: bl __atomic_compare_exchange
6482 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
6486 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6487 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
6488 ; -O0: subs w10, w9, w8
6489 ; -O0: csel w8, w9, w8, hi
6490 ; -O0: bl __atomic_compare_exchange
6492 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
6494 ; -O1: csel w8, w0, w20, hi
6495 ; -O1: bl __atomic_compare_exchange
6496 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
6500 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6501 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
6502 ; -O0: subs w10, w9, w8
6503 ; -O0: csel w8, w9, w8, hi
6504 ; -O0: bl __atomic_compare_exchange
6506 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
6508 ; -O1: csel w8, w0, w20, hi
6509 ; -O1: bl __atomic_compare_exchange
6510 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
6514 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
6515 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
6516 ; -O0: subs w10, w9, w8
6517 ; -O0: csel w8, w9, w8, hi
6518 ; -O0: bl __atomic_compare_exchange
6520 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
6522 ; -O1: csel w8, w0, w20, hi
6523 ; -O1: bl __atomic_compare_exchange
6524 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
6528 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6529 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
6530 ; -O0: subs w10, w9, w8
6531 ; -O0: csel w8, w9, w8, hi
6532 ; -O0: bl __atomic_compare_exchange
6534 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
6536 ; -O1: csel w8, w0, w20, hi
6537 ; -O1: bl __atomic_compare_exchange
6538 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
6542 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6543 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
6544 ; -O0: subs w10, w9, w8
6545 ; -O0: csel w8, w9, w8, hi
6546 ; -O0: bl __atomic_compare_exchange
6548 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
6550 ; -O1: csel w8, w0, w20, hi
6551 ; -O1: bl __atomic_compare_exchange
6552 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
6556 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6557 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
6558 ; -O0: subs x10, x9, x8
6559 ; -O0: csel x8, x9, x8, hi
6560 ; -O0: bl __atomic_compare_exchange
6562 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
6564 ; -O1: csel x8, x0, x20, hi
6565 ; -O1: bl __atomic_compare_exchange
6566 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
6570 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6571 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
6572 ; -O0: subs x10, x9, x8
6573 ; -O0: csel x8, x9, x8, hi
6574 ; -O0: bl __atomic_compare_exchange
6576 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
6578 ; -O1: csel x8, x0, x20, hi
6579 ; -O1: bl __atomic_compare_exchange
6580 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
6584 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
6585 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
6586 ; -O0: subs x10, x9, x8
6587 ; -O0: csel x8, x9, x8, hi
6588 ; -O0: bl __atomic_compare_exchange
6590 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
6592 ; -O1: csel x8, x0, x20, hi
6593 ; -O1: bl __atomic_compare_exchange
6594 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
6598 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6599 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
6600 ; -O0: subs x10, x9, x8
6601 ; -O0: csel x8, x9, x8, hi
6602 ; -O0: bl __atomic_compare_exchange
6604 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
6606 ; -O1: csel x8, x0, x20, hi
6607 ; -O1: bl __atomic_compare_exchange
6608 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
6612 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6613 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
6614 ; -O0: subs x10, x9, x8
6615 ; -O0: csel x8, x9, x8, hi
6616 ; -O0: bl __atomic_compare_exchange
6618 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
6620 ; -O1: csel x8, x0, x20, hi
6621 ; -O1: bl __atomic_compare_exchange
6622 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
6626 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6627 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
6628 ; -O0: subs x8, x8, x10
6629 ; -O0: subs x8, x8, x9
6630 ; -O0: subs x12, x12, x10
6631 ; -O0: csel w11, w8, w11, eq
6632 ; -O0: ands w12, w11, #0x1
6633 ; -O0: csel x9, x8, x9, ne
6634 ; -O0: ands w11, w11, #0x1
6635 ; -O0: csel x8, x8, x10, ne
6636 ; -O0: bl __atomic_compare_exchange
6638 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
6639 ; -O1: ldp x0, x1, [x0]
6641 ; -O1: csel x8, x1, x19, lo
6642 ; -O1: csel x9, x0, x21, lo
6643 ; -O1: bl __atomic_compare_exchange
6644 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
6648 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6649 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
6650 ; -O0: subs x8, x8, x10
6651 ; -O0: subs x8, x8, x9
6652 ; -O0: subs x12, x12, x10
6653 ; -O0: csel w11, w8, w11, eq
6654 ; -O0: ands w12, w11, #0x1
6655 ; -O0: csel x9, x8, x9, ne
6656 ; -O0: ands w11, w11, #0x1
6657 ; -O0: csel x8, x8, x10, ne
6658 ; -O0: bl __atomic_compare_exchange
6660 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
6661 ; -O1: ldp x0, x1, [x0]
6663 ; -O1: csel x8, x1, x19, lo
6664 ; -O1: csel x9, x0, x21, lo
6665 ; -O1: bl __atomic_compare_exchange
6666 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
6670 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
6671 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
6672 ; -O0: subs x8, x8, x10
6673 ; -O0: subs x8, x8, x9
6674 ; -O0: subs x12, x12, x10
6675 ; -O0: csel w11, w8, w11, eq
6676 ; -O0: ands w12, w11, #0x1
6677 ; -O0: csel x9, x8, x9, ne
6678 ; -O0: ands w11, w11, #0x1
6679 ; -O0: csel x8, x8, x10, ne
6680 ; -O0: bl __atomic_compare_exchange
6682 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
6683 ; -O1: ldp x0, x1, [x0]
6685 ; -O1: csel x8, x1, x19, lo
6686 ; -O1: csel x9, x0, x21, lo
6687 ; -O1: bl __atomic_compare_exchange
6688 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
6692 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6693 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
6694 ; -O0: subs x8, x8, x10
6695 ; -O0: subs x8, x8, x9
6696 ; -O0: subs x12, x12, x10
6697 ; -O0: csel w11, w8, w11, eq
6698 ; -O0: ands w12, w11, #0x1
6699 ; -O0: csel x9, x8, x9, ne
6700 ; -O0: ands w11, w11, #0x1
6701 ; -O0: csel x8, x8, x10, ne
6702 ; -O0: bl __atomic_compare_exchange
6704 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
6705 ; -O1: ldp x0, x1, [x0]
6707 ; -O1: csel x8, x1, x19, lo
6708 ; -O1: csel x9, x0, x21, lo
6709 ; -O1: bl __atomic_compare_exchange
6710 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
6714 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6715 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
6716 ; -O0: subs x8, x8, x10
6717 ; -O0: subs x8, x8, x9
6718 ; -O0: subs x12, x12, x10
6719 ; -O0: csel w11, w8, w11, eq
6720 ; -O0: ands w12, w11, #0x1
6721 ; -O0: csel x9, x8, x9, ne
6722 ; -O0: ands w11, w11, #0x1
6723 ; -O0: csel x8, x8, x10, ne
6724 ; -O0: bl __atomic_compare_exchange
6726 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
6727 ; -O1: ldp x0, x1, [x0]
6729 ; -O1: csel x8, x1, x19, lo
6730 ; -O1: csel x9, x0, x21, lo
6731 ; -O1: bl __atomic_compare_exchange
6732 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
6736 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
6737 ; -O0-LABEL: atomicrmw_umin_i8_aligned_monotonic:
6738 ; -O0: and w9, w0, #0xff
6739 ; -O0: subs w9, w9, w8, uxtb
6740 ; -O0: csel w1, w0, w8, ls
6741 ; -O0: bl __aarch64_cas1_relax
6742 ; -O0: and w8, w0, #0xff
6743 ; -O0: subs w8, w8, w9, uxtb
6745 ; -O1-LABEL: atomicrmw_umin_i8_aligned_monotonic:
6746 ; -O1: and w9, w1, #0xff
6747 ; -O1: ldxrb w8, [x0]
6749 ; -O1: csel w10, w8, w9, ls
6750 ; -O1: stxrb w11, w10, [x0]
6751 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
6755 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
6756 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acquire:
6757 ; -O0: and w9, w0, #0xff
6758 ; -O0: subs w9, w9, w8, uxtb
6759 ; -O0: csel w1, w0, w8, ls
6760 ; -O0: bl __aarch64_cas1_acq
6761 ; -O0: and w8, w0, #0xff
6762 ; -O0: subs w8, w8, w9, uxtb
6764 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acquire:
6765 ; -O1: and w9, w1, #0xff
6766 ; -O1: ldaxrb w8, [x0]
6768 ; -O1: csel w10, w8, w9, ls
6769 ; -O1: stxrb w11, w10, [x0]
6770 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
6774 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
6775 ; -O0-LABEL: atomicrmw_umin_i8_aligned_release:
6776 ; -O0: and w9, w0, #0xff
6777 ; -O0: subs w9, w9, w8, uxtb
6778 ; -O0: csel w1, w0, w8, ls
6779 ; -O0: bl __aarch64_cas1_rel
6780 ; -O0: and w8, w0, #0xff
6781 ; -O0: subs w8, w8, w9, uxtb
6783 ; -O1-LABEL: atomicrmw_umin_i8_aligned_release:
6784 ; -O1: and w9, w1, #0xff
6785 ; -O1: ldxrb w8, [x0]
6787 ; -O1: csel w10, w8, w9, ls
6788 ; -O1: stlxrb w11, w10, [x0]
6789 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
6793 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
6794 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
6795 ; -O0: and w9, w0, #0xff
6796 ; -O0: subs w9, w9, w8, uxtb
6797 ; -O0: csel w1, w0, w8, ls
6798 ; -O0: bl __aarch64_cas1_acq_rel
6799 ; -O0: and w8, w0, #0xff
6800 ; -O0: subs w8, w8, w9, uxtb
6802 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
6803 ; -O1: and w9, w1, #0xff
6804 ; -O1: ldaxrb w8, [x0]
6806 ; -O1: csel w10, w8, w9, ls
6807 ; -O1: stlxrb w11, w10, [x0]
6808 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
6812 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
6813 ; -O0-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
6814 ; -O0: and w9, w0, #0xff
6815 ; -O0: subs w9, w9, w8, uxtb
6816 ; -O0: csel w1, w0, w8, ls
6817 ; -O0: bl __aarch64_cas1_acq_rel
6818 ; -O0: and w8, w0, #0xff
6819 ; -O0: subs w8, w8, w9, uxtb
6821 ; -O1-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
6822 ; -O1: and w9, w1, #0xff
6823 ; -O1: ldaxrb w8, [x0]
6825 ; -O1: csel w10, w8, w9, ls
6826 ; -O1: stlxrb w11, w10, [x0]
6827 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
6831 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
6832 ; -O0-LABEL: atomicrmw_umin_i16_aligned_monotonic:
6833 ; -O0: subs w9, w9, w8, uxth
6834 ; -O0: csel w1, w0, w8, ls
6835 ; -O0: bl __aarch64_cas2_relax
6836 ; -O0: subs w8, w8, w0, uxth
6838 ; -O1-LABEL: atomicrmw_umin_i16_aligned_monotonic:
6839 ; -O1: and w9, w1, #0xffff
6840 ; -O1: ldxrh w8, [x0]
6842 ; -O1: csel w10, w8, w9, ls
6843 ; -O1: stxrh w11, w10, [x0]
6844 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
6848 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
6849 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acquire:
6850 ; -O0: subs w9, w9, w8, uxth
6851 ; -O0: csel w1, w0, w8, ls
6852 ; -O0: bl __aarch64_cas2_acq
6853 ; -O0: subs w8, w8, w0, uxth
6855 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acquire:
6856 ; -O1: and w9, w1, #0xffff
6857 ; -O1: ldaxrh w8, [x0]
6859 ; -O1: csel w10, w8, w9, ls
6860 ; -O1: stxrh w11, w10, [x0]
6861 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
6865 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
6866 ; -O0-LABEL: atomicrmw_umin_i16_aligned_release:
6867 ; -O0: subs w9, w9, w8, uxth
6868 ; -O0: csel w1, w0, w8, ls
6869 ; -O0: bl __aarch64_cas2_rel
6870 ; -O0: subs w8, w8, w0, uxth
6872 ; -O1-LABEL: atomicrmw_umin_i16_aligned_release:
6873 ; -O1: and w9, w1, #0xffff
6874 ; -O1: ldxrh w8, [x0]
6876 ; -O1: csel w10, w8, w9, ls
6877 ; -O1: stlxrh w11, w10, [x0]
6878 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
6882 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6883 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
6884 ; -O0: subs w9, w9, w8, uxth
6885 ; -O0: csel w1, w0, w8, ls
6886 ; -O0: bl __aarch64_cas2_acq_rel
6887 ; -O0: subs w8, w8, w0, uxth
6889 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
6890 ; -O1: and w9, w1, #0xffff
6891 ; -O1: ldaxrh w8, [x0]
6893 ; -O1: csel w10, w8, w9, ls
6894 ; -O1: stlxrh w11, w10, [x0]
6895 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
6899 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6900 ; -O0-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
6901 ; -O0: subs w9, w9, w8, uxth
6902 ; -O0: csel w1, w0, w8, ls
6903 ; -O0: bl __aarch64_cas2_acq_rel
6904 ; -O0: subs w8, w8, w0, uxth
6906 ; -O1-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
6907 ; -O1: and w9, w1, #0xffff
6908 ; -O1: ldaxrh w8, [x0]
6910 ; -O1: csel w10, w8, w9, ls
6911 ; -O1: stlxrh w11, w10, [x0]
6912 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
6916 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6917 ; -O0-LABEL: atomicrmw_umin_i32_aligned_monotonic:
6918 ; -O0: subs w9, w0, w8
6919 ; -O0: csel w1, w0, w8, ls
6920 ; -O0: bl __aarch64_cas4_relax
6921 ; -O0: subs w8, w0, w8
6923 ; -O1-LABEL: atomicrmw_umin_i32_aligned_monotonic:
6924 ; -O1: ldxr w8, [x0]
6926 ; -O1: csel w9, w8, w1, ls
6927 ; -O1: stxr w10, w9, [x0]
6928 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
6932 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
6933 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acquire:
6934 ; -O0: subs w9, w0, w8
6935 ; -O0: csel w1, w0, w8, ls
6936 ; -O0: bl __aarch64_cas4_acq
6937 ; -O0: subs w8, w0, w8
6939 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acquire:
6940 ; -O1: ldaxr w8, [x0]
6942 ; -O1: csel w9, w8, w1, ls
6943 ; -O1: stxr w10, w9, [x0]
6944 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
6948 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
6949 ; -O0-LABEL: atomicrmw_umin_i32_aligned_release:
6950 ; -O0: subs w9, w0, w8
6951 ; -O0: csel w1, w0, w8, ls
6952 ; -O0: bl __aarch64_cas4_rel
6953 ; -O0: subs w8, w0, w8
6955 ; -O1-LABEL: atomicrmw_umin_i32_aligned_release:
6956 ; -O1: ldxr w8, [x0]
6958 ; -O1: csel w9, w8, w1, ls
6959 ; -O1: stlxr w10, w9, [x0]
6960 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
6964 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6965 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
6966 ; -O0: subs w9, w0, w8
6967 ; -O0: csel w1, w0, w8, ls
6968 ; -O0: bl __aarch64_cas4_acq_rel
6969 ; -O0: subs w8, w0, w8
6971 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
6972 ; -O1: ldaxr w8, [x0]
6974 ; -O1: csel w9, w8, w1, ls
6975 ; -O1: stlxr w10, w9, [x0]
6976 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
6980 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6981 ; -O0-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
6982 ; -O0: subs w9, w0, w8
6983 ; -O0: csel w1, w0, w8, ls
6984 ; -O0: bl __aarch64_cas4_acq_rel
6985 ; -O0: subs w8, w0, w8
6987 ; -O1-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
6988 ; -O1: ldaxr w8, [x0]
6990 ; -O1: csel w9, w8, w1, ls
6991 ; -O1: stlxr w10, w9, [x0]
6992 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
6996 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6997 ; -O0-LABEL: atomicrmw_umin_i64_aligned_monotonic:
6998 ; -O0: subs x9, x0, x8
6999 ; -O0: csel x1, x0, x8, ls
7000 ; -O0: bl __aarch64_cas8_relax
7001 ; -O0: subs x8, x0, x8
7003 ; -O1-LABEL: atomicrmw_umin_i64_aligned_monotonic:
7004 ; -O1: ldxr x0, [x8]
7006 ; -O1: csel x9, x0, x1, ls
7007 ; -O1: stxr w10, x9, [x8]
7008 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
7012 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
7013 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acquire:
7014 ; -O0: subs x9, x0, x8
7015 ; -O0: csel x1, x0, x8, ls
7016 ; -O0: bl __aarch64_cas8_acq
7017 ; -O0: subs x8, x0, x8
7019 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acquire:
7020 ; -O1: ldaxr x0, [x8]
7022 ; -O1: csel x9, x0, x1, ls
7023 ; -O1: stxr w10, x9, [x8]
7024 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
7028 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
7029 ; -O0-LABEL: atomicrmw_umin_i64_aligned_release:
7030 ; -O0: subs x9, x0, x8
7031 ; -O0: csel x1, x0, x8, ls
7032 ; -O0: bl __aarch64_cas8_rel
7033 ; -O0: subs x8, x0, x8
7035 ; -O1-LABEL: atomicrmw_umin_i64_aligned_release:
7036 ; -O1: ldxr x0, [x8]
7038 ; -O1: csel x9, x0, x1, ls
7039 ; -O1: stlxr w10, x9, [x8]
7040 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
7044 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
7045 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
7046 ; -O0: subs x9, x0, x8
7047 ; -O0: csel x1, x0, x8, ls
7048 ; -O0: bl __aarch64_cas8_acq_rel
7049 ; -O0: subs x8, x0, x8
7051 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
7052 ; -O1: ldaxr x0, [x8]
7054 ; -O1: csel x9, x0, x1, ls
7055 ; -O1: stlxr w10, x9, [x8]
7056 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
7060 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
7061 ; -O0-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
7062 ; -O0: subs x9, x0, x8
7063 ; -O0: csel x1, x0, x8, ls
7064 ; -O0: bl __aarch64_cas8_acq_rel
7065 ; -O0: subs x8, x0, x8
7067 ; -O1-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
7068 ; -O1: ldaxr x0, [x8]
7070 ; -O1: csel x9, x0, x1, ls
7071 ; -O1: stlxr w10, x9, [x8]
7072 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
7076 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
7077 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
7078 ; -O0: subs x8, x8, x9
7079 ; -O0: subs x8, x8, x11
7080 ; -O0: subs x12, x12, x9
7081 ; -O0: csel w10, w8, w10, eq
7082 ; -O0: ands w12, w10, #0x1
7083 ; -O0: csel x2, x8, x11, ne
7084 ; -O0: ands w10, w10, #0x1
7085 ; -O0: csel x3, x8, x9, ne
7086 ; -O0: bl __aarch64_cas16_relax
7087 ; -O0: eor x8, x0, x8
7088 ; -O0: eor x9, x1, x9
7089 ; -O0: orr x8, x8, x9
7090 ; -O0: subs x8, x8, #0
7092 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
7093 ; -O1: ldxp x0, x1, [x8]
7095 ; -O1: csel x9, x1, x3, hs
7096 ; -O1: csel x10, x0, x2, hs
7097 ; -O1: stxp w11, x10, x9, [x8]
7098 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
7102 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
7103 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
7104 ; -O0: subs x8, x8, x9
7105 ; -O0: subs x8, x8, x11
7106 ; -O0: subs x12, x12, x9
7107 ; -O0: csel w10, w8, w10, eq
7108 ; -O0: ands w12, w10, #0x1
7109 ; -O0: csel x2, x8, x11, ne
7110 ; -O0: ands w10, w10, #0x1
7111 ; -O0: csel x3, x8, x9, ne
7112 ; -O0: bl __aarch64_cas16_acq
7113 ; -O0: eor x8, x0, x8
7114 ; -O0: eor x9, x1, x9
7115 ; -O0: orr x8, x8, x9
7116 ; -O0: subs x8, x8, #0
7118 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
7119 ; -O1: ldaxp x0, x1, [x8]
7121 ; -O1: csel x9, x1, x3, hs
7122 ; -O1: csel x10, x0, x2, hs
7123 ; -O1: stxp w11, x10, x9, [x8]
7124 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
7128 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
7129 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
7130 ; -O0: subs x8, x8, x9
7131 ; -O0: subs x8, x8, x11
7132 ; -O0: subs x12, x12, x9
7133 ; -O0: csel w10, w8, w10, eq
7134 ; -O0: ands w12, w10, #0x1
7135 ; -O0: csel x2, x8, x11, ne
7136 ; -O0: ands w10, w10, #0x1
7137 ; -O0: csel x3, x8, x9, ne
7138 ; -O0: bl __aarch64_cas16_rel
7139 ; -O0: eor x8, x0, x8
7140 ; -O0: eor x9, x1, x9
7141 ; -O0: orr x8, x8, x9
7142 ; -O0: subs x8, x8, #0
7144 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
7145 ; -O1: ldxp x0, x1, [x8]
7147 ; -O1: csel x9, x1, x3, hs
7148 ; -O1: csel x10, x0, x2, hs
7149 ; -O1: stlxp w11, x10, x9, [x8]
7150 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
7154 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
7155 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
7156 ; -O0: subs x8, x8, x9
7157 ; -O0: subs x8, x8, x11
7158 ; -O0: subs x12, x12, x9
7159 ; -O0: csel w10, w8, w10, eq
7160 ; -O0: ands w12, w10, #0x1
7161 ; -O0: csel x2, x8, x11, ne
7162 ; -O0: ands w10, w10, #0x1
7163 ; -O0: csel x3, x8, x9, ne
7164 ; -O0: bl __aarch64_cas16_acq_rel
7165 ; -O0: eor x8, x0, x8
7166 ; -O0: eor x9, x1, x9
7167 ; -O0: orr x8, x8, x9
7168 ; -O0: subs x8, x8, #0
7170 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
7171 ; -O1: ldaxp x0, x1, [x8]
7173 ; -O1: csel x9, x1, x3, hs
7174 ; -O1: csel x10, x0, x2, hs
7175 ; -O1: stlxp w11, x10, x9, [x8]
7176 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
7180 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
7181 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
7182 ; -O0: subs x8, x8, x9
7183 ; -O0: subs x8, x8, x11
7184 ; -O0: subs x12, x12, x9
7185 ; -O0: csel w10, w8, w10, eq
7186 ; -O0: ands w12, w10, #0x1
7187 ; -O0: csel x2, x8, x11, ne
7188 ; -O0: ands w10, w10, #0x1
7189 ; -O0: csel x3, x8, x9, ne
7190 ; -O0: bl __aarch64_cas16_acq_rel
7191 ; -O0: eor x8, x0, x8
7192 ; -O0: eor x9, x1, x9
7193 ; -O0: orr x8, x8, x9
7194 ; -O0: subs x8, x8, #0
7196 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
7197 ; -O1: ldaxp x0, x1, [x8]
7199 ; -O1: csel x9, x1, x3, hs
7200 ; -O1: csel x10, x0, x2, hs
7201 ; -O1: stlxp w11, x10, x9, [x8]
7202 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
7206 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
7207 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
7208 ; -O0: and w9, w0, #0xff
7209 ; -O0: subs w9, w9, w8, uxtb
7210 ; -O0: csel w1, w0, w8, ls
7211 ; -O0: bl __aarch64_cas1_relax
7212 ; -O0: and w8, w0, #0xff
7213 ; -O0: subs w8, w8, w9, uxtb
7215 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
7216 ; -O1: and w9, w1, #0xff
7217 ; -O1: ldxrb w8, [x0]
7219 ; -O1: csel w10, w8, w9, ls
7220 ; -O1: stxrb w11, w10, [x0]
7221 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
7225 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
7226 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acquire:
7227 ; -O0: and w9, w0, #0xff
7228 ; -O0: subs w9, w9, w8, uxtb
7229 ; -O0: csel w1, w0, w8, ls
7230 ; -O0: bl __aarch64_cas1_acq
7231 ; -O0: and w8, w0, #0xff
7232 ; -O0: subs w8, w8, w9, uxtb
7234 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acquire:
7235 ; -O1: and w9, w1, #0xff
7236 ; -O1: ldaxrb w8, [x0]
7238 ; -O1: csel w10, w8, w9, ls
7239 ; -O1: stxrb w11, w10, [x0]
7240 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
7244 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
7245 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_release:
7246 ; -O0: and w9, w0, #0xff
7247 ; -O0: subs w9, w9, w8, uxtb
7248 ; -O0: csel w1, w0, w8, ls
7249 ; -O0: bl __aarch64_cas1_rel
7250 ; -O0: and w8, w0, #0xff
7251 ; -O0: subs w8, w8, w9, uxtb
7253 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_release:
7254 ; -O1: and w9, w1, #0xff
7255 ; -O1: ldxrb w8, [x0]
7257 ; -O1: csel w10, w8, w9, ls
7258 ; -O1: stlxrb w11, w10, [x0]
7259 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
7263 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
7264 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
7265 ; -O0: and w9, w0, #0xff
7266 ; -O0: subs w9, w9, w8, uxtb
7267 ; -O0: csel w1, w0, w8, ls
7268 ; -O0: bl __aarch64_cas1_acq_rel
7269 ; -O0: and w8, w0, #0xff
7270 ; -O0: subs w8, w8, w9, uxtb
7272 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
7273 ; -O1: and w9, w1, #0xff
7274 ; -O1: ldaxrb w8, [x0]
7276 ; -O1: csel w10, w8, w9, ls
7277 ; -O1: stlxrb w11, w10, [x0]
7278 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
7282 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
7283 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
7284 ; -O0: and w9, w0, #0xff
7285 ; -O0: subs w9, w9, w8, uxtb
7286 ; -O0: csel w1, w0, w8, ls
7287 ; -O0: bl __aarch64_cas1_acq_rel
7288 ; -O0: and w8, w0, #0xff
7289 ; -O0: subs w8, w8, w9, uxtb
7291 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
7292 ; -O1: and w9, w1, #0xff
7293 ; -O1: ldaxrb w8, [x0]
7295 ; -O1: csel w10, w8, w9, ls
7296 ; -O1: stlxrb w11, w10, [x0]
7297 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
7301 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
7302 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
7303 ; -O0: subs w10, w10, w8, uxth
7304 ; -O0: csel w8, w9, w8, ls
7305 ; -O0: bl __atomic_compare_exchange
7307 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
7308 ; -O1: and w8, w0, #0xffff
7309 ; -O1: cmp w8, w20, uxth
7310 ; -O1: csel w8, w0, w20, ls
7311 ; -O1: bl __atomic_compare_exchange
7312 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
7316 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
7317 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
7318 ; -O0: subs w10, w10, w8, uxth
7319 ; -O0: csel w8, w9, w8, ls
7320 ; -O0: bl __atomic_compare_exchange
7322 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
7323 ; -O1: and w8, w0, #0xffff
7324 ; -O1: cmp w8, w20, uxth
7325 ; -O1: csel w8, w0, w20, ls
7326 ; -O1: bl __atomic_compare_exchange
7327 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
7331 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
7332 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
7333 ; -O0: subs w10, w10, w8, uxth
7334 ; -O0: csel w8, w9, w8, ls
7335 ; -O0: bl __atomic_compare_exchange
7337 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
7338 ; -O1: and w8, w0, #0xffff
7339 ; -O1: cmp w8, w20, uxth
7340 ; -O1: csel w8, w0, w20, ls
7341 ; -O1: bl __atomic_compare_exchange
7342 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
7346 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
7347 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
7348 ; -O0: subs w10, w10, w8, uxth
7349 ; -O0: csel w8, w9, w8, ls
7350 ; -O0: bl __atomic_compare_exchange
7352 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
7353 ; -O1: and w8, w0, #0xffff
7354 ; -O1: cmp w8, w20, uxth
7355 ; -O1: csel w8, w0, w20, ls
7356 ; -O1: bl __atomic_compare_exchange
7357 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
7361 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
7362 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
7363 ; -O0: subs w10, w10, w8, uxth
7364 ; -O0: csel w8, w9, w8, ls
7365 ; -O0: bl __atomic_compare_exchange
7367 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
7368 ; -O1: and w8, w0, #0xffff
7369 ; -O1: cmp w8, w20, uxth
7370 ; -O1: csel w8, w0, w20, ls
7371 ; -O1: bl __atomic_compare_exchange
7372 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
7376 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
7377 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
7378 ; -O0: subs w10, w9, w8
7379 ; -O0: csel w8, w9, w8, ls
7380 ; -O0: bl __atomic_compare_exchange
7382 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
7384 ; -O1: csel w8, w0, w20, ls
7385 ; -O1: bl __atomic_compare_exchange
7386 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
7390 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
7391 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
7392 ; -O0: subs w10, w9, w8
7393 ; -O0: csel w8, w9, w8, ls
7394 ; -O0: bl __atomic_compare_exchange
7396 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
7398 ; -O1: csel w8, w0, w20, ls
7399 ; -O1: bl __atomic_compare_exchange
7400 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
7404 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
7405 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
7406 ; -O0: subs w10, w9, w8
7407 ; -O0: csel w8, w9, w8, ls
7408 ; -O0: bl __atomic_compare_exchange
7410 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
7412 ; -O1: csel w8, w0, w20, ls
7413 ; -O1: bl __atomic_compare_exchange
7414 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
7418 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
7419 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
7420 ; -O0: subs w10, w9, w8
7421 ; -O0: csel w8, w9, w8, ls
7422 ; -O0: bl __atomic_compare_exchange
7424 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
7426 ; -O1: csel w8, w0, w20, ls
7427 ; -O1: bl __atomic_compare_exchange
7428 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
7432 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
7433 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
7434 ; -O0: subs w10, w9, w8
7435 ; -O0: csel w8, w9, w8, ls
7436 ; -O0: bl __atomic_compare_exchange
7438 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
7440 ; -O1: csel w8, w0, w20, ls
7441 ; -O1: bl __atomic_compare_exchange
7442 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
7446 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
7447 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
7448 ; -O0: subs x10, x9, x8
7449 ; -O0: csel x8, x9, x8, ls
7450 ; -O0: bl __atomic_compare_exchange
7452 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
7454 ; -O1: csel x8, x0, x20, ls
7455 ; -O1: bl __atomic_compare_exchange
7456 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
7460 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
7461 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
7462 ; -O0: subs x10, x9, x8
7463 ; -O0: csel x8, x9, x8, ls
7464 ; -O0: bl __atomic_compare_exchange
7466 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
7468 ; -O1: csel x8, x0, x20, ls
7469 ; -O1: bl __atomic_compare_exchange
7470 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
7474 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
7475 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
7476 ; -O0: subs x10, x9, x8
7477 ; -O0: csel x8, x9, x8, ls
7478 ; -O0: bl __atomic_compare_exchange
7480 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
7482 ; -O1: csel x8, x0, x20, ls
7483 ; -O1: bl __atomic_compare_exchange
7484 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
7488 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
7489 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
7490 ; -O0: subs x10, x9, x8
7491 ; -O0: csel x8, x9, x8, ls
7492 ; -O0: bl __atomic_compare_exchange
7494 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
7496 ; -O1: csel x8, x0, x20, ls
7497 ; -O1: bl __atomic_compare_exchange
7498 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
7502 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
7503 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
7504 ; -O0: subs x10, x9, x8
7505 ; -O0: csel x8, x9, x8, ls
7506 ; -O0: bl __atomic_compare_exchange
7508 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
7510 ; -O1: csel x8, x0, x20, ls
7511 ; -O1: bl __atomic_compare_exchange
7512 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
7516 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
7517 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
7518 ; -O0: subs x8, x8, x10
7519 ; -O0: subs x8, x8, x9
7520 ; -O0: subs x12, x12, x10
7521 ; -O0: csel w11, w8, w11, eq
7522 ; -O0: ands w12, w11, #0x1
7523 ; -O0: csel x9, x8, x9, ne
7524 ; -O0: ands w11, w11, #0x1
7525 ; -O0: csel x8, x8, x10, ne
7526 ; -O0: bl __atomic_compare_exchange
7528 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
7529 ; -O1: ldp x0, x1, [x0]
7531 ; -O1: csel x8, x1, x19, hs
7532 ; -O1: csel x9, x0, x21, hs
7533 ; -O1: bl __atomic_compare_exchange
7534 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
7538 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
7539 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
7540 ; -O0: subs x8, x8, x10
7541 ; -O0: subs x8, x8, x9
7542 ; -O0: subs x12, x12, x10
7543 ; -O0: csel w11, w8, w11, eq
7544 ; -O0: ands w12, w11, #0x1
7545 ; -O0: csel x9, x8, x9, ne
7546 ; -O0: ands w11, w11, #0x1
7547 ; -O0: csel x8, x8, x10, ne
7548 ; -O0: bl __atomic_compare_exchange
7550 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
7551 ; -O1: ldp x0, x1, [x0]
7553 ; -O1: csel x8, x1, x19, hs
7554 ; -O1: csel x9, x0, x21, hs
7555 ; -O1: bl __atomic_compare_exchange
7556 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
7560 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
7561 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
7562 ; -O0: subs x8, x8, x10
7563 ; -O0: subs x8, x8, x9
7564 ; -O0: subs x12, x12, x10
7565 ; -O0: csel w11, w8, w11, eq
7566 ; -O0: ands w12, w11, #0x1
7567 ; -O0: csel x9, x8, x9, ne
7568 ; -O0: ands w11, w11, #0x1
7569 ; -O0: csel x8, x8, x10, ne
7570 ; -O0: bl __atomic_compare_exchange
7572 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
7573 ; -O1: ldp x0, x1, [x0]
7575 ; -O1: csel x8, x1, x19, hs
7576 ; -O1: csel x9, x0, x21, hs
7577 ; -O1: bl __atomic_compare_exchange
7578 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
7582 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
7583 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
7584 ; -O0: subs x8, x8, x10
7585 ; -O0: subs x8, x8, x9
7586 ; -O0: subs x12, x12, x10
7587 ; -O0: csel w11, w8, w11, eq
7588 ; -O0: ands w12, w11, #0x1
7589 ; -O0: csel x9, x8, x9, ne
7590 ; -O0: ands w11, w11, #0x1
7591 ; -O0: csel x8, x8, x10, ne
7592 ; -O0: bl __atomic_compare_exchange
7594 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
7595 ; -O1: ldp x0, x1, [x0]
7597 ; -O1: csel x8, x1, x19, hs
7598 ; -O1: csel x9, x0, x21, hs
7599 ; -O1: bl __atomic_compare_exchange
7600 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
7604 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
7605 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
7606 ; -O0: subs x8, x8, x10
7607 ; -O0: subs x8, x8, x9
7608 ; -O0: subs x12, x12, x10
7609 ; -O0: csel w11, w8, w11, eq
7610 ; -O0: ands w12, w11, #0x1
7611 ; -O0: csel x9, x8, x9, ne
7612 ; -O0: ands w11, w11, #0x1
7613 ; -O0: csel x8, x8, x10, ne
7614 ; -O0: bl __atomic_compare_exchange
7616 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
7617 ; -O1: ldp x0, x1, [x0]
7619 ; -O1: csel x8, x1, x19, hs
7620 ; -O1: csel x9, x0, x21, hs
7621 ; -O1: bl __atomic_compare_exchange
7622 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1