1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+outline-atomics -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -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: subs x10, x10, x11
150 ; -O0: ccmp x8, x9, #0, eq
152 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
153 ; -O1: ldxp x1, x8, [x0]
154 ; -O1: stxp w9, x3, x2, [x0]
155 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
159 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
160 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
161 ; -O0: bl __aarch64_cas16_acq
162 ; -O0: subs x10, x10, x11
163 ; -O0: ccmp x8, x9, #0, eq
165 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
166 ; -O1: ldaxp x1, x8, [x0]
167 ; -O1: stxp w9, x3, x2, [x0]
168 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
172 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
173 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
174 ; -O0: bl __aarch64_cas16_rel
175 ; -O0: subs x10, x10, x11
176 ; -O0: ccmp x8, x9, #0, eq
178 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
179 ; -O1: ldxp x1, x8, [x0]
180 ; -O1: stlxp w9, x3, x2, [x0]
181 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
185 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
186 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
187 ; -O0: bl __aarch64_cas16_acq_rel
188 ; -O0: subs x10, x10, x11
189 ; -O0: ccmp x8, x9, #0, eq
191 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
192 ; -O1: ldaxp x1, x8, [x0]
193 ; -O1: stlxp w9, x3, x2, [x0]
194 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
198 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
199 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
200 ; -O0: bl __aarch64_cas16_acq_rel
201 ; -O0: subs x10, x10, x11
202 ; -O0: ccmp x8, x9, #0, eq
204 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
205 ; -O1: ldaxp x1, x8, [x0]
206 ; -O1: stlxp w9, x3, x2, [x0]
207 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
211 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
212 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
213 ; CHECK: bl __aarch64_swp1_relax
214 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
218 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
219 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
220 ; CHECK: bl __aarch64_swp1_acq
221 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
225 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
226 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_release:
227 ; CHECK: bl __aarch64_swp1_rel
228 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
232 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
233 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
234 ; CHECK: bl __aarch64_swp1_acq_rel
235 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
239 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
240 ; CHECK-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
241 ; CHECK: bl __aarch64_swp1_acq_rel
242 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
246 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
247 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
248 ; CHECK: bl __atomic_exchange
249 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
253 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
254 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
255 ; CHECK: bl __atomic_exchange
256 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
260 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
261 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
262 ; CHECK: bl __atomic_exchange
263 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
267 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
268 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
269 ; CHECK: bl __atomic_exchange
270 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
274 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
275 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
276 ; CHECK: bl __atomic_exchange
277 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
281 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
282 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
283 ; CHECK: bl __atomic_exchange
284 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
288 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
289 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
290 ; CHECK: bl __atomic_exchange
291 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
295 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
296 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
297 ; CHECK: bl __atomic_exchange
298 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
302 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
303 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
304 ; CHECK: bl __atomic_exchange
305 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
309 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
310 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
311 ; CHECK: bl __atomic_exchange
312 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
316 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
317 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
318 ; CHECK: bl __atomic_exchange
319 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
323 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
324 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
325 ; CHECK: bl __atomic_exchange
326 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
330 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
331 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
332 ; CHECK: bl __atomic_exchange
333 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
337 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
338 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
339 ; CHECK: bl __atomic_exchange
340 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
344 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
345 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
346 ; CHECK: bl __atomic_exchange
347 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
351 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
352 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
353 ; CHECK: bl __atomic_exchange
354 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
358 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
359 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
360 ; CHECK: bl __atomic_exchange
361 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
365 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
366 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
367 ; CHECK: bl __atomic_exchange
368 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
372 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
373 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
374 ; CHECK: bl __atomic_exchange
375 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
379 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
380 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
381 ; CHECK: bl __atomic_exchange
382 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
386 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
387 ; CHECK-LABEL: atomicrmw_add_i8_aligned_monotonic:
388 ; CHECK: bl __aarch64_ldadd1_relax
389 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
393 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
394 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acquire:
395 ; CHECK: bl __aarch64_ldadd1_acq
396 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
400 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
401 ; CHECK-LABEL: atomicrmw_add_i8_aligned_release:
402 ; CHECK: bl __aarch64_ldadd1_rel
403 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
407 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
408 ; CHECK-LABEL: atomicrmw_add_i8_aligned_acq_rel:
409 ; CHECK: bl __aarch64_ldadd1_acq_rel
410 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
414 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
415 ; CHECK-LABEL: atomicrmw_add_i8_aligned_seq_cst:
416 ; CHECK: bl __aarch64_ldadd1_acq_rel
417 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
421 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
422 ; CHECK-LABEL: atomicrmw_add_i16_aligned_monotonic:
423 ; CHECK: bl __aarch64_ldadd2_relax
424 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
428 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
429 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acquire:
430 ; CHECK: bl __aarch64_ldadd2_acq
431 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
435 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
436 ; CHECK-LABEL: atomicrmw_add_i16_aligned_release:
437 ; CHECK: bl __aarch64_ldadd2_rel
438 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
442 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
443 ; CHECK-LABEL: atomicrmw_add_i16_aligned_acq_rel:
444 ; CHECK: bl __aarch64_ldadd2_acq_rel
445 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
449 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
450 ; CHECK-LABEL: atomicrmw_add_i16_aligned_seq_cst:
451 ; CHECK: bl __aarch64_ldadd2_acq_rel
452 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
456 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
457 ; CHECK-LABEL: atomicrmw_add_i32_aligned_monotonic:
458 ; CHECK: bl __aarch64_ldadd4_relax
459 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
463 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
464 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acquire:
465 ; CHECK: bl __aarch64_ldadd4_acq
466 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
470 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
471 ; CHECK-LABEL: atomicrmw_add_i32_aligned_release:
472 ; CHECK: bl __aarch64_ldadd4_rel
473 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
477 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
478 ; CHECK-LABEL: atomicrmw_add_i32_aligned_acq_rel:
479 ; CHECK: bl __aarch64_ldadd4_acq_rel
480 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
484 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
485 ; CHECK-LABEL: atomicrmw_add_i32_aligned_seq_cst:
486 ; CHECK: bl __aarch64_ldadd4_acq_rel
487 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
491 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
492 ; CHECK-LABEL: atomicrmw_add_i64_aligned_monotonic:
493 ; CHECK: bl __aarch64_ldadd8_relax
494 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
498 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
499 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acquire:
500 ; CHECK: bl __aarch64_ldadd8_acq
501 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
505 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
506 ; CHECK-LABEL: atomicrmw_add_i64_aligned_release:
507 ; CHECK: bl __aarch64_ldadd8_rel
508 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
512 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
513 ; CHECK-LABEL: atomicrmw_add_i64_aligned_acq_rel:
514 ; CHECK: bl __aarch64_ldadd8_acq_rel
515 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
519 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
520 ; CHECK-LABEL: atomicrmw_add_i64_aligned_seq_cst:
521 ; CHECK: bl __aarch64_ldadd8_acq_rel
522 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
526 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
527 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
528 ; -O0: adds x3, x1, x9
529 ; -O0: bl __aarch64_cas16_relax
530 ; -O0: subs x10, x10, x11
531 ; -O0: ccmp x8, x9, #0, eq
533 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
534 ; -O1: ldxp x1, x0, [x8]
535 ; -O1: adds x9, x1, x3
536 ; -O1: stxp w11, x9, x10, [x8]
537 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
541 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
542 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
543 ; -O0: adds x3, x1, x9
544 ; -O0: bl __aarch64_cas16_acq
545 ; -O0: subs x10, x10, x11
546 ; -O0: ccmp x8, x9, #0, eq
548 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
549 ; -O1: ldaxp x1, x0, [x8]
550 ; -O1: adds x9, x1, x3
551 ; -O1: stxp w11, x9, x10, [x8]
552 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
556 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
557 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
558 ; -O0: adds x3, x1, x9
559 ; -O0: bl __aarch64_cas16_rel
560 ; -O0: subs x10, x10, x11
561 ; -O0: ccmp x8, x9, #0, eq
563 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
564 ; -O1: ldxp x1, x0, [x8]
565 ; -O1: adds x9, x1, x3
566 ; -O1: stlxp w11, x9, x10, [x8]
567 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
571 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
572 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
573 ; -O0: adds x3, x1, x9
574 ; -O0: bl __aarch64_cas16_acq_rel
575 ; -O0: subs x10, x10, x11
576 ; -O0: ccmp x8, x9, #0, eq
578 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
579 ; -O1: ldaxp x1, x0, [x8]
580 ; -O1: adds x9, x1, x3
581 ; -O1: stlxp w11, x9, x10, [x8]
582 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
586 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
587 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
588 ; -O0: adds x3, x1, x9
589 ; -O0: bl __aarch64_cas16_acq_rel
590 ; -O0: subs x10, x10, x11
591 ; -O0: ccmp x8, x9, #0, eq
593 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
594 ; -O1: ldaxp x1, x0, [x8]
595 ; -O1: adds x9, x1, x3
596 ; -O1: stlxp w11, x9, x10, [x8]
597 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
601 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
602 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_monotonic:
603 ; CHECK: bl __aarch64_ldadd1_relax
604 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
608 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
609 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acquire:
610 ; CHECK: bl __aarch64_ldadd1_acq
611 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
615 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
616 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_release:
617 ; CHECK: bl __aarch64_ldadd1_rel
618 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
622 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
623 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
624 ; CHECK: bl __aarch64_ldadd1_acq_rel
625 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
629 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
630 ; CHECK-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
631 ; CHECK: bl __aarch64_ldadd1_acq_rel
632 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
636 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
637 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
638 ; -O0: add w8, w9, w8
639 ; -O0: bl __atomic_compare_exchange
641 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
642 ; -O1: add w8, w0, w20
643 ; -O1: bl __atomic_compare_exchange
644 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
648 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
649 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
650 ; -O0: add w8, w9, w8
651 ; -O0: bl __atomic_compare_exchange
653 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
654 ; -O1: add w8, w0, w20
655 ; -O1: bl __atomic_compare_exchange
656 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
660 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
661 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
662 ; -O0: add w8, w9, w8
663 ; -O0: bl __atomic_compare_exchange
665 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
666 ; -O1: add w8, w0, w20
667 ; -O1: bl __atomic_compare_exchange
668 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
672 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
673 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
674 ; -O0: add w8, w9, w8
675 ; -O0: bl __atomic_compare_exchange
677 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
678 ; -O1: add w8, w0, w20
679 ; -O1: bl __atomic_compare_exchange
680 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
684 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
685 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
686 ; -O0: add w8, w9, w8
687 ; -O0: bl __atomic_compare_exchange
689 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
690 ; -O1: add w8, w0, w20
691 ; -O1: bl __atomic_compare_exchange
692 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
696 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
697 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
698 ; -O0: add w8, w9, w8
699 ; -O0: bl __atomic_compare_exchange
701 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
702 ; -O1: add w8, w0, w20
703 ; -O1: bl __atomic_compare_exchange
704 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
708 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
709 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
710 ; -O0: add w8, w9, w8
711 ; -O0: bl __atomic_compare_exchange
713 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
714 ; -O1: add w8, w0, w20
715 ; -O1: bl __atomic_compare_exchange
716 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
720 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
721 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
722 ; -O0: add w8, w9, w8
723 ; -O0: bl __atomic_compare_exchange
725 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
726 ; -O1: add w8, w0, w20
727 ; -O1: bl __atomic_compare_exchange
728 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
732 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
733 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
734 ; -O0: add w8, w9, w8
735 ; -O0: bl __atomic_compare_exchange
737 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
738 ; -O1: add w8, w0, w20
739 ; -O1: bl __atomic_compare_exchange
740 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
744 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
745 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
746 ; -O0: add w8, w9, w8
747 ; -O0: bl __atomic_compare_exchange
749 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
750 ; -O1: add w8, w0, w20
751 ; -O1: bl __atomic_compare_exchange
752 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
756 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
757 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
758 ; -O0: add x8, x9, x8
759 ; -O0: bl __atomic_compare_exchange
761 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
762 ; -O1: add x8, x0, x20
763 ; -O1: bl __atomic_compare_exchange
764 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
768 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
769 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
770 ; -O0: add x8, x9, x8
771 ; -O0: bl __atomic_compare_exchange
773 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
774 ; -O1: add x8, x0, x20
775 ; -O1: bl __atomic_compare_exchange
776 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
780 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
781 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
782 ; -O0: add x8, x9, x8
783 ; -O0: bl __atomic_compare_exchange
785 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
786 ; -O1: add x8, x0, x20
787 ; -O1: bl __atomic_compare_exchange
788 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
792 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
793 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
794 ; -O0: add x8, x9, x8
795 ; -O0: bl __atomic_compare_exchange
797 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
798 ; -O1: add x8, x0, x20
799 ; -O1: bl __atomic_compare_exchange
800 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
804 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
805 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
806 ; -O0: add x8, x9, x8
807 ; -O0: bl __atomic_compare_exchange
809 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
810 ; -O1: add x8, x0, x20
811 ; -O1: bl __atomic_compare_exchange
812 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
816 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
817 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
818 ; -O0: adds x9, x10, x9
819 ; -O0: bl __atomic_compare_exchange
821 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
822 ; -O1: ldp x0, x1, [x0]
823 ; -O1: adds x8, x1, x19
824 ; -O1: bl __atomic_compare_exchange
825 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
829 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
830 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
831 ; -O0: adds x9, x10, x9
832 ; -O0: bl __atomic_compare_exchange
834 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
835 ; -O1: ldp x0, x1, [x0]
836 ; -O1: adds x8, x1, x19
837 ; -O1: bl __atomic_compare_exchange
838 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
842 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
843 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
844 ; -O0: adds x9, x10, x9
845 ; -O0: bl __atomic_compare_exchange
847 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
848 ; -O1: ldp x0, x1, [x0]
849 ; -O1: adds x8, x1, x19
850 ; -O1: bl __atomic_compare_exchange
851 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
855 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
856 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
857 ; -O0: adds x9, x10, x9
858 ; -O0: bl __atomic_compare_exchange
860 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
861 ; -O1: ldp x0, x1, [x0]
862 ; -O1: adds x8, x1, x19
863 ; -O1: bl __atomic_compare_exchange
864 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
868 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
869 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
870 ; -O0: adds x9, x10, x9
871 ; -O0: bl __atomic_compare_exchange
873 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
874 ; -O1: ldp x0, x1, [x0]
875 ; -O1: adds x8, x1, x19
876 ; -O1: bl __atomic_compare_exchange
877 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
881 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
882 ; -O0-LABEL: atomicrmw_sub_i8_aligned_monotonic:
883 ; -O0: subs w0, w8, w9
884 ; -O0: bl __aarch64_ldadd1_relax
886 ; -O1-LABEL: atomicrmw_sub_i8_aligned_monotonic:
887 ; -O1: bl __aarch64_ldadd1_relax
888 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
892 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
893 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acquire:
894 ; -O0: subs w0, w8, w9
895 ; -O0: bl __aarch64_ldadd1_acq
897 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acquire:
898 ; -O1: bl __aarch64_ldadd1_acq
899 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
903 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
904 ; -O0-LABEL: atomicrmw_sub_i8_aligned_release:
905 ; -O0: subs w0, w8, w9
906 ; -O0: bl __aarch64_ldadd1_rel
908 ; -O1-LABEL: atomicrmw_sub_i8_aligned_release:
909 ; -O1: bl __aarch64_ldadd1_rel
910 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
914 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
915 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
916 ; -O0: subs w0, w8, w9
917 ; -O0: bl __aarch64_ldadd1_acq_rel
919 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
920 ; -O1: bl __aarch64_ldadd1_acq_rel
921 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
925 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
926 ; -O0-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
927 ; -O0: subs w0, w8, w9
928 ; -O0: bl __aarch64_ldadd1_acq_rel
930 ; -O1-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
931 ; -O1: bl __aarch64_ldadd1_acq_rel
932 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
936 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
937 ; -O0-LABEL: atomicrmw_sub_i16_aligned_monotonic:
938 ; -O0: subs w0, w8, w9
939 ; -O0: bl __aarch64_ldadd2_relax
941 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
942 ; -O1: bl __aarch64_ldadd2_relax
943 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
947 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
948 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
949 ; -O0: subs w0, w8, w9
950 ; -O0: bl __aarch64_ldadd2_acq
952 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
953 ; -O1: bl __aarch64_ldadd2_acq
954 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
958 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
959 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
960 ; -O0: subs w0, w8, w9
961 ; -O0: bl __aarch64_ldadd2_rel
963 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
964 ; -O1: bl __aarch64_ldadd2_rel
965 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
969 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
970 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
971 ; -O0: subs w0, w8, w9
972 ; -O0: bl __aarch64_ldadd2_acq_rel
974 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
975 ; -O1: bl __aarch64_ldadd2_acq_rel
976 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
980 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
981 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
982 ; -O0: subs w0, w8, w9
983 ; -O0: bl __aarch64_ldadd2_acq_rel
985 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
986 ; -O1: bl __aarch64_ldadd2_acq_rel
987 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
991 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
992 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
993 ; -O0: subs w0, w8, w9
994 ; -O0: bl __aarch64_ldadd4_relax
996 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
997 ; -O1: bl __aarch64_ldadd4_relax
998 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1002 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1003 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
1004 ; -O0: subs w0, w8, w9
1005 ; -O0: bl __aarch64_ldadd4_acq
1007 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1008 ; -O1: bl __aarch64_ldadd4_acq
1009 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1013 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1014 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1015 ; -O0: subs w0, w8, w9
1016 ; -O0: bl __aarch64_ldadd4_rel
1018 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1019 ; -O1: bl __aarch64_ldadd4_rel
1020 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1024 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1025 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1026 ; -O0: subs w0, w8, w9
1027 ; -O0: bl __aarch64_ldadd4_acq_rel
1029 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1030 ; -O1: bl __aarch64_ldadd4_acq_rel
1031 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1035 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1036 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1037 ; -O0: subs w0, w8, w9
1038 ; -O0: bl __aarch64_ldadd4_acq_rel
1040 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1041 ; -O1: bl __aarch64_ldadd4_acq_rel
1042 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1046 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1047 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1048 ; -O0: subs x0, x8, x9
1049 ; -O0: bl __aarch64_ldadd8_relax
1051 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1052 ; -O1: bl __aarch64_ldadd8_relax
1053 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1057 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1058 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1059 ; -O0: subs x0, x8, x9
1060 ; -O0: bl __aarch64_ldadd8_acq
1062 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1063 ; -O1: bl __aarch64_ldadd8_acq
1064 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1068 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1069 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1070 ; -O0: subs x0, x8, x9
1071 ; -O0: bl __aarch64_ldadd8_rel
1073 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1074 ; -O1: bl __aarch64_ldadd8_rel
1075 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1079 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1080 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1081 ; -O0: subs x0, x8, x9
1082 ; -O0: bl __aarch64_ldadd8_acq_rel
1084 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1085 ; -O1: bl __aarch64_ldadd8_acq_rel
1086 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1090 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1091 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1092 ; -O0: subs x0, x8, x9
1093 ; -O0: bl __aarch64_ldadd8_acq_rel
1095 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1096 ; -O1: bl __aarch64_ldadd8_acq_rel
1097 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1101 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1102 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1103 ; -O0: subs x3, x1, x9
1104 ; -O0: bl __aarch64_cas16_relax
1105 ; -O0: subs x10, x10, x11
1106 ; -O0: ccmp x8, x9, #0, eq
1108 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1109 ; -O1: ldxp x1, x0, [x8]
1110 ; -O1: subs x9, x1, x3
1111 ; -O1: stxp w11, x9, x10, [x8]
1112 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1116 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1117 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1118 ; -O0: subs x3, x1, x9
1119 ; -O0: bl __aarch64_cas16_acq
1120 ; -O0: subs x10, x10, x11
1121 ; -O0: ccmp x8, x9, #0, eq
1123 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1124 ; -O1: ldaxp x1, x0, [x8]
1125 ; -O1: subs x9, x1, x3
1126 ; -O1: stxp w11, x9, x10, [x8]
1127 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1131 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1132 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1133 ; -O0: subs x3, x1, x9
1134 ; -O0: bl __aarch64_cas16_rel
1135 ; -O0: subs x10, x10, x11
1136 ; -O0: ccmp x8, x9, #0, eq
1138 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1139 ; -O1: ldxp x1, x0, [x8]
1140 ; -O1: subs x9, x1, x3
1141 ; -O1: stlxp w11, x9, x10, [x8]
1142 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1146 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1147 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1148 ; -O0: subs x3, x1, x9
1149 ; -O0: bl __aarch64_cas16_acq_rel
1150 ; -O0: subs x10, x10, x11
1151 ; -O0: ccmp x8, x9, #0, eq
1153 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1154 ; -O1: ldaxp x1, x0, [x8]
1155 ; -O1: subs x9, x1, x3
1156 ; -O1: stlxp w11, x9, x10, [x8]
1157 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1161 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1162 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1163 ; -O0: subs x3, x1, x9
1164 ; -O0: bl __aarch64_cas16_acq_rel
1165 ; -O0: subs x10, x10, x11
1166 ; -O0: ccmp x8, x9, #0, eq
1168 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1169 ; -O1: ldaxp x1, x0, [x8]
1170 ; -O1: subs x9, x1, x3
1171 ; -O1: stlxp w11, x9, x10, [x8]
1172 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1176 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1177 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1178 ; -O0: subs w0, w8, w9
1179 ; -O0: bl __aarch64_ldadd1_relax
1181 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1182 ; -O1: bl __aarch64_ldadd1_relax
1183 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1187 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1188 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1189 ; -O0: subs w0, w8, w9
1190 ; -O0: bl __aarch64_ldadd1_acq
1192 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1193 ; -O1: bl __aarch64_ldadd1_acq
1194 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1198 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1199 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1200 ; -O0: subs w0, w8, w9
1201 ; -O0: bl __aarch64_ldadd1_rel
1203 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1204 ; -O1: bl __aarch64_ldadd1_rel
1205 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1209 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1210 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1211 ; -O0: subs w0, w8, w9
1212 ; -O0: bl __aarch64_ldadd1_acq_rel
1214 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1215 ; -O1: bl __aarch64_ldadd1_acq_rel
1216 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1220 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1221 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1222 ; -O0: subs w0, w8, w9
1223 ; -O0: bl __aarch64_ldadd1_acq_rel
1225 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1226 ; -O1: bl __aarch64_ldadd1_acq_rel
1227 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1231 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1232 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1233 ; -O0: subs w8, w9, w8
1234 ; -O0: bl __atomic_compare_exchange
1236 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1237 ; -O1: sub w8, w0, w20
1238 ; -O1: bl __atomic_compare_exchange
1239 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1243 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1244 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1245 ; -O0: subs w8, w9, w8
1246 ; -O0: bl __atomic_compare_exchange
1248 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1249 ; -O1: sub w8, w0, w20
1250 ; -O1: bl __atomic_compare_exchange
1251 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1255 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1256 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1257 ; -O0: subs w8, w9, w8
1258 ; -O0: bl __atomic_compare_exchange
1260 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1261 ; -O1: sub w8, w0, w20
1262 ; -O1: bl __atomic_compare_exchange
1263 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1267 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1268 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1269 ; -O0: subs w8, w9, w8
1270 ; -O0: bl __atomic_compare_exchange
1272 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1273 ; -O1: sub w8, w0, w20
1274 ; -O1: bl __atomic_compare_exchange
1275 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1279 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1280 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1281 ; -O0: subs w8, w9, w8
1282 ; -O0: bl __atomic_compare_exchange
1284 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1285 ; -O1: sub w8, w0, w20
1286 ; -O1: bl __atomic_compare_exchange
1287 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1291 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1292 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1293 ; -O0: subs w8, w9, w8
1294 ; -O0: bl __atomic_compare_exchange
1296 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1297 ; -O1: sub w8, w0, w20
1298 ; -O1: bl __atomic_compare_exchange
1299 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1303 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1304 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1305 ; -O0: subs w8, w9, w8
1306 ; -O0: bl __atomic_compare_exchange
1308 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1309 ; -O1: sub w8, w0, w20
1310 ; -O1: bl __atomic_compare_exchange
1311 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1315 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1316 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1317 ; -O0: subs w8, w9, w8
1318 ; -O0: bl __atomic_compare_exchange
1320 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1321 ; -O1: sub w8, w0, w20
1322 ; -O1: bl __atomic_compare_exchange
1323 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1327 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1328 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1329 ; -O0: subs w8, w9, w8
1330 ; -O0: bl __atomic_compare_exchange
1332 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1333 ; -O1: sub w8, w0, w20
1334 ; -O1: bl __atomic_compare_exchange
1335 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1339 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1340 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1341 ; -O0: subs w8, w9, w8
1342 ; -O0: bl __atomic_compare_exchange
1344 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1345 ; -O1: sub w8, w0, w20
1346 ; -O1: bl __atomic_compare_exchange
1347 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
1351 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1352 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1353 ; -O0: subs x8, x9, x8
1354 ; -O0: bl __atomic_compare_exchange
1356 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
1357 ; -O1: sub x8, x0, x20
1358 ; -O1: bl __atomic_compare_exchange
1359 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
1363 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1364 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1365 ; -O0: subs x8, x9, x8
1366 ; -O0: bl __atomic_compare_exchange
1368 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
1369 ; -O1: sub x8, x0, x20
1370 ; -O1: bl __atomic_compare_exchange
1371 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
1375 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
1376 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
1377 ; -O0: subs x8, x9, x8
1378 ; -O0: bl __atomic_compare_exchange
1380 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
1381 ; -O1: sub x8, x0, x20
1382 ; -O1: bl __atomic_compare_exchange
1383 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
1387 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1388 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1389 ; -O0: subs x8, x9, x8
1390 ; -O0: bl __atomic_compare_exchange
1392 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
1393 ; -O1: sub x8, x0, x20
1394 ; -O1: bl __atomic_compare_exchange
1395 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
1399 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1400 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1401 ; -O0: subs x8, x9, x8
1402 ; -O0: bl __atomic_compare_exchange
1404 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
1405 ; -O1: sub x8, x0, x20
1406 ; -O1: bl __atomic_compare_exchange
1407 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
1411 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1412 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1413 ; -O0: subs x9, x10, x9
1414 ; -O0: bl __atomic_compare_exchange
1416 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
1417 ; -O1: ldp x0, x1, [x0]
1418 ; -O1: subs x8, x1, x19
1419 ; -O1: bl __atomic_compare_exchange
1420 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
1424 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1425 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1426 ; -O0: subs x9, x10, x9
1427 ; -O0: bl __atomic_compare_exchange
1429 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
1430 ; -O1: ldp x0, x1, [x0]
1431 ; -O1: subs x8, x1, x19
1432 ; -O1: bl __atomic_compare_exchange
1433 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
1437 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
1438 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
1439 ; -O0: subs x9, x10, x9
1440 ; -O0: bl __atomic_compare_exchange
1442 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
1443 ; -O1: ldp x0, x1, [x0]
1444 ; -O1: subs x8, x1, x19
1445 ; -O1: bl __atomic_compare_exchange
1446 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
1450 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1451 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1452 ; -O0: subs x9, x10, x9
1453 ; -O0: bl __atomic_compare_exchange
1455 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
1456 ; -O1: ldp x0, x1, [x0]
1457 ; -O1: subs x8, x1, x19
1458 ; -O1: bl __atomic_compare_exchange
1459 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
1463 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1464 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1465 ; -O0: subs x9, x10, x9
1466 ; -O0: bl __atomic_compare_exchange
1468 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
1469 ; -O1: ldp x0, x1, [x0]
1470 ; -O1: subs x8, x1, x19
1471 ; -O1: bl __atomic_compare_exchange
1472 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
1476 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1477 ; -O0-LABEL: atomicrmw_and_i8_aligned_monotonic:
1479 ; -O0: bl __aarch64_ldclr1_relax
1481 ; -O1-LABEL: atomicrmw_and_i8_aligned_monotonic:
1483 ; -O1: bl __aarch64_ldclr1_relax
1484 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1488 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
1489 ; -O0-LABEL: atomicrmw_and_i8_aligned_acquire:
1491 ; -O0: bl __aarch64_ldclr1_acq
1493 ; -O1-LABEL: atomicrmw_and_i8_aligned_acquire:
1495 ; -O1: bl __aarch64_ldclr1_acq
1496 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1500 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
1501 ; -O0-LABEL: atomicrmw_and_i8_aligned_release:
1503 ; -O0: bl __aarch64_ldclr1_rel
1505 ; -O1-LABEL: atomicrmw_and_i8_aligned_release:
1507 ; -O1: bl __aarch64_ldclr1_rel
1508 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1512 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1513 ; -O0-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1515 ; -O0: bl __aarch64_ldclr1_acq_rel
1517 ; -O1-LABEL: atomicrmw_and_i8_aligned_acq_rel:
1519 ; -O1: bl __aarch64_ldclr1_acq_rel
1520 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1524 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1525 ; -O0-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1527 ; -O0: bl __aarch64_ldclr1_acq_rel
1529 ; -O1-LABEL: atomicrmw_and_i8_aligned_seq_cst:
1531 ; -O1: bl __aarch64_ldclr1_acq_rel
1532 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1536 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1537 ; -O0-LABEL: atomicrmw_and_i16_aligned_monotonic:
1539 ; -O0: bl __aarch64_ldclr2_relax
1541 ; -O1-LABEL: atomicrmw_and_i16_aligned_monotonic:
1543 ; -O1: bl __aarch64_ldclr2_relax
1544 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
1548 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
1549 ; -O0-LABEL: atomicrmw_and_i16_aligned_acquire:
1551 ; -O0: bl __aarch64_ldclr2_acq
1553 ; -O1-LABEL: atomicrmw_and_i16_aligned_acquire:
1555 ; -O1: bl __aarch64_ldclr2_acq
1556 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
1560 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
1561 ; -O0-LABEL: atomicrmw_and_i16_aligned_release:
1563 ; -O0: bl __aarch64_ldclr2_rel
1565 ; -O1-LABEL: atomicrmw_and_i16_aligned_release:
1567 ; -O1: bl __aarch64_ldclr2_rel
1568 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
1572 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1573 ; -O0-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1575 ; -O0: bl __aarch64_ldclr2_acq_rel
1577 ; -O1-LABEL: atomicrmw_and_i16_aligned_acq_rel:
1579 ; -O1: bl __aarch64_ldclr2_acq_rel
1580 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
1584 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1585 ; -O0-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1587 ; -O0: bl __aarch64_ldclr2_acq_rel
1589 ; -O1-LABEL: atomicrmw_and_i16_aligned_seq_cst:
1591 ; -O1: bl __aarch64_ldclr2_acq_rel
1592 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
1596 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1597 ; -O0-LABEL: atomicrmw_and_i32_aligned_monotonic:
1599 ; -O0: bl __aarch64_ldclr4_relax
1601 ; -O1-LABEL: atomicrmw_and_i32_aligned_monotonic:
1603 ; -O1: bl __aarch64_ldclr4_relax
1604 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
1608 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
1609 ; -O0-LABEL: atomicrmw_and_i32_aligned_acquire:
1611 ; -O0: bl __aarch64_ldclr4_acq
1613 ; -O1-LABEL: atomicrmw_and_i32_aligned_acquire:
1615 ; -O1: bl __aarch64_ldclr4_acq
1616 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
1620 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
1621 ; -O0-LABEL: atomicrmw_and_i32_aligned_release:
1623 ; -O0: bl __aarch64_ldclr4_rel
1625 ; -O1-LABEL: atomicrmw_and_i32_aligned_release:
1627 ; -O1: bl __aarch64_ldclr4_rel
1628 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
1632 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1633 ; -O0-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1635 ; -O0: bl __aarch64_ldclr4_acq_rel
1637 ; -O1-LABEL: atomicrmw_and_i32_aligned_acq_rel:
1639 ; -O1: bl __aarch64_ldclr4_acq_rel
1640 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
1644 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1645 ; -O0-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1647 ; -O0: bl __aarch64_ldclr4_acq_rel
1649 ; -O1-LABEL: atomicrmw_and_i32_aligned_seq_cst:
1651 ; -O1: bl __aarch64_ldclr4_acq_rel
1652 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
1656 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1657 ; -O0-LABEL: atomicrmw_and_i64_aligned_monotonic:
1659 ; -O0: bl __aarch64_ldclr8_relax
1661 ; -O1-LABEL: atomicrmw_and_i64_aligned_monotonic:
1663 ; -O1: bl __aarch64_ldclr8_relax
1664 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
1668 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
1669 ; -O0-LABEL: atomicrmw_and_i64_aligned_acquire:
1671 ; -O0: bl __aarch64_ldclr8_acq
1673 ; -O1-LABEL: atomicrmw_and_i64_aligned_acquire:
1675 ; -O1: bl __aarch64_ldclr8_acq
1676 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
1680 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
1681 ; -O0-LABEL: atomicrmw_and_i64_aligned_release:
1683 ; -O0: bl __aarch64_ldclr8_rel
1685 ; -O1-LABEL: atomicrmw_and_i64_aligned_release:
1687 ; -O1: bl __aarch64_ldclr8_rel
1688 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
1692 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1693 ; -O0-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1695 ; -O0: bl __aarch64_ldclr8_acq_rel
1697 ; -O1-LABEL: atomicrmw_and_i64_aligned_acq_rel:
1699 ; -O1: bl __aarch64_ldclr8_acq_rel
1700 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
1704 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1705 ; -O0-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1707 ; -O0: bl __aarch64_ldclr8_acq_rel
1709 ; -O1-LABEL: atomicrmw_and_i64_aligned_seq_cst:
1711 ; -O1: bl __aarch64_ldclr8_acq_rel
1712 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
1716 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1717 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
1718 ; -O0: and x2, x0, x9
1719 ; -O0: and x3, x1, x8
1720 ; -O0: bl __aarch64_cas16_relax
1721 ; -O0: subs x10, x10, x11
1722 ; -O0: ccmp x8, x9, #0, eq
1724 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
1725 ; -O1: ldxp x1, x0, [x8]
1726 ; -O1: and x9, x0, x2
1727 ; -O1: and x10, x1, x3
1728 ; -O1: stxp w11, x10, x9, [x8]
1729 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
1733 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
1734 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
1735 ; -O0: and x2, x0, x9
1736 ; -O0: and x3, x1, x8
1737 ; -O0: bl __aarch64_cas16_acq
1738 ; -O0: subs x10, x10, x11
1739 ; -O0: ccmp x8, x9, #0, eq
1741 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
1742 ; -O1: ldaxp x1, x0, [x8]
1743 ; -O1: and x9, x0, x2
1744 ; -O1: and x10, x1, x3
1745 ; -O1: stxp w11, x10, x9, [x8]
1746 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
1750 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
1751 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
1752 ; -O0: and x2, x0, x9
1753 ; -O0: and x3, x1, x8
1754 ; -O0: bl __aarch64_cas16_rel
1755 ; -O0: subs x10, x10, x11
1756 ; -O0: ccmp x8, x9, #0, eq
1758 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
1759 ; -O1: ldxp x1, x0, [x8]
1760 ; -O1: and x9, x0, x2
1761 ; -O1: and x10, x1, x3
1762 ; -O1: stlxp w11, x10, x9, [x8]
1763 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
1767 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1768 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1769 ; -O0: and x2, x0, x9
1770 ; -O0: and x3, x1, x8
1771 ; -O0: bl __aarch64_cas16_acq_rel
1772 ; -O0: subs x10, x10, x11
1773 ; -O0: ccmp x8, x9, #0, eq
1775 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
1776 ; -O1: ldaxp x1, x0, [x8]
1777 ; -O1: and x9, x0, x2
1778 ; -O1: and x10, x1, x3
1779 ; -O1: stlxp w11, x10, x9, [x8]
1780 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
1784 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1785 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1786 ; -O0: and x2, x0, x9
1787 ; -O0: and x3, x1, x8
1788 ; -O0: bl __aarch64_cas16_acq_rel
1789 ; -O0: subs x10, x10, x11
1790 ; -O0: ccmp x8, x9, #0, eq
1792 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
1793 ; -O1: ldaxp x1, x0, [x8]
1794 ; -O1: and x9, x0, x2
1795 ; -O1: and x10, x1, x3
1796 ; -O1: stlxp w11, x10, x9, [x8]
1797 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
1801 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1802 ; -O0-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1804 ; -O0: bl __aarch64_ldclr1_relax
1806 ; -O1-LABEL: atomicrmw_and_i8_unaligned_monotonic:
1808 ; -O1: bl __aarch64_ldclr1_relax
1809 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
1813 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1814 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acquire:
1816 ; -O0: bl __aarch64_ldclr1_acq
1818 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acquire:
1820 ; -O1: bl __aarch64_ldclr1_acq
1821 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
1825 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
1826 ; -O0-LABEL: atomicrmw_and_i8_unaligned_release:
1828 ; -O0: bl __aarch64_ldclr1_rel
1830 ; -O1-LABEL: atomicrmw_and_i8_unaligned_release:
1832 ; -O1: bl __aarch64_ldclr1_rel
1833 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
1837 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1838 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1840 ; -O0: bl __aarch64_ldclr1_acq_rel
1842 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
1844 ; -O1: bl __aarch64_ldclr1_acq_rel
1845 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
1849 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1850 ; -O0-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1852 ; -O0: bl __aarch64_ldclr1_acq_rel
1854 ; -O1-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
1856 ; -O1: bl __aarch64_ldclr1_acq_rel
1857 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
1861 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1862 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1863 ; -O0: and w8, w9, w8
1864 ; -O0: bl __atomic_compare_exchange
1866 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
1867 ; -O1: and w8, w0, w20
1868 ; -O1: bl __atomic_compare_exchange
1869 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
1873 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1874 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
1875 ; -O0: and w8, w9, w8
1876 ; -O0: bl __atomic_compare_exchange
1878 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
1879 ; -O1: and w8, w0, w20
1880 ; -O1: bl __atomic_compare_exchange
1881 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
1885 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
1886 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
1887 ; -O0: and w8, w9, w8
1888 ; -O0: bl __atomic_compare_exchange
1890 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
1891 ; -O1: and w8, w0, w20
1892 ; -O1: bl __atomic_compare_exchange
1893 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
1897 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1898 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1899 ; -O0: and w8, w9, w8
1900 ; -O0: bl __atomic_compare_exchange
1902 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
1903 ; -O1: and w8, w0, w20
1904 ; -O1: bl __atomic_compare_exchange
1905 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
1909 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1910 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1911 ; -O0: and w8, w9, w8
1912 ; -O0: bl __atomic_compare_exchange
1914 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
1915 ; -O1: and w8, w0, w20
1916 ; -O1: bl __atomic_compare_exchange
1917 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
1921 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1922 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1923 ; -O0: and w8, w9, w8
1924 ; -O0: bl __atomic_compare_exchange
1926 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
1927 ; -O1: and w8, w0, w20
1928 ; -O1: bl __atomic_compare_exchange
1929 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
1933 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1934 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
1935 ; -O0: and w8, w9, w8
1936 ; -O0: bl __atomic_compare_exchange
1938 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
1939 ; -O1: and w8, w0, w20
1940 ; -O1: bl __atomic_compare_exchange
1941 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
1945 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
1946 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
1947 ; -O0: and w8, w9, w8
1948 ; -O0: bl __atomic_compare_exchange
1950 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
1951 ; -O1: and w8, w0, w20
1952 ; -O1: bl __atomic_compare_exchange
1953 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
1957 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1958 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1959 ; -O0: and w8, w9, w8
1960 ; -O0: bl __atomic_compare_exchange
1962 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
1963 ; -O1: and w8, w0, w20
1964 ; -O1: bl __atomic_compare_exchange
1965 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
1969 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1970 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1971 ; -O0: and w8, w9, w8
1972 ; -O0: bl __atomic_compare_exchange
1974 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
1975 ; -O1: and w8, w0, w20
1976 ; -O1: bl __atomic_compare_exchange
1977 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
1981 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1982 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1983 ; -O0: and x8, x9, x8
1984 ; -O0: bl __atomic_compare_exchange
1986 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
1987 ; -O1: and x8, x0, x20
1988 ; -O1: bl __atomic_compare_exchange
1989 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
1993 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1994 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
1995 ; -O0: and x8, x9, x8
1996 ; -O0: bl __atomic_compare_exchange
1998 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
1999 ; -O1: and x8, x0, x20
2000 ; -O1: bl __atomic_compare_exchange
2001 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
2005 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
2006 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
2007 ; -O0: and x8, x9, x8
2008 ; -O0: bl __atomic_compare_exchange
2010 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
2011 ; -O1: and x8, x0, x20
2012 ; -O1: bl __atomic_compare_exchange
2013 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
2017 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2018 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2019 ; -O0: and x8, x9, x8
2020 ; -O0: bl __atomic_compare_exchange
2022 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2023 ; -O1: and x8, x0, x20
2024 ; -O1: bl __atomic_compare_exchange
2025 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
2029 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2030 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2031 ; -O0: and x8, x9, x8
2032 ; -O0: bl __atomic_compare_exchange
2034 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2035 ; -O1: and x8, x0, x20
2036 ; -O1: bl __atomic_compare_exchange
2037 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
2041 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2042 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2043 ; -O0: and x8, x11, x8
2044 ; -O0: and x9, x10, x9
2045 ; -O0: bl __atomic_compare_exchange
2047 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2048 ; -O1: ldp x0, x1, [x0]
2049 ; -O1: and x8, x1, x19
2050 ; -O1: and x9, x0, x21
2051 ; -O1: bl __atomic_compare_exchange
2052 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
2056 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2057 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
2058 ; -O0: and x8, x11, x8
2059 ; -O0: and x9, x10, x9
2060 ; -O0: bl __atomic_compare_exchange
2062 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
2063 ; -O1: ldp x0, x1, [x0]
2064 ; -O1: and x8, x1, x19
2065 ; -O1: and x9, x0, x21
2066 ; -O1: bl __atomic_compare_exchange
2067 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
2071 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
2072 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
2073 ; -O0: and x8, x11, x8
2074 ; -O0: and x9, x10, x9
2075 ; -O0: bl __atomic_compare_exchange
2077 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
2078 ; -O1: ldp x0, x1, [x0]
2079 ; -O1: and x8, x1, x19
2080 ; -O1: and x9, x0, x21
2081 ; -O1: bl __atomic_compare_exchange
2082 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
2086 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2087 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2088 ; -O0: and x8, x11, x8
2089 ; -O0: and x9, x10, x9
2090 ; -O0: bl __atomic_compare_exchange
2092 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2093 ; -O1: ldp x0, x1, [x0]
2094 ; -O1: and x8, x1, x19
2095 ; -O1: and x9, x0, x21
2096 ; -O1: bl __atomic_compare_exchange
2097 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2101 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2102 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2103 ; -O0: and x8, x11, x8
2104 ; -O0: and x9, x10, x9
2105 ; -O0: bl __atomic_compare_exchange
2107 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2108 ; -O1: ldp x0, x1, [x0]
2109 ; -O1: and x8, x1, x19
2110 ; -O1: and x9, x0, x21
2111 ; -O1: bl __atomic_compare_exchange
2112 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2116 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2117 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2118 ; -O0: and w8, w0, w8
2120 ; -O0: bl __aarch64_cas1_relax
2121 ; -O0: subs w8, w0, w8, uxtb
2122 ; -O0: subs w8, w8, #1
2124 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2125 ; -O1: ldxrb w8, [x0]
2126 ; -O1: and w9, w8, w1
2128 ; -O1: stxrb w10, w9, [x0]
2129 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2133 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2134 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2135 ; -O0: and w8, w0, w8
2137 ; -O0: bl __aarch64_cas1_acq
2138 ; -O0: subs w8, w0, w8, uxtb
2139 ; -O0: subs w8, w8, #1
2141 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2142 ; -O1: ldaxrb w8, [x0]
2143 ; -O1: and w9, w8, w1
2145 ; -O1: stxrb w10, w9, [x0]
2146 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2150 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2151 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2152 ; -O0: and w8, w0, w8
2154 ; -O0: bl __aarch64_cas1_rel
2155 ; -O0: subs w8, w0, w8, uxtb
2156 ; -O0: subs w8, w8, #1
2158 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2159 ; -O1: ldxrb w8, [x0]
2160 ; -O1: and w9, w8, w1
2162 ; -O1: stlxrb w10, w9, [x0]
2163 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2167 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2168 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2169 ; -O0: and w8, w0, w8
2171 ; -O0: bl __aarch64_cas1_acq_rel
2172 ; -O0: subs w8, w0, w8, uxtb
2173 ; -O0: subs w8, w8, #1
2175 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2176 ; -O1: ldaxrb w8, [x0]
2177 ; -O1: and w9, w8, w1
2179 ; -O1: stlxrb w10, w9, [x0]
2180 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2184 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2185 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2186 ; -O0: and w8, w0, w8
2188 ; -O0: bl __aarch64_cas1_acq_rel
2189 ; -O0: subs w8, w0, w8, uxtb
2190 ; -O0: subs w8, w8, #1
2192 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2193 ; -O1: ldaxrb w8, [x0]
2194 ; -O1: and w9, w8, w1
2196 ; -O1: stlxrb w10, w9, [x0]
2197 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2201 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2202 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2203 ; -O0: and w8, w0, w8
2205 ; -O0: bl __aarch64_cas2_relax
2206 ; -O0: subs w8, w0, w8, uxth
2207 ; -O0: subs w8, w8, #1
2209 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
2210 ; -O1: ldxrh w8, [x0]
2211 ; -O1: and w9, w8, w1
2213 ; -O1: stxrh w10, w9, [x0]
2214 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
2218 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
2219 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
2220 ; -O0: and w8, w0, w8
2222 ; -O0: bl __aarch64_cas2_acq
2223 ; -O0: subs w8, w0, w8, uxth
2224 ; -O0: subs w8, w8, #1
2226 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
2227 ; -O1: ldaxrh w8, [x0]
2228 ; -O1: and w9, w8, w1
2230 ; -O1: stxrh w10, w9, [x0]
2231 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
2235 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
2236 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
2237 ; -O0: and w8, w0, w8
2239 ; -O0: bl __aarch64_cas2_rel
2240 ; -O0: subs w8, w0, w8, uxth
2241 ; -O0: subs w8, w8, #1
2243 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
2244 ; -O1: ldxrh w8, [x0]
2245 ; -O1: and w9, w8, w1
2247 ; -O1: stlxrh w10, w9, [x0]
2248 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
2252 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2253 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2254 ; -O0: and w8, w0, w8
2256 ; -O0: bl __aarch64_cas2_acq_rel
2257 ; -O0: subs w8, w0, w8, uxth
2258 ; -O0: subs w8, w8, #1
2260 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
2261 ; -O1: ldaxrh w8, [x0]
2262 ; -O1: and w9, w8, w1
2264 ; -O1: stlxrh w10, w9, [x0]
2265 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
2269 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2270 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2271 ; -O0: and w8, w0, w8
2273 ; -O0: bl __aarch64_cas2_acq_rel
2274 ; -O0: subs w8, w0, w8, uxth
2275 ; -O0: subs w8, w8, #1
2277 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
2278 ; -O1: ldaxrh w8, [x0]
2279 ; -O1: and w9, w8, w1
2281 ; -O1: stlxrh w10, w9, [x0]
2282 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
2286 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2287 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2288 ; -O0: and w8, w0, w8
2290 ; -O0: bl __aarch64_cas4_relax
2291 ; -O0: subs w8, w0, w8
2292 ; -O0: subs w8, w8, #1
2294 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
2295 ; -O1: ldxr w8, [x0]
2296 ; -O1: and w9, w8, w1
2298 ; -O1: stxr w10, w9, [x0]
2299 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
2303 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
2304 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
2305 ; -O0: and w8, w0, w8
2307 ; -O0: bl __aarch64_cas4_acq
2308 ; -O0: subs w8, w0, w8
2309 ; -O0: subs w8, w8, #1
2311 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
2312 ; -O1: ldaxr w8, [x0]
2313 ; -O1: and w9, w8, w1
2315 ; -O1: stxr w10, w9, [x0]
2316 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
2320 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
2321 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
2322 ; -O0: and w8, w0, w8
2324 ; -O0: bl __aarch64_cas4_rel
2325 ; -O0: subs w8, w0, w8
2326 ; -O0: subs w8, w8, #1
2328 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
2329 ; -O1: ldxr w8, [x0]
2330 ; -O1: and w9, w8, w1
2332 ; -O1: stlxr w10, w9, [x0]
2333 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
2337 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2338 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2339 ; -O0: and w8, w0, w8
2341 ; -O0: bl __aarch64_cas4_acq_rel
2342 ; -O0: subs w8, w0, w8
2343 ; -O0: subs w8, w8, #1
2345 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
2346 ; -O1: ldaxr w8, [x0]
2347 ; -O1: and w9, w8, w1
2349 ; -O1: stlxr w10, w9, [x0]
2350 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
2354 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2355 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2356 ; -O0: and w8, w0, w8
2358 ; -O0: bl __aarch64_cas4_acq_rel
2359 ; -O0: subs w8, w0, w8
2360 ; -O0: subs w8, w8, #1
2362 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
2363 ; -O1: ldaxr w8, [x0]
2364 ; -O1: and w9, w8, w1
2366 ; -O1: stlxr w10, w9, [x0]
2367 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
2371 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2372 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2373 ; -O0: and x8, x0, x8
2375 ; -O0: bl __aarch64_cas8_relax
2376 ; -O0: subs x8, x0, x8
2377 ; -O0: subs w8, w8, #1
2379 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
2380 ; -O1: ldxr x0, [x8]
2381 ; -O1: and x9, x0, x1
2383 ; -O1: stxr w10, x9, [x8]
2384 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
2388 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
2389 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
2390 ; -O0: and x8, x0, x8
2392 ; -O0: bl __aarch64_cas8_acq
2393 ; -O0: subs x8, x0, x8
2394 ; -O0: subs w8, w8, #1
2396 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
2397 ; -O1: ldaxr x0, [x8]
2398 ; -O1: and x9, x0, x1
2400 ; -O1: stxr w10, x9, [x8]
2401 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
2405 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
2406 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
2407 ; -O0: and x8, x0, x8
2409 ; -O0: bl __aarch64_cas8_rel
2410 ; -O0: subs x8, x0, x8
2411 ; -O0: subs w8, w8, #1
2413 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
2414 ; -O1: ldxr x0, [x8]
2415 ; -O1: and x9, x0, x1
2417 ; -O1: stlxr w10, x9, [x8]
2418 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
2422 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2423 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2424 ; -O0: and x8, x0, x8
2426 ; -O0: bl __aarch64_cas8_acq_rel
2427 ; -O0: subs x8, x0, x8
2428 ; -O0: subs w8, w8, #1
2430 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
2431 ; -O1: ldaxr x0, [x8]
2432 ; -O1: and x9, x0, x1
2434 ; -O1: stlxr w10, x9, [x8]
2435 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
2439 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2440 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2441 ; -O0: and x8, x0, x8
2443 ; -O0: bl __aarch64_cas8_acq_rel
2444 ; -O0: subs x8, x0, x8
2445 ; -O0: subs w8, w8, #1
2447 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
2448 ; -O1: ldaxr x0, [x8]
2449 ; -O1: and x9, x0, x1
2451 ; -O1: stlxr w10, x9, [x8]
2452 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
2456 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2457 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2458 ; -O0: and x8, x1, x8
2459 ; -O0: and x9, x0, x9
2462 ; -O0: bl __aarch64_cas16_relax
2463 ; -O0: subs x10, x10, x11
2464 ; -O0: ccmp x8, x9, #0, eq
2466 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
2467 ; -O1: ldxp x1, x0, [x8]
2468 ; -O1: and x9, x1, x3
2469 ; -O1: and x10, x0, x2
2472 ; -O1: stxp w11, x9, x10, [x8]
2473 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
2477 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
2478 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
2479 ; -O0: and x8, x1, x8
2480 ; -O0: and x9, x0, x9
2483 ; -O0: bl __aarch64_cas16_acq
2484 ; -O0: subs x10, x10, x11
2485 ; -O0: ccmp x8, x9, #0, eq
2487 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
2488 ; -O1: ldaxp x1, x0, [x8]
2489 ; -O1: and x9, x1, x3
2490 ; -O1: and x10, x0, x2
2493 ; -O1: stxp w11, x9, x10, [x8]
2494 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
2498 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
2499 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
2500 ; -O0: and x8, x1, x8
2501 ; -O0: and x9, x0, x9
2504 ; -O0: bl __aarch64_cas16_rel
2505 ; -O0: subs x10, x10, x11
2506 ; -O0: ccmp x8, x9, #0, eq
2508 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
2509 ; -O1: ldxp x1, x0, [x8]
2510 ; -O1: and x9, x1, x3
2511 ; -O1: and x10, x0, x2
2514 ; -O1: stlxp w11, x9, x10, [x8]
2515 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
2519 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2520 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2521 ; -O0: and x8, x1, x8
2522 ; -O0: and x9, x0, x9
2525 ; -O0: bl __aarch64_cas16_acq_rel
2526 ; -O0: subs x10, x10, x11
2527 ; -O0: ccmp x8, x9, #0, eq
2529 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
2530 ; -O1: ldaxp x1, x0, [x8]
2531 ; -O1: and x9, x1, x3
2532 ; -O1: and x10, x0, x2
2535 ; -O1: stlxp w11, x9, x10, [x8]
2536 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
2540 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2541 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2542 ; -O0: and x8, x1, x8
2543 ; -O0: and x9, x0, x9
2546 ; -O0: bl __aarch64_cas16_acq_rel
2547 ; -O0: subs x10, x10, x11
2548 ; -O0: ccmp x8, x9, #0, eq
2550 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
2551 ; -O1: ldaxp x1, x0, [x8]
2552 ; -O1: and x9, x1, x3
2553 ; -O1: and x10, x0, x2
2556 ; -O1: stlxp w11, x9, x10, [x8]
2557 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
2561 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2562 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2563 ; -O0: and w8, w0, w8
2565 ; -O0: bl __aarch64_cas1_relax
2566 ; -O0: subs w8, w0, w8, uxtb
2567 ; -O0: subs w8, w8, #1
2569 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
2570 ; -O1: ldxrb w8, [x0]
2571 ; -O1: and w9, w8, w1
2573 ; -O1: stxrb w10, w9, [x0]
2574 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2578 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2579 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2580 ; -O0: and w8, w0, w8
2582 ; -O0: bl __aarch64_cas1_acq
2583 ; -O0: subs w8, w0, w8, uxtb
2584 ; -O0: subs w8, w8, #1
2586 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
2587 ; -O1: ldaxrb w8, [x0]
2588 ; -O1: and w9, w8, w1
2590 ; -O1: stxrb w10, w9, [x0]
2591 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2595 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
2596 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
2597 ; -O0: and w8, w0, w8
2599 ; -O0: bl __aarch64_cas1_rel
2600 ; -O0: subs w8, w0, w8, uxtb
2601 ; -O0: subs w8, w8, #1
2603 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
2604 ; -O1: ldxrb w8, [x0]
2605 ; -O1: and w9, w8, w1
2607 ; -O1: stlxrb w10, w9, [x0]
2608 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2612 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2613 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2614 ; -O0: and w8, w0, w8
2616 ; -O0: bl __aarch64_cas1_acq_rel
2617 ; -O0: subs w8, w0, w8, uxtb
2618 ; -O0: subs w8, w8, #1
2620 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
2621 ; -O1: ldaxrb w8, [x0]
2622 ; -O1: and w9, w8, w1
2624 ; -O1: stlxrb w10, w9, [x0]
2625 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2629 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2630 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2631 ; -O0: and w8, w0, w8
2633 ; -O0: bl __aarch64_cas1_acq_rel
2634 ; -O0: subs w8, w0, w8, uxtb
2635 ; -O0: subs w8, w8, #1
2637 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
2638 ; -O1: ldaxrb w8, [x0]
2639 ; -O1: and w9, w8, w1
2641 ; -O1: stlxrb w10, w9, [x0]
2642 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
2646 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2647 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2648 ; -O0: and w8, w9, w8
2650 ; -O0: bl __atomic_compare_exchange
2652 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
2653 ; -O1: and w8, w0, w20
2655 ; -O1: bl __atomic_compare_exchange
2656 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
2660 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2661 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2662 ; -O0: and w8, w9, w8
2664 ; -O0: bl __atomic_compare_exchange
2666 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
2667 ; -O1: and w8, w0, w20
2669 ; -O1: bl __atomic_compare_exchange
2670 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
2674 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
2675 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
2676 ; -O0: and w8, w9, w8
2678 ; -O0: bl __atomic_compare_exchange
2680 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
2681 ; -O1: and w8, w0, w20
2683 ; -O1: bl __atomic_compare_exchange
2684 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
2688 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2689 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2690 ; -O0: and w8, w9, w8
2692 ; -O0: bl __atomic_compare_exchange
2694 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
2695 ; -O1: and w8, w0, w20
2697 ; -O1: bl __atomic_compare_exchange
2698 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
2702 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2703 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2704 ; -O0: and w8, w9, w8
2706 ; -O0: bl __atomic_compare_exchange
2708 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
2709 ; -O1: and w8, w0, w20
2711 ; -O1: bl __atomic_compare_exchange
2712 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
2716 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2717 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2718 ; -O0: and w8, w9, w8
2720 ; -O0: bl __atomic_compare_exchange
2722 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
2723 ; -O1: and w8, w0, w20
2725 ; -O1: bl __atomic_compare_exchange
2726 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
2730 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2731 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2732 ; -O0: and w8, w9, w8
2734 ; -O0: bl __atomic_compare_exchange
2736 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
2737 ; -O1: and w8, w0, w20
2739 ; -O1: bl __atomic_compare_exchange
2740 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
2744 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
2745 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
2746 ; -O0: and w8, w9, w8
2748 ; -O0: bl __atomic_compare_exchange
2750 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
2751 ; -O1: and w8, w0, w20
2753 ; -O1: bl __atomic_compare_exchange
2754 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
2758 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2759 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2760 ; -O0: and w8, w9, w8
2762 ; -O0: bl __atomic_compare_exchange
2764 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
2765 ; -O1: and w8, w0, w20
2767 ; -O1: bl __atomic_compare_exchange
2768 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
2772 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2773 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2774 ; -O0: and w8, w9, w8
2776 ; -O0: bl __atomic_compare_exchange
2778 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
2779 ; -O1: and w8, w0, w20
2781 ; -O1: bl __atomic_compare_exchange
2782 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
2786 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2787 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2788 ; -O0: and x8, x9, x8
2790 ; -O0: bl __atomic_compare_exchange
2792 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
2793 ; -O1: and x8, x0, x20
2795 ; -O1: bl __atomic_compare_exchange
2796 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
2800 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2801 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2802 ; -O0: and x8, x9, x8
2804 ; -O0: bl __atomic_compare_exchange
2806 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
2807 ; -O1: and x8, x0, x20
2809 ; -O1: bl __atomic_compare_exchange
2810 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
2814 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
2815 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
2816 ; -O0: and x8, x9, x8
2818 ; -O0: bl __atomic_compare_exchange
2820 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
2821 ; -O1: and x8, x0, x20
2823 ; -O1: bl __atomic_compare_exchange
2824 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
2828 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2829 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2830 ; -O0: and x8, x9, x8
2832 ; -O0: bl __atomic_compare_exchange
2834 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
2835 ; -O1: and x8, x0, x20
2837 ; -O1: bl __atomic_compare_exchange
2838 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
2842 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2843 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2844 ; -O0: and x8, x9, x8
2846 ; -O0: bl __atomic_compare_exchange
2848 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
2849 ; -O1: and x8, x0, x20
2851 ; -O1: bl __atomic_compare_exchange
2852 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
2856 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2857 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2858 ; -O0: and x9, x11, x9
2859 ; -O0: and x8, x10, x8
2862 ; -O0: bl __atomic_compare_exchange
2864 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
2865 ; -O1: ldp x0, x1, [x0]
2866 ; -O1: and x8, x1, x19
2867 ; -O1: and x9, x0, x21
2870 ; -O1: bl __atomic_compare_exchange
2871 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
2875 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2876 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2877 ; -O0: and x9, x11, x9
2878 ; -O0: and x8, x10, x8
2881 ; -O0: bl __atomic_compare_exchange
2883 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
2884 ; -O1: ldp x0, x1, [x0]
2885 ; -O1: and x8, x1, x19
2886 ; -O1: and x9, x0, x21
2889 ; -O1: bl __atomic_compare_exchange
2890 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
2894 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
2895 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
2896 ; -O0: and x9, x11, x9
2897 ; -O0: and x8, x10, x8
2900 ; -O0: bl __atomic_compare_exchange
2902 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
2903 ; -O1: ldp x0, x1, [x0]
2904 ; -O1: and x8, x1, x19
2905 ; -O1: and x9, x0, x21
2908 ; -O1: bl __atomic_compare_exchange
2909 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
2913 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2914 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2915 ; -O0: and x9, x11, x9
2916 ; -O0: and x8, x10, x8
2919 ; -O0: bl __atomic_compare_exchange
2921 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
2922 ; -O1: ldp x0, x1, [x0]
2923 ; -O1: and x8, x1, x19
2924 ; -O1: and x9, x0, x21
2927 ; -O1: bl __atomic_compare_exchange
2928 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
2932 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2933 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2934 ; -O0: and x9, x11, x9
2935 ; -O0: and x8, x10, x8
2938 ; -O0: bl __atomic_compare_exchange
2940 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
2941 ; -O1: ldp x0, x1, [x0]
2942 ; -O1: and x8, x1, x19
2943 ; -O1: and x9, x0, x21
2946 ; -O1: bl __atomic_compare_exchange
2947 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
2951 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2952 ; CHECK-LABEL: atomicrmw_or_i8_aligned_monotonic:
2953 ; CHECK: bl __aarch64_ldset1_relax
2954 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
2958 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
2959 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acquire:
2960 ; CHECK: bl __aarch64_ldset1_acq
2961 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
2965 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
2966 ; CHECK-LABEL: atomicrmw_or_i8_aligned_release:
2967 ; CHECK: bl __aarch64_ldset1_rel
2968 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
2972 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2973 ; CHECK-LABEL: atomicrmw_or_i8_aligned_acq_rel:
2974 ; CHECK: bl __aarch64_ldset1_acq_rel
2975 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
2979 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2980 ; CHECK-LABEL: atomicrmw_or_i8_aligned_seq_cst:
2981 ; CHECK: bl __aarch64_ldset1_acq_rel
2982 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
2986 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2987 ; CHECK-LABEL: atomicrmw_or_i16_aligned_monotonic:
2988 ; CHECK: bl __aarch64_ldset2_relax
2989 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
2993 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
2994 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acquire:
2995 ; CHECK: bl __aarch64_ldset2_acq
2996 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
3000 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
3001 ; CHECK-LABEL: atomicrmw_or_i16_aligned_release:
3002 ; CHECK: bl __aarch64_ldset2_rel
3003 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
3007 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3008 ; CHECK-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3009 ; CHECK: bl __aarch64_ldset2_acq_rel
3010 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
3014 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3015 ; CHECK-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3016 ; CHECK: bl __aarch64_ldset2_acq_rel
3017 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
3021 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3022 ; CHECK-LABEL: atomicrmw_or_i32_aligned_monotonic:
3023 ; CHECK: bl __aarch64_ldset4_relax
3024 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
3028 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
3029 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acquire:
3030 ; CHECK: bl __aarch64_ldset4_acq
3031 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
3035 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
3036 ; CHECK-LABEL: atomicrmw_or_i32_aligned_release:
3037 ; CHECK: bl __aarch64_ldset4_rel
3038 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
3042 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3043 ; CHECK-LABEL: atomicrmw_or_i32_aligned_acq_rel:
3044 ; CHECK: bl __aarch64_ldset4_acq_rel
3045 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
3049 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3050 ; CHECK-LABEL: atomicrmw_or_i32_aligned_seq_cst:
3051 ; CHECK: bl __aarch64_ldset4_acq_rel
3052 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
3056 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3057 ; CHECK-LABEL: atomicrmw_or_i64_aligned_monotonic:
3058 ; CHECK: bl __aarch64_ldset8_relax
3059 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
3063 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
3064 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acquire:
3065 ; CHECK: bl __aarch64_ldset8_acq
3066 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
3070 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
3071 ; CHECK-LABEL: atomicrmw_or_i64_aligned_release:
3072 ; CHECK: bl __aarch64_ldset8_rel
3073 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
3077 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3078 ; CHECK-LABEL: atomicrmw_or_i64_aligned_acq_rel:
3079 ; CHECK: bl __aarch64_ldset8_acq_rel
3080 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
3084 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3085 ; CHECK-LABEL: atomicrmw_or_i64_aligned_seq_cst:
3086 ; CHECK: bl __aarch64_ldset8_acq_rel
3087 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
3091 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3092 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
3093 ; -O0: orr x2, x0, x9
3094 ; -O0: orr x3, x1, x8
3095 ; -O0: bl __aarch64_cas16_relax
3096 ; -O0: subs x10, x10, x11
3097 ; -O0: ccmp x8, x9, #0, eq
3099 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
3100 ; -O1: ldxp x1, x0, [x8]
3101 ; -O1: orr x9, x0, x2
3102 ; -O1: orr x10, x1, x3
3103 ; -O1: stxp w11, x10, x9, [x8]
3104 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
3108 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
3109 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
3110 ; -O0: orr x2, x0, x9
3111 ; -O0: orr x3, x1, x8
3112 ; -O0: bl __aarch64_cas16_acq
3113 ; -O0: subs x10, x10, x11
3114 ; -O0: ccmp x8, x9, #0, eq
3116 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
3117 ; -O1: ldaxp x1, x0, [x8]
3118 ; -O1: orr x9, x0, x2
3119 ; -O1: orr x10, x1, x3
3120 ; -O1: stxp w11, x10, x9, [x8]
3121 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
3125 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
3126 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
3127 ; -O0: orr x2, x0, x9
3128 ; -O0: orr x3, x1, x8
3129 ; -O0: bl __aarch64_cas16_rel
3130 ; -O0: subs x10, x10, x11
3131 ; -O0: ccmp x8, x9, #0, eq
3133 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
3134 ; -O1: ldxp x1, x0, [x8]
3135 ; -O1: orr x9, x0, x2
3136 ; -O1: orr x10, x1, x3
3137 ; -O1: stlxp w11, x10, x9, [x8]
3138 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
3142 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3143 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3144 ; -O0: orr x2, x0, x9
3145 ; -O0: orr x3, x1, x8
3146 ; -O0: bl __aarch64_cas16_acq_rel
3147 ; -O0: subs x10, x10, x11
3148 ; -O0: ccmp x8, x9, #0, eq
3150 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
3151 ; -O1: ldaxp x1, x0, [x8]
3152 ; -O1: orr x9, x0, x2
3153 ; -O1: orr x10, x1, x3
3154 ; -O1: stlxp w11, x10, x9, [x8]
3155 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
3159 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3160 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3161 ; -O0: orr x2, x0, x9
3162 ; -O0: orr x3, x1, x8
3163 ; -O0: bl __aarch64_cas16_acq_rel
3164 ; -O0: subs x10, x10, x11
3165 ; -O0: ccmp x8, x9, #0, eq
3167 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
3168 ; -O1: ldaxp x1, x0, [x8]
3169 ; -O1: orr x9, x0, x2
3170 ; -O1: orr x10, x1, x3
3171 ; -O1: stlxp w11, x10, x9, [x8]
3172 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
3176 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3177 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_monotonic:
3178 ; CHECK: bl __aarch64_ldset1_relax
3179 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3183 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3184 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acquire:
3185 ; CHECK: bl __aarch64_ldset1_acq
3186 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3190 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
3191 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_release:
3192 ; CHECK: bl __aarch64_ldset1_rel
3193 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3197 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3198 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
3199 ; CHECK: bl __aarch64_ldset1_acq_rel
3200 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3204 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3205 ; CHECK-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
3206 ; CHECK: bl __aarch64_ldset1_acq_rel
3207 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3211 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3212 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3213 ; -O0: orr w8, w9, w8
3214 ; -O0: bl __atomic_compare_exchange
3216 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
3217 ; -O1: orr w8, w0, w20
3218 ; -O1: bl __atomic_compare_exchange
3219 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
3223 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3224 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
3225 ; -O0: orr w8, w9, w8
3226 ; -O0: bl __atomic_compare_exchange
3228 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
3229 ; -O1: orr w8, w0, w20
3230 ; -O1: bl __atomic_compare_exchange
3231 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
3235 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
3236 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
3237 ; -O0: orr w8, w9, w8
3238 ; -O0: bl __atomic_compare_exchange
3240 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
3241 ; -O1: orr w8, w0, w20
3242 ; -O1: bl __atomic_compare_exchange
3243 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
3247 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3248 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3249 ; -O0: orr w8, w9, w8
3250 ; -O0: bl __atomic_compare_exchange
3252 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
3253 ; -O1: orr w8, w0, w20
3254 ; -O1: bl __atomic_compare_exchange
3255 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
3259 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3260 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3261 ; -O0: orr w8, w9, w8
3262 ; -O0: bl __atomic_compare_exchange
3264 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
3265 ; -O1: orr w8, w0, w20
3266 ; -O1: bl __atomic_compare_exchange
3267 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
3271 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3272 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3273 ; -O0: orr w8, w9, w8
3274 ; -O0: bl __atomic_compare_exchange
3276 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
3277 ; -O1: orr w8, w0, w20
3278 ; -O1: bl __atomic_compare_exchange
3279 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
3283 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3284 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
3285 ; -O0: orr w8, w9, w8
3286 ; -O0: bl __atomic_compare_exchange
3288 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
3289 ; -O1: orr w8, w0, w20
3290 ; -O1: bl __atomic_compare_exchange
3291 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
3295 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
3296 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
3297 ; -O0: orr w8, w9, w8
3298 ; -O0: bl __atomic_compare_exchange
3300 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
3301 ; -O1: orr w8, w0, w20
3302 ; -O1: bl __atomic_compare_exchange
3303 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
3307 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3308 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3309 ; -O0: orr w8, w9, w8
3310 ; -O0: bl __atomic_compare_exchange
3312 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
3313 ; -O1: orr w8, w0, w20
3314 ; -O1: bl __atomic_compare_exchange
3315 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
3319 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3320 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3321 ; -O0: orr w8, w9, w8
3322 ; -O0: bl __atomic_compare_exchange
3324 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
3325 ; -O1: orr w8, w0, w20
3326 ; -O1: bl __atomic_compare_exchange
3327 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
3331 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3332 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3333 ; -O0: orr x8, x9, x8
3334 ; -O0: bl __atomic_compare_exchange
3336 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
3337 ; -O1: orr x8, x0, x20
3338 ; -O1: bl __atomic_compare_exchange
3339 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
3343 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3344 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
3345 ; -O0: orr x8, x9, x8
3346 ; -O0: bl __atomic_compare_exchange
3348 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
3349 ; -O1: orr x8, x0, x20
3350 ; -O1: bl __atomic_compare_exchange
3351 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
3355 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
3356 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
3357 ; -O0: orr x8, x9, x8
3358 ; -O0: bl __atomic_compare_exchange
3360 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
3361 ; -O1: orr x8, x0, x20
3362 ; -O1: bl __atomic_compare_exchange
3363 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
3367 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3368 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3369 ; -O0: orr x8, x9, x8
3370 ; -O0: bl __atomic_compare_exchange
3372 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
3373 ; -O1: orr x8, x0, x20
3374 ; -O1: bl __atomic_compare_exchange
3375 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
3379 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3380 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3381 ; -O0: orr x8, x9, x8
3382 ; -O0: bl __atomic_compare_exchange
3384 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
3385 ; -O1: orr x8, x0, x20
3386 ; -O1: bl __atomic_compare_exchange
3387 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
3391 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3392 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3393 ; -O0: orr x8, x11, x8
3394 ; -O0: orr x9, x10, x9
3395 ; -O0: bl __atomic_compare_exchange
3397 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
3398 ; -O1: ldp x0, x1, [x0]
3399 ; -O1: orr x8, x1, x19
3400 ; -O1: orr x9, x0, x21
3401 ; -O1: bl __atomic_compare_exchange
3402 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
3406 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3407 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
3408 ; -O0: orr x8, x11, x8
3409 ; -O0: orr x9, x10, x9
3410 ; -O0: bl __atomic_compare_exchange
3412 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
3413 ; -O1: ldp x0, x1, [x0]
3414 ; -O1: orr x8, x1, x19
3415 ; -O1: orr x9, x0, x21
3416 ; -O1: bl __atomic_compare_exchange
3417 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
3421 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
3422 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
3423 ; -O0: orr x8, x11, x8
3424 ; -O0: orr x9, x10, x9
3425 ; -O0: bl __atomic_compare_exchange
3427 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
3428 ; -O1: ldp x0, x1, [x0]
3429 ; -O1: orr x8, x1, x19
3430 ; -O1: orr x9, x0, x21
3431 ; -O1: bl __atomic_compare_exchange
3432 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
3436 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3437 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3438 ; -O0: orr x8, x11, x8
3439 ; -O0: orr x9, x10, x9
3440 ; -O0: bl __atomic_compare_exchange
3442 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
3443 ; -O1: ldp x0, x1, [x0]
3444 ; -O1: orr x8, x1, x19
3445 ; -O1: orr x9, x0, x21
3446 ; -O1: bl __atomic_compare_exchange
3447 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
3451 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3452 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3453 ; -O0: orr x8, x11, x8
3454 ; -O0: orr x9, x10, x9
3455 ; -O0: bl __atomic_compare_exchange
3457 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
3458 ; -O1: ldp x0, x1, [x0]
3459 ; -O1: orr x8, x1, x19
3460 ; -O1: orr x9, x0, x21
3461 ; -O1: bl __atomic_compare_exchange
3462 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
3466 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3467 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_monotonic:
3468 ; CHECK: bl __aarch64_ldeor1_relax
3469 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3473 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
3474 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acquire:
3475 ; CHECK: bl __aarch64_ldeor1_acq
3476 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3480 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
3481 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_release:
3482 ; CHECK: bl __aarch64_ldeor1_rel
3483 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3487 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3488 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
3489 ; CHECK: bl __aarch64_ldeor1_acq_rel
3490 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3494 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3495 ; CHECK-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
3496 ; CHECK: bl __aarch64_ldeor1_acq_rel
3497 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3501 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3502 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_monotonic:
3503 ; CHECK: bl __aarch64_ldeor2_relax
3504 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
3508 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
3509 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acquire:
3510 ; CHECK: bl __aarch64_ldeor2_acq
3511 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
3515 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
3516 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_release:
3517 ; CHECK: bl __aarch64_ldeor2_rel
3518 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
3522 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3523 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
3524 ; CHECK: bl __aarch64_ldeor2_acq_rel
3525 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
3529 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3530 ; CHECK-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
3531 ; CHECK: bl __aarch64_ldeor2_acq_rel
3532 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
3536 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3537 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_monotonic:
3538 ; CHECK: bl __aarch64_ldeor4_relax
3539 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
3543 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
3544 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acquire:
3545 ; CHECK: bl __aarch64_ldeor4_acq
3546 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
3550 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
3551 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_release:
3552 ; CHECK: bl __aarch64_ldeor4_rel
3553 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
3557 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3558 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
3559 ; CHECK: bl __aarch64_ldeor4_acq_rel
3560 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
3564 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3565 ; CHECK-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
3566 ; CHECK: bl __aarch64_ldeor4_acq_rel
3567 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
3571 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3572 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_monotonic:
3573 ; CHECK: bl __aarch64_ldeor8_relax
3574 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
3578 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
3579 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acquire:
3580 ; CHECK: bl __aarch64_ldeor8_acq
3581 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
3585 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
3586 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_release:
3587 ; CHECK: bl __aarch64_ldeor8_rel
3588 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
3592 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3593 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
3594 ; CHECK: bl __aarch64_ldeor8_acq_rel
3595 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
3599 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3600 ; CHECK-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
3601 ; CHECK: bl __aarch64_ldeor8_acq_rel
3602 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
3606 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3607 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3608 ; -O0: eor x2, x0, x9
3609 ; -O0: eor x3, x1, x8
3610 ; -O0: bl __aarch64_cas16_relax
3611 ; -O0: subs x10, x10, x11
3612 ; -O0: ccmp x8, x9, #0, eq
3614 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
3615 ; -O1: ldxp x1, x0, [x8]
3616 ; -O1: eor x9, x0, x2
3617 ; -O1: eor x10, x1, x3
3618 ; -O1: stxp w11, x10, x9, [x8]
3619 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
3623 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
3624 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
3625 ; -O0: eor x2, x0, x9
3626 ; -O0: eor x3, x1, x8
3627 ; -O0: bl __aarch64_cas16_acq
3628 ; -O0: subs x10, x10, x11
3629 ; -O0: ccmp x8, x9, #0, eq
3631 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
3632 ; -O1: ldaxp x1, x0, [x8]
3633 ; -O1: eor x9, x0, x2
3634 ; -O1: eor x10, x1, x3
3635 ; -O1: stxp w11, x10, x9, [x8]
3636 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
3640 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
3641 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
3642 ; -O0: eor x2, x0, x9
3643 ; -O0: eor x3, x1, x8
3644 ; -O0: bl __aarch64_cas16_rel
3645 ; -O0: subs x10, x10, x11
3646 ; -O0: ccmp x8, x9, #0, eq
3648 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
3649 ; -O1: ldxp x1, x0, [x8]
3650 ; -O1: eor x9, x0, x2
3651 ; -O1: eor x10, x1, x3
3652 ; -O1: stlxp w11, x10, x9, [x8]
3653 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
3657 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3658 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3659 ; -O0: eor x2, x0, x9
3660 ; -O0: eor x3, x1, x8
3661 ; -O0: bl __aarch64_cas16_acq_rel
3662 ; -O0: subs x10, x10, x11
3663 ; -O0: ccmp x8, x9, #0, eq
3665 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
3666 ; -O1: ldaxp x1, x0, [x8]
3667 ; -O1: eor x9, x0, x2
3668 ; -O1: eor x10, x1, x3
3669 ; -O1: stlxp w11, x10, x9, [x8]
3670 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
3674 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3675 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3676 ; -O0: eor x2, x0, x9
3677 ; -O0: eor x3, x1, x8
3678 ; -O0: bl __aarch64_cas16_acq_rel
3679 ; -O0: subs x10, x10, x11
3680 ; -O0: ccmp x8, x9, #0, eq
3682 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
3683 ; -O1: ldaxp x1, x0, [x8]
3684 ; -O1: eor x9, x0, x2
3685 ; -O1: eor x10, x1, x3
3686 ; -O1: stlxp w11, x10, x9, [x8]
3687 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
3691 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3692 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
3693 ; CHECK: bl __aarch64_ldeor1_relax
3694 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
3698 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3699 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acquire:
3700 ; CHECK: bl __aarch64_ldeor1_acq
3701 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
3705 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
3706 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_release:
3707 ; CHECK: bl __aarch64_ldeor1_rel
3708 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
3712 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3713 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
3714 ; CHECK: bl __aarch64_ldeor1_acq_rel
3715 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
3719 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3720 ; CHECK-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
3721 ; CHECK: bl __aarch64_ldeor1_acq_rel
3722 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
3726 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3727 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3728 ; -O0: eor w8, w9, w8
3729 ; -O0: bl __atomic_compare_exchange
3731 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
3732 ; -O1: eor w8, w0, w20
3733 ; -O1: bl __atomic_compare_exchange
3734 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
3738 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3739 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3740 ; -O0: eor w8, w9, w8
3741 ; -O0: bl __atomic_compare_exchange
3743 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
3744 ; -O1: eor w8, w0, w20
3745 ; -O1: bl __atomic_compare_exchange
3746 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
3750 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
3751 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
3752 ; -O0: eor w8, w9, w8
3753 ; -O0: bl __atomic_compare_exchange
3755 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
3756 ; -O1: eor w8, w0, w20
3757 ; -O1: bl __atomic_compare_exchange
3758 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
3762 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3763 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3764 ; -O0: eor w8, w9, w8
3765 ; -O0: bl __atomic_compare_exchange
3767 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
3768 ; -O1: eor w8, w0, w20
3769 ; -O1: bl __atomic_compare_exchange
3770 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
3774 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3775 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3776 ; -O0: eor w8, w9, w8
3777 ; -O0: bl __atomic_compare_exchange
3779 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
3780 ; -O1: eor w8, w0, w20
3781 ; -O1: bl __atomic_compare_exchange
3782 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
3786 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3787 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3788 ; -O0: eor w8, w9, w8
3789 ; -O0: bl __atomic_compare_exchange
3791 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
3792 ; -O1: eor w8, w0, w20
3793 ; -O1: bl __atomic_compare_exchange
3794 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
3798 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3799 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3800 ; -O0: eor w8, w9, w8
3801 ; -O0: bl __atomic_compare_exchange
3803 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
3804 ; -O1: eor w8, w0, w20
3805 ; -O1: bl __atomic_compare_exchange
3806 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
3810 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
3811 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
3812 ; -O0: eor w8, w9, w8
3813 ; -O0: bl __atomic_compare_exchange
3815 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
3816 ; -O1: eor w8, w0, w20
3817 ; -O1: bl __atomic_compare_exchange
3818 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
3822 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3823 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3824 ; -O0: eor w8, w9, w8
3825 ; -O0: bl __atomic_compare_exchange
3827 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
3828 ; -O1: eor w8, w0, w20
3829 ; -O1: bl __atomic_compare_exchange
3830 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
3834 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3835 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3836 ; -O0: eor w8, w9, w8
3837 ; -O0: bl __atomic_compare_exchange
3839 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
3840 ; -O1: eor w8, w0, w20
3841 ; -O1: bl __atomic_compare_exchange
3842 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
3846 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3847 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3848 ; -O0: eor x8, x9, x8
3849 ; -O0: bl __atomic_compare_exchange
3851 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
3852 ; -O1: eor x8, x0, x20
3853 ; -O1: bl __atomic_compare_exchange
3854 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
3858 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3859 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3860 ; -O0: eor x8, x9, x8
3861 ; -O0: bl __atomic_compare_exchange
3863 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
3864 ; -O1: eor x8, x0, x20
3865 ; -O1: bl __atomic_compare_exchange
3866 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
3870 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
3871 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
3872 ; -O0: eor x8, x9, x8
3873 ; -O0: bl __atomic_compare_exchange
3875 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
3876 ; -O1: eor x8, x0, x20
3877 ; -O1: bl __atomic_compare_exchange
3878 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
3882 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3883 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3884 ; -O0: eor x8, x9, x8
3885 ; -O0: bl __atomic_compare_exchange
3887 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
3888 ; -O1: eor x8, x0, x20
3889 ; -O1: bl __atomic_compare_exchange
3890 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
3894 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3895 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3896 ; -O0: eor x8, x9, x8
3897 ; -O0: bl __atomic_compare_exchange
3899 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
3900 ; -O1: eor x8, x0, x20
3901 ; -O1: bl __atomic_compare_exchange
3902 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
3906 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3907 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3908 ; -O0: eor x8, x11, x8
3909 ; -O0: eor x9, x10, x9
3910 ; -O0: bl __atomic_compare_exchange
3912 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
3913 ; -O1: ldp x0, x1, [x0]
3914 ; -O1: eor x8, x1, x19
3915 ; -O1: eor x9, x0, x21
3916 ; -O1: bl __atomic_compare_exchange
3917 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
3921 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3922 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3923 ; -O0: eor x8, x11, x8
3924 ; -O0: eor x9, x10, x9
3925 ; -O0: bl __atomic_compare_exchange
3927 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
3928 ; -O1: ldp x0, x1, [x0]
3929 ; -O1: eor x8, x1, x19
3930 ; -O1: eor x9, x0, x21
3931 ; -O1: bl __atomic_compare_exchange
3932 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
3936 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
3937 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
3938 ; -O0: eor x8, x11, x8
3939 ; -O0: eor x9, x10, x9
3940 ; -O0: bl __atomic_compare_exchange
3942 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
3943 ; -O1: ldp x0, x1, [x0]
3944 ; -O1: eor x8, x1, x19
3945 ; -O1: eor x9, x0, x21
3946 ; -O1: bl __atomic_compare_exchange
3947 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
3951 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3952 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3953 ; -O0: eor x8, x11, x8
3954 ; -O0: eor x9, x10, x9
3955 ; -O0: bl __atomic_compare_exchange
3957 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
3958 ; -O1: ldp x0, x1, [x0]
3959 ; -O1: eor x8, x1, x19
3960 ; -O1: eor x9, x0, x21
3961 ; -O1: bl __atomic_compare_exchange
3962 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
3966 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3967 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3968 ; -O0: eor x8, x11, x8
3969 ; -O0: eor x9, x10, x9
3970 ; -O0: bl __atomic_compare_exchange
3972 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
3973 ; -O1: ldp x0, x1, [x0]
3974 ; -O1: eor x8, x1, x19
3975 ; -O1: eor x9, x0, x21
3976 ; -O1: bl __atomic_compare_exchange
3977 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
3981 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3982 ; -O0-LABEL: atomicrmw_max_i8_aligned_monotonic:
3984 ; -O0: subs w9, w9, w8, sxtb
3985 ; -O0: csel w1, w0, w8, gt
3986 ; -O0: bl __aarch64_cas1_relax
3987 ; -O0: subs w8, w0, w8, uxtb
3988 ; -O0: subs w8, w8, #1
3990 ; -O1-LABEL: atomicrmw_max_i8_aligned_monotonic:
3991 ; -O1: ldxrb w9, [x0]
3993 ; -O1: cmp w8, w1, sxtb
3994 ; -O1: csel w9, w9, w1, gt
3995 ; -O1: stxrb w10, w9, [x0]
3996 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4000 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
4001 ; -O0-LABEL: atomicrmw_max_i8_aligned_acquire:
4003 ; -O0: subs w9, w9, w8, sxtb
4004 ; -O0: csel w1, w0, w8, gt
4005 ; -O0: bl __aarch64_cas1_acq
4006 ; -O0: subs w8, w0, w8, uxtb
4007 ; -O0: subs w8, w8, #1
4009 ; -O1-LABEL: atomicrmw_max_i8_aligned_acquire:
4010 ; -O1: ldaxrb w9, [x0]
4012 ; -O1: cmp w8, w1, sxtb
4013 ; -O1: csel w9, w9, w1, gt
4014 ; -O1: stxrb w10, w9, [x0]
4015 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4019 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
4020 ; -O0-LABEL: atomicrmw_max_i8_aligned_release:
4022 ; -O0: subs w9, w9, w8, sxtb
4023 ; -O0: csel w1, w0, w8, gt
4024 ; -O0: bl __aarch64_cas1_rel
4025 ; -O0: subs w8, w0, w8, uxtb
4026 ; -O0: subs w8, w8, #1
4028 ; -O1-LABEL: atomicrmw_max_i8_aligned_release:
4029 ; -O1: ldxrb w9, [x0]
4031 ; -O1: cmp w8, w1, sxtb
4032 ; -O1: csel w9, w9, w1, gt
4033 ; -O1: stlxrb w10, w9, [x0]
4034 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4038 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4039 ; -O0-LABEL: atomicrmw_max_i8_aligned_acq_rel:
4041 ; -O0: subs w9, w9, w8, sxtb
4042 ; -O0: csel w1, w0, w8, gt
4043 ; -O0: bl __aarch64_cas1_acq_rel
4044 ; -O0: subs w8, w0, w8, uxtb
4045 ; -O0: subs w8, w8, #1
4047 ; -O1-LABEL: atomicrmw_max_i8_aligned_acq_rel:
4048 ; -O1: ldaxrb w9, [x0]
4050 ; -O1: cmp w8, w1, sxtb
4051 ; -O1: csel w9, w9, w1, gt
4052 ; -O1: stlxrb w10, w9, [x0]
4053 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4057 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4058 ; -O0-LABEL: atomicrmw_max_i8_aligned_seq_cst:
4060 ; -O0: subs w9, w9, w8, sxtb
4061 ; -O0: csel w1, w0, w8, gt
4062 ; -O0: bl __aarch64_cas1_acq_rel
4063 ; -O0: subs w8, w0, w8, uxtb
4064 ; -O0: subs w8, w8, #1
4066 ; -O1-LABEL: atomicrmw_max_i8_aligned_seq_cst:
4067 ; -O1: ldaxrb w9, [x0]
4069 ; -O1: cmp w8, w1, sxtb
4070 ; -O1: csel w9, w9, w1, gt
4071 ; -O1: stlxrb w10, w9, [x0]
4072 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4076 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4077 ; -O0-LABEL: atomicrmw_max_i16_aligned_monotonic:
4079 ; -O0: subs w9, w9, w8, sxth
4080 ; -O0: csel w1, w0, w8, gt
4081 ; -O0: bl __aarch64_cas2_relax
4082 ; -O0: subs w8, w0, w8, uxth
4083 ; -O0: subs w8, w8, #1
4085 ; -O1-LABEL: atomicrmw_max_i16_aligned_monotonic:
4086 ; -O1: ldxrh w9, [x0]
4088 ; -O1: cmp w8, w1, sxth
4089 ; -O1: csel w9, w9, w1, gt
4090 ; -O1: stxrh w10, w9, [x0]
4091 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
4095 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
4096 ; -O0-LABEL: atomicrmw_max_i16_aligned_acquire:
4098 ; -O0: subs w9, w9, w8, sxth
4099 ; -O0: csel w1, w0, w8, gt
4100 ; -O0: bl __aarch64_cas2_acq
4101 ; -O0: subs w8, w0, w8, uxth
4102 ; -O0: subs w8, w8, #1
4104 ; -O1-LABEL: atomicrmw_max_i16_aligned_acquire:
4105 ; -O1: ldaxrh w9, [x0]
4107 ; -O1: cmp w8, w1, sxth
4108 ; -O1: csel w9, w9, w1, gt
4109 ; -O1: stxrh w10, w9, [x0]
4110 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
4114 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
4115 ; -O0-LABEL: atomicrmw_max_i16_aligned_release:
4117 ; -O0: subs w9, w9, w8, sxth
4118 ; -O0: csel w1, w0, w8, gt
4119 ; -O0: bl __aarch64_cas2_rel
4120 ; -O0: subs w8, w0, w8, uxth
4121 ; -O0: subs w8, w8, #1
4123 ; -O1-LABEL: atomicrmw_max_i16_aligned_release:
4124 ; -O1: ldxrh w9, [x0]
4126 ; -O1: cmp w8, w1, sxth
4127 ; -O1: csel w9, w9, w1, gt
4128 ; -O1: stlxrh w10, w9, [x0]
4129 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
4133 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4134 ; -O0-LABEL: atomicrmw_max_i16_aligned_acq_rel:
4136 ; -O0: subs w9, w9, w8, sxth
4137 ; -O0: csel w1, w0, w8, gt
4138 ; -O0: bl __aarch64_cas2_acq_rel
4139 ; -O0: subs w8, w0, w8, uxth
4140 ; -O0: subs w8, w8, #1
4142 ; -O1-LABEL: atomicrmw_max_i16_aligned_acq_rel:
4143 ; -O1: ldaxrh w9, [x0]
4145 ; -O1: cmp w8, w1, sxth
4146 ; -O1: csel w9, w9, w1, gt
4147 ; -O1: stlxrh w10, w9, [x0]
4148 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
4152 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4153 ; -O0-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4155 ; -O0: subs w9, w9, w8, sxth
4156 ; -O0: csel w1, w0, w8, gt
4157 ; -O0: bl __aarch64_cas2_acq_rel
4158 ; -O0: subs w8, w0, w8, uxth
4159 ; -O0: subs w8, w8, #1
4161 ; -O1-LABEL: atomicrmw_max_i16_aligned_seq_cst:
4162 ; -O1: ldaxrh w9, [x0]
4164 ; -O1: cmp w8, w1, sxth
4165 ; -O1: csel w9, w9, w1, gt
4166 ; -O1: stlxrh w10, w9, [x0]
4167 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
4171 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4172 ; -O0-LABEL: atomicrmw_max_i32_aligned_monotonic:
4173 ; -O0: subs w9, w0, w8
4174 ; -O0: csel w1, w0, w8, gt
4175 ; -O0: bl __aarch64_cas4_relax
4176 ; -O0: subs w8, w0, w8
4177 ; -O0: subs w8, w8, #1
4179 ; -O1-LABEL: atomicrmw_max_i32_aligned_monotonic:
4180 ; -O1: ldxr w8, [x0]
4182 ; -O1: csel w9, w8, w1, gt
4183 ; -O1: stxr w10, w9, [x0]
4184 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
4188 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
4189 ; -O0-LABEL: atomicrmw_max_i32_aligned_acquire:
4190 ; -O0: subs w9, w0, w8
4191 ; -O0: csel w1, w0, w8, gt
4192 ; -O0: bl __aarch64_cas4_acq
4193 ; -O0: subs w8, w0, w8
4194 ; -O0: subs w8, w8, #1
4196 ; -O1-LABEL: atomicrmw_max_i32_aligned_acquire:
4197 ; -O1: ldaxr w8, [x0]
4199 ; -O1: csel w9, w8, w1, gt
4200 ; -O1: stxr w10, w9, [x0]
4201 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
4205 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
4206 ; -O0-LABEL: atomicrmw_max_i32_aligned_release:
4207 ; -O0: subs w9, w0, w8
4208 ; -O0: csel w1, w0, w8, gt
4209 ; -O0: bl __aarch64_cas4_rel
4210 ; -O0: subs w8, w0, w8
4211 ; -O0: subs w8, w8, #1
4213 ; -O1-LABEL: atomicrmw_max_i32_aligned_release:
4214 ; -O1: ldxr w8, [x0]
4216 ; -O1: csel w9, w8, w1, gt
4217 ; -O1: stlxr w10, w9, [x0]
4218 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
4222 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4223 ; -O0-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4224 ; -O0: subs w9, w0, w8
4225 ; -O0: csel w1, w0, w8, gt
4226 ; -O0: bl __aarch64_cas4_acq_rel
4227 ; -O0: subs w8, w0, w8
4228 ; -O0: subs w8, w8, #1
4230 ; -O1-LABEL: atomicrmw_max_i32_aligned_acq_rel:
4231 ; -O1: ldaxr w8, [x0]
4233 ; -O1: csel w9, w8, w1, gt
4234 ; -O1: stlxr w10, w9, [x0]
4235 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
4239 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4240 ; -O0-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4241 ; -O0: subs w9, w0, w8
4242 ; -O0: csel w1, w0, w8, gt
4243 ; -O0: bl __aarch64_cas4_acq_rel
4244 ; -O0: subs w8, w0, w8
4245 ; -O0: subs w8, w8, #1
4247 ; -O1-LABEL: atomicrmw_max_i32_aligned_seq_cst:
4248 ; -O1: ldaxr w8, [x0]
4250 ; -O1: csel w9, w8, w1, gt
4251 ; -O1: stlxr w10, w9, [x0]
4252 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
4256 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4257 ; -O0-LABEL: atomicrmw_max_i64_aligned_monotonic:
4258 ; -O0: subs x9, x0, x8
4259 ; -O0: csel x1, x0, x8, gt
4260 ; -O0: bl __aarch64_cas8_relax
4261 ; -O0: subs x8, x0, x8
4262 ; -O0: subs w8, w8, #1
4264 ; -O1-LABEL: atomicrmw_max_i64_aligned_monotonic:
4265 ; -O1: ldxr x0, [x8]
4267 ; -O1: csel x9, x0, x1, gt
4268 ; -O1: stxr w10, x9, [x8]
4269 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
4273 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
4274 ; -O0-LABEL: atomicrmw_max_i64_aligned_acquire:
4275 ; -O0: subs x9, x0, x8
4276 ; -O0: csel x1, x0, x8, gt
4277 ; -O0: bl __aarch64_cas8_acq
4278 ; -O0: subs x8, x0, x8
4279 ; -O0: subs w8, w8, #1
4281 ; -O1-LABEL: atomicrmw_max_i64_aligned_acquire:
4282 ; -O1: ldaxr x0, [x8]
4284 ; -O1: csel x9, x0, x1, gt
4285 ; -O1: stxr w10, x9, [x8]
4286 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
4290 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
4291 ; -O0-LABEL: atomicrmw_max_i64_aligned_release:
4292 ; -O0: subs x9, x0, x8
4293 ; -O0: csel x1, x0, x8, gt
4294 ; -O0: bl __aarch64_cas8_rel
4295 ; -O0: subs x8, x0, x8
4296 ; -O0: subs w8, w8, #1
4298 ; -O1-LABEL: atomicrmw_max_i64_aligned_release:
4299 ; -O1: ldxr x0, [x8]
4301 ; -O1: csel x9, x0, x1, gt
4302 ; -O1: stlxr w10, x9, [x8]
4303 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
4307 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4308 ; -O0-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4309 ; -O0: subs x9, x0, x8
4310 ; -O0: csel x1, x0, x8, gt
4311 ; -O0: bl __aarch64_cas8_acq_rel
4312 ; -O0: subs x8, x0, x8
4313 ; -O0: subs w8, w8, #1
4315 ; -O1-LABEL: atomicrmw_max_i64_aligned_acq_rel:
4316 ; -O1: ldaxr x0, [x8]
4318 ; -O1: csel x9, x0, x1, gt
4319 ; -O1: stlxr w10, x9, [x8]
4320 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
4324 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4325 ; -O0-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4326 ; -O0: subs x9, x0, x8
4327 ; -O0: csel x1, x0, x8, gt
4328 ; -O0: bl __aarch64_cas8_acq_rel
4329 ; -O0: subs x8, x0, x8
4330 ; -O0: subs w8, w8, #1
4332 ; -O1-LABEL: atomicrmw_max_i64_aligned_seq_cst:
4333 ; -O1: ldaxr x0, [x8]
4335 ; -O1: csel x9, x0, x1, gt
4336 ; -O1: stlxr w10, x9, [x8]
4337 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
4341 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4342 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
4343 ; -O0: subs x10, x8, x1
4344 ; -O0: csel x2, x0, x9, lt
4345 ; -O0: csel x3, x1, x8, lt
4346 ; -O0: bl __aarch64_cas16_relax
4347 ; -O0: subs x10, x10, x11
4348 ; -O0: ccmp x8, x9, #0, eq
4350 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
4351 ; -O1: ldxp x1, x0, [x8]
4353 ; -O1: csel x9, x0, x2, lt
4354 ; -O1: csel x10, x1, x3, lt
4355 ; -O1: stxp w11, x10, x9, [x8]
4356 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
4360 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
4361 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
4362 ; -O0: subs x10, x8, x1
4363 ; -O0: csel x2, x0, x9, lt
4364 ; -O0: csel x3, x1, x8, lt
4365 ; -O0: bl __aarch64_cas16_acq
4366 ; -O0: subs x10, x10, x11
4367 ; -O0: ccmp x8, x9, #0, eq
4369 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
4370 ; -O1: ldaxp x1, x0, [x8]
4372 ; -O1: csel x9, x0, x2, lt
4373 ; -O1: csel x10, x1, x3, lt
4374 ; -O1: stxp w11, x10, x9, [x8]
4375 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
4379 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
4380 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
4381 ; -O0: subs x10, x8, x1
4382 ; -O0: csel x2, x0, x9, lt
4383 ; -O0: csel x3, x1, x8, lt
4384 ; -O0: bl __aarch64_cas16_rel
4385 ; -O0: subs x10, x10, x11
4386 ; -O0: ccmp x8, x9, #0, eq
4388 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
4389 ; -O1: ldxp x1, x0, [x8]
4391 ; -O1: csel x9, x0, x2, lt
4392 ; -O1: csel x10, x1, x3, lt
4393 ; -O1: stlxp w11, x10, x9, [x8]
4394 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
4398 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4399 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4400 ; -O0: subs x10, x8, x1
4401 ; -O0: csel x2, x0, x9, lt
4402 ; -O0: csel x3, x1, x8, lt
4403 ; -O0: bl __aarch64_cas16_acq_rel
4404 ; -O0: subs x10, x10, x11
4405 ; -O0: ccmp x8, x9, #0, eq
4407 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
4408 ; -O1: ldaxp x1, x0, [x8]
4410 ; -O1: csel x9, x0, x2, lt
4411 ; -O1: csel x10, x1, x3, lt
4412 ; -O1: stlxp w11, x10, x9, [x8]
4413 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
4417 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4418 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4419 ; -O0: subs x10, x8, x1
4420 ; -O0: csel x2, x0, x9, lt
4421 ; -O0: csel x3, x1, x8, lt
4422 ; -O0: bl __aarch64_cas16_acq_rel
4423 ; -O0: subs x10, x10, x11
4424 ; -O0: ccmp x8, x9, #0, eq
4426 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
4427 ; -O1: ldaxp x1, x0, [x8]
4429 ; -O1: csel x9, x0, x2, lt
4430 ; -O1: csel x10, x1, x3, lt
4431 ; -O1: stlxp w11, x10, x9, [x8]
4432 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
4436 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4437 ; -O0-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4439 ; -O0: subs w9, w9, w8, sxtb
4440 ; -O0: csel w1, w0, w8, gt
4441 ; -O0: bl __aarch64_cas1_relax
4442 ; -O0: subs w8, w0, w8, uxtb
4443 ; -O0: subs w8, w8, #1
4445 ; -O1-LABEL: atomicrmw_max_i8_unaligned_monotonic:
4446 ; -O1: ldxrb w9, [x0]
4448 ; -O1: cmp w8, w1, sxtb
4449 ; -O1: csel w9, w9, w1, gt
4450 ; -O1: stxrb w10, w9, [x0]
4451 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
4455 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4456 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acquire:
4458 ; -O0: subs w9, w9, w8, sxtb
4459 ; -O0: csel w1, w0, w8, gt
4460 ; -O0: bl __aarch64_cas1_acq
4461 ; -O0: subs w8, w0, w8, uxtb
4462 ; -O0: subs w8, w8, #1
4464 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acquire:
4465 ; -O1: ldaxrb w9, [x0]
4467 ; -O1: cmp w8, w1, sxtb
4468 ; -O1: csel w9, w9, w1, gt
4469 ; -O1: stxrb w10, w9, [x0]
4470 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
4474 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
4475 ; -O0-LABEL: atomicrmw_max_i8_unaligned_release:
4477 ; -O0: subs w9, w9, w8, sxtb
4478 ; -O0: csel w1, w0, w8, gt
4479 ; -O0: bl __aarch64_cas1_rel
4480 ; -O0: subs w8, w0, w8, uxtb
4481 ; -O0: subs w8, w8, #1
4483 ; -O1-LABEL: atomicrmw_max_i8_unaligned_release:
4484 ; -O1: ldxrb w9, [x0]
4486 ; -O1: cmp w8, w1, sxtb
4487 ; -O1: csel w9, w9, w1, gt
4488 ; -O1: stlxrb w10, w9, [x0]
4489 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
4493 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4494 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4496 ; -O0: subs w9, w9, w8, sxtb
4497 ; -O0: csel w1, w0, w8, gt
4498 ; -O0: bl __aarch64_cas1_acq_rel
4499 ; -O0: subs w8, w0, w8, uxtb
4500 ; -O0: subs w8, w8, #1
4502 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
4503 ; -O1: ldaxrb w9, [x0]
4505 ; -O1: cmp w8, w1, sxtb
4506 ; -O1: csel w9, w9, w1, gt
4507 ; -O1: stlxrb w10, w9, [x0]
4508 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
4512 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4513 ; -O0-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4515 ; -O0: subs w9, w9, w8, sxtb
4516 ; -O0: csel w1, w0, w8, gt
4517 ; -O0: bl __aarch64_cas1_acq_rel
4518 ; -O0: subs w8, w0, w8, uxtb
4519 ; -O0: subs w8, w8, #1
4521 ; -O1-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
4522 ; -O1: ldaxrb w9, [x0]
4524 ; -O1: cmp w8, w1, sxtb
4525 ; -O1: csel w9, w9, w1, gt
4526 ; -O1: stlxrb w10, w9, [x0]
4527 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
4531 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4532 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4534 ; -O0: subs w10, w10, w8, sxth
4535 ; -O0: csel w8, w9, w8, gt
4536 ; -O0: bl __atomic_compare_exchange
4538 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
4540 ; -O1: cmp w8, w20, sxth
4541 ; -O1: csel w8, w0, w20, gt
4542 ; -O1: bl __atomic_compare_exchange
4543 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
4547 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4548 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
4550 ; -O0: subs w10, w10, w8, sxth
4551 ; -O0: csel w8, w9, w8, gt
4552 ; -O0: bl __atomic_compare_exchange
4554 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
4556 ; -O1: cmp w8, w20, sxth
4557 ; -O1: csel w8, w0, w20, gt
4558 ; -O1: bl __atomic_compare_exchange
4559 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
4563 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
4564 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
4566 ; -O0: subs w10, w10, w8, sxth
4567 ; -O0: csel w8, w9, w8, gt
4568 ; -O0: bl __atomic_compare_exchange
4570 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
4572 ; -O1: cmp w8, w20, sxth
4573 ; -O1: csel w8, w0, w20, gt
4574 ; -O1: bl __atomic_compare_exchange
4575 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
4579 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4580 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4582 ; -O0: subs w10, w10, w8, sxth
4583 ; -O0: csel w8, w9, w8, gt
4584 ; -O0: bl __atomic_compare_exchange
4586 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
4588 ; -O1: cmp w8, w20, sxth
4589 ; -O1: csel w8, w0, w20, gt
4590 ; -O1: bl __atomic_compare_exchange
4591 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
4595 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4596 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4598 ; -O0: subs w10, w10, w8, sxth
4599 ; -O0: csel w8, w9, w8, gt
4600 ; -O0: bl __atomic_compare_exchange
4602 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
4604 ; -O1: cmp w8, w20, sxth
4605 ; -O1: csel w8, w0, w20, gt
4606 ; -O1: bl __atomic_compare_exchange
4607 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
4611 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4612 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4613 ; -O0: subs w10, w9, w8
4614 ; -O0: csel w8, w9, w8, gt
4615 ; -O0: bl __atomic_compare_exchange
4617 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
4619 ; -O1: csel w8, w0, w20, gt
4620 ; -O1: bl __atomic_compare_exchange
4621 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
4625 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4626 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
4627 ; -O0: subs w10, w9, w8
4628 ; -O0: csel w8, w9, w8, gt
4629 ; -O0: bl __atomic_compare_exchange
4631 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
4633 ; -O1: csel w8, w0, w20, gt
4634 ; -O1: bl __atomic_compare_exchange
4635 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
4639 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
4640 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
4641 ; -O0: subs w10, w9, w8
4642 ; -O0: csel w8, w9, w8, gt
4643 ; -O0: bl __atomic_compare_exchange
4645 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
4647 ; -O1: csel w8, w0, w20, gt
4648 ; -O1: bl __atomic_compare_exchange
4649 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
4653 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4654 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4655 ; -O0: subs w10, w9, w8
4656 ; -O0: csel w8, w9, w8, gt
4657 ; -O0: bl __atomic_compare_exchange
4659 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
4661 ; -O1: csel w8, w0, w20, gt
4662 ; -O1: bl __atomic_compare_exchange
4663 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
4667 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4668 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4669 ; -O0: subs w10, w9, w8
4670 ; -O0: csel w8, w9, w8, gt
4671 ; -O0: bl __atomic_compare_exchange
4673 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
4675 ; -O1: csel w8, w0, w20, gt
4676 ; -O1: bl __atomic_compare_exchange
4677 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
4681 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4682 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4683 ; -O0: subs x10, x9, x8
4684 ; -O0: csel x8, x9, x8, gt
4685 ; -O0: bl __atomic_compare_exchange
4687 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
4689 ; -O1: csel x8, x0, x20, gt
4690 ; -O1: bl __atomic_compare_exchange
4691 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
4695 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4696 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
4697 ; -O0: subs x10, x9, x8
4698 ; -O0: csel x8, x9, x8, gt
4699 ; -O0: bl __atomic_compare_exchange
4701 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
4703 ; -O1: csel x8, x0, x20, gt
4704 ; -O1: bl __atomic_compare_exchange
4705 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
4709 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
4710 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
4711 ; -O0: subs x10, x9, x8
4712 ; -O0: csel x8, x9, x8, gt
4713 ; -O0: bl __atomic_compare_exchange
4715 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
4717 ; -O1: csel x8, x0, x20, gt
4718 ; -O1: bl __atomic_compare_exchange
4719 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
4723 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4724 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4725 ; -O0: subs x10, x9, x8
4726 ; -O0: csel x8, x9, x8, gt
4727 ; -O0: bl __atomic_compare_exchange
4729 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
4731 ; -O1: csel x8, x0, x20, gt
4732 ; -O1: bl __atomic_compare_exchange
4733 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
4737 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4738 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4739 ; -O0: subs x10, x9, x8
4740 ; -O0: csel x8, x9, x8, gt
4741 ; -O0: bl __atomic_compare_exchange
4743 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
4745 ; -O1: csel x8, x0, x20, gt
4746 ; -O1: bl __atomic_compare_exchange
4747 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
4751 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4752 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4753 ; -O0: subs x12, x9, x10
4754 ; -O0: csel x8, x11, x8, lt
4755 ; -O0: csel x9, x10, x9, lt
4756 ; -O0: bl __atomic_compare_exchange
4758 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
4759 ; -O1: ldp x0, x1, [x0]
4761 ; -O1: csel x8, x1, x19, lt
4762 ; -O1: csel x9, x0, x21, lt
4763 ; -O1: bl __atomic_compare_exchange
4764 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
4768 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4769 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
4770 ; -O0: subs x12, x9, x10
4771 ; -O0: csel x8, x11, x8, lt
4772 ; -O0: csel x9, x10, x9, lt
4773 ; -O0: bl __atomic_compare_exchange
4775 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
4776 ; -O1: ldp x0, x1, [x0]
4778 ; -O1: csel x8, x1, x19, lt
4779 ; -O1: csel x9, x0, x21, lt
4780 ; -O1: bl __atomic_compare_exchange
4781 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
4785 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
4786 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
4787 ; -O0: subs x12, x9, x10
4788 ; -O0: csel x8, x11, x8, lt
4789 ; -O0: csel x9, x10, x9, lt
4790 ; -O0: bl __atomic_compare_exchange
4792 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
4793 ; -O1: ldp x0, x1, [x0]
4795 ; -O1: csel x8, x1, x19, lt
4796 ; -O1: csel x9, x0, x21, lt
4797 ; -O1: bl __atomic_compare_exchange
4798 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
4802 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4803 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4804 ; -O0: subs x12, x9, x10
4805 ; -O0: csel x8, x11, x8, lt
4806 ; -O0: csel x9, x10, x9, lt
4807 ; -O0: bl __atomic_compare_exchange
4809 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
4810 ; -O1: ldp x0, x1, [x0]
4812 ; -O1: csel x8, x1, x19, lt
4813 ; -O1: csel x9, x0, x21, lt
4814 ; -O1: bl __atomic_compare_exchange
4815 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
4819 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4820 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4821 ; -O0: subs x12, x9, x10
4822 ; -O0: csel x8, x11, x8, lt
4823 ; -O0: csel x9, x10, x9, lt
4824 ; -O0: bl __atomic_compare_exchange
4826 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
4827 ; -O1: ldp x0, x1, [x0]
4829 ; -O1: csel x8, x1, x19, lt
4830 ; -O1: csel x9, x0, x21, lt
4831 ; -O1: bl __atomic_compare_exchange
4832 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
4836 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4837 ; -O0-LABEL: atomicrmw_min_i8_aligned_monotonic:
4839 ; -O0: subs w9, w9, w8, sxtb
4840 ; -O0: csel w1, w0, w8, le
4841 ; -O0: bl __aarch64_cas1_relax
4842 ; -O0: subs w8, w0, w8, uxtb
4843 ; -O0: subs w8, w8, #1
4845 ; -O1-LABEL: atomicrmw_min_i8_aligned_monotonic:
4846 ; -O1: ldxrb w9, [x0]
4848 ; -O1: cmp w8, w1, sxtb
4849 ; -O1: csel w9, w9, w1, le
4850 ; -O1: stxrb w10, w9, [x0]
4851 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
4855 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
4856 ; -O0-LABEL: atomicrmw_min_i8_aligned_acquire:
4858 ; -O0: subs w9, w9, w8, sxtb
4859 ; -O0: csel w1, w0, w8, le
4860 ; -O0: bl __aarch64_cas1_acq
4861 ; -O0: subs w8, w0, w8, uxtb
4862 ; -O0: subs w8, w8, #1
4864 ; -O1-LABEL: atomicrmw_min_i8_aligned_acquire:
4865 ; -O1: ldaxrb w9, [x0]
4867 ; -O1: cmp w8, w1, sxtb
4868 ; -O1: csel w9, w9, w1, le
4869 ; -O1: stxrb w10, w9, [x0]
4870 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
4874 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
4875 ; -O0-LABEL: atomicrmw_min_i8_aligned_release:
4877 ; -O0: subs w9, w9, w8, sxtb
4878 ; -O0: csel w1, w0, w8, le
4879 ; -O0: bl __aarch64_cas1_rel
4880 ; -O0: subs w8, w0, w8, uxtb
4881 ; -O0: subs w8, w8, #1
4883 ; -O1-LABEL: atomicrmw_min_i8_aligned_release:
4884 ; -O1: ldxrb w9, [x0]
4886 ; -O1: cmp w8, w1, sxtb
4887 ; -O1: csel w9, w9, w1, le
4888 ; -O1: stlxrb w10, w9, [x0]
4889 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
4893 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4894 ; -O0-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4896 ; -O0: subs w9, w9, w8, sxtb
4897 ; -O0: csel w1, w0, w8, le
4898 ; -O0: bl __aarch64_cas1_acq_rel
4899 ; -O0: subs w8, w0, w8, uxtb
4900 ; -O0: subs w8, w8, #1
4902 ; -O1-LABEL: atomicrmw_min_i8_aligned_acq_rel:
4903 ; -O1: ldaxrb w9, [x0]
4905 ; -O1: cmp w8, w1, sxtb
4906 ; -O1: csel w9, w9, w1, le
4907 ; -O1: stlxrb w10, w9, [x0]
4908 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
4912 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4913 ; -O0-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4915 ; -O0: subs w9, w9, w8, sxtb
4916 ; -O0: csel w1, w0, w8, le
4917 ; -O0: bl __aarch64_cas1_acq_rel
4918 ; -O0: subs w8, w0, w8, uxtb
4919 ; -O0: subs w8, w8, #1
4921 ; -O1-LABEL: atomicrmw_min_i8_aligned_seq_cst:
4922 ; -O1: ldaxrb w9, [x0]
4924 ; -O1: cmp w8, w1, sxtb
4925 ; -O1: csel w9, w9, w1, le
4926 ; -O1: stlxrb w10, w9, [x0]
4927 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
4931 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4932 ; -O0-LABEL: atomicrmw_min_i16_aligned_monotonic:
4934 ; -O0: subs w9, w9, w8, sxth
4935 ; -O0: csel w1, w0, w8, le
4936 ; -O0: bl __aarch64_cas2_relax
4937 ; -O0: subs w8, w0, w8, uxth
4938 ; -O0: subs w8, w8, #1
4940 ; -O1-LABEL: atomicrmw_min_i16_aligned_monotonic:
4941 ; -O1: ldxrh w9, [x0]
4943 ; -O1: cmp w8, w1, sxth
4944 ; -O1: csel w9, w9, w1, le
4945 ; -O1: stxrh w10, w9, [x0]
4946 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
4950 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
4951 ; -O0-LABEL: atomicrmw_min_i16_aligned_acquire:
4953 ; -O0: subs w9, w9, w8, sxth
4954 ; -O0: csel w1, w0, w8, le
4955 ; -O0: bl __aarch64_cas2_acq
4956 ; -O0: subs w8, w0, w8, uxth
4957 ; -O0: subs w8, w8, #1
4959 ; -O1-LABEL: atomicrmw_min_i16_aligned_acquire:
4960 ; -O1: ldaxrh w9, [x0]
4962 ; -O1: cmp w8, w1, sxth
4963 ; -O1: csel w9, w9, w1, le
4964 ; -O1: stxrh w10, w9, [x0]
4965 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
4969 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
4970 ; -O0-LABEL: atomicrmw_min_i16_aligned_release:
4972 ; -O0: subs w9, w9, w8, sxth
4973 ; -O0: csel w1, w0, w8, le
4974 ; -O0: bl __aarch64_cas2_rel
4975 ; -O0: subs w8, w0, w8, uxth
4976 ; -O0: subs w8, w8, #1
4978 ; -O1-LABEL: atomicrmw_min_i16_aligned_release:
4979 ; -O1: ldxrh w9, [x0]
4981 ; -O1: cmp w8, w1, sxth
4982 ; -O1: csel w9, w9, w1, le
4983 ; -O1: stlxrh w10, w9, [x0]
4984 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
4988 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4989 ; -O0-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4991 ; -O0: subs w9, w9, w8, sxth
4992 ; -O0: csel w1, w0, w8, le
4993 ; -O0: bl __aarch64_cas2_acq_rel
4994 ; -O0: subs w8, w0, w8, uxth
4995 ; -O0: subs w8, w8, #1
4997 ; -O1-LABEL: atomicrmw_min_i16_aligned_acq_rel:
4998 ; -O1: ldaxrh w9, [x0]
5000 ; -O1: cmp w8, w1, sxth
5001 ; -O1: csel w9, w9, w1, le
5002 ; -O1: stlxrh w10, w9, [x0]
5003 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
5007 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5008 ; -O0-LABEL: atomicrmw_min_i16_aligned_seq_cst:
5010 ; -O0: subs w9, w9, w8, sxth
5011 ; -O0: csel w1, w0, w8, le
5012 ; -O0: bl __aarch64_cas2_acq_rel
5013 ; -O0: subs w8, w0, w8, uxth
5014 ; -O0: subs w8, w8, #1
5016 ; -O1-LABEL: atomicrmw_min_i16_aligned_seq_cst:
5017 ; -O1: ldaxrh w9, [x0]
5019 ; -O1: cmp w8, w1, sxth
5020 ; -O1: csel w9, w9, w1, le
5021 ; -O1: stlxrh w10, w9, [x0]
5022 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
5026 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5027 ; -O0-LABEL: atomicrmw_min_i32_aligned_monotonic:
5028 ; -O0: subs w9, w0, w8
5029 ; -O0: csel w1, w0, w8, le
5030 ; -O0: bl __aarch64_cas4_relax
5031 ; -O0: subs w8, w0, w8
5032 ; -O0: subs w8, w8, #1
5034 ; -O1-LABEL: atomicrmw_min_i32_aligned_monotonic:
5035 ; -O1: ldxr w8, [x0]
5037 ; -O1: csel w9, w8, w1, le
5038 ; -O1: stxr w10, w9, [x0]
5039 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
5043 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
5044 ; -O0-LABEL: atomicrmw_min_i32_aligned_acquire:
5045 ; -O0: subs w9, w0, w8
5046 ; -O0: csel w1, w0, w8, le
5047 ; -O0: bl __aarch64_cas4_acq
5048 ; -O0: subs w8, w0, w8
5049 ; -O0: subs w8, w8, #1
5051 ; -O1-LABEL: atomicrmw_min_i32_aligned_acquire:
5052 ; -O1: ldaxr w8, [x0]
5054 ; -O1: csel w9, w8, w1, le
5055 ; -O1: stxr w10, w9, [x0]
5056 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
5060 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
5061 ; -O0-LABEL: atomicrmw_min_i32_aligned_release:
5062 ; -O0: subs w9, w0, w8
5063 ; -O0: csel w1, w0, w8, le
5064 ; -O0: bl __aarch64_cas4_rel
5065 ; -O0: subs w8, w0, w8
5066 ; -O0: subs w8, w8, #1
5068 ; -O1-LABEL: atomicrmw_min_i32_aligned_release:
5069 ; -O1: ldxr w8, [x0]
5071 ; -O1: csel w9, w8, w1, le
5072 ; -O1: stlxr w10, w9, [x0]
5073 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
5077 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5078 ; -O0-LABEL: atomicrmw_min_i32_aligned_acq_rel:
5079 ; -O0: subs w9, w0, w8
5080 ; -O0: csel w1, w0, w8, le
5081 ; -O0: bl __aarch64_cas4_acq_rel
5082 ; -O0: subs w8, w0, w8
5083 ; -O0: subs w8, w8, #1
5085 ; -O1-LABEL: atomicrmw_min_i32_aligned_acq_rel:
5086 ; -O1: ldaxr w8, [x0]
5088 ; -O1: csel w9, w8, w1, le
5089 ; -O1: stlxr w10, w9, [x0]
5090 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
5094 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5095 ; -O0-LABEL: atomicrmw_min_i32_aligned_seq_cst:
5096 ; -O0: subs w9, w0, w8
5097 ; -O0: csel w1, w0, w8, le
5098 ; -O0: bl __aarch64_cas4_acq_rel
5099 ; -O0: subs w8, w0, w8
5100 ; -O0: subs w8, w8, #1
5102 ; -O1-LABEL: atomicrmw_min_i32_aligned_seq_cst:
5103 ; -O1: ldaxr w8, [x0]
5105 ; -O1: csel w9, w8, w1, le
5106 ; -O1: stlxr w10, w9, [x0]
5107 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
5111 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5112 ; -O0-LABEL: atomicrmw_min_i64_aligned_monotonic:
5113 ; -O0: subs x9, x0, x8
5114 ; -O0: csel x1, x0, x8, le
5115 ; -O0: bl __aarch64_cas8_relax
5116 ; -O0: subs x8, x0, x8
5117 ; -O0: subs w8, w8, #1
5119 ; -O1-LABEL: atomicrmw_min_i64_aligned_monotonic:
5120 ; -O1: ldxr x0, [x8]
5122 ; -O1: csel x9, x0, x1, le
5123 ; -O1: stxr w10, x9, [x8]
5124 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
5128 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
5129 ; -O0-LABEL: atomicrmw_min_i64_aligned_acquire:
5130 ; -O0: subs x9, x0, x8
5131 ; -O0: csel x1, x0, x8, le
5132 ; -O0: bl __aarch64_cas8_acq
5133 ; -O0: subs x8, x0, x8
5134 ; -O0: subs w8, w8, #1
5136 ; -O1-LABEL: atomicrmw_min_i64_aligned_acquire:
5137 ; -O1: ldaxr x0, [x8]
5139 ; -O1: csel x9, x0, x1, le
5140 ; -O1: stxr w10, x9, [x8]
5141 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
5145 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
5146 ; -O0-LABEL: atomicrmw_min_i64_aligned_release:
5147 ; -O0: subs x9, x0, x8
5148 ; -O0: csel x1, x0, x8, le
5149 ; -O0: bl __aarch64_cas8_rel
5150 ; -O0: subs x8, x0, x8
5151 ; -O0: subs w8, w8, #1
5153 ; -O1-LABEL: atomicrmw_min_i64_aligned_release:
5154 ; -O1: ldxr x0, [x8]
5156 ; -O1: csel x9, x0, x1, le
5157 ; -O1: stlxr w10, x9, [x8]
5158 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
5162 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5163 ; -O0-LABEL: atomicrmw_min_i64_aligned_acq_rel:
5164 ; -O0: subs x9, x0, x8
5165 ; -O0: csel x1, x0, x8, le
5166 ; -O0: bl __aarch64_cas8_acq_rel
5167 ; -O0: subs x8, x0, x8
5168 ; -O0: subs w8, w8, #1
5170 ; -O1-LABEL: atomicrmw_min_i64_aligned_acq_rel:
5171 ; -O1: ldaxr x0, [x8]
5173 ; -O1: csel x9, x0, x1, le
5174 ; -O1: stlxr w10, x9, [x8]
5175 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
5179 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5180 ; -O0-LABEL: atomicrmw_min_i64_aligned_seq_cst:
5181 ; -O0: subs x9, x0, x8
5182 ; -O0: csel x1, x0, x8, le
5183 ; -O0: bl __aarch64_cas8_acq_rel
5184 ; -O0: subs x8, x0, x8
5185 ; -O0: subs w8, w8, #1
5187 ; -O1-LABEL: atomicrmw_min_i64_aligned_seq_cst:
5188 ; -O1: ldaxr x0, [x8]
5190 ; -O1: csel x9, x0, x1, le
5191 ; -O1: stlxr w10, x9, [x8]
5192 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
5196 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5197 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
5198 ; -O0: subs x10, x8, x1
5199 ; -O0: csel x2, x0, x9, ge
5200 ; -O0: csel x3, x1, x8, ge
5201 ; -O0: bl __aarch64_cas16_relax
5202 ; -O0: subs x10, x10, x11
5203 ; -O0: ccmp x8, x9, #0, eq
5205 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
5206 ; -O1: ldxp x1, x0, [x8]
5208 ; -O1: csel x9, x0, x2, ge
5209 ; -O1: csel x10, x1, x3, ge
5210 ; -O1: stxp w11, x10, x9, [x8]
5211 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
5215 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
5216 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
5217 ; -O0: subs x10, x8, x1
5218 ; -O0: csel x2, x0, x9, ge
5219 ; -O0: csel x3, x1, x8, ge
5220 ; -O0: bl __aarch64_cas16_acq
5221 ; -O0: subs x10, x10, x11
5222 ; -O0: ccmp x8, x9, #0, eq
5224 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
5225 ; -O1: ldaxp x1, x0, [x8]
5227 ; -O1: csel x9, x0, x2, ge
5228 ; -O1: csel x10, x1, x3, ge
5229 ; -O1: stxp w11, x10, x9, [x8]
5230 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
5234 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
5235 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
5236 ; -O0: subs x10, x8, x1
5237 ; -O0: csel x2, x0, x9, ge
5238 ; -O0: csel x3, x1, x8, ge
5239 ; -O0: bl __aarch64_cas16_rel
5240 ; -O0: subs x10, x10, x11
5241 ; -O0: ccmp x8, x9, #0, eq
5243 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
5244 ; -O1: ldxp x1, x0, [x8]
5246 ; -O1: csel x9, x0, x2, ge
5247 ; -O1: csel x10, x1, x3, ge
5248 ; -O1: stlxp w11, x10, x9, [x8]
5249 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
5253 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5254 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
5255 ; -O0: subs x10, x8, x1
5256 ; -O0: csel x2, x0, x9, ge
5257 ; -O0: csel x3, x1, x8, ge
5258 ; -O0: bl __aarch64_cas16_acq_rel
5259 ; -O0: subs x10, x10, x11
5260 ; -O0: ccmp x8, x9, #0, eq
5262 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
5263 ; -O1: ldaxp x1, x0, [x8]
5265 ; -O1: csel x9, x0, x2, ge
5266 ; -O1: csel x10, x1, x3, ge
5267 ; -O1: stlxp w11, x10, x9, [x8]
5268 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
5272 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5273 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
5274 ; -O0: subs x10, x8, x1
5275 ; -O0: csel x2, x0, x9, ge
5276 ; -O0: csel x3, x1, x8, ge
5277 ; -O0: bl __aarch64_cas16_acq_rel
5278 ; -O0: subs x10, x10, x11
5279 ; -O0: ccmp x8, x9, #0, eq
5281 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
5282 ; -O1: ldaxp x1, x0, [x8]
5284 ; -O1: csel x9, x0, x2, ge
5285 ; -O1: csel x10, x1, x3, ge
5286 ; -O1: stlxp w11, x10, x9, [x8]
5287 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
5291 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5292 ; -O0-LABEL: atomicrmw_min_i8_unaligned_monotonic:
5294 ; -O0: subs w9, w9, w8, sxtb
5295 ; -O0: csel w1, w0, w8, le
5296 ; -O0: bl __aarch64_cas1_relax
5297 ; -O0: subs w8, w0, w8, uxtb
5298 ; -O0: subs w8, w8, #1
5300 ; -O1-LABEL: atomicrmw_min_i8_unaligned_monotonic:
5301 ; -O1: ldxrb w9, [x0]
5303 ; -O1: cmp w8, w1, sxtb
5304 ; -O1: csel w9, w9, w1, le
5305 ; -O1: stxrb w10, w9, [x0]
5306 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
5310 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5311 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acquire:
5313 ; -O0: subs w9, w9, w8, sxtb
5314 ; -O0: csel w1, w0, w8, le
5315 ; -O0: bl __aarch64_cas1_acq
5316 ; -O0: subs w8, w0, w8, uxtb
5317 ; -O0: subs w8, w8, #1
5319 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acquire:
5320 ; -O1: ldaxrb w9, [x0]
5322 ; -O1: cmp w8, w1, sxtb
5323 ; -O1: csel w9, w9, w1, le
5324 ; -O1: stxrb w10, w9, [x0]
5325 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
5329 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
5330 ; -O0-LABEL: atomicrmw_min_i8_unaligned_release:
5332 ; -O0: subs w9, w9, w8, sxtb
5333 ; -O0: csel w1, w0, w8, le
5334 ; -O0: bl __aarch64_cas1_rel
5335 ; -O0: subs w8, w0, w8, uxtb
5336 ; -O0: subs w8, w8, #1
5338 ; -O1-LABEL: atomicrmw_min_i8_unaligned_release:
5339 ; -O1: ldxrb w9, [x0]
5341 ; -O1: cmp w8, w1, sxtb
5342 ; -O1: csel w9, w9, w1, le
5343 ; -O1: stlxrb w10, w9, [x0]
5344 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
5348 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5349 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
5351 ; -O0: subs w9, w9, w8, sxtb
5352 ; -O0: csel w1, w0, w8, le
5353 ; -O0: bl __aarch64_cas1_acq_rel
5354 ; -O0: subs w8, w0, w8, uxtb
5355 ; -O0: subs w8, w8, #1
5357 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
5358 ; -O1: ldaxrb w9, [x0]
5360 ; -O1: cmp w8, w1, sxtb
5361 ; -O1: csel w9, w9, w1, le
5362 ; -O1: stlxrb w10, w9, [x0]
5363 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
5367 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5368 ; -O0-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
5370 ; -O0: subs w9, w9, w8, sxtb
5371 ; -O0: csel w1, w0, w8, le
5372 ; -O0: bl __aarch64_cas1_acq_rel
5373 ; -O0: subs w8, w0, w8, uxtb
5374 ; -O0: subs w8, w8, #1
5376 ; -O1-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
5377 ; -O1: ldaxrb w9, [x0]
5379 ; -O1: cmp w8, w1, sxtb
5380 ; -O1: csel w9, w9, w1, le
5381 ; -O1: stlxrb w10, w9, [x0]
5382 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
5386 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5387 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
5389 ; -O0: subs w10, w10, w8, sxth
5390 ; -O0: csel w8, w9, w8, le
5391 ; -O0: bl __atomic_compare_exchange
5393 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
5395 ; -O1: cmp w8, w20, sxth
5396 ; -O1: csel w8, w0, w20, le
5397 ; -O1: bl __atomic_compare_exchange
5398 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
5402 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5403 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
5405 ; -O0: subs w10, w10, w8, sxth
5406 ; -O0: csel w8, w9, w8, le
5407 ; -O0: bl __atomic_compare_exchange
5409 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
5411 ; -O1: cmp w8, w20, sxth
5412 ; -O1: csel w8, w0, w20, le
5413 ; -O1: bl __atomic_compare_exchange
5414 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
5418 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
5419 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
5421 ; -O0: subs w10, w10, w8, sxth
5422 ; -O0: csel w8, w9, w8, le
5423 ; -O0: bl __atomic_compare_exchange
5425 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
5427 ; -O1: cmp w8, w20, sxth
5428 ; -O1: csel w8, w0, w20, le
5429 ; -O1: bl __atomic_compare_exchange
5430 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
5434 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5435 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
5437 ; -O0: subs w10, w10, w8, sxth
5438 ; -O0: csel w8, w9, w8, le
5439 ; -O0: bl __atomic_compare_exchange
5441 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
5443 ; -O1: cmp w8, w20, sxth
5444 ; -O1: csel w8, w0, w20, le
5445 ; -O1: bl __atomic_compare_exchange
5446 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
5450 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5451 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
5453 ; -O0: subs w10, w10, w8, sxth
5454 ; -O0: csel w8, w9, w8, le
5455 ; -O0: bl __atomic_compare_exchange
5457 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
5459 ; -O1: cmp w8, w20, sxth
5460 ; -O1: csel w8, w0, w20, le
5461 ; -O1: bl __atomic_compare_exchange
5462 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
5466 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5467 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
5468 ; -O0: subs w10, w9, w8
5469 ; -O0: csel w8, w9, w8, le
5470 ; -O0: bl __atomic_compare_exchange
5472 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
5474 ; -O1: csel w8, w0, w20, le
5475 ; -O1: bl __atomic_compare_exchange
5476 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
5480 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5481 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
5482 ; -O0: subs w10, w9, w8
5483 ; -O0: csel w8, w9, w8, le
5484 ; -O0: bl __atomic_compare_exchange
5486 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
5488 ; -O1: csel w8, w0, w20, le
5489 ; -O1: bl __atomic_compare_exchange
5490 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
5494 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
5495 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
5496 ; -O0: subs w10, w9, w8
5497 ; -O0: csel w8, w9, w8, le
5498 ; -O0: bl __atomic_compare_exchange
5500 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
5502 ; -O1: csel w8, w0, w20, le
5503 ; -O1: bl __atomic_compare_exchange
5504 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
5508 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5509 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5510 ; -O0: subs w10, w9, w8
5511 ; -O0: csel w8, w9, w8, le
5512 ; -O0: bl __atomic_compare_exchange
5514 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
5516 ; -O1: csel w8, w0, w20, le
5517 ; -O1: bl __atomic_compare_exchange
5518 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
5522 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5523 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5524 ; -O0: subs w10, w9, w8
5525 ; -O0: csel w8, w9, w8, le
5526 ; -O0: bl __atomic_compare_exchange
5528 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
5530 ; -O1: csel w8, w0, w20, le
5531 ; -O1: bl __atomic_compare_exchange
5532 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
5536 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5537 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5538 ; -O0: subs x10, x9, x8
5539 ; -O0: csel x8, x9, x8, le
5540 ; -O0: bl __atomic_compare_exchange
5542 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
5544 ; -O1: csel x8, x0, x20, le
5545 ; -O1: bl __atomic_compare_exchange
5546 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
5550 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5551 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
5552 ; -O0: subs x10, x9, x8
5553 ; -O0: csel x8, x9, x8, le
5554 ; -O0: bl __atomic_compare_exchange
5556 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
5558 ; -O1: csel x8, x0, x20, le
5559 ; -O1: bl __atomic_compare_exchange
5560 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
5564 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
5565 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
5566 ; -O0: subs x10, x9, x8
5567 ; -O0: csel x8, x9, x8, le
5568 ; -O0: bl __atomic_compare_exchange
5570 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
5572 ; -O1: csel x8, x0, x20, le
5573 ; -O1: bl __atomic_compare_exchange
5574 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
5578 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5579 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5580 ; -O0: subs x10, x9, x8
5581 ; -O0: csel x8, x9, x8, le
5582 ; -O0: bl __atomic_compare_exchange
5584 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
5586 ; -O1: csel x8, x0, x20, le
5587 ; -O1: bl __atomic_compare_exchange
5588 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
5592 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5593 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5594 ; -O0: subs x10, x9, x8
5595 ; -O0: csel x8, x9, x8, le
5596 ; -O0: bl __atomic_compare_exchange
5598 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
5600 ; -O1: csel x8, x0, x20, le
5601 ; -O1: bl __atomic_compare_exchange
5602 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
5606 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5607 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5608 ; -O0: subs x12, x9, x10
5609 ; -O0: csel x8, x11, x8, ge
5610 ; -O0: csel x9, x10, x9, ge
5611 ; -O0: bl __atomic_compare_exchange
5613 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
5614 ; -O1: ldp x0, x1, [x0]
5616 ; -O1: csel x8, x1, x19, ge
5617 ; -O1: csel x9, x0, x21, ge
5618 ; -O1: bl __atomic_compare_exchange
5619 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
5623 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5624 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
5625 ; -O0: subs x12, x9, x10
5626 ; -O0: csel x8, x11, x8, ge
5627 ; -O0: csel x9, x10, x9, ge
5628 ; -O0: bl __atomic_compare_exchange
5630 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
5631 ; -O1: ldp x0, x1, [x0]
5633 ; -O1: csel x8, x1, x19, ge
5634 ; -O1: csel x9, x0, x21, ge
5635 ; -O1: bl __atomic_compare_exchange
5636 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
5640 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
5641 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
5642 ; -O0: subs x12, x9, x10
5643 ; -O0: csel x8, x11, x8, ge
5644 ; -O0: csel x9, x10, x9, ge
5645 ; -O0: bl __atomic_compare_exchange
5647 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
5648 ; -O1: ldp x0, x1, [x0]
5650 ; -O1: csel x8, x1, x19, ge
5651 ; -O1: csel x9, x0, x21, ge
5652 ; -O1: bl __atomic_compare_exchange
5653 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
5657 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5658 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5659 ; -O0: subs x12, x9, x10
5660 ; -O0: csel x8, x11, x8, ge
5661 ; -O0: csel x9, x10, x9, ge
5662 ; -O0: bl __atomic_compare_exchange
5664 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
5665 ; -O1: ldp x0, x1, [x0]
5667 ; -O1: csel x8, x1, x19, ge
5668 ; -O1: csel x9, x0, x21, ge
5669 ; -O1: bl __atomic_compare_exchange
5670 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
5674 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5675 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5676 ; -O0: subs x12, x9, x10
5677 ; -O0: csel x8, x11, x8, ge
5678 ; -O0: csel x9, x10, x9, ge
5679 ; -O0: bl __atomic_compare_exchange
5681 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
5682 ; -O1: ldp x0, x1, [x0]
5684 ; -O1: csel x8, x1, x19, ge
5685 ; -O1: csel x9, x0, x21, ge
5686 ; -O1: bl __atomic_compare_exchange
5687 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
5691 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5692 ; -O0-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5693 ; -O0: and w9, w0, #0xff
5694 ; -O0: subs w9, w9, w8, uxtb
5695 ; -O0: csel w1, w0, w8, hi
5696 ; -O0: bl __aarch64_cas1_relax
5697 ; -O0: subs w8, w0, w8
5698 ; -O0: subs w8, w8, #1
5700 ; -O1-LABEL: atomicrmw_umax_i8_aligned_monotonic:
5701 ; -O1: and w9, w1, #0xff
5702 ; -O1: ldxrb w8, [x0]
5704 ; -O1: csel w10, w8, w9, hi
5705 ; -O1: stxrb w11, w10, [x0]
5706 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
5710 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
5711 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acquire:
5712 ; -O0: and w9, w0, #0xff
5713 ; -O0: subs w9, w9, w8, uxtb
5714 ; -O0: csel w1, w0, w8, hi
5715 ; -O0: bl __aarch64_cas1_acq
5716 ; -O0: subs w8, w0, w8
5717 ; -O0: subs w8, w8, #1
5719 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acquire:
5720 ; -O1: and w9, w1, #0xff
5721 ; -O1: ldaxrb w8, [x0]
5723 ; -O1: csel w10, w8, w9, hi
5724 ; -O1: stxrb w11, w10, [x0]
5725 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
5729 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
5730 ; -O0-LABEL: atomicrmw_umax_i8_aligned_release:
5731 ; -O0: and w9, w0, #0xff
5732 ; -O0: subs w9, w9, w8, uxtb
5733 ; -O0: csel w1, w0, w8, hi
5734 ; -O0: bl __aarch64_cas1_rel
5735 ; -O0: subs w8, w0, w8
5736 ; -O0: subs w8, w8, #1
5738 ; -O1-LABEL: atomicrmw_umax_i8_aligned_release:
5739 ; -O1: and w9, w1, #0xff
5740 ; -O1: ldxrb w8, [x0]
5742 ; -O1: csel w10, w8, w9, hi
5743 ; -O1: stlxrb w11, w10, [x0]
5744 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
5748 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5749 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5750 ; -O0: and w9, w0, #0xff
5751 ; -O0: subs w9, w9, w8, uxtb
5752 ; -O0: csel w1, w0, w8, hi
5753 ; -O0: bl __aarch64_cas1_acq_rel
5754 ; -O0: subs w8, w0, w8
5755 ; -O0: subs w8, w8, #1
5757 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
5758 ; -O1: and w9, w1, #0xff
5759 ; -O1: ldaxrb w8, [x0]
5761 ; -O1: csel w10, w8, w9, hi
5762 ; -O1: stlxrb w11, w10, [x0]
5763 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
5767 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5768 ; -O0-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5769 ; -O0: and w9, w0, #0xff
5770 ; -O0: subs w9, w9, w8, uxtb
5771 ; -O0: csel w1, w0, w8, hi
5772 ; -O0: bl __aarch64_cas1_acq_rel
5773 ; -O0: subs w8, w0, w8
5774 ; -O0: subs w8, w8, #1
5776 ; -O1-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
5777 ; -O1: and w9, w1, #0xff
5778 ; -O1: ldaxrb w8, [x0]
5780 ; -O1: csel w10, w8, w9, hi
5781 ; -O1: stlxrb w11, w10, [x0]
5782 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
5786 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5787 ; -O0-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5788 ; -O0: and w9, w0, #0xffff
5789 ; -O0: subs w9, w9, w8, uxth
5790 ; -O0: csel w1, w0, w8, hi
5791 ; -O0: bl __aarch64_cas2_relax
5792 ; -O0: subs w8, w0, w8
5793 ; -O0: subs w8, w8, #1
5795 ; -O1-LABEL: atomicrmw_umax_i16_aligned_monotonic:
5796 ; -O1: and w9, w1, #0xffff
5797 ; -O1: ldxrh w8, [x0]
5799 ; -O1: csel w10, w8, w9, hi
5800 ; -O1: stxrh w11, w10, [x0]
5801 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
5805 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
5806 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acquire:
5807 ; -O0: and w9, w0, #0xffff
5808 ; -O0: subs w9, w9, w8, uxth
5809 ; -O0: csel w1, w0, w8, hi
5810 ; -O0: bl __aarch64_cas2_acq
5811 ; -O0: subs w8, w0, w8
5812 ; -O0: subs w8, w8, #1
5814 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acquire:
5815 ; -O1: and w9, w1, #0xffff
5816 ; -O1: ldaxrh w8, [x0]
5818 ; -O1: csel w10, w8, w9, hi
5819 ; -O1: stxrh w11, w10, [x0]
5820 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
5824 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
5825 ; -O0-LABEL: atomicrmw_umax_i16_aligned_release:
5826 ; -O0: and w9, w0, #0xffff
5827 ; -O0: subs w9, w9, w8, uxth
5828 ; -O0: csel w1, w0, w8, hi
5829 ; -O0: bl __aarch64_cas2_rel
5830 ; -O0: subs w8, w0, w8
5831 ; -O0: subs w8, w8, #1
5833 ; -O1-LABEL: atomicrmw_umax_i16_aligned_release:
5834 ; -O1: and w9, w1, #0xffff
5835 ; -O1: ldxrh w8, [x0]
5837 ; -O1: csel w10, w8, w9, hi
5838 ; -O1: stlxrh w11, w10, [x0]
5839 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
5843 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5844 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5845 ; -O0: and w9, w0, #0xffff
5846 ; -O0: subs w9, w9, w8, uxth
5847 ; -O0: csel w1, w0, w8, hi
5848 ; -O0: bl __aarch64_cas2_acq_rel
5849 ; -O0: subs w8, w0, w8
5850 ; -O0: subs w8, w8, #1
5852 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
5853 ; -O1: and w9, w1, #0xffff
5854 ; -O1: ldaxrh w8, [x0]
5856 ; -O1: csel w10, w8, w9, hi
5857 ; -O1: stlxrh w11, w10, [x0]
5858 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
5862 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5863 ; -O0-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5864 ; -O0: and w9, w0, #0xffff
5865 ; -O0: subs w9, w9, w8, uxth
5866 ; -O0: csel w1, w0, w8, hi
5867 ; -O0: bl __aarch64_cas2_acq_rel
5868 ; -O0: subs w8, w0, w8
5869 ; -O0: subs w8, w8, #1
5871 ; -O1-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
5872 ; -O1: and w9, w1, #0xffff
5873 ; -O1: ldaxrh w8, [x0]
5875 ; -O1: csel w10, w8, w9, hi
5876 ; -O1: stlxrh w11, w10, [x0]
5877 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
5881 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5882 ; -O0-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5883 ; -O0: subs w9, w0, w8
5884 ; -O0: csel w1, w0, w8, hi
5885 ; -O0: bl __aarch64_cas4_relax
5886 ; -O0: subs w8, w0, w8
5887 ; -O0: subs w8, w8, #1
5889 ; -O1-LABEL: atomicrmw_umax_i32_aligned_monotonic:
5890 ; -O1: ldxr w8, [x0]
5892 ; -O1: csel w9, w8, w1, hi
5893 ; -O1: stxr w10, w9, [x0]
5894 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
5898 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
5899 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acquire:
5900 ; -O0: subs w9, w0, w8
5901 ; -O0: csel w1, w0, w8, hi
5902 ; -O0: bl __aarch64_cas4_acq
5903 ; -O0: subs w8, w0, w8
5904 ; -O0: subs w8, w8, #1
5906 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acquire:
5907 ; -O1: ldaxr w8, [x0]
5909 ; -O1: csel w9, w8, w1, hi
5910 ; -O1: stxr w10, w9, [x0]
5911 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
5915 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
5916 ; -O0-LABEL: atomicrmw_umax_i32_aligned_release:
5917 ; -O0: subs w9, w0, w8
5918 ; -O0: csel w1, w0, w8, hi
5919 ; -O0: bl __aarch64_cas4_rel
5920 ; -O0: subs w8, w0, w8
5921 ; -O0: subs w8, w8, #1
5923 ; -O1-LABEL: atomicrmw_umax_i32_aligned_release:
5924 ; -O1: ldxr w8, [x0]
5926 ; -O1: csel w9, w8, w1, hi
5927 ; -O1: stlxr w10, w9, [x0]
5928 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
5932 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5933 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5934 ; -O0: subs w9, w0, w8
5935 ; -O0: csel w1, w0, w8, hi
5936 ; -O0: bl __aarch64_cas4_acq_rel
5937 ; -O0: subs w8, w0, w8
5938 ; -O0: subs w8, w8, #1
5940 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
5941 ; -O1: ldaxr w8, [x0]
5943 ; -O1: csel w9, w8, w1, hi
5944 ; -O1: stlxr w10, w9, [x0]
5945 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
5949 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5950 ; -O0-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5951 ; -O0: subs w9, w0, w8
5952 ; -O0: csel w1, w0, w8, hi
5953 ; -O0: bl __aarch64_cas4_acq_rel
5954 ; -O0: subs w8, w0, w8
5955 ; -O0: subs w8, w8, #1
5957 ; -O1-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
5958 ; -O1: ldaxr w8, [x0]
5960 ; -O1: csel w9, w8, w1, hi
5961 ; -O1: stlxr w10, w9, [x0]
5962 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
5966 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5967 ; -O0-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5968 ; -O0: subs x9, x0, x8
5969 ; -O0: csel x1, x0, x8, hi
5970 ; -O0: bl __aarch64_cas8_relax
5971 ; -O0: subs x8, x0, x8
5972 ; -O0: subs w8, w8, #1
5974 ; -O1-LABEL: atomicrmw_umax_i64_aligned_monotonic:
5975 ; -O1: ldxr x0, [x8]
5977 ; -O1: csel x9, x0, x1, hi
5978 ; -O1: stxr w10, x9, [x8]
5979 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
5983 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
5984 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acquire:
5985 ; -O0: subs x9, x0, x8
5986 ; -O0: csel x1, x0, x8, hi
5987 ; -O0: bl __aarch64_cas8_acq
5988 ; -O0: subs x8, x0, x8
5989 ; -O0: subs w8, w8, #1
5991 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acquire:
5992 ; -O1: ldaxr x0, [x8]
5994 ; -O1: csel x9, x0, x1, hi
5995 ; -O1: stxr w10, x9, [x8]
5996 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
6000 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
6001 ; -O0-LABEL: atomicrmw_umax_i64_aligned_release:
6002 ; -O0: subs x9, x0, x8
6003 ; -O0: csel x1, x0, x8, hi
6004 ; -O0: bl __aarch64_cas8_rel
6005 ; -O0: subs x8, x0, x8
6006 ; -O0: subs w8, w8, #1
6008 ; -O1-LABEL: atomicrmw_umax_i64_aligned_release:
6009 ; -O1: ldxr x0, [x8]
6011 ; -O1: csel x9, x0, x1, hi
6012 ; -O1: stlxr w10, x9, [x8]
6013 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
6017 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6018 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
6019 ; -O0: subs x9, x0, x8
6020 ; -O0: csel x1, x0, x8, hi
6021 ; -O0: bl __aarch64_cas8_acq_rel
6022 ; -O0: subs x8, x0, x8
6023 ; -O0: subs w8, w8, #1
6025 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
6026 ; -O1: ldaxr x0, [x8]
6028 ; -O1: csel x9, x0, x1, hi
6029 ; -O1: stlxr w10, x9, [x8]
6030 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
6034 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6035 ; -O0-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
6036 ; -O0: subs x9, x0, x8
6037 ; -O0: csel x1, x0, x8, hi
6038 ; -O0: bl __aarch64_cas8_acq_rel
6039 ; -O0: subs x8, x0, x8
6040 ; -O0: subs w8, w8, #1
6042 ; -O1-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
6043 ; -O1: ldaxr x0, [x8]
6045 ; -O1: csel x9, x0, x1, hi
6046 ; -O1: stlxr w10, x9, [x8]
6047 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
6051 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6052 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
6053 ; -O0: subs x10, x8, x1
6054 ; -O0: csel x2, x0, x9, lo
6055 ; -O0: csel x3, x1, x8, lo
6056 ; -O0: bl __aarch64_cas16_relax
6057 ; -O0: subs x10, x10, x11
6058 ; -O0: ccmp x8, x9, #0, eq
6060 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
6061 ; -O1: ldxp x1, x0, [x8]
6063 ; -O1: csel x9, x0, x2, lo
6064 ; -O1: csel x10, x1, x3, lo
6065 ; -O1: stxp w11, x10, x9, [x8]
6066 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
6070 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
6071 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
6072 ; -O0: subs x10, x8, x1
6073 ; -O0: csel x2, x0, x9, lo
6074 ; -O0: csel x3, x1, x8, lo
6075 ; -O0: bl __aarch64_cas16_acq
6076 ; -O0: subs x10, x10, x11
6077 ; -O0: ccmp x8, x9, #0, eq
6079 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
6080 ; -O1: ldaxp x1, x0, [x8]
6082 ; -O1: csel x9, x0, x2, lo
6083 ; -O1: csel x10, x1, x3, lo
6084 ; -O1: stxp w11, x10, x9, [x8]
6085 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
6089 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
6090 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
6091 ; -O0: subs x10, x8, x1
6092 ; -O0: csel x2, x0, x9, lo
6093 ; -O0: csel x3, x1, x8, lo
6094 ; -O0: bl __aarch64_cas16_rel
6095 ; -O0: subs x10, x10, x11
6096 ; -O0: ccmp x8, x9, #0, eq
6098 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
6099 ; -O1: ldxp x1, x0, [x8]
6101 ; -O1: csel x9, x0, x2, lo
6102 ; -O1: csel x10, x1, x3, lo
6103 ; -O1: stlxp w11, x10, x9, [x8]
6104 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
6108 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6109 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
6110 ; -O0: subs x10, x8, x1
6111 ; -O0: csel x2, x0, x9, lo
6112 ; -O0: csel x3, x1, x8, lo
6113 ; -O0: bl __aarch64_cas16_acq_rel
6114 ; -O0: subs x10, x10, x11
6115 ; -O0: ccmp x8, x9, #0, eq
6117 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
6118 ; -O1: ldaxp x1, x0, [x8]
6120 ; -O1: csel x9, x0, x2, lo
6121 ; -O1: csel x10, x1, x3, lo
6122 ; -O1: stlxp w11, x10, x9, [x8]
6123 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
6127 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6128 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
6129 ; -O0: subs x10, x8, x1
6130 ; -O0: csel x2, x0, x9, lo
6131 ; -O0: csel x3, x1, x8, lo
6132 ; -O0: bl __aarch64_cas16_acq_rel
6133 ; -O0: subs x10, x10, x11
6134 ; -O0: ccmp x8, x9, #0, eq
6136 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
6137 ; -O1: ldaxp x1, x0, [x8]
6139 ; -O1: csel x9, x0, x2, lo
6140 ; -O1: csel x10, x1, x3, lo
6141 ; -O1: stlxp w11, x10, x9, [x8]
6142 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
6146 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6147 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
6148 ; -O0: and w9, w0, #0xff
6149 ; -O0: subs w9, w9, w8, uxtb
6150 ; -O0: csel w1, w0, w8, hi
6151 ; -O0: bl __aarch64_cas1_relax
6152 ; -O0: subs w8, w0, w8
6153 ; -O0: subs w8, w8, #1
6155 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
6156 ; -O1: and w9, w1, #0xff
6157 ; -O1: ldxrb w8, [x0]
6159 ; -O1: csel w10, w8, w9, hi
6160 ; -O1: stxrb w11, w10, [x0]
6161 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
6165 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6166 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acquire:
6167 ; -O0: and w9, w0, #0xff
6168 ; -O0: subs w9, w9, w8, uxtb
6169 ; -O0: csel w1, w0, w8, hi
6170 ; -O0: bl __aarch64_cas1_acq
6171 ; -O0: subs w8, w0, w8
6172 ; -O0: subs w8, w8, #1
6174 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acquire:
6175 ; -O1: and w9, w1, #0xff
6176 ; -O1: ldaxrb w8, [x0]
6178 ; -O1: csel w10, w8, w9, hi
6179 ; -O1: stxrb w11, w10, [x0]
6180 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
6184 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
6185 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_release:
6186 ; -O0: and w9, w0, #0xff
6187 ; -O0: subs w9, w9, w8, uxtb
6188 ; -O0: csel w1, w0, w8, hi
6189 ; -O0: bl __aarch64_cas1_rel
6190 ; -O0: subs w8, w0, w8
6191 ; -O0: subs w8, w8, #1
6193 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_release:
6194 ; -O1: and w9, w1, #0xff
6195 ; -O1: ldxrb w8, [x0]
6197 ; -O1: csel w10, w8, w9, hi
6198 ; -O1: stlxrb w11, w10, [x0]
6199 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
6203 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6204 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
6205 ; -O0: and w9, w0, #0xff
6206 ; -O0: subs w9, w9, w8, uxtb
6207 ; -O0: csel w1, w0, w8, hi
6208 ; -O0: bl __aarch64_cas1_acq_rel
6209 ; -O0: subs w8, w0, w8
6210 ; -O0: subs w8, w8, #1
6212 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
6213 ; -O1: and w9, w1, #0xff
6214 ; -O1: ldaxrb w8, [x0]
6216 ; -O1: csel w10, w8, w9, hi
6217 ; -O1: stlxrb w11, w10, [x0]
6218 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
6222 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6223 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
6224 ; -O0: and w9, w0, #0xff
6225 ; -O0: subs w9, w9, w8, uxtb
6226 ; -O0: csel w1, w0, w8, hi
6227 ; -O0: bl __aarch64_cas1_acq_rel
6228 ; -O0: subs w8, w0, w8
6229 ; -O0: subs w8, w8, #1
6231 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
6232 ; -O1: and w9, w1, #0xff
6233 ; -O1: ldaxrb w8, [x0]
6235 ; -O1: csel w10, w8, w9, hi
6236 ; -O1: stlxrb w11, w10, [x0]
6237 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
6241 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6242 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
6243 ; -O0: and w10, w9, #0xffff
6244 ; -O0: subs w10, w10, w8, uxth
6245 ; -O0: csel w8, w9, w8, hi
6246 ; -O0: bl __atomic_compare_exchange
6248 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
6249 ; -O1: and w8, w0, #0xffff
6250 ; -O1: cmp w8, w20, uxth
6251 ; -O1: csel w8, w0, w20, hi
6252 ; -O1: bl __atomic_compare_exchange
6253 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
6257 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6258 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
6259 ; -O0: and w10, w9, #0xffff
6260 ; -O0: subs w10, w10, w8, uxth
6261 ; -O0: csel w8, w9, w8, hi
6262 ; -O0: bl __atomic_compare_exchange
6264 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
6265 ; -O1: and w8, w0, #0xffff
6266 ; -O1: cmp w8, w20, uxth
6267 ; -O1: csel w8, w0, w20, hi
6268 ; -O1: bl __atomic_compare_exchange
6269 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
6273 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
6274 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
6275 ; -O0: and w10, w9, #0xffff
6276 ; -O0: subs w10, w10, w8, uxth
6277 ; -O0: csel w8, w9, w8, hi
6278 ; -O0: bl __atomic_compare_exchange
6280 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
6281 ; -O1: and w8, w0, #0xffff
6282 ; -O1: cmp w8, w20, uxth
6283 ; -O1: csel w8, w0, w20, hi
6284 ; -O1: bl __atomic_compare_exchange
6285 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
6289 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6290 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
6291 ; -O0: and w10, w9, #0xffff
6292 ; -O0: subs w10, w10, w8, uxth
6293 ; -O0: csel w8, w9, w8, hi
6294 ; -O0: bl __atomic_compare_exchange
6296 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
6297 ; -O1: and w8, w0, #0xffff
6298 ; -O1: cmp w8, w20, uxth
6299 ; -O1: csel w8, w0, w20, hi
6300 ; -O1: bl __atomic_compare_exchange
6301 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
6305 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6306 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
6307 ; -O0: and w10, w9, #0xffff
6308 ; -O0: subs w10, w10, w8, uxth
6309 ; -O0: csel w8, w9, w8, hi
6310 ; -O0: bl __atomic_compare_exchange
6312 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
6313 ; -O1: and w8, w0, #0xffff
6314 ; -O1: cmp w8, w20, uxth
6315 ; -O1: csel w8, w0, w20, hi
6316 ; -O1: bl __atomic_compare_exchange
6317 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
6321 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6322 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
6323 ; -O0: subs w10, w9, w8
6324 ; -O0: csel w8, w9, w8, hi
6325 ; -O0: bl __atomic_compare_exchange
6327 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
6329 ; -O1: csel w8, w0, w20, hi
6330 ; -O1: bl __atomic_compare_exchange
6331 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
6335 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6336 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
6337 ; -O0: subs w10, w9, w8
6338 ; -O0: csel w8, w9, w8, hi
6339 ; -O0: bl __atomic_compare_exchange
6341 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
6343 ; -O1: csel w8, w0, w20, hi
6344 ; -O1: bl __atomic_compare_exchange
6345 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
6349 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
6350 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
6351 ; -O0: subs w10, w9, w8
6352 ; -O0: csel w8, w9, w8, hi
6353 ; -O0: bl __atomic_compare_exchange
6355 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
6357 ; -O1: csel w8, w0, w20, hi
6358 ; -O1: bl __atomic_compare_exchange
6359 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
6363 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6364 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
6365 ; -O0: subs w10, w9, w8
6366 ; -O0: csel w8, w9, w8, hi
6367 ; -O0: bl __atomic_compare_exchange
6369 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
6371 ; -O1: csel w8, w0, w20, hi
6372 ; -O1: bl __atomic_compare_exchange
6373 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
6377 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6378 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
6379 ; -O0: subs w10, w9, w8
6380 ; -O0: csel w8, w9, w8, hi
6381 ; -O0: bl __atomic_compare_exchange
6383 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
6385 ; -O1: csel w8, w0, w20, hi
6386 ; -O1: bl __atomic_compare_exchange
6387 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
6391 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6392 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
6393 ; -O0: subs x10, x9, x8
6394 ; -O0: csel x8, x9, x8, hi
6395 ; -O0: bl __atomic_compare_exchange
6397 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
6399 ; -O1: csel x8, x0, x20, hi
6400 ; -O1: bl __atomic_compare_exchange
6401 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
6405 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6406 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
6407 ; -O0: subs x10, x9, x8
6408 ; -O0: csel x8, x9, x8, hi
6409 ; -O0: bl __atomic_compare_exchange
6411 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
6413 ; -O1: csel x8, x0, x20, hi
6414 ; -O1: bl __atomic_compare_exchange
6415 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
6419 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
6420 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
6421 ; -O0: subs x10, x9, x8
6422 ; -O0: csel x8, x9, x8, hi
6423 ; -O0: bl __atomic_compare_exchange
6425 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
6427 ; -O1: csel x8, x0, x20, hi
6428 ; -O1: bl __atomic_compare_exchange
6429 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
6433 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6434 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
6435 ; -O0: subs x10, x9, x8
6436 ; -O0: csel x8, x9, x8, hi
6437 ; -O0: bl __atomic_compare_exchange
6439 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
6441 ; -O1: csel x8, x0, x20, hi
6442 ; -O1: bl __atomic_compare_exchange
6443 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
6447 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6448 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
6449 ; -O0: subs x10, x9, x8
6450 ; -O0: csel x8, x9, x8, hi
6451 ; -O0: bl __atomic_compare_exchange
6453 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
6455 ; -O1: csel x8, x0, x20, hi
6456 ; -O1: bl __atomic_compare_exchange
6457 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
6461 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6462 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
6463 ; -O0: subs x12, x9, x10
6464 ; -O0: csel x8, x11, x8, lo
6465 ; -O0: csel x9, x10, x9, lo
6466 ; -O0: bl __atomic_compare_exchange
6468 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
6469 ; -O1: ldp x0, x1, [x0]
6471 ; -O1: csel x8, x1, x19, lo
6472 ; -O1: csel x9, x0, x21, lo
6473 ; -O1: bl __atomic_compare_exchange
6474 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
6478 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6479 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
6480 ; -O0: subs x12, x9, x10
6481 ; -O0: csel x8, x11, x8, lo
6482 ; -O0: csel x9, x10, x9, lo
6483 ; -O0: bl __atomic_compare_exchange
6485 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
6486 ; -O1: ldp x0, x1, [x0]
6488 ; -O1: csel x8, x1, x19, lo
6489 ; -O1: csel x9, x0, x21, lo
6490 ; -O1: bl __atomic_compare_exchange
6491 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
6495 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
6496 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
6497 ; -O0: subs x12, x9, x10
6498 ; -O0: csel x8, x11, x8, lo
6499 ; -O0: csel x9, x10, x9, lo
6500 ; -O0: bl __atomic_compare_exchange
6502 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
6503 ; -O1: ldp x0, x1, [x0]
6505 ; -O1: csel x8, x1, x19, lo
6506 ; -O1: csel x9, x0, x21, lo
6507 ; -O1: bl __atomic_compare_exchange
6508 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
6512 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6513 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
6514 ; -O0: subs x12, x9, x10
6515 ; -O0: csel x8, x11, x8, lo
6516 ; -O0: csel x9, x10, x9, lo
6517 ; -O0: bl __atomic_compare_exchange
6519 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
6520 ; -O1: ldp x0, x1, [x0]
6522 ; -O1: csel x8, x1, x19, lo
6523 ; -O1: csel x9, x0, x21, lo
6524 ; -O1: bl __atomic_compare_exchange
6525 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
6529 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6530 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
6531 ; -O0: subs x12, x9, x10
6532 ; -O0: csel x8, x11, x8, lo
6533 ; -O0: csel x9, x10, x9, lo
6534 ; -O0: bl __atomic_compare_exchange
6536 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
6537 ; -O1: ldp x0, x1, [x0]
6539 ; -O1: csel x8, x1, x19, lo
6540 ; -O1: csel x9, x0, x21, lo
6541 ; -O1: bl __atomic_compare_exchange
6542 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
6546 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
6547 ; -O0-LABEL: atomicrmw_umin_i8_aligned_monotonic:
6548 ; -O0: and w9, w0, #0xff
6549 ; -O0: subs w9, w9, w8, uxtb
6550 ; -O0: csel w1, w0, w8, ls
6551 ; -O0: bl __aarch64_cas1_relax
6552 ; -O0: subs w8, w0, w8
6553 ; -O0: subs w8, w8, #1
6555 ; -O1-LABEL: atomicrmw_umin_i8_aligned_monotonic:
6556 ; -O1: and w9, w1, #0xff
6557 ; -O1: ldxrb w8, [x0]
6559 ; -O1: csel w10, w8, w9, ls
6560 ; -O1: stxrb w11, w10, [x0]
6561 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
6565 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
6566 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acquire:
6567 ; -O0: and w9, w0, #0xff
6568 ; -O0: subs w9, w9, w8, uxtb
6569 ; -O0: csel w1, w0, w8, ls
6570 ; -O0: bl __aarch64_cas1_acq
6571 ; -O0: subs w8, w0, w8
6572 ; -O0: subs w8, w8, #1
6574 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acquire:
6575 ; -O1: and w9, w1, #0xff
6576 ; -O1: ldaxrb w8, [x0]
6578 ; -O1: csel w10, w8, w9, ls
6579 ; -O1: stxrb w11, w10, [x0]
6580 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
6584 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
6585 ; -O0-LABEL: atomicrmw_umin_i8_aligned_release:
6586 ; -O0: and w9, w0, #0xff
6587 ; -O0: subs w9, w9, w8, uxtb
6588 ; -O0: csel w1, w0, w8, ls
6589 ; -O0: bl __aarch64_cas1_rel
6590 ; -O0: subs w8, w0, w8
6591 ; -O0: subs w8, w8, #1
6593 ; -O1-LABEL: atomicrmw_umin_i8_aligned_release:
6594 ; -O1: and w9, w1, #0xff
6595 ; -O1: ldxrb w8, [x0]
6597 ; -O1: csel w10, w8, w9, ls
6598 ; -O1: stlxrb w11, w10, [x0]
6599 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
6603 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
6604 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
6605 ; -O0: and w9, w0, #0xff
6606 ; -O0: subs w9, w9, w8, uxtb
6607 ; -O0: csel w1, w0, w8, ls
6608 ; -O0: bl __aarch64_cas1_acq_rel
6609 ; -O0: subs w8, w0, w8
6610 ; -O0: subs w8, w8, #1
6612 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
6613 ; -O1: and w9, w1, #0xff
6614 ; -O1: ldaxrb w8, [x0]
6616 ; -O1: csel w10, w8, w9, ls
6617 ; -O1: stlxrb w11, w10, [x0]
6618 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
6622 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
6623 ; -O0-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
6624 ; -O0: and w9, w0, #0xff
6625 ; -O0: subs w9, w9, w8, uxtb
6626 ; -O0: csel w1, w0, w8, ls
6627 ; -O0: bl __aarch64_cas1_acq_rel
6628 ; -O0: subs w8, w0, w8
6629 ; -O0: subs w8, w8, #1
6631 ; -O1-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
6632 ; -O1: and w9, w1, #0xff
6633 ; -O1: ldaxrb w8, [x0]
6635 ; -O1: csel w10, w8, w9, ls
6636 ; -O1: stlxrb w11, w10, [x0]
6637 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
6641 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
6642 ; -O0-LABEL: atomicrmw_umin_i16_aligned_monotonic:
6643 ; -O0: and w9, w0, #0xffff
6644 ; -O0: subs w9, w9, w8, uxth
6645 ; -O0: csel w1, w0, w8, ls
6646 ; -O0: bl __aarch64_cas2_relax
6647 ; -O0: subs w8, w0, w8
6648 ; -O0: subs w8, w8, #1
6650 ; -O1-LABEL: atomicrmw_umin_i16_aligned_monotonic:
6651 ; -O1: and w9, w1, #0xffff
6652 ; -O1: ldxrh w8, [x0]
6654 ; -O1: csel w10, w8, w9, ls
6655 ; -O1: stxrh w11, w10, [x0]
6656 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
6660 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
6661 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acquire:
6662 ; -O0: and w9, w0, #0xffff
6663 ; -O0: subs w9, w9, w8, uxth
6664 ; -O0: csel w1, w0, w8, ls
6665 ; -O0: bl __aarch64_cas2_acq
6666 ; -O0: subs w8, w0, w8
6667 ; -O0: subs w8, w8, #1
6669 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acquire:
6670 ; -O1: and w9, w1, #0xffff
6671 ; -O1: ldaxrh w8, [x0]
6673 ; -O1: csel w10, w8, w9, ls
6674 ; -O1: stxrh w11, w10, [x0]
6675 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
6679 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
6680 ; -O0-LABEL: atomicrmw_umin_i16_aligned_release:
6681 ; -O0: and w9, w0, #0xffff
6682 ; -O0: subs w9, w9, w8, uxth
6683 ; -O0: csel w1, w0, w8, ls
6684 ; -O0: bl __aarch64_cas2_rel
6685 ; -O0: subs w8, w0, w8
6686 ; -O0: subs w8, w8, #1
6688 ; -O1-LABEL: atomicrmw_umin_i16_aligned_release:
6689 ; -O1: and w9, w1, #0xffff
6690 ; -O1: ldxrh w8, [x0]
6692 ; -O1: csel w10, w8, w9, ls
6693 ; -O1: stlxrh w11, w10, [x0]
6694 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
6698 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6699 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
6700 ; -O0: and w9, w0, #0xffff
6701 ; -O0: subs w9, w9, w8, uxth
6702 ; -O0: csel w1, w0, w8, ls
6703 ; -O0: bl __aarch64_cas2_acq_rel
6704 ; -O0: subs w8, w0, w8
6705 ; -O0: subs w8, w8, #1
6707 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
6708 ; -O1: and w9, w1, #0xffff
6709 ; -O1: ldaxrh w8, [x0]
6711 ; -O1: csel w10, w8, w9, ls
6712 ; -O1: stlxrh w11, w10, [x0]
6713 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
6717 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6718 ; -O0-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
6719 ; -O0: and w9, w0, #0xffff
6720 ; -O0: subs w9, w9, w8, uxth
6721 ; -O0: csel w1, w0, w8, ls
6722 ; -O0: bl __aarch64_cas2_acq_rel
6723 ; -O0: subs w8, w0, w8
6724 ; -O0: subs w8, w8, #1
6726 ; -O1-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
6727 ; -O1: and w9, w1, #0xffff
6728 ; -O1: ldaxrh w8, [x0]
6730 ; -O1: csel w10, w8, w9, ls
6731 ; -O1: stlxrh w11, w10, [x0]
6732 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
6736 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6737 ; -O0-LABEL: atomicrmw_umin_i32_aligned_monotonic:
6738 ; -O0: subs w9, w0, w8
6739 ; -O0: csel w1, w0, w8, ls
6740 ; -O0: bl __aarch64_cas4_relax
6741 ; -O0: subs w8, w0, w8
6742 ; -O0: subs w8, w8, #1
6744 ; -O1-LABEL: atomicrmw_umin_i32_aligned_monotonic:
6745 ; -O1: ldxr w8, [x0]
6747 ; -O1: csel w9, w8, w1, ls
6748 ; -O1: stxr w10, w9, [x0]
6749 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
6753 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
6754 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acquire:
6755 ; -O0: subs w9, w0, w8
6756 ; -O0: csel w1, w0, w8, ls
6757 ; -O0: bl __aarch64_cas4_acq
6758 ; -O0: subs w8, w0, w8
6759 ; -O0: subs w8, w8, #1
6761 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acquire:
6762 ; -O1: ldaxr w8, [x0]
6764 ; -O1: csel w9, w8, w1, ls
6765 ; -O1: stxr w10, w9, [x0]
6766 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
6770 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
6771 ; -O0-LABEL: atomicrmw_umin_i32_aligned_release:
6772 ; -O0: subs w9, w0, w8
6773 ; -O0: csel w1, w0, w8, ls
6774 ; -O0: bl __aarch64_cas4_rel
6775 ; -O0: subs w8, w0, w8
6776 ; -O0: subs w8, w8, #1
6778 ; -O1-LABEL: atomicrmw_umin_i32_aligned_release:
6779 ; -O1: ldxr w8, [x0]
6781 ; -O1: csel w9, w8, w1, ls
6782 ; -O1: stlxr w10, w9, [x0]
6783 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
6787 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6788 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
6789 ; -O0: subs w9, w0, w8
6790 ; -O0: csel w1, w0, w8, ls
6791 ; -O0: bl __aarch64_cas4_acq_rel
6792 ; -O0: subs w8, w0, w8
6793 ; -O0: subs w8, w8, #1
6795 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
6796 ; -O1: ldaxr w8, [x0]
6798 ; -O1: csel w9, w8, w1, ls
6799 ; -O1: stlxr w10, w9, [x0]
6800 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
6804 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6805 ; -O0-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
6806 ; -O0: subs w9, w0, w8
6807 ; -O0: csel w1, w0, w8, ls
6808 ; -O0: bl __aarch64_cas4_acq_rel
6809 ; -O0: subs w8, w0, w8
6810 ; -O0: subs w8, w8, #1
6812 ; -O1-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
6813 ; -O1: ldaxr w8, [x0]
6815 ; -O1: csel w9, w8, w1, ls
6816 ; -O1: stlxr w10, w9, [x0]
6817 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
6821 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6822 ; -O0-LABEL: atomicrmw_umin_i64_aligned_monotonic:
6823 ; -O0: subs x9, x0, x8
6824 ; -O0: csel x1, x0, x8, ls
6825 ; -O0: bl __aarch64_cas8_relax
6826 ; -O0: subs x8, x0, x8
6827 ; -O0: subs w8, w8, #1
6829 ; -O1-LABEL: atomicrmw_umin_i64_aligned_monotonic:
6830 ; -O1: ldxr x0, [x8]
6832 ; -O1: csel x9, x0, x1, ls
6833 ; -O1: stxr w10, x9, [x8]
6834 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
6838 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
6839 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acquire:
6840 ; -O0: subs x9, x0, x8
6841 ; -O0: csel x1, x0, x8, ls
6842 ; -O0: bl __aarch64_cas8_acq
6843 ; -O0: subs x8, x0, x8
6844 ; -O0: subs w8, w8, #1
6846 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acquire:
6847 ; -O1: ldaxr x0, [x8]
6849 ; -O1: csel x9, x0, x1, ls
6850 ; -O1: stxr w10, x9, [x8]
6851 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
6855 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
6856 ; -O0-LABEL: atomicrmw_umin_i64_aligned_release:
6857 ; -O0: subs x9, x0, x8
6858 ; -O0: csel x1, x0, x8, ls
6859 ; -O0: bl __aarch64_cas8_rel
6860 ; -O0: subs x8, x0, x8
6861 ; -O0: subs w8, w8, #1
6863 ; -O1-LABEL: atomicrmw_umin_i64_aligned_release:
6864 ; -O1: ldxr x0, [x8]
6866 ; -O1: csel x9, x0, x1, ls
6867 ; -O1: stlxr w10, x9, [x8]
6868 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
6872 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6873 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
6874 ; -O0: subs x9, x0, x8
6875 ; -O0: csel x1, x0, x8, ls
6876 ; -O0: bl __aarch64_cas8_acq_rel
6877 ; -O0: subs x8, x0, x8
6878 ; -O0: subs w8, w8, #1
6880 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
6881 ; -O1: ldaxr x0, [x8]
6883 ; -O1: csel x9, x0, x1, ls
6884 ; -O1: stlxr w10, x9, [x8]
6885 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
6889 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6890 ; -O0-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
6891 ; -O0: subs x9, x0, x8
6892 ; -O0: csel x1, x0, x8, ls
6893 ; -O0: bl __aarch64_cas8_acq_rel
6894 ; -O0: subs x8, x0, x8
6895 ; -O0: subs w8, w8, #1
6897 ; -O1-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
6898 ; -O1: ldaxr x0, [x8]
6900 ; -O1: csel x9, x0, x1, ls
6901 ; -O1: stlxr w10, x9, [x8]
6902 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
6906 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6907 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
6908 ; -O0: subs x10, x8, x1
6909 ; -O0: csel x2, x0, x9, hs
6910 ; -O0: csel x3, x1, x8, hs
6911 ; -O0: bl __aarch64_cas16_relax
6912 ; -O0: subs x10, x10, x11
6913 ; -O0: ccmp x8, x9, #0, eq
6915 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
6916 ; -O1: ldxp x1, x0, [x8]
6918 ; -O1: csel x9, x0, x2, hs
6919 ; -O1: csel x10, x1, x3, hs
6920 ; -O1: stxp w11, x10, x9, [x8]
6921 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
6925 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
6926 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
6927 ; -O0: subs x10, x8, x1
6928 ; -O0: csel x2, x0, x9, hs
6929 ; -O0: csel x3, x1, x8, hs
6930 ; -O0: bl __aarch64_cas16_acq
6931 ; -O0: subs x10, x10, x11
6932 ; -O0: ccmp x8, x9, #0, eq
6934 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
6935 ; -O1: ldaxp x1, x0, [x8]
6937 ; -O1: csel x9, x0, x2, hs
6938 ; -O1: csel x10, x1, x3, hs
6939 ; -O1: stxp w11, x10, x9, [x8]
6940 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
6944 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
6945 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
6946 ; -O0: subs x10, x8, x1
6947 ; -O0: csel x2, x0, x9, hs
6948 ; -O0: csel x3, x1, x8, hs
6949 ; -O0: bl __aarch64_cas16_rel
6950 ; -O0: subs x10, x10, x11
6951 ; -O0: ccmp x8, x9, #0, eq
6953 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
6954 ; -O1: ldxp x1, x0, [x8]
6956 ; -O1: csel x9, x0, x2, hs
6957 ; -O1: csel x10, x1, x3, hs
6958 ; -O1: stlxp w11, x10, x9, [x8]
6959 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
6963 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6964 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6965 ; -O0: subs x10, x8, x1
6966 ; -O0: csel x2, x0, x9, hs
6967 ; -O0: csel x3, x1, x8, hs
6968 ; -O0: bl __aarch64_cas16_acq_rel
6969 ; -O0: subs x10, x10, x11
6970 ; -O0: ccmp x8, x9, #0, eq
6972 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
6973 ; -O1: ldaxp x1, x0, [x8]
6975 ; -O1: csel x9, x0, x2, hs
6976 ; -O1: csel x10, x1, x3, hs
6977 ; -O1: stlxp w11, x10, x9, [x8]
6978 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
6982 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6983 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6984 ; -O0: subs x10, x8, x1
6985 ; -O0: csel x2, x0, x9, hs
6986 ; -O0: csel x3, x1, x8, hs
6987 ; -O0: bl __aarch64_cas16_acq_rel
6988 ; -O0: subs x10, x10, x11
6989 ; -O0: ccmp x8, x9, #0, eq
6991 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
6992 ; -O1: ldaxp x1, x0, [x8]
6994 ; -O1: csel x9, x0, x2, hs
6995 ; -O1: csel x10, x1, x3, hs
6996 ; -O1: stlxp w11, x10, x9, [x8]
6997 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
7001 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
7002 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
7003 ; -O0: and w9, w0, #0xff
7004 ; -O0: subs w9, w9, w8, uxtb
7005 ; -O0: csel w1, w0, w8, ls
7006 ; -O0: bl __aarch64_cas1_relax
7007 ; -O0: subs w8, w0, w8
7008 ; -O0: subs w8, w8, #1
7010 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
7011 ; -O1: and w9, w1, #0xff
7012 ; -O1: ldxrb w8, [x0]
7014 ; -O1: csel w10, w8, w9, ls
7015 ; -O1: stxrb w11, w10, [x0]
7016 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
7020 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
7021 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acquire:
7022 ; -O0: and w9, w0, #0xff
7023 ; -O0: subs w9, w9, w8, uxtb
7024 ; -O0: csel w1, w0, w8, ls
7025 ; -O0: bl __aarch64_cas1_acq
7026 ; -O0: subs w8, w0, w8
7027 ; -O0: subs w8, w8, #1
7029 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acquire:
7030 ; -O1: and w9, w1, #0xff
7031 ; -O1: ldaxrb w8, [x0]
7033 ; -O1: csel w10, w8, w9, ls
7034 ; -O1: stxrb w11, w10, [x0]
7035 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
7039 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
7040 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_release:
7041 ; -O0: and w9, w0, #0xff
7042 ; -O0: subs w9, w9, w8, uxtb
7043 ; -O0: csel w1, w0, w8, ls
7044 ; -O0: bl __aarch64_cas1_rel
7045 ; -O0: subs w8, w0, w8
7046 ; -O0: subs w8, w8, #1
7048 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_release:
7049 ; -O1: and w9, w1, #0xff
7050 ; -O1: ldxrb w8, [x0]
7052 ; -O1: csel w10, w8, w9, ls
7053 ; -O1: stlxrb w11, w10, [x0]
7054 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
7058 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
7059 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
7060 ; -O0: and w9, w0, #0xff
7061 ; -O0: subs w9, w9, w8, uxtb
7062 ; -O0: csel w1, w0, w8, ls
7063 ; -O0: bl __aarch64_cas1_acq_rel
7064 ; -O0: subs w8, w0, w8
7065 ; -O0: subs w8, w8, #1
7067 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
7068 ; -O1: and w9, w1, #0xff
7069 ; -O1: ldaxrb w8, [x0]
7071 ; -O1: csel w10, w8, w9, ls
7072 ; -O1: stlxrb w11, w10, [x0]
7073 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
7077 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
7078 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
7079 ; -O0: and w9, w0, #0xff
7080 ; -O0: subs w9, w9, w8, uxtb
7081 ; -O0: csel w1, w0, w8, ls
7082 ; -O0: bl __aarch64_cas1_acq_rel
7083 ; -O0: subs w8, w0, w8
7084 ; -O0: subs w8, w8, #1
7086 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
7087 ; -O1: and w9, w1, #0xff
7088 ; -O1: ldaxrb w8, [x0]
7090 ; -O1: csel w10, w8, w9, ls
7091 ; -O1: stlxrb w11, w10, [x0]
7092 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
7096 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
7097 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
7098 ; -O0: and w10, w9, #0xffff
7099 ; -O0: subs w10, w10, w8, uxth
7100 ; -O0: csel w8, w9, w8, ls
7101 ; -O0: bl __atomic_compare_exchange
7103 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
7104 ; -O1: and w8, w0, #0xffff
7105 ; -O1: cmp w8, w20, uxth
7106 ; -O1: csel w8, w0, w20, ls
7107 ; -O1: bl __atomic_compare_exchange
7108 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
7112 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
7113 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
7114 ; -O0: and w10, w9, #0xffff
7115 ; -O0: subs w10, w10, w8, uxth
7116 ; -O0: csel w8, w9, w8, ls
7117 ; -O0: bl __atomic_compare_exchange
7119 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
7120 ; -O1: and w8, w0, #0xffff
7121 ; -O1: cmp w8, w20, uxth
7122 ; -O1: csel w8, w0, w20, ls
7123 ; -O1: bl __atomic_compare_exchange
7124 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
7128 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
7129 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
7130 ; -O0: and w10, w9, #0xffff
7131 ; -O0: subs w10, w10, w8, uxth
7132 ; -O0: csel w8, w9, w8, ls
7133 ; -O0: bl __atomic_compare_exchange
7135 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
7136 ; -O1: and w8, w0, #0xffff
7137 ; -O1: cmp w8, w20, uxth
7138 ; -O1: csel w8, w0, w20, ls
7139 ; -O1: bl __atomic_compare_exchange
7140 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
7144 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
7145 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
7146 ; -O0: and w10, w9, #0xffff
7147 ; -O0: subs w10, w10, w8, uxth
7148 ; -O0: csel w8, w9, w8, ls
7149 ; -O0: bl __atomic_compare_exchange
7151 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
7152 ; -O1: and w8, w0, #0xffff
7153 ; -O1: cmp w8, w20, uxth
7154 ; -O1: csel w8, w0, w20, ls
7155 ; -O1: bl __atomic_compare_exchange
7156 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
7160 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
7161 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
7162 ; -O0: and w10, w9, #0xffff
7163 ; -O0: subs w10, w10, w8, uxth
7164 ; -O0: csel w8, w9, w8, ls
7165 ; -O0: bl __atomic_compare_exchange
7167 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
7168 ; -O1: and w8, w0, #0xffff
7169 ; -O1: cmp w8, w20, uxth
7170 ; -O1: csel w8, w0, w20, ls
7171 ; -O1: bl __atomic_compare_exchange
7172 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
7176 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
7177 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
7178 ; -O0: subs w10, w9, w8
7179 ; -O0: csel w8, w9, w8, ls
7180 ; -O0: bl __atomic_compare_exchange
7182 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
7184 ; -O1: csel w8, w0, w20, ls
7185 ; -O1: bl __atomic_compare_exchange
7186 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
7190 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
7191 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
7192 ; -O0: subs w10, w9, w8
7193 ; -O0: csel w8, w9, w8, ls
7194 ; -O0: bl __atomic_compare_exchange
7196 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
7198 ; -O1: csel w8, w0, w20, ls
7199 ; -O1: bl __atomic_compare_exchange
7200 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
7204 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
7205 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
7206 ; -O0: subs w10, w9, w8
7207 ; -O0: csel w8, w9, w8, ls
7208 ; -O0: bl __atomic_compare_exchange
7210 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
7212 ; -O1: csel w8, w0, w20, ls
7213 ; -O1: bl __atomic_compare_exchange
7214 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
7218 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
7219 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
7220 ; -O0: subs w10, w9, w8
7221 ; -O0: csel w8, w9, w8, ls
7222 ; -O0: bl __atomic_compare_exchange
7224 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
7226 ; -O1: csel w8, w0, w20, ls
7227 ; -O1: bl __atomic_compare_exchange
7228 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
7232 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
7233 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
7234 ; -O0: subs w10, w9, w8
7235 ; -O0: csel w8, w9, w8, ls
7236 ; -O0: bl __atomic_compare_exchange
7238 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
7240 ; -O1: csel w8, w0, w20, ls
7241 ; -O1: bl __atomic_compare_exchange
7242 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
7246 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
7247 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
7248 ; -O0: subs x10, x9, x8
7249 ; -O0: csel x8, x9, x8, ls
7250 ; -O0: bl __atomic_compare_exchange
7252 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
7254 ; -O1: csel x8, x0, x20, ls
7255 ; -O1: bl __atomic_compare_exchange
7256 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
7260 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
7261 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
7262 ; -O0: subs x10, x9, x8
7263 ; -O0: csel x8, x9, x8, ls
7264 ; -O0: bl __atomic_compare_exchange
7266 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
7268 ; -O1: csel x8, x0, x20, ls
7269 ; -O1: bl __atomic_compare_exchange
7270 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
7274 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
7275 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
7276 ; -O0: subs x10, x9, x8
7277 ; -O0: csel x8, x9, x8, ls
7278 ; -O0: bl __atomic_compare_exchange
7280 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
7282 ; -O1: csel x8, x0, x20, ls
7283 ; -O1: bl __atomic_compare_exchange
7284 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
7288 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
7289 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
7290 ; -O0: subs x10, x9, x8
7291 ; -O0: csel x8, x9, x8, ls
7292 ; -O0: bl __atomic_compare_exchange
7294 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
7296 ; -O1: csel x8, x0, x20, ls
7297 ; -O1: bl __atomic_compare_exchange
7298 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
7302 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
7303 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
7304 ; -O0: subs x10, x9, x8
7305 ; -O0: csel x8, x9, x8, ls
7306 ; -O0: bl __atomic_compare_exchange
7308 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
7310 ; -O1: csel x8, x0, x20, ls
7311 ; -O1: bl __atomic_compare_exchange
7312 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
7316 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
7317 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
7318 ; -O0: subs x12, x9, x10
7319 ; -O0: csel x8, x11, x8, hs
7320 ; -O0: csel x9, x10, x9, hs
7321 ; -O0: bl __atomic_compare_exchange
7323 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
7324 ; -O1: ldp x0, x1, [x0]
7326 ; -O1: csel x8, x1, x19, hs
7327 ; -O1: csel x9, x0, x21, hs
7328 ; -O1: bl __atomic_compare_exchange
7329 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
7333 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
7334 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
7335 ; -O0: subs x12, x9, x10
7336 ; -O0: csel x8, x11, x8, hs
7337 ; -O0: csel x9, x10, x9, hs
7338 ; -O0: bl __atomic_compare_exchange
7340 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
7341 ; -O1: ldp x0, x1, [x0]
7343 ; -O1: csel x8, x1, x19, hs
7344 ; -O1: csel x9, x0, x21, hs
7345 ; -O1: bl __atomic_compare_exchange
7346 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
7350 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
7351 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
7352 ; -O0: subs x12, x9, x10
7353 ; -O0: csel x8, x11, x8, hs
7354 ; -O0: csel x9, x10, x9, hs
7355 ; -O0: bl __atomic_compare_exchange
7357 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
7358 ; -O1: ldp x0, x1, [x0]
7360 ; -O1: csel x8, x1, x19, hs
7361 ; -O1: csel x9, x0, x21, hs
7362 ; -O1: bl __atomic_compare_exchange
7363 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
7367 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
7368 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
7369 ; -O0: subs x12, x9, x10
7370 ; -O0: csel x8, x11, x8, hs
7371 ; -O0: csel x9, x10, x9, hs
7372 ; -O0: bl __atomic_compare_exchange
7374 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
7375 ; -O1: ldp x0, x1, [x0]
7377 ; -O1: csel x8, x1, x19, hs
7378 ; -O1: csel x9, x0, x21, hs
7379 ; -O1: bl __atomic_compare_exchange
7380 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
7384 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
7385 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
7386 ; -O0: subs x12, x9, x10
7387 ; -O0: csel x8, x11, x8, hs
7388 ; -O0: csel x9, x10, x9, hs
7389 ; -O0: bl __atomic_compare_exchange
7391 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
7392 ; -O1: ldp x0, x1, [x0]
7394 ; -O1: csel x8, x1, x19, hs
7395 ; -O1: csel x9, x0, x21, hs
7396 ; -O1: bl __atomic_compare_exchange
7397 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1