1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+lse2,+rcpc3 -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+lse2,+rcpc3 -O1 | FileCheck %s --check-prefixes=CHECK,-O1
6 define dso_local i8 @atomicrmw_xchg_i8_aligned_monotonic(ptr %ptr, i8 %value) {
7 ; -O0-LABEL: atomicrmw_xchg_i8_aligned_monotonic:
8 ; -O0: ldaxrb w9, [x11]
9 ; -O0: cmp w9, w10, uxtb
10 ; -O0: stlxrb w8, w12, [x11]
11 ; -O0: and w8, w9, #0xff
12 ; -O0: subs w8, w8, w10, uxtb
14 ; -O1-LABEL: atomicrmw_xchg_i8_aligned_monotonic:
16 ; -O1: stxrb w9, w1, [x0]
17 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
21 define dso_local i8 @atomicrmw_xchg_i8_aligned_acquire(ptr %ptr, i8 %value) {
22 ; -O0-LABEL: atomicrmw_xchg_i8_aligned_acquire:
23 ; -O0: ldaxrb w9, [x11]
24 ; -O0: cmp w9, w10, uxtb
25 ; -O0: stlxrb w8, w12, [x11]
26 ; -O0: and w8, w9, #0xff
27 ; -O0: subs w8, w8, w10, uxtb
29 ; -O1-LABEL: atomicrmw_xchg_i8_aligned_acquire:
30 ; -O1: ldaxrb w8, [x0]
31 ; -O1: stxrb w9, w1, [x0]
32 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
36 define dso_local i8 @atomicrmw_xchg_i8_aligned_release(ptr %ptr, i8 %value) {
37 ; -O0-LABEL: atomicrmw_xchg_i8_aligned_release:
38 ; -O0: ldaxrb w9, [x11]
39 ; -O0: cmp w9, w10, uxtb
40 ; -O0: stlxrb w8, w12, [x11]
41 ; -O0: and w8, w9, #0xff
42 ; -O0: subs w8, w8, w10, uxtb
44 ; -O1-LABEL: atomicrmw_xchg_i8_aligned_release:
46 ; -O1: stlxrb w9, w1, [x0]
47 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
51 define dso_local i8 @atomicrmw_xchg_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
52 ; -O0-LABEL: atomicrmw_xchg_i8_aligned_acq_rel:
53 ; -O0: ldaxrb w9, [x11]
54 ; -O0: cmp w9, w10, uxtb
55 ; -O0: stlxrb w8, w12, [x11]
56 ; -O0: and w8, w9, #0xff
57 ; -O0: subs w8, w8, w10, uxtb
59 ; -O1-LABEL: atomicrmw_xchg_i8_aligned_acq_rel:
60 ; -O1: ldaxrb w8, [x0]
61 ; -O1: stlxrb w9, w1, [x0]
62 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
66 define dso_local i8 @atomicrmw_xchg_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
67 ; -O0-LABEL: atomicrmw_xchg_i8_aligned_seq_cst:
68 ; -O0: ldaxrb w9, [x11]
69 ; -O0: cmp w9, w10, uxtb
70 ; -O0: stlxrb w8, w12, [x11]
71 ; -O0: and w8, w9, #0xff
72 ; -O0: subs w8, w8, w10, uxtb
74 ; -O1-LABEL: atomicrmw_xchg_i8_aligned_seq_cst:
75 ; -O1: ldaxrb w8, [x0]
76 ; -O1: stlxrb w9, w1, [x0]
77 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
81 define dso_local i16 @atomicrmw_xchg_i16_aligned_monotonic(ptr %ptr, i16 %value) {
82 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_monotonic:
83 ; -O0: ldaxrh w9, [x11]
84 ; -O0: cmp w9, w8, uxth
85 ; -O0: stlxrh w10, w12, [x11]
86 ; -O0: subs w8, w8, w9, uxth
88 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_monotonic:
90 ; -O1: stxrh w9, w1, [x0]
91 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 2
95 define dso_local i16 @atomicrmw_xchg_i16_aligned_acquire(ptr %ptr, i16 %value) {
96 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_acquire:
97 ; -O0: ldaxrh w9, [x11]
98 ; -O0: cmp w9, w8, uxth
99 ; -O0: stlxrh w10, w12, [x11]
100 ; -O0: subs w8, w8, w9, uxth
102 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_acquire:
103 ; -O1: ldaxrh w8, [x0]
104 ; -O1: stxrh w9, w1, [x0]
105 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 2
109 define dso_local i16 @atomicrmw_xchg_i16_aligned_release(ptr %ptr, i16 %value) {
110 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_release:
111 ; -O0: ldaxrh w9, [x11]
112 ; -O0: cmp w9, w8, uxth
113 ; -O0: stlxrh w10, w12, [x11]
114 ; -O0: subs w8, w8, w9, uxth
116 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_release:
117 ; -O1: ldxrh w8, [x0]
118 ; -O1: stlxrh w9, w1, [x0]
119 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 2
123 define dso_local i16 @atomicrmw_xchg_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
124 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_acq_rel:
125 ; -O0: ldaxrh w9, [x11]
126 ; -O0: cmp w9, w8, uxth
127 ; -O0: stlxrh w10, w12, [x11]
128 ; -O0: subs w8, w8, w9, uxth
130 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_acq_rel:
131 ; -O1: ldaxrh w8, [x0]
132 ; -O1: stlxrh w9, w1, [x0]
133 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 2
137 define dso_local i16 @atomicrmw_xchg_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
138 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_seq_cst:
139 ; -O0: ldaxrh w9, [x11]
140 ; -O0: cmp w9, w8, uxth
141 ; -O0: stlxrh w10, w12, [x11]
142 ; -O0: subs w8, w8, w9, uxth
144 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_seq_cst:
145 ; -O1: ldaxrh w8, [x0]
146 ; -O1: stlxrh w9, w1, [x0]
147 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 2
151 define dso_local i32 @atomicrmw_xchg_i32_aligned_monotonic(ptr %ptr, i32 %value) {
152 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_monotonic:
153 ; -O0: ldaxr w9, [x11]
155 ; -O0: stlxr w10, w12, [x11]
156 ; -O0: subs w8, w9, w8
158 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_monotonic:
160 ; -O1: stxr w9, w1, [x8]
161 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 4
165 define dso_local i32 @atomicrmw_xchg_i32_aligned_acquire(ptr %ptr, i32 %value) {
166 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_acquire:
167 ; -O0: ldaxr w9, [x11]
169 ; -O0: stlxr w10, w12, [x11]
170 ; -O0: subs w8, w9, w8
172 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_acquire:
173 ; -O1: ldaxr w0, [x8]
174 ; -O1: stxr w9, w1, [x8]
175 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 4
179 define dso_local i32 @atomicrmw_xchg_i32_aligned_release(ptr %ptr, i32 %value) {
180 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_release:
181 ; -O0: ldaxr w9, [x11]
183 ; -O0: stlxr w10, w12, [x11]
184 ; -O0: subs w8, w9, w8
186 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_release:
188 ; -O1: stlxr w9, w1, [x8]
189 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 4
193 define dso_local i32 @atomicrmw_xchg_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
194 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_acq_rel:
195 ; -O0: ldaxr w9, [x11]
197 ; -O0: stlxr w10, w12, [x11]
198 ; -O0: subs w8, w9, w8
200 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_acq_rel:
201 ; -O1: ldaxr w0, [x8]
202 ; -O1: stlxr w9, w1, [x8]
203 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 4
207 define dso_local i32 @atomicrmw_xchg_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
208 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_seq_cst:
209 ; -O0: ldaxr w9, [x11]
211 ; -O0: stlxr w10, w12, [x11]
212 ; -O0: subs w8, w9, w8
214 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_seq_cst:
215 ; -O1: ldaxr w0, [x8]
216 ; -O1: stlxr w9, w1, [x8]
217 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 4
221 define dso_local i64 @atomicrmw_xchg_i64_aligned_monotonic(ptr %ptr, i64 %value) {
222 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_monotonic:
223 ; -O0: ldaxr x9, [x11]
225 ; -O0: stlxr w10, x12, [x11]
226 ; -O0: subs x8, x9, x8
228 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_monotonic:
230 ; -O1: stxr w9, x1, [x8]
231 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 8
235 define dso_local i64 @atomicrmw_xchg_i64_aligned_acquire(ptr %ptr, i64 %value) {
236 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_acquire:
237 ; -O0: ldaxr x9, [x11]
239 ; -O0: stlxr w10, x12, [x11]
240 ; -O0: subs x8, x9, x8
242 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_acquire:
243 ; -O1: ldaxr x0, [x8]
244 ; -O1: stxr w9, x1, [x8]
245 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 8
249 define dso_local i64 @atomicrmw_xchg_i64_aligned_release(ptr %ptr, i64 %value) {
250 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_release:
251 ; -O0: ldaxr x9, [x11]
253 ; -O0: stlxr w10, x12, [x11]
254 ; -O0: subs x8, x9, x8
256 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_release:
258 ; -O1: stlxr w9, x1, [x8]
259 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 8
263 define dso_local i64 @atomicrmw_xchg_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
264 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_acq_rel:
265 ; -O0: ldaxr x9, [x11]
267 ; -O0: stlxr w10, x12, [x11]
268 ; -O0: subs x8, x9, x8
270 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_acq_rel:
271 ; -O1: ldaxr x0, [x8]
272 ; -O1: stlxr w9, x1, [x8]
273 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 8
277 define dso_local i64 @atomicrmw_xchg_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
278 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_seq_cst:
279 ; -O0: ldaxr x9, [x11]
281 ; -O0: stlxr w10, x12, [x11]
282 ; -O0: subs x8, x9, x8
284 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_seq_cst:
285 ; -O1: ldaxr x0, [x8]
286 ; -O1: stlxr w9, x1, [x8]
287 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 8
291 define dso_local i128 @atomicrmw_xchg_i128_aligned_monotonic(ptr %ptr, i128 %value) {
292 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
293 ; -O0: ldxp x10, x9, [x11]
296 ; -O0: stxp w8, x14, x15, [x11]
297 ; -O0: stxp w8, x10, x9, [x11]
298 ; -O0: eor x8, x10, x8
299 ; -O0: eor x11, x9, x11
300 ; -O0: orr x8, x8, x11
301 ; -O0: subs x8, x8, #0
303 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
304 ; -O1: ldxp x8, x1, [x0]
305 ; -O1: stxp w9, x2, x3, [x0]
306 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
310 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
311 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
312 ; -O0: ldaxp x10, x9, [x11]
315 ; -O0: stxp w8, x14, x15, [x11]
316 ; -O0: stxp w8, x10, x9, [x11]
317 ; -O0: eor x8, x10, x8
318 ; -O0: eor x11, x9, x11
319 ; -O0: orr x8, x8, x11
320 ; -O0: subs x8, x8, #0
322 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
323 ; -O1: ldaxp x8, x1, [x0]
324 ; -O1: stxp w9, x2, x3, [x0]
325 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
329 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
330 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
331 ; -O0: ldxp x10, x9, [x11]
334 ; -O0: stlxp w8, x14, x15, [x11]
335 ; -O0: stlxp w8, x10, x9, [x11]
336 ; -O0: eor x8, x10, x8
337 ; -O0: eor x11, x9, x11
338 ; -O0: orr x8, x8, x11
339 ; -O0: subs x8, x8, #0
341 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
342 ; -O1: ldxp x8, x1, [x0]
343 ; -O1: stlxp w9, x2, x3, [x0]
344 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
348 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
349 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
350 ; -O0: ldaxp x10, x9, [x11]
353 ; -O0: stlxp w8, x14, x15, [x11]
354 ; -O0: stlxp w8, x10, x9, [x11]
355 ; -O0: eor x8, x10, x8
356 ; -O0: eor x11, x9, x11
357 ; -O0: orr x8, x8, x11
358 ; -O0: subs x8, x8, #0
360 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
361 ; -O1: ldaxp x8, x1, [x0]
362 ; -O1: stlxp w9, x2, x3, [x0]
363 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
367 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
368 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
369 ; -O0: ldaxp x10, x9, [x11]
372 ; -O0: stlxp w8, x14, x15, [x11]
373 ; -O0: stlxp w8, x10, x9, [x11]
374 ; -O0: eor x8, x10, x8
375 ; -O0: eor x11, x9, x11
376 ; -O0: orr x8, x8, x11
377 ; -O0: subs x8, x8, #0
379 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
380 ; -O1: ldaxp x8, x1, [x0]
381 ; -O1: stlxp w9, x2, x3, [x0]
382 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
386 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
387 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
388 ; -O0: ldaxrb w9, [x11]
389 ; -O0: cmp w9, w10, uxtb
390 ; -O0: stlxrb w8, w12, [x11]
391 ; -O0: and w8, w9, #0xff
392 ; -O0: subs w8, w8, w10, uxtb
394 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
395 ; -O1: ldxrb w8, [x0]
396 ; -O1: stxrb w9, w1, [x0]
397 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
401 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
402 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
403 ; -O0: ldaxrb w9, [x11]
404 ; -O0: cmp w9, w10, uxtb
405 ; -O0: stlxrb w8, w12, [x11]
406 ; -O0: and w8, w9, #0xff
407 ; -O0: subs w8, w8, w10, uxtb
409 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
410 ; -O1: ldaxrb w8, [x0]
411 ; -O1: stxrb w9, w1, [x0]
412 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
416 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
417 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_release:
418 ; -O0: ldaxrb w9, [x11]
419 ; -O0: cmp w9, w10, uxtb
420 ; -O0: stlxrb w8, w12, [x11]
421 ; -O0: and w8, w9, #0xff
422 ; -O0: subs w8, w8, w10, uxtb
424 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_release:
425 ; -O1: ldxrb w8, [x0]
426 ; -O1: stlxrb w9, w1, [x0]
427 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
431 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
432 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
433 ; -O0: ldaxrb w9, [x11]
434 ; -O0: cmp w9, w10, uxtb
435 ; -O0: stlxrb w8, w12, [x11]
436 ; -O0: and w8, w9, #0xff
437 ; -O0: subs w8, w8, w10, uxtb
439 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
440 ; -O1: ldaxrb w8, [x0]
441 ; -O1: stlxrb w9, w1, [x0]
442 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
446 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
447 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
448 ; -O0: ldaxrb w9, [x11]
449 ; -O0: cmp w9, w10, uxtb
450 ; -O0: stlxrb w8, w12, [x11]
451 ; -O0: and w8, w9, #0xff
452 ; -O0: subs w8, w8, w10, uxtb
454 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
455 ; -O1: ldaxrb w8, [x0]
456 ; -O1: stlxrb w9, w1, [x0]
457 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
461 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
462 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
463 ; CHECK: bl __atomic_exchange
464 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
468 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
469 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
470 ; CHECK: bl __atomic_exchange
471 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
475 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
476 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
477 ; CHECK: bl __atomic_exchange
478 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
482 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
483 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
484 ; CHECK: bl __atomic_exchange
485 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
489 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
490 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
491 ; CHECK: bl __atomic_exchange
492 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
496 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
497 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
498 ; CHECK: bl __atomic_exchange
499 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
503 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
504 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
505 ; CHECK: bl __atomic_exchange
506 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
510 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
511 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
512 ; CHECK: bl __atomic_exchange
513 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
517 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
518 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
519 ; CHECK: bl __atomic_exchange
520 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
524 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
525 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
526 ; CHECK: bl __atomic_exchange
527 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
531 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
532 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
533 ; CHECK: bl __atomic_exchange
534 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
538 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
539 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
540 ; CHECK: bl __atomic_exchange
541 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
545 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
546 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
547 ; CHECK: bl __atomic_exchange
548 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
552 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
553 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
554 ; CHECK: bl __atomic_exchange
555 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
559 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
560 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
561 ; CHECK: bl __atomic_exchange
562 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
566 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
567 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
568 ; CHECK: bl __atomic_exchange
569 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
573 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
574 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
575 ; CHECK: bl __atomic_exchange
576 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
580 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
581 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
582 ; CHECK: bl __atomic_exchange
583 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
587 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
588 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
589 ; CHECK: bl __atomic_exchange
590 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
594 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
595 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
596 ; CHECK: bl __atomic_exchange
597 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
601 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
602 ; -O0-LABEL: atomicrmw_add_i8_aligned_monotonic:
603 ; -O0: add w12, w8, w10, uxth
604 ; -O0: ldaxrb w9, [x11]
605 ; -O0: cmp w9, w10, uxtb
606 ; -O0: stlxrb w8, w12, [x11]
607 ; -O0: and w8, w9, #0xff
608 ; -O0: subs w8, w8, w10, uxtb
610 ; -O1-LABEL: atomicrmw_add_i8_aligned_monotonic:
611 ; -O1: ldxrb w8, [x0]
612 ; -O1: add w9, w8, w1
613 ; -O1: stxrb w10, w9, [x0]
614 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
618 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
619 ; -O0-LABEL: atomicrmw_add_i8_aligned_acquire:
620 ; -O0: add w12, w8, w10, uxth
621 ; -O0: ldaxrb w9, [x11]
622 ; -O0: cmp w9, w10, uxtb
623 ; -O0: stlxrb w8, w12, [x11]
624 ; -O0: and w8, w9, #0xff
625 ; -O0: subs w8, w8, w10, uxtb
627 ; -O1-LABEL: atomicrmw_add_i8_aligned_acquire:
628 ; -O1: ldaxrb w8, [x0]
629 ; -O1: add w9, w8, w1
630 ; -O1: stxrb w10, w9, [x0]
631 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
635 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
636 ; -O0-LABEL: atomicrmw_add_i8_aligned_release:
637 ; -O0: add w12, w8, w10, uxth
638 ; -O0: ldaxrb w9, [x11]
639 ; -O0: cmp w9, w10, uxtb
640 ; -O0: stlxrb w8, w12, [x11]
641 ; -O0: and w8, w9, #0xff
642 ; -O0: subs w8, w8, w10, uxtb
644 ; -O1-LABEL: atomicrmw_add_i8_aligned_release:
645 ; -O1: ldxrb w8, [x0]
646 ; -O1: add w9, w8, w1
647 ; -O1: stlxrb w10, w9, [x0]
648 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
652 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
653 ; -O0-LABEL: atomicrmw_add_i8_aligned_acq_rel:
654 ; -O0: add w12, w8, w10, uxth
655 ; -O0: ldaxrb w9, [x11]
656 ; -O0: cmp w9, w10, uxtb
657 ; -O0: stlxrb w8, w12, [x11]
658 ; -O0: and w8, w9, #0xff
659 ; -O0: subs w8, w8, w10, uxtb
661 ; -O1-LABEL: atomicrmw_add_i8_aligned_acq_rel:
662 ; -O1: ldaxrb w8, [x0]
663 ; -O1: add w9, w8, w1
664 ; -O1: stlxrb w10, w9, [x0]
665 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
669 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
670 ; -O0-LABEL: atomicrmw_add_i8_aligned_seq_cst:
671 ; -O0: add w12, w8, w10, uxth
672 ; -O0: ldaxrb w9, [x11]
673 ; -O0: cmp w9, w10, uxtb
674 ; -O0: stlxrb w8, w12, [x11]
675 ; -O0: and w8, w9, #0xff
676 ; -O0: subs w8, w8, w10, uxtb
678 ; -O1-LABEL: atomicrmw_add_i8_aligned_seq_cst:
679 ; -O1: ldaxrb w8, [x0]
680 ; -O1: add w9, w8, w1
681 ; -O1: stlxrb w10, w9, [x0]
682 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
686 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
687 ; -O0-LABEL: atomicrmw_add_i16_aligned_monotonic:
688 ; -O0: add w12, w9, w8, uxth
689 ; -O0: ldaxrh w9, [x11]
690 ; -O0: cmp w9, w8, uxth
691 ; -O0: stlxrh w10, w12, [x11]
692 ; -O0: subs w8, w8, w9, uxth
694 ; -O1-LABEL: atomicrmw_add_i16_aligned_monotonic:
695 ; -O1: ldxrh w8, [x0]
696 ; -O1: add w9, w8, w1
697 ; -O1: stxrh w10, w9, [x0]
698 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
702 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
703 ; -O0-LABEL: atomicrmw_add_i16_aligned_acquire:
704 ; -O0: add w12, w9, w8, uxth
705 ; -O0: ldaxrh w9, [x11]
706 ; -O0: cmp w9, w8, uxth
707 ; -O0: stlxrh w10, w12, [x11]
708 ; -O0: subs w8, w8, w9, uxth
710 ; -O1-LABEL: atomicrmw_add_i16_aligned_acquire:
711 ; -O1: ldaxrh w8, [x0]
712 ; -O1: add w9, w8, w1
713 ; -O1: stxrh w10, w9, [x0]
714 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
718 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
719 ; -O0-LABEL: atomicrmw_add_i16_aligned_release:
720 ; -O0: add w12, w9, w8, uxth
721 ; -O0: ldaxrh w9, [x11]
722 ; -O0: cmp w9, w8, uxth
723 ; -O0: stlxrh w10, w12, [x11]
724 ; -O0: subs w8, w8, w9, uxth
726 ; -O1-LABEL: atomicrmw_add_i16_aligned_release:
727 ; -O1: ldxrh w8, [x0]
728 ; -O1: add w9, w8, w1
729 ; -O1: stlxrh w10, w9, [x0]
730 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
734 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
735 ; -O0-LABEL: atomicrmw_add_i16_aligned_acq_rel:
736 ; -O0: add w12, w9, w8, uxth
737 ; -O0: ldaxrh w9, [x11]
738 ; -O0: cmp w9, w8, uxth
739 ; -O0: stlxrh w10, w12, [x11]
740 ; -O0: subs w8, w8, w9, uxth
742 ; -O1-LABEL: atomicrmw_add_i16_aligned_acq_rel:
743 ; -O1: ldaxrh w8, [x0]
744 ; -O1: add w9, w8, w1
745 ; -O1: stlxrh w10, w9, [x0]
746 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
750 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
751 ; -O0-LABEL: atomicrmw_add_i16_aligned_seq_cst:
752 ; -O0: add w12, w9, w8, uxth
753 ; -O0: ldaxrh w9, [x11]
754 ; -O0: cmp w9, w8, uxth
755 ; -O0: stlxrh w10, w12, [x11]
756 ; -O0: subs w8, w8, w9, uxth
758 ; -O1-LABEL: atomicrmw_add_i16_aligned_seq_cst:
759 ; -O1: ldaxrh w8, [x0]
760 ; -O1: add w9, w8, w1
761 ; -O1: stlxrh w10, w9, [x0]
762 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
766 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
767 ; -O0-LABEL: atomicrmw_add_i32_aligned_monotonic:
768 ; -O0: add w12, w8, w9
769 ; -O0: ldaxr w9, [x11]
771 ; -O0: stlxr w10, w12, [x11]
772 ; -O0: subs w8, w9, w8
774 ; -O1-LABEL: atomicrmw_add_i32_aligned_monotonic:
776 ; -O1: add w9, w8, w1
777 ; -O1: stxr w10, w9, [x0]
778 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
782 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
783 ; -O0-LABEL: atomicrmw_add_i32_aligned_acquire:
784 ; -O0: add w12, w8, w9
785 ; -O0: ldaxr w9, [x11]
787 ; -O0: stlxr w10, w12, [x11]
788 ; -O0: subs w8, w9, w8
790 ; -O1-LABEL: atomicrmw_add_i32_aligned_acquire:
791 ; -O1: ldaxr w8, [x0]
792 ; -O1: add w9, w8, w1
793 ; -O1: stxr w10, w9, [x0]
794 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
798 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
799 ; -O0-LABEL: atomicrmw_add_i32_aligned_release:
800 ; -O0: add w12, w8, w9
801 ; -O0: ldaxr w9, [x11]
803 ; -O0: stlxr w10, w12, [x11]
804 ; -O0: subs w8, w9, w8
806 ; -O1-LABEL: atomicrmw_add_i32_aligned_release:
808 ; -O1: add w9, w8, w1
809 ; -O1: stlxr w10, w9, [x0]
810 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
814 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
815 ; -O0-LABEL: atomicrmw_add_i32_aligned_acq_rel:
816 ; -O0: add w12, w8, w9
817 ; -O0: ldaxr w9, [x11]
819 ; -O0: stlxr w10, w12, [x11]
820 ; -O0: subs w8, w9, w8
822 ; -O1-LABEL: atomicrmw_add_i32_aligned_acq_rel:
823 ; -O1: ldaxr w8, [x0]
824 ; -O1: add w9, w8, w1
825 ; -O1: stlxr w10, w9, [x0]
826 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
830 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
831 ; -O0-LABEL: atomicrmw_add_i32_aligned_seq_cst:
832 ; -O0: add w12, w8, w9
833 ; -O0: ldaxr w9, [x11]
835 ; -O0: stlxr w10, w12, [x11]
836 ; -O0: subs w8, w9, w8
838 ; -O1-LABEL: atomicrmw_add_i32_aligned_seq_cst:
839 ; -O1: ldaxr w8, [x0]
840 ; -O1: add w9, w8, w1
841 ; -O1: stlxr w10, w9, [x0]
842 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
846 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
847 ; -O0-LABEL: atomicrmw_add_i64_aligned_monotonic:
848 ; -O0: add x12, x8, x9
849 ; -O0: ldaxr x9, [x11]
851 ; -O0: stlxr w10, x12, [x11]
852 ; -O0: subs x8, x9, x8
854 ; -O1-LABEL: atomicrmw_add_i64_aligned_monotonic:
856 ; -O1: add x9, x0, x1
857 ; -O1: stxr w10, x9, [x8]
858 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
862 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
863 ; -O0-LABEL: atomicrmw_add_i64_aligned_acquire:
864 ; -O0: add x12, x8, x9
865 ; -O0: ldaxr x9, [x11]
867 ; -O0: stlxr w10, x12, [x11]
868 ; -O0: subs x8, x9, x8
870 ; -O1-LABEL: atomicrmw_add_i64_aligned_acquire:
871 ; -O1: ldaxr x0, [x8]
872 ; -O1: add x9, x0, x1
873 ; -O1: stxr w10, x9, [x8]
874 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
878 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
879 ; -O0-LABEL: atomicrmw_add_i64_aligned_release:
880 ; -O0: add x12, x8, x9
881 ; -O0: ldaxr x9, [x11]
883 ; -O0: stlxr w10, x12, [x11]
884 ; -O0: subs x8, x9, x8
886 ; -O1-LABEL: atomicrmw_add_i64_aligned_release:
888 ; -O1: add x9, x0, x1
889 ; -O1: stlxr w10, x9, [x8]
890 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
894 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
895 ; -O0-LABEL: atomicrmw_add_i64_aligned_acq_rel:
896 ; -O0: add x12, x8, x9
897 ; -O0: ldaxr x9, [x11]
899 ; -O0: stlxr w10, x12, [x11]
900 ; -O0: subs x8, x9, x8
902 ; -O1-LABEL: atomicrmw_add_i64_aligned_acq_rel:
903 ; -O1: ldaxr x0, [x8]
904 ; -O1: add x9, x0, x1
905 ; -O1: stlxr w10, x9, [x8]
906 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
910 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
911 ; -O0-LABEL: atomicrmw_add_i64_aligned_seq_cst:
912 ; -O0: add x12, x8, x9
913 ; -O0: ldaxr x9, [x11]
915 ; -O0: stlxr w10, x12, [x11]
916 ; -O0: subs x8, x9, x8
918 ; -O1-LABEL: atomicrmw_add_i64_aligned_seq_cst:
919 ; -O1: ldaxr x0, [x8]
920 ; -O1: add x9, x0, x1
921 ; -O1: stlxr w10, x9, [x8]
922 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
926 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
927 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
928 ; -O0: adds x14, x8, x10
929 ; -O0: and w10, w8, #0x1
930 ; -O0: subs w10, w10, #1
931 ; -O0: ldxp x10, x9, [x11]
934 ; -O0: stxp w8, x14, x15, [x11]
935 ; -O0: stxp w8, x10, x9, [x11]
936 ; -O0: eor x8, x10, x8
937 ; -O0: eor x11, x9, x11
938 ; -O0: orr x8, x8, x11
939 ; -O0: subs x8, x8, #0
941 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
942 ; -O1: ldxp x0, x1, [x8]
943 ; -O1: adds x9, x0, x2
944 ; -O1: stxp w11, x9, x10, [x8]
945 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
949 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
950 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
951 ; -O0: adds x14, x8, x10
952 ; -O0: and w10, w8, #0x1
953 ; -O0: subs w10, w10, #1
954 ; -O0: ldaxp x10, x9, [x11]
957 ; -O0: stxp w8, x14, x15, [x11]
958 ; -O0: stxp w8, x10, x9, [x11]
959 ; -O0: eor x8, x10, x8
960 ; -O0: eor x11, x9, x11
961 ; -O0: orr x8, x8, x11
962 ; -O0: subs x8, x8, #0
964 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
965 ; -O1: ldaxp x0, x1, [x8]
966 ; -O1: adds x9, x0, x2
967 ; -O1: stxp w11, x9, x10, [x8]
968 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
972 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
973 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
974 ; -O0: adds x14, x8, x10
975 ; -O0: and w10, w8, #0x1
976 ; -O0: subs w10, w10, #1
977 ; -O0: ldxp x10, x9, [x11]
980 ; -O0: stlxp w8, x14, x15, [x11]
981 ; -O0: stlxp w8, x10, x9, [x11]
982 ; -O0: eor x8, x10, x8
983 ; -O0: eor x11, x9, x11
984 ; -O0: orr x8, x8, x11
985 ; -O0: subs x8, x8, #0
987 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
988 ; -O1: ldxp x0, x1, [x8]
989 ; -O1: adds x9, x0, x2
990 ; -O1: stlxp w11, x9, x10, [x8]
991 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
995 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
996 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
997 ; -O0: adds x14, x8, x10
998 ; -O0: and w10, w8, #0x1
999 ; -O0: subs w10, w10, #1
1000 ; -O0: ldaxp x10, x9, [x11]
1003 ; -O0: stlxp w8, x14, x15, [x11]
1004 ; -O0: stlxp w8, x10, x9, [x11]
1005 ; -O0: eor x8, x10, x8
1006 ; -O0: eor x11, x9, x11
1007 ; -O0: orr x8, x8, x11
1008 ; -O0: subs x8, x8, #0
1010 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
1011 ; -O1: ldaxp x0, x1, [x8]
1012 ; -O1: adds x9, x0, x2
1013 ; -O1: stlxp w11, x9, x10, [x8]
1014 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
1018 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1019 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
1020 ; -O0: adds x14, x8, x10
1021 ; -O0: and w10, w8, #0x1
1022 ; -O0: subs w10, w10, #1
1023 ; -O0: ldaxp x10, x9, [x11]
1026 ; -O0: stlxp w8, x14, x15, [x11]
1027 ; -O0: stlxp w8, x10, x9, [x11]
1028 ; -O0: eor x8, x10, x8
1029 ; -O0: eor x11, x9, x11
1030 ; -O0: orr x8, x8, x11
1031 ; -O0: subs x8, x8, #0
1033 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
1034 ; -O1: ldaxp x0, x1, [x8]
1035 ; -O1: adds x9, x0, x2
1036 ; -O1: stlxp w11, x9, x10, [x8]
1037 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
1041 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1042 ; -O0-LABEL: atomicrmw_add_i8_unaligned_monotonic:
1043 ; -O0: add w12, w8, w10, uxth
1044 ; -O0: ldaxrb w9, [x11]
1045 ; -O0: cmp w9, w10, uxtb
1046 ; -O0: stlxrb w8, w12, [x11]
1047 ; -O0: and w8, w9, #0xff
1048 ; -O0: subs w8, w8, w10, uxtb
1050 ; -O1-LABEL: atomicrmw_add_i8_unaligned_monotonic:
1051 ; -O1: ldxrb w8, [x0]
1052 ; -O1: add w9, w8, w1
1053 ; -O1: stxrb w10, w9, [x0]
1054 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
1058 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1059 ; -O0-LABEL: atomicrmw_add_i8_unaligned_acquire:
1060 ; -O0: add w12, w8, w10, uxth
1061 ; -O0: ldaxrb w9, [x11]
1062 ; -O0: cmp w9, w10, uxtb
1063 ; -O0: stlxrb w8, w12, [x11]
1064 ; -O0: and w8, w9, #0xff
1065 ; -O0: subs w8, w8, w10, uxtb
1067 ; -O1-LABEL: atomicrmw_add_i8_unaligned_acquire:
1068 ; -O1: ldaxrb w8, [x0]
1069 ; -O1: add w9, w8, w1
1070 ; -O1: stxrb w10, w9, [x0]
1071 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
1075 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
1076 ; -O0-LABEL: atomicrmw_add_i8_unaligned_release:
1077 ; -O0: add w12, w8, w10, uxth
1078 ; -O0: ldaxrb w9, [x11]
1079 ; -O0: cmp w9, w10, uxtb
1080 ; -O0: stlxrb w8, w12, [x11]
1081 ; -O0: and w8, w9, #0xff
1082 ; -O0: subs w8, w8, w10, uxtb
1084 ; -O1-LABEL: atomicrmw_add_i8_unaligned_release:
1085 ; -O1: ldxrb w8, [x0]
1086 ; -O1: add w9, w8, w1
1087 ; -O1: stlxrb w10, w9, [x0]
1088 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
1092 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1093 ; -O0-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
1094 ; -O0: add w12, w8, w10, uxth
1095 ; -O0: ldaxrb w9, [x11]
1096 ; -O0: cmp w9, w10, uxtb
1097 ; -O0: stlxrb w8, w12, [x11]
1098 ; -O0: and w8, w9, #0xff
1099 ; -O0: subs w8, w8, w10, uxtb
1101 ; -O1-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
1102 ; -O1: ldaxrb w8, [x0]
1103 ; -O1: add w9, w8, w1
1104 ; -O1: stlxrb w10, w9, [x0]
1105 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
1109 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1110 ; -O0-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
1111 ; -O0: add w12, w8, w10, uxth
1112 ; -O0: ldaxrb w9, [x11]
1113 ; -O0: cmp w9, w10, uxtb
1114 ; -O0: stlxrb w8, w12, [x11]
1115 ; -O0: and w8, w9, #0xff
1116 ; -O0: subs w8, w8, w10, uxtb
1118 ; -O1-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
1119 ; -O1: ldaxrb w8, [x0]
1120 ; -O1: add w9, w8, w1
1121 ; -O1: stlxrb w10, w9, [x0]
1122 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
1126 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1127 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
1128 ; -O0: add w8, w8, w9, uxth
1129 ; -O0: bl __atomic_compare_exchange
1131 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
1132 ; -O1: add w8, w0, w20
1133 ; -O1: bl __atomic_compare_exchange
1134 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
1138 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1139 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
1140 ; -O0: add w8, w8, w9, uxth
1141 ; -O0: bl __atomic_compare_exchange
1143 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
1144 ; -O1: add w8, w0, w20
1145 ; -O1: bl __atomic_compare_exchange
1146 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
1150 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
1151 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
1152 ; -O0: add w8, w8, w9, uxth
1153 ; -O0: bl __atomic_compare_exchange
1155 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
1156 ; -O1: add w8, w0, w20
1157 ; -O1: bl __atomic_compare_exchange
1158 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
1162 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1163 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
1164 ; -O0: add w8, w8, w9, uxth
1165 ; -O0: bl __atomic_compare_exchange
1167 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
1168 ; -O1: add w8, w0, w20
1169 ; -O1: bl __atomic_compare_exchange
1170 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
1174 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1175 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
1176 ; -O0: add w8, w8, w9, uxth
1177 ; -O0: bl __atomic_compare_exchange
1179 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
1180 ; -O1: add w8, w0, w20
1181 ; -O1: bl __atomic_compare_exchange
1182 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
1186 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1187 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
1188 ; -O0: add w8, w9, w8
1189 ; -O0: bl __atomic_compare_exchange
1191 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
1192 ; -O1: add w8, w0, w20
1193 ; -O1: bl __atomic_compare_exchange
1194 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
1198 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1199 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
1200 ; -O0: add w8, w9, w8
1201 ; -O0: bl __atomic_compare_exchange
1203 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
1204 ; -O1: add w8, w0, w20
1205 ; -O1: bl __atomic_compare_exchange
1206 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
1210 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
1211 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
1212 ; -O0: add w8, w9, w8
1213 ; -O0: bl __atomic_compare_exchange
1215 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
1216 ; -O1: add w8, w0, w20
1217 ; -O1: bl __atomic_compare_exchange
1218 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
1222 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1223 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
1224 ; -O0: add w8, w9, w8
1225 ; -O0: bl __atomic_compare_exchange
1227 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
1228 ; -O1: add w8, w0, w20
1229 ; -O1: bl __atomic_compare_exchange
1230 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
1234 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1235 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
1236 ; -O0: add w8, w9, w8
1237 ; -O0: bl __atomic_compare_exchange
1239 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
1240 ; -O1: add w8, w0, w20
1241 ; -O1: bl __atomic_compare_exchange
1242 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
1246 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1247 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
1248 ; -O0: add x8, x9, x8
1249 ; -O0: bl __atomic_compare_exchange
1251 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
1252 ; -O1: add x8, x0, x20
1253 ; -O1: bl __atomic_compare_exchange
1254 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
1258 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1259 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
1260 ; -O0: add x8, x9, x8
1261 ; -O0: bl __atomic_compare_exchange
1263 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
1264 ; -O1: add x8, x0, x20
1265 ; -O1: bl __atomic_compare_exchange
1266 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
1270 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
1271 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
1272 ; -O0: add x8, x9, x8
1273 ; -O0: bl __atomic_compare_exchange
1275 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
1276 ; -O1: add x8, x0, x20
1277 ; -O1: bl __atomic_compare_exchange
1278 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
1282 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1283 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
1284 ; -O0: add x8, x9, x8
1285 ; -O0: bl __atomic_compare_exchange
1287 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
1288 ; -O1: add x8, x0, x20
1289 ; -O1: bl __atomic_compare_exchange
1290 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
1294 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1295 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
1296 ; -O0: add x8, x9, x8
1297 ; -O0: bl __atomic_compare_exchange
1299 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
1300 ; -O1: add x8, x0, x20
1301 ; -O1: bl __atomic_compare_exchange
1302 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
1306 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1307 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
1308 ; -O0: adds x9, x8, x9
1309 ; -O0: and w11, w8, #0x1
1310 ; -O0: subs w11, w11, #1
1311 ; -O0: bl __atomic_compare_exchange
1313 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
1314 ; -O1: ldp x0, x1, [x0]
1315 ; -O1: adds x8, x0, x21
1316 ; -O1: bl __atomic_compare_exchange
1317 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
1321 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1322 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
1323 ; -O0: adds x9, x8, x9
1324 ; -O0: and w11, w8, #0x1
1325 ; -O0: subs w11, w11, #1
1326 ; -O0: bl __atomic_compare_exchange
1328 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
1329 ; -O1: ldp x0, x1, [x0]
1330 ; -O1: adds x8, x0, x21
1331 ; -O1: bl __atomic_compare_exchange
1332 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
1336 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
1337 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
1338 ; -O0: adds x9, x8, x9
1339 ; -O0: and w11, w8, #0x1
1340 ; -O0: subs w11, w11, #1
1341 ; -O0: bl __atomic_compare_exchange
1343 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
1344 ; -O1: ldp x0, x1, [x0]
1345 ; -O1: adds x8, x0, x21
1346 ; -O1: bl __atomic_compare_exchange
1347 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
1351 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1352 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
1353 ; -O0: adds x9, x8, x9
1354 ; -O0: and w11, w8, #0x1
1355 ; -O0: subs w11, w11, #1
1356 ; -O0: bl __atomic_compare_exchange
1358 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
1359 ; -O1: ldp x0, x1, [x0]
1360 ; -O1: adds x8, x0, x21
1361 ; -O1: bl __atomic_compare_exchange
1362 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
1366 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1367 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
1368 ; -O0: adds x9, x8, x9
1369 ; -O0: and w11, w8, #0x1
1370 ; -O0: subs w11, w11, #1
1371 ; -O0: bl __atomic_compare_exchange
1373 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
1374 ; -O1: ldp x0, x1, [x0]
1375 ; -O1: adds x8, x0, x21
1376 ; -O1: bl __atomic_compare_exchange
1377 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
1381 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1382 ; -O0-LABEL: atomicrmw_sub_i8_aligned_monotonic:
1383 ; -O0: subs w12, w10, w8
1384 ; -O0: ldaxrb w9, [x11]
1385 ; -O0: cmp w9, w10, uxtb
1386 ; -O0: stlxrb w8, w12, [x11]
1387 ; -O0: and w8, w9, #0xff
1388 ; -O0: subs w8, w8, w10, uxtb
1390 ; -O1-LABEL: atomicrmw_sub_i8_aligned_monotonic:
1391 ; -O1: ldxrb w8, [x0]
1392 ; -O1: sub w9, w8, w1
1393 ; -O1: stxrb w10, w9, [x0]
1394 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1398 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
1399 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acquire:
1400 ; -O0: subs w12, w10, w8
1401 ; -O0: ldaxrb w9, [x11]
1402 ; -O0: cmp w9, w10, uxtb
1403 ; -O0: stlxrb w8, w12, [x11]
1404 ; -O0: and w8, w9, #0xff
1405 ; -O0: subs w8, w8, w10, uxtb
1407 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acquire:
1408 ; -O1: ldaxrb w8, [x0]
1409 ; -O1: sub w9, w8, w1
1410 ; -O1: stxrb w10, w9, [x0]
1411 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1415 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
1416 ; -O0-LABEL: atomicrmw_sub_i8_aligned_release:
1417 ; -O0: subs w12, w10, w8
1418 ; -O0: ldaxrb w9, [x11]
1419 ; -O0: cmp w9, w10, uxtb
1420 ; -O0: stlxrb w8, w12, [x11]
1421 ; -O0: and w8, w9, #0xff
1422 ; -O0: subs w8, w8, w10, uxtb
1424 ; -O1-LABEL: atomicrmw_sub_i8_aligned_release:
1425 ; -O1: ldxrb w8, [x0]
1426 ; -O1: sub w9, w8, w1
1427 ; -O1: stlxrb w10, w9, [x0]
1428 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1432 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1433 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
1434 ; -O0: subs w12, w10, w8
1435 ; -O0: ldaxrb w9, [x11]
1436 ; -O0: cmp w9, w10, uxtb
1437 ; -O0: stlxrb w8, w12, [x11]
1438 ; -O0: and w8, w9, #0xff
1439 ; -O0: subs w8, w8, w10, uxtb
1441 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
1442 ; -O1: ldaxrb w8, [x0]
1443 ; -O1: sub w9, w8, w1
1444 ; -O1: stlxrb w10, w9, [x0]
1445 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1449 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1450 ; -O0-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
1451 ; -O0: subs w12, w10, w8
1452 ; -O0: ldaxrb w9, [x11]
1453 ; -O0: cmp w9, w10, uxtb
1454 ; -O0: stlxrb w8, w12, [x11]
1455 ; -O0: and w8, w9, #0xff
1456 ; -O0: subs w8, w8, w10, uxtb
1458 ; -O1-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
1459 ; -O1: ldaxrb w8, [x0]
1460 ; -O1: sub w9, w8, w1
1461 ; -O1: stlxrb w10, w9, [x0]
1462 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1466 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1467 ; -O0-LABEL: atomicrmw_sub_i16_aligned_monotonic:
1468 ; -O0: subs w12, w8, w9
1469 ; -O0: ldaxrh w9, [x11]
1470 ; -O0: cmp w9, w8, uxth
1471 ; -O0: stlxrh w10, w12, [x11]
1472 ; -O0: subs w8, w8, w9, uxth
1474 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
1475 ; -O1: ldxrh w8, [x0]
1476 ; -O1: sub w9, w8, w1
1477 ; -O1: stxrh w10, w9, [x0]
1478 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
1482 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
1483 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
1484 ; -O0: subs w12, w8, w9
1485 ; -O0: ldaxrh w9, [x11]
1486 ; -O0: cmp w9, w8, uxth
1487 ; -O0: stlxrh w10, w12, [x11]
1488 ; -O0: subs w8, w8, w9, uxth
1490 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
1491 ; -O1: ldaxrh w8, [x0]
1492 ; -O1: sub w9, w8, w1
1493 ; -O1: stxrh w10, w9, [x0]
1494 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
1498 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
1499 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
1500 ; -O0: subs w12, w8, w9
1501 ; -O0: ldaxrh w9, [x11]
1502 ; -O0: cmp w9, w8, uxth
1503 ; -O0: stlxrh w10, w12, [x11]
1504 ; -O0: subs w8, w8, w9, uxth
1506 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
1507 ; -O1: ldxrh w8, [x0]
1508 ; -O1: sub w9, w8, w1
1509 ; -O1: stlxrh w10, w9, [x0]
1510 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
1514 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1515 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1516 ; -O0: subs w12, w8, w9
1517 ; -O0: ldaxrh w9, [x11]
1518 ; -O0: cmp w9, w8, uxth
1519 ; -O0: stlxrh w10, w12, [x11]
1520 ; -O0: subs w8, w8, w9, uxth
1522 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1523 ; -O1: ldaxrh w8, [x0]
1524 ; -O1: sub w9, w8, w1
1525 ; -O1: stlxrh w10, w9, [x0]
1526 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
1530 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1531 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1532 ; -O0: subs w12, w8, w9
1533 ; -O0: ldaxrh w9, [x11]
1534 ; -O0: cmp w9, w8, uxth
1535 ; -O0: stlxrh w10, w12, [x11]
1536 ; -O0: subs w8, w8, w9, uxth
1538 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1539 ; -O1: ldaxrh w8, [x0]
1540 ; -O1: sub w9, w8, w1
1541 ; -O1: stlxrh w10, w9, [x0]
1542 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1546 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1547 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1548 ; -O0: subs w12, w8, w9
1549 ; -O0: ldaxr w9, [x11]
1551 ; -O0: stlxr w10, w12, [x11]
1552 ; -O0: subs w8, w9, w8
1554 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1555 ; -O1: ldxr w8, [x0]
1556 ; -O1: sub w9, w8, w1
1557 ; -O1: stxr w10, w9, [x0]
1558 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1562 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1563 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
1564 ; -O0: subs w12, w8, w9
1565 ; -O0: ldaxr w9, [x11]
1567 ; -O0: stlxr w10, w12, [x11]
1568 ; -O0: subs w8, w9, w8
1570 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1571 ; -O1: ldaxr w8, [x0]
1572 ; -O1: sub w9, w8, w1
1573 ; -O1: stxr w10, w9, [x0]
1574 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1578 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1579 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1580 ; -O0: subs w12, w8, w9
1581 ; -O0: ldaxr w9, [x11]
1583 ; -O0: stlxr w10, w12, [x11]
1584 ; -O0: subs w8, w9, w8
1586 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1587 ; -O1: ldxr w8, [x0]
1588 ; -O1: sub w9, w8, w1
1589 ; -O1: stlxr w10, w9, [x0]
1590 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1594 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1595 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1596 ; -O0: subs w12, w8, w9
1597 ; -O0: ldaxr w9, [x11]
1599 ; -O0: stlxr w10, w12, [x11]
1600 ; -O0: subs w8, w9, w8
1602 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1603 ; -O1: ldaxr w8, [x0]
1604 ; -O1: sub w9, w8, w1
1605 ; -O1: stlxr w10, w9, [x0]
1606 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1610 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1611 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1612 ; -O0: subs w12, w8, w9
1613 ; -O0: ldaxr w9, [x11]
1615 ; -O0: stlxr w10, w12, [x11]
1616 ; -O0: subs w8, w9, w8
1618 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1619 ; -O1: ldaxr w8, [x0]
1620 ; -O1: sub w9, w8, w1
1621 ; -O1: stlxr w10, w9, [x0]
1622 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1626 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1627 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1628 ; -O0: subs x12, x8, x9
1629 ; -O0: ldaxr x9, [x11]
1631 ; -O0: stlxr w10, x12, [x11]
1632 ; -O0: subs x8, x9, x8
1634 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1635 ; -O1: ldxr x0, [x8]
1636 ; -O1: sub x9, x0, x1
1637 ; -O1: stxr w10, x9, [x8]
1638 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1642 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1643 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1644 ; -O0: subs x12, x8, x9
1645 ; -O0: ldaxr x9, [x11]
1647 ; -O0: stlxr w10, x12, [x11]
1648 ; -O0: subs x8, x9, x8
1650 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1651 ; -O1: ldaxr x0, [x8]
1652 ; -O1: sub x9, x0, x1
1653 ; -O1: stxr w10, x9, [x8]
1654 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1658 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1659 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1660 ; -O0: subs x12, x8, x9
1661 ; -O0: ldaxr x9, [x11]
1663 ; -O0: stlxr w10, x12, [x11]
1664 ; -O0: subs x8, x9, x8
1666 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1667 ; -O1: ldxr x0, [x8]
1668 ; -O1: sub x9, x0, x1
1669 ; -O1: stlxr w10, x9, [x8]
1670 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1674 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1675 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1676 ; -O0: subs x12, x8, x9
1677 ; -O0: ldaxr x9, [x11]
1679 ; -O0: stlxr w10, x12, [x11]
1680 ; -O0: subs x8, x9, x8
1682 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1683 ; -O1: ldaxr x0, [x8]
1684 ; -O1: sub x9, x0, x1
1685 ; -O1: stlxr w10, x9, [x8]
1686 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1690 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1691 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1692 ; -O0: subs x12, x8, x9
1693 ; -O0: ldaxr x9, [x11]
1695 ; -O0: stlxr w10, x12, [x11]
1696 ; -O0: subs x8, x9, x8
1698 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1699 ; -O1: ldaxr x0, [x8]
1700 ; -O1: sub x9, x0, x1
1701 ; -O1: stlxr w10, x9, [x8]
1702 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1706 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1707 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1708 ; -O0: subs x14, x8, x10
1709 ; -O0: and w10, w8, #0x1
1710 ; -O0: ldxp x10, x9, [x11]
1713 ; -O0: stxp w8, x14, x15, [x11]
1714 ; -O0: stxp w8, x10, x9, [x11]
1715 ; -O0: eor x8, x10, x8
1716 ; -O0: eor x11, x9, x11
1717 ; -O0: orr x8, x8, x11
1718 ; -O0: subs x8, x8, #0
1720 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1721 ; -O1: ldxp x0, x1, [x8]
1722 ; -O1: subs x9, x0, x2
1723 ; -O1: stxp w11, x9, x10, [x8]
1724 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1728 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1729 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1730 ; -O0: subs x14, x8, x10
1731 ; -O0: and w10, w8, #0x1
1732 ; -O0: ldaxp x10, x9, [x11]
1735 ; -O0: stxp w8, x14, x15, [x11]
1736 ; -O0: stxp w8, x10, x9, [x11]
1737 ; -O0: eor x8, x10, x8
1738 ; -O0: eor x11, x9, x11
1739 ; -O0: orr x8, x8, x11
1740 ; -O0: subs x8, x8, #0
1742 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1743 ; -O1: ldaxp x0, x1, [x8]
1744 ; -O1: subs x9, x0, x2
1745 ; -O1: stxp w11, x9, x10, [x8]
1746 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1750 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1751 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1752 ; -O0: subs x14, x8, x10
1753 ; -O0: and w10, w8, #0x1
1754 ; -O0: ldxp x10, x9, [x11]
1757 ; -O0: stlxp w8, x14, x15, [x11]
1758 ; -O0: stlxp w8, x10, x9, [x11]
1759 ; -O0: eor x8, x10, x8
1760 ; -O0: eor x11, x9, x11
1761 ; -O0: orr x8, x8, x11
1762 ; -O0: subs x8, x8, #0
1764 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1765 ; -O1: ldxp x0, x1, [x8]
1766 ; -O1: subs x9, x0, x2
1767 ; -O1: stlxp w11, x9, x10, [x8]
1768 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1772 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1773 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1774 ; -O0: subs x14, x8, x10
1775 ; -O0: and w10, w8, #0x1
1776 ; -O0: ldaxp x10, x9, [x11]
1779 ; -O0: stlxp w8, x14, x15, [x11]
1780 ; -O0: stlxp w8, x10, x9, [x11]
1781 ; -O0: eor x8, x10, x8
1782 ; -O0: eor x11, x9, x11
1783 ; -O0: orr x8, x8, x11
1784 ; -O0: subs x8, x8, #0
1786 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1787 ; -O1: ldaxp x0, x1, [x8]
1788 ; -O1: subs x9, x0, x2
1789 ; -O1: stlxp w11, x9, x10, [x8]
1790 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1794 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1795 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1796 ; -O0: subs x14, x8, x10
1797 ; -O0: and w10, w8, #0x1
1798 ; -O0: ldaxp x10, x9, [x11]
1801 ; -O0: stlxp w8, x14, x15, [x11]
1802 ; -O0: stlxp w8, x10, x9, [x11]
1803 ; -O0: eor x8, x10, x8
1804 ; -O0: eor x11, x9, x11
1805 ; -O0: orr x8, x8, x11
1806 ; -O0: subs x8, x8, #0
1808 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1809 ; -O1: ldaxp x0, x1, [x8]
1810 ; -O1: subs x9, x0, x2
1811 ; -O1: stlxp w11, x9, x10, [x8]
1812 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1816 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1817 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1818 ; -O0: subs w12, w10, w8
1819 ; -O0: ldaxrb w9, [x11]
1820 ; -O0: cmp w9, w10, uxtb
1821 ; -O0: stlxrb w8, w12, [x11]
1822 ; -O0: and w8, w9, #0xff
1823 ; -O0: subs w8, w8, w10, uxtb
1825 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1826 ; -O1: ldxrb w8, [x0]
1827 ; -O1: sub w9, w8, w1
1828 ; -O1: stxrb w10, w9, [x0]
1829 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1833 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1834 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1835 ; -O0: subs w12, w10, w8
1836 ; -O0: ldaxrb w9, [x11]
1837 ; -O0: cmp w9, w10, uxtb
1838 ; -O0: stlxrb w8, w12, [x11]
1839 ; -O0: and w8, w9, #0xff
1840 ; -O0: subs w8, w8, w10, uxtb
1842 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1843 ; -O1: ldaxrb w8, [x0]
1844 ; -O1: sub w9, w8, w1
1845 ; -O1: stxrb w10, w9, [x0]
1846 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1850 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1851 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1852 ; -O0: subs w12, w10, w8
1853 ; -O0: ldaxrb w9, [x11]
1854 ; -O0: cmp w9, w10, uxtb
1855 ; -O0: stlxrb w8, w12, [x11]
1856 ; -O0: and w8, w9, #0xff
1857 ; -O0: subs w8, w8, w10, uxtb
1859 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1860 ; -O1: ldxrb w8, [x0]
1861 ; -O1: sub w9, w8, w1
1862 ; -O1: stlxrb w10, w9, [x0]
1863 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1867 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1868 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1869 ; -O0: subs w12, w10, w8
1870 ; -O0: ldaxrb w9, [x11]
1871 ; -O0: cmp w9, w10, uxtb
1872 ; -O0: stlxrb w8, w12, [x11]
1873 ; -O0: and w8, w9, #0xff
1874 ; -O0: subs w8, w8, w10, uxtb
1876 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1877 ; -O1: ldaxrb w8, [x0]
1878 ; -O1: sub w9, w8, w1
1879 ; -O1: stlxrb w10, w9, [x0]
1880 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1884 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1885 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1886 ; -O0: subs w12, w10, w8
1887 ; -O0: ldaxrb w9, [x11]
1888 ; -O0: cmp w9, w10, uxtb
1889 ; -O0: stlxrb w8, w12, [x11]
1890 ; -O0: and w8, w9, #0xff
1891 ; -O0: subs w8, w8, w10, uxtb
1893 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1894 ; -O1: ldaxrb w8, [x0]
1895 ; -O1: sub w9, w8, w1
1896 ; -O1: stlxrb w10, w9, [x0]
1897 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1901 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1902 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1903 ; -O0: subs w8, w9, w8
1904 ; -O0: bl __atomic_compare_exchange
1906 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1907 ; -O1: sub w8, w0, w20
1908 ; -O1: bl __atomic_compare_exchange
1909 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1913 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1914 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1915 ; -O0: subs w8, w9, w8
1916 ; -O0: bl __atomic_compare_exchange
1918 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1919 ; -O1: sub w8, w0, w20
1920 ; -O1: bl __atomic_compare_exchange
1921 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1925 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1926 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1927 ; -O0: subs w8, w9, w8
1928 ; -O0: bl __atomic_compare_exchange
1930 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1931 ; -O1: sub w8, w0, w20
1932 ; -O1: bl __atomic_compare_exchange
1933 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1937 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1938 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1939 ; -O0: subs w8, w9, w8
1940 ; -O0: bl __atomic_compare_exchange
1942 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1943 ; -O1: sub w8, w0, w20
1944 ; -O1: bl __atomic_compare_exchange
1945 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1949 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1950 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1951 ; -O0: subs w8, w9, w8
1952 ; -O0: bl __atomic_compare_exchange
1954 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1955 ; -O1: sub w8, w0, w20
1956 ; -O1: bl __atomic_compare_exchange
1957 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1961 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1962 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1963 ; -O0: subs w8, w9, w8
1964 ; -O0: bl __atomic_compare_exchange
1966 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1967 ; -O1: sub w8, w0, w20
1968 ; -O1: bl __atomic_compare_exchange
1969 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1973 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1974 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1975 ; -O0: subs w8, w9, w8
1976 ; -O0: bl __atomic_compare_exchange
1978 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1979 ; -O1: sub w8, w0, w20
1980 ; -O1: bl __atomic_compare_exchange
1981 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1985 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1986 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1987 ; -O0: subs w8, w9, w8
1988 ; -O0: bl __atomic_compare_exchange
1990 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1991 ; -O1: sub w8, w0, w20
1992 ; -O1: bl __atomic_compare_exchange
1993 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1997 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1998 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1999 ; -O0: subs w8, w9, w8
2000 ; -O0: bl __atomic_compare_exchange
2002 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
2003 ; -O1: sub w8, w0, w20
2004 ; -O1: bl __atomic_compare_exchange
2005 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
2009 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2010 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
2011 ; -O0: subs w8, w9, w8
2012 ; -O0: bl __atomic_compare_exchange
2014 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
2015 ; -O1: sub w8, w0, w20
2016 ; -O1: bl __atomic_compare_exchange
2017 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
2021 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2022 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
2023 ; -O0: subs x8, x9, x8
2024 ; -O0: bl __atomic_compare_exchange
2026 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
2027 ; -O1: sub x8, x0, x20
2028 ; -O1: bl __atomic_compare_exchange
2029 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
2033 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2034 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
2035 ; -O0: subs x8, x9, x8
2036 ; -O0: bl __atomic_compare_exchange
2038 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
2039 ; -O1: sub x8, x0, x20
2040 ; -O1: bl __atomic_compare_exchange
2041 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
2045 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
2046 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
2047 ; -O0: subs x8, x9, x8
2048 ; -O0: bl __atomic_compare_exchange
2050 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
2051 ; -O1: sub x8, x0, x20
2052 ; -O1: bl __atomic_compare_exchange
2053 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
2057 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2058 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
2059 ; -O0: subs x8, x9, x8
2060 ; -O0: bl __atomic_compare_exchange
2062 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
2063 ; -O1: sub x8, x0, x20
2064 ; -O1: bl __atomic_compare_exchange
2065 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
2069 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2070 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
2071 ; -O0: subs x8, x9, x8
2072 ; -O0: bl __atomic_compare_exchange
2074 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
2075 ; -O1: sub x8, x0, x20
2076 ; -O1: bl __atomic_compare_exchange
2077 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
2081 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2082 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
2083 ; -O0: subs x9, x8, x9
2084 ; -O0: and w11, w8, #0x1
2085 ; -O0: bl __atomic_compare_exchange
2087 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
2088 ; -O1: ldp x0, x1, [x0]
2089 ; -O1: subs x8, x0, x21
2090 ; -O1: bl __atomic_compare_exchange
2091 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
2095 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2096 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
2097 ; -O0: subs x9, x8, x9
2098 ; -O0: and w11, w8, #0x1
2099 ; -O0: bl __atomic_compare_exchange
2101 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
2102 ; -O1: ldp x0, x1, [x0]
2103 ; -O1: subs x8, x0, x21
2104 ; -O1: bl __atomic_compare_exchange
2105 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
2109 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
2110 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
2111 ; -O0: subs x9, x8, x9
2112 ; -O0: and w11, w8, #0x1
2113 ; -O0: bl __atomic_compare_exchange
2115 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
2116 ; -O1: ldp x0, x1, [x0]
2117 ; -O1: subs x8, x0, x21
2118 ; -O1: bl __atomic_compare_exchange
2119 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
2123 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2124 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
2125 ; -O0: subs x9, x8, x9
2126 ; -O0: and w11, w8, #0x1
2127 ; -O0: bl __atomic_compare_exchange
2129 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
2130 ; -O1: ldp x0, x1, [x0]
2131 ; -O1: subs x8, x0, x21
2132 ; -O1: bl __atomic_compare_exchange
2133 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
2137 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2138 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
2139 ; -O0: subs x9, x8, x9
2140 ; -O0: and w11, w8, #0x1
2141 ; -O0: bl __atomic_compare_exchange
2143 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
2144 ; -O1: ldp x0, x1, [x0]
2145 ; -O1: subs x8, x0, x21
2146 ; -O1: bl __atomic_compare_exchange
2147 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
2151 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2152 ; -O0-LABEL: atomicrmw_and_i8_aligned_monotonic:
2153 ; -O0: and w12, w10, w8
2154 ; -O0: ldaxrb w9, [x11]
2155 ; -O0: cmp w9, w10, uxtb
2156 ; -O0: stlxrb w8, w12, [x11]
2157 ; -O0: and w8, w9, #0xff
2158 ; -O0: subs w8, w8, w10, uxtb
2160 ; -O1-LABEL: atomicrmw_and_i8_aligned_monotonic:
2161 ; -O1: ldxrb w8, [x0]
2162 ; -O1: and w9, w8, w1
2163 ; -O1: stxrb w10, w9, [x0]
2164 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
2168 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
2169 ; -O0-LABEL: atomicrmw_and_i8_aligned_acquire:
2170 ; -O0: and w12, w10, w8
2171 ; -O0: ldaxrb w9, [x11]
2172 ; -O0: cmp w9, w10, uxtb
2173 ; -O0: stlxrb w8, w12, [x11]
2174 ; -O0: and w8, w9, #0xff
2175 ; -O0: subs w8, w8, w10, uxtb
2177 ; -O1-LABEL: atomicrmw_and_i8_aligned_acquire:
2178 ; -O1: ldaxrb w8, [x0]
2179 ; -O1: and w9, w8, w1
2180 ; -O1: stxrb w10, w9, [x0]
2181 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
2185 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
2186 ; -O0-LABEL: atomicrmw_and_i8_aligned_release:
2187 ; -O0: and w12, w10, w8
2188 ; -O0: ldaxrb w9, [x11]
2189 ; -O0: cmp w9, w10, uxtb
2190 ; -O0: stlxrb w8, w12, [x11]
2191 ; -O0: and w8, w9, #0xff
2192 ; -O0: subs w8, w8, w10, uxtb
2194 ; -O1-LABEL: atomicrmw_and_i8_aligned_release:
2195 ; -O1: ldxrb w8, [x0]
2196 ; -O1: and w9, w8, w1
2197 ; -O1: stlxrb w10, w9, [x0]
2198 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
2202 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2203 ; -O0-LABEL: atomicrmw_and_i8_aligned_acq_rel:
2204 ; -O0: and w12, w10, w8
2205 ; -O0: ldaxrb w9, [x11]
2206 ; -O0: cmp w9, w10, uxtb
2207 ; -O0: stlxrb w8, w12, [x11]
2208 ; -O0: and w8, w9, #0xff
2209 ; -O0: subs w8, w8, w10, uxtb
2211 ; -O1-LABEL: atomicrmw_and_i8_aligned_acq_rel:
2212 ; -O1: ldaxrb w8, [x0]
2213 ; -O1: and w9, w8, w1
2214 ; -O1: stlxrb w10, w9, [x0]
2215 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
2219 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2220 ; -O0-LABEL: atomicrmw_and_i8_aligned_seq_cst:
2221 ; -O0: and w12, w10, w8
2222 ; -O0: ldaxrb w9, [x11]
2223 ; -O0: cmp w9, w10, uxtb
2224 ; -O0: stlxrb w8, w12, [x11]
2225 ; -O0: and w8, w9, #0xff
2226 ; -O0: subs w8, w8, w10, uxtb
2228 ; -O1-LABEL: atomicrmw_and_i8_aligned_seq_cst:
2229 ; -O1: ldaxrb w8, [x0]
2230 ; -O1: and w9, w8, w1
2231 ; -O1: stlxrb w10, w9, [x0]
2232 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
2236 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2237 ; -O0-LABEL: atomicrmw_and_i16_aligned_monotonic:
2238 ; -O0: and w12, w8, w9
2239 ; -O0: ldaxrh w9, [x11]
2240 ; -O0: cmp w9, w8, uxth
2241 ; -O0: stlxrh w10, w12, [x11]
2242 ; -O0: subs w8, w8, w9, uxth
2244 ; -O1-LABEL: atomicrmw_and_i16_aligned_monotonic:
2245 ; -O1: ldxrh w8, [x0]
2246 ; -O1: and w9, w8, w1
2247 ; -O1: stxrh w10, w9, [x0]
2248 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
2252 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
2253 ; -O0-LABEL: atomicrmw_and_i16_aligned_acquire:
2254 ; -O0: and w12, w8, w9
2255 ; -O0: ldaxrh w9, [x11]
2256 ; -O0: cmp w9, w8, uxth
2257 ; -O0: stlxrh w10, w12, [x11]
2258 ; -O0: subs w8, w8, w9, uxth
2260 ; -O1-LABEL: atomicrmw_and_i16_aligned_acquire:
2261 ; -O1: ldaxrh w8, [x0]
2262 ; -O1: and w9, w8, w1
2263 ; -O1: stxrh w10, w9, [x0]
2264 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
2268 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
2269 ; -O0-LABEL: atomicrmw_and_i16_aligned_release:
2270 ; -O0: and w12, w8, w9
2271 ; -O0: ldaxrh w9, [x11]
2272 ; -O0: cmp w9, w8, uxth
2273 ; -O0: stlxrh w10, w12, [x11]
2274 ; -O0: subs w8, w8, w9, uxth
2276 ; -O1-LABEL: atomicrmw_and_i16_aligned_release:
2277 ; -O1: ldxrh w8, [x0]
2278 ; -O1: and w9, w8, w1
2279 ; -O1: stlxrh w10, w9, [x0]
2280 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
2284 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2285 ; -O0-LABEL: atomicrmw_and_i16_aligned_acq_rel:
2286 ; -O0: and w12, w8, w9
2287 ; -O0: ldaxrh w9, [x11]
2288 ; -O0: cmp w9, w8, uxth
2289 ; -O0: stlxrh w10, w12, [x11]
2290 ; -O0: subs w8, w8, w9, uxth
2292 ; -O1-LABEL: atomicrmw_and_i16_aligned_acq_rel:
2293 ; -O1: ldaxrh w8, [x0]
2294 ; -O1: and w9, w8, w1
2295 ; -O1: stlxrh w10, w9, [x0]
2296 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
2300 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2301 ; -O0-LABEL: atomicrmw_and_i16_aligned_seq_cst:
2302 ; -O0: and w12, w8, w9
2303 ; -O0: ldaxrh w9, [x11]
2304 ; -O0: cmp w9, w8, uxth
2305 ; -O0: stlxrh w10, w12, [x11]
2306 ; -O0: subs w8, w8, w9, uxth
2308 ; -O1-LABEL: atomicrmw_and_i16_aligned_seq_cst:
2309 ; -O1: ldaxrh w8, [x0]
2310 ; -O1: and w9, w8, w1
2311 ; -O1: stlxrh w10, w9, [x0]
2312 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
2316 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2317 ; -O0-LABEL: atomicrmw_and_i32_aligned_monotonic:
2318 ; -O0: and w12, w8, w9
2319 ; -O0: ldaxr w9, [x11]
2321 ; -O0: stlxr w10, w12, [x11]
2322 ; -O0: subs w8, w9, w8
2324 ; -O1-LABEL: atomicrmw_and_i32_aligned_monotonic:
2325 ; -O1: ldxr w8, [x0]
2326 ; -O1: and w9, w8, w1
2327 ; -O1: stxr w10, w9, [x0]
2328 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
2332 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
2333 ; -O0-LABEL: atomicrmw_and_i32_aligned_acquire:
2334 ; -O0: and w12, w8, w9
2335 ; -O0: ldaxr w9, [x11]
2337 ; -O0: stlxr w10, w12, [x11]
2338 ; -O0: subs w8, w9, w8
2340 ; -O1-LABEL: atomicrmw_and_i32_aligned_acquire:
2341 ; -O1: ldaxr w8, [x0]
2342 ; -O1: and w9, w8, w1
2343 ; -O1: stxr w10, w9, [x0]
2344 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
2348 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
2349 ; -O0-LABEL: atomicrmw_and_i32_aligned_release:
2350 ; -O0: and w12, w8, w9
2351 ; -O0: ldaxr w9, [x11]
2353 ; -O0: stlxr w10, w12, [x11]
2354 ; -O0: subs w8, w9, w8
2356 ; -O1-LABEL: atomicrmw_and_i32_aligned_release:
2357 ; -O1: ldxr w8, [x0]
2358 ; -O1: and w9, w8, w1
2359 ; -O1: stlxr w10, w9, [x0]
2360 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
2364 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2365 ; -O0-LABEL: atomicrmw_and_i32_aligned_acq_rel:
2366 ; -O0: and w12, w8, w9
2367 ; -O0: ldaxr w9, [x11]
2369 ; -O0: stlxr w10, w12, [x11]
2370 ; -O0: subs w8, w9, w8
2372 ; -O1-LABEL: atomicrmw_and_i32_aligned_acq_rel:
2373 ; -O1: ldaxr w8, [x0]
2374 ; -O1: and w9, w8, w1
2375 ; -O1: stlxr w10, w9, [x0]
2376 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
2380 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2381 ; -O0-LABEL: atomicrmw_and_i32_aligned_seq_cst:
2382 ; -O0: and w12, w8, w9
2383 ; -O0: ldaxr w9, [x11]
2385 ; -O0: stlxr w10, w12, [x11]
2386 ; -O0: subs w8, w9, w8
2388 ; -O1-LABEL: atomicrmw_and_i32_aligned_seq_cst:
2389 ; -O1: ldaxr w8, [x0]
2390 ; -O1: and w9, w8, w1
2391 ; -O1: stlxr w10, w9, [x0]
2392 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
2396 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2397 ; -O0-LABEL: atomicrmw_and_i64_aligned_monotonic:
2398 ; -O0: and x12, x8, x9
2399 ; -O0: ldaxr x9, [x11]
2401 ; -O0: stlxr w10, x12, [x11]
2402 ; -O0: subs x8, x9, x8
2404 ; -O1-LABEL: atomicrmw_and_i64_aligned_monotonic:
2405 ; -O1: ldxr x0, [x8]
2406 ; -O1: and x9, x0, x1
2407 ; -O1: stxr w10, x9, [x8]
2408 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
2412 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
2413 ; -O0-LABEL: atomicrmw_and_i64_aligned_acquire:
2414 ; -O0: and x12, x8, x9
2415 ; -O0: ldaxr x9, [x11]
2417 ; -O0: stlxr w10, x12, [x11]
2418 ; -O0: subs x8, x9, x8
2420 ; -O1-LABEL: atomicrmw_and_i64_aligned_acquire:
2421 ; -O1: ldaxr x0, [x8]
2422 ; -O1: and x9, x0, x1
2423 ; -O1: stxr w10, x9, [x8]
2424 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
2428 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
2429 ; -O0-LABEL: atomicrmw_and_i64_aligned_release:
2430 ; -O0: and x12, x8, x9
2431 ; -O0: ldaxr x9, [x11]
2433 ; -O0: stlxr w10, x12, [x11]
2434 ; -O0: subs x8, x9, x8
2436 ; -O1-LABEL: atomicrmw_and_i64_aligned_release:
2437 ; -O1: ldxr x0, [x8]
2438 ; -O1: and x9, x0, x1
2439 ; -O1: stlxr w10, x9, [x8]
2440 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
2444 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2445 ; -O0-LABEL: atomicrmw_and_i64_aligned_acq_rel:
2446 ; -O0: and x12, x8, x9
2447 ; -O0: ldaxr x9, [x11]
2449 ; -O0: stlxr w10, x12, [x11]
2450 ; -O0: subs x8, x9, x8
2452 ; -O1-LABEL: atomicrmw_and_i64_aligned_acq_rel:
2453 ; -O1: ldaxr x0, [x8]
2454 ; -O1: and x9, x0, x1
2455 ; -O1: stlxr w10, x9, [x8]
2456 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
2460 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2461 ; -O0-LABEL: atomicrmw_and_i64_aligned_seq_cst:
2462 ; -O0: and x12, x8, x9
2463 ; -O0: ldaxr x9, [x11]
2465 ; -O0: stlxr w10, x12, [x11]
2466 ; -O0: subs x8, x9, x8
2468 ; -O1-LABEL: atomicrmw_and_i64_aligned_seq_cst:
2469 ; -O1: ldaxr x0, [x8]
2470 ; -O1: and x9, x0, x1
2471 ; -O1: stlxr w10, x9, [x8]
2472 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
2476 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2477 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
2478 ; -O0: and x14, x8, x10
2479 ; -O0: and x15, x8, x9
2480 ; -O0: ldxp x10, x9, [x11]
2483 ; -O0: stxp w8, x14, x15, [x11]
2484 ; -O0: stxp w8, x10, x9, [x11]
2485 ; -O0: eor x8, x10, x8
2486 ; -O0: eor x11, x9, x11
2487 ; -O0: orr x8, x8, x11
2488 ; -O0: subs x8, x8, #0
2490 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
2491 ; -O1: ldxp x0, x1, [x8]
2492 ; -O1: and x9, x1, x3
2493 ; -O1: and x10, x0, x2
2494 ; -O1: stxp w11, x10, x9, [x8]
2495 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
2499 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
2500 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
2501 ; -O0: and x14, x8, x10
2502 ; -O0: and x15, x8, x9
2503 ; -O0: ldaxp x10, x9, [x11]
2506 ; -O0: stxp w8, x14, x15, [x11]
2507 ; -O0: stxp w8, x10, x9, [x11]
2508 ; -O0: eor x8, x10, x8
2509 ; -O0: eor x11, x9, x11
2510 ; -O0: orr x8, x8, x11
2511 ; -O0: subs x8, x8, #0
2513 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
2514 ; -O1: ldaxp x0, x1, [x8]
2515 ; -O1: and x9, x1, x3
2516 ; -O1: and x10, x0, x2
2517 ; -O1: stxp w11, x10, x9, [x8]
2518 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
2522 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
2523 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
2524 ; -O0: and x14, x8, x10
2525 ; -O0: and x15, x8, x9
2526 ; -O0: ldxp x10, x9, [x11]
2529 ; -O0: stlxp w8, x14, x15, [x11]
2530 ; -O0: stlxp w8, x10, x9, [x11]
2531 ; -O0: eor x8, x10, x8
2532 ; -O0: eor x11, x9, x11
2533 ; -O0: orr x8, x8, x11
2534 ; -O0: subs x8, x8, #0
2536 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
2537 ; -O1: ldxp x0, x1, [x8]
2538 ; -O1: and x9, x1, x3
2539 ; -O1: and x10, x0, x2
2540 ; -O1: stlxp w11, x10, x9, [x8]
2541 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
2545 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2546 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
2547 ; -O0: and x14, x8, x10
2548 ; -O0: and x15, x8, x9
2549 ; -O0: ldaxp x10, x9, [x11]
2552 ; -O0: stlxp w8, x14, x15, [x11]
2553 ; -O0: stlxp w8, x10, x9, [x11]
2554 ; -O0: eor x8, x10, x8
2555 ; -O0: eor x11, x9, x11
2556 ; -O0: orr x8, x8, x11
2557 ; -O0: subs x8, x8, #0
2559 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
2560 ; -O1: ldaxp x0, x1, [x8]
2561 ; -O1: and x9, x1, x3
2562 ; -O1: and x10, x0, x2
2563 ; -O1: stlxp w11, x10, x9, [x8]
2564 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
2568 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2569 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
2570 ; -O0: and x14, x8, x10
2571 ; -O0: and x15, x8, x9
2572 ; -O0: ldaxp x10, x9, [x11]
2575 ; -O0: stlxp w8, x14, x15, [x11]
2576 ; -O0: stlxp w8, x10, x9, [x11]
2577 ; -O0: eor x8, x10, x8
2578 ; -O0: eor x11, x9, x11
2579 ; -O0: orr x8, x8, x11
2580 ; -O0: subs x8, x8, #0
2582 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
2583 ; -O1: ldaxp x0, x1, [x8]
2584 ; -O1: and x9, x1, x3
2585 ; -O1: and x10, x0, x2
2586 ; -O1: stlxp w11, x10, x9, [x8]
2587 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
2591 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2592 ; -O0-LABEL: atomicrmw_and_i8_unaligned_monotonic:
2593 ; -O0: and w12, w10, w8
2594 ; -O0: ldaxrb w9, [x11]
2595 ; -O0: cmp w9, w10, uxtb
2596 ; -O0: stlxrb w8, w12, [x11]
2597 ; -O0: and w8, w9, #0xff
2598 ; -O0: subs w8, w8, w10, uxtb
2600 ; -O1-LABEL: atomicrmw_and_i8_unaligned_monotonic:
2601 ; -O1: ldxrb w8, [x0]
2602 ; -O1: and w9, w8, w1
2603 ; -O1: stxrb w10, w9, [x0]
2604 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
2608 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2609 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acquire:
2610 ; -O0: and w12, w10, w8
2611 ; -O0: ldaxrb w9, [x11]
2612 ; -O0: cmp w9, w10, uxtb
2613 ; -O0: stlxrb w8, w12, [x11]
2614 ; -O0: and w8, w9, #0xff
2615 ; -O0: subs w8, w8, w10, uxtb
2617 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acquire:
2618 ; -O1: ldaxrb w8, [x0]
2619 ; -O1: and w9, w8, w1
2620 ; -O1: stxrb w10, w9, [x0]
2621 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
2625 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
2626 ; -O0-LABEL: atomicrmw_and_i8_unaligned_release:
2627 ; -O0: and w12, w10, w8
2628 ; -O0: ldaxrb w9, [x11]
2629 ; -O0: cmp w9, w10, uxtb
2630 ; -O0: stlxrb w8, w12, [x11]
2631 ; -O0: and w8, w9, #0xff
2632 ; -O0: subs w8, w8, w10, uxtb
2634 ; -O1-LABEL: atomicrmw_and_i8_unaligned_release:
2635 ; -O1: ldxrb w8, [x0]
2636 ; -O1: and w9, w8, w1
2637 ; -O1: stlxrb w10, w9, [x0]
2638 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
2642 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2643 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
2644 ; -O0: and w12, w10, w8
2645 ; -O0: ldaxrb w9, [x11]
2646 ; -O0: cmp w9, w10, uxtb
2647 ; -O0: stlxrb w8, w12, [x11]
2648 ; -O0: and w8, w9, #0xff
2649 ; -O0: subs w8, w8, w10, uxtb
2651 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
2652 ; -O1: ldaxrb w8, [x0]
2653 ; -O1: and w9, w8, w1
2654 ; -O1: stlxrb w10, w9, [x0]
2655 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
2659 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2660 ; -O0-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2661 ; -O0: and w12, w10, w8
2662 ; -O0: ldaxrb w9, [x11]
2663 ; -O0: cmp w9, w10, uxtb
2664 ; -O0: stlxrb w8, w12, [x11]
2665 ; -O0: and w8, w9, #0xff
2666 ; -O0: subs w8, w8, w10, uxtb
2668 ; -O1-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2669 ; -O1: ldaxrb w8, [x0]
2670 ; -O1: and w9, w8, w1
2671 ; -O1: stlxrb w10, w9, [x0]
2672 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
2676 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2677 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2678 ; -O0: and w8, w9, w8
2679 ; -O0: bl __atomic_compare_exchange
2681 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2682 ; -O1: and w8, w0, w20
2683 ; -O1: bl __atomic_compare_exchange
2684 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
2688 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2689 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
2690 ; -O0: and w8, w9, w8
2691 ; -O0: bl __atomic_compare_exchange
2693 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
2694 ; -O1: and w8, w0, w20
2695 ; -O1: bl __atomic_compare_exchange
2696 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
2700 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
2701 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
2702 ; -O0: and w8, w9, w8
2703 ; -O0: bl __atomic_compare_exchange
2705 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
2706 ; -O1: and w8, w0, w20
2707 ; -O1: bl __atomic_compare_exchange
2708 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
2712 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2713 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2714 ; -O0: and w8, w9, w8
2715 ; -O0: bl __atomic_compare_exchange
2717 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2718 ; -O1: and w8, w0, w20
2719 ; -O1: bl __atomic_compare_exchange
2720 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
2724 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2725 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2726 ; -O0: and w8, w9, w8
2727 ; -O0: bl __atomic_compare_exchange
2729 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2730 ; -O1: and w8, w0, w20
2731 ; -O1: bl __atomic_compare_exchange
2732 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
2736 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2737 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2738 ; -O0: and w8, w9, w8
2739 ; -O0: bl __atomic_compare_exchange
2741 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2742 ; -O1: and w8, w0, w20
2743 ; -O1: bl __atomic_compare_exchange
2744 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
2748 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2749 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
2750 ; -O0: and w8, w9, w8
2751 ; -O0: bl __atomic_compare_exchange
2753 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
2754 ; -O1: and w8, w0, w20
2755 ; -O1: bl __atomic_compare_exchange
2756 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
2760 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
2761 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
2762 ; -O0: and w8, w9, w8
2763 ; -O0: bl __atomic_compare_exchange
2765 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
2766 ; -O1: and w8, w0, w20
2767 ; -O1: bl __atomic_compare_exchange
2768 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
2772 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2773 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2774 ; -O0: and w8, w9, w8
2775 ; -O0: bl __atomic_compare_exchange
2777 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2778 ; -O1: and w8, w0, w20
2779 ; -O1: bl __atomic_compare_exchange
2780 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
2784 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2785 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2786 ; -O0: and w8, w9, w8
2787 ; -O0: bl __atomic_compare_exchange
2789 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2790 ; -O1: and w8, w0, w20
2791 ; -O1: bl __atomic_compare_exchange
2792 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
2796 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2797 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2798 ; -O0: and x8, x9, x8
2799 ; -O0: bl __atomic_compare_exchange
2801 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2802 ; -O1: and x8, x0, x20
2803 ; -O1: bl __atomic_compare_exchange
2804 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
2808 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2809 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
2810 ; -O0: and x8, x9, x8
2811 ; -O0: bl __atomic_compare_exchange
2813 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
2814 ; -O1: and x8, x0, x20
2815 ; -O1: bl __atomic_compare_exchange
2816 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
2820 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
2821 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
2822 ; -O0: and x8, x9, x8
2823 ; -O0: bl __atomic_compare_exchange
2825 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
2826 ; -O1: and x8, x0, x20
2827 ; -O1: bl __atomic_compare_exchange
2828 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
2832 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2833 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2834 ; -O0: and x8, x9, x8
2835 ; -O0: bl __atomic_compare_exchange
2837 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2838 ; -O1: and x8, x0, x20
2839 ; -O1: bl __atomic_compare_exchange
2840 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
2844 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2845 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2846 ; -O0: and x8, x9, x8
2847 ; -O0: bl __atomic_compare_exchange
2849 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2850 ; -O1: and x8, x0, x20
2851 ; -O1: bl __atomic_compare_exchange
2852 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
2856 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2857 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2858 ; -O0: and x9, x8, x9
2859 ; -O0: and x8, x8, x10
2860 ; -O0: bl __atomic_compare_exchange
2862 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2863 ; -O1: ldp x0, x1, [x0]
2864 ; -O1: and x8, x1, x19
2865 ; -O1: and x9, x0, x21
2866 ; -O1: bl __atomic_compare_exchange
2867 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
2871 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2872 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
2873 ; -O0: and x9, x8, x9
2874 ; -O0: and x8, x8, x10
2875 ; -O0: bl __atomic_compare_exchange
2877 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
2878 ; -O1: ldp x0, x1, [x0]
2879 ; -O1: and x8, x1, x19
2880 ; -O1: and x9, x0, x21
2881 ; -O1: bl __atomic_compare_exchange
2882 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
2886 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
2887 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
2888 ; -O0: and x9, x8, x9
2889 ; -O0: and x8, x8, x10
2890 ; -O0: bl __atomic_compare_exchange
2892 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
2893 ; -O1: ldp x0, x1, [x0]
2894 ; -O1: and x8, x1, x19
2895 ; -O1: and x9, x0, x21
2896 ; -O1: bl __atomic_compare_exchange
2897 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
2901 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2902 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2903 ; -O0: and x9, x8, x9
2904 ; -O0: and x8, x8, x10
2905 ; -O0: bl __atomic_compare_exchange
2907 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2908 ; -O1: ldp x0, x1, [x0]
2909 ; -O1: and x8, x1, x19
2910 ; -O1: and x9, x0, x21
2911 ; -O1: bl __atomic_compare_exchange
2912 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2916 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2917 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2918 ; -O0: and x9, x8, x9
2919 ; -O0: and x8, x8, x10
2920 ; -O0: bl __atomic_compare_exchange
2922 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2923 ; -O1: ldp x0, x1, [x0]
2924 ; -O1: and x8, x1, x19
2925 ; -O1: and x9, x0, x21
2926 ; -O1: bl __atomic_compare_exchange
2927 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2931 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2932 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2933 ; -O0: and w8, w10, w8
2935 ; -O0: ldaxrb w9, [x11]
2936 ; -O0: cmp w9, w10, uxtb
2937 ; -O0: stlxrb w8, w12, [x11]
2938 ; -O0: and w8, w9, #0xff
2939 ; -O0: subs w8, w8, w10, uxtb
2941 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2942 ; -O1: ldxrb w8, [x0]
2943 ; -O1: and w9, w8, w1
2945 ; -O1: stxrb w10, w9, [x0]
2946 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2950 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2951 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2952 ; -O0: and w8, w10, w8
2954 ; -O0: ldaxrb w9, [x11]
2955 ; -O0: cmp w9, w10, uxtb
2956 ; -O0: stlxrb w8, w12, [x11]
2957 ; -O0: and w8, w9, #0xff
2958 ; -O0: subs w8, w8, w10, uxtb
2960 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2961 ; -O1: ldaxrb w8, [x0]
2962 ; -O1: and w9, w8, w1
2964 ; -O1: stxrb w10, w9, [x0]
2965 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2969 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2970 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2971 ; -O0: and w8, w10, w8
2973 ; -O0: ldaxrb w9, [x11]
2974 ; -O0: cmp w9, w10, uxtb
2975 ; -O0: stlxrb w8, w12, [x11]
2976 ; -O0: and w8, w9, #0xff
2977 ; -O0: subs w8, w8, w10, uxtb
2979 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2980 ; -O1: ldxrb w8, [x0]
2981 ; -O1: and w9, w8, w1
2983 ; -O1: stlxrb w10, w9, [x0]
2984 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2988 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2989 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2990 ; -O0: and w8, w10, w8
2992 ; -O0: ldaxrb w9, [x11]
2993 ; -O0: cmp w9, w10, uxtb
2994 ; -O0: stlxrb w8, w12, [x11]
2995 ; -O0: and w8, w9, #0xff
2996 ; -O0: subs w8, w8, w10, uxtb
2998 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2999 ; -O1: ldaxrb w8, [x0]
3000 ; -O1: and w9, w8, w1
3002 ; -O1: stlxrb w10, w9, [x0]
3003 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
3007 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3008 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
3009 ; -O0: and w8, w10, w8
3011 ; -O0: ldaxrb w9, [x11]
3012 ; -O0: cmp w9, w10, uxtb
3013 ; -O0: stlxrb w8, w12, [x11]
3014 ; -O0: and w8, w9, #0xff
3015 ; -O0: subs w8, w8, w10, uxtb
3017 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
3018 ; -O1: ldaxrb w8, [x0]
3019 ; -O1: and w9, w8, w1
3021 ; -O1: stlxrb w10, w9, [x0]
3022 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
3026 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3027 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
3028 ; -O0: and w9, w8, w9
3030 ; -O0: ldaxrh w9, [x11]
3031 ; -O0: cmp w9, w8, uxth
3032 ; -O0: stlxrh w10, w12, [x11]
3033 ; -O0: subs w8, w8, w9, uxth
3035 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
3036 ; -O1: ldxrh w8, [x0]
3037 ; -O1: and w9, w8, w1
3039 ; -O1: stxrh w10, w9, [x0]
3040 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
3044 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
3045 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
3046 ; -O0: and w9, w8, w9
3048 ; -O0: ldaxrh w9, [x11]
3049 ; -O0: cmp w9, w8, uxth
3050 ; -O0: stlxrh w10, w12, [x11]
3051 ; -O0: subs w8, w8, w9, uxth
3053 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
3054 ; -O1: ldaxrh w8, [x0]
3055 ; -O1: and w9, w8, w1
3057 ; -O1: stxrh w10, w9, [x0]
3058 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
3062 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
3063 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
3064 ; -O0: and w9, w8, w9
3066 ; -O0: ldaxrh w9, [x11]
3067 ; -O0: cmp w9, w8, uxth
3068 ; -O0: stlxrh w10, w12, [x11]
3069 ; -O0: subs w8, w8, w9, uxth
3071 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
3072 ; -O1: ldxrh w8, [x0]
3073 ; -O1: and w9, w8, w1
3075 ; -O1: stlxrh w10, w9, [x0]
3076 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
3080 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3081 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
3082 ; -O0: and w9, w8, w9
3084 ; -O0: ldaxrh w9, [x11]
3085 ; -O0: cmp w9, w8, uxth
3086 ; -O0: stlxrh w10, w12, [x11]
3087 ; -O0: subs w8, w8, w9, uxth
3089 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
3090 ; -O1: ldaxrh w8, [x0]
3091 ; -O1: and w9, w8, w1
3093 ; -O1: stlxrh w10, w9, [x0]
3094 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
3098 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3099 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
3100 ; -O0: and w9, w8, w9
3102 ; -O0: ldaxrh w9, [x11]
3103 ; -O0: cmp w9, w8, uxth
3104 ; -O0: stlxrh w10, w12, [x11]
3105 ; -O0: subs w8, w8, w9, uxth
3107 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
3108 ; -O1: ldaxrh w8, [x0]
3109 ; -O1: and w9, w8, w1
3111 ; -O1: stlxrh w10, w9, [x0]
3112 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
3116 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3117 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
3118 ; -O0: and w9, w8, w9
3120 ; -O0: ldaxr w9, [x11]
3122 ; -O0: stlxr w10, w12, [x11]
3123 ; -O0: subs w8, w9, w8
3125 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
3126 ; -O1: ldxr w8, [x0]
3127 ; -O1: and w9, w8, w1
3129 ; -O1: stxr w10, w9, [x0]
3130 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
3134 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
3135 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
3136 ; -O0: and w9, w8, w9
3138 ; -O0: ldaxr w9, [x11]
3140 ; -O0: stlxr w10, w12, [x11]
3141 ; -O0: subs w8, w9, w8
3143 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
3144 ; -O1: ldaxr w8, [x0]
3145 ; -O1: and w9, w8, w1
3147 ; -O1: stxr w10, w9, [x0]
3148 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
3152 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
3153 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
3154 ; -O0: and w9, w8, w9
3156 ; -O0: ldaxr w9, [x11]
3158 ; -O0: stlxr w10, w12, [x11]
3159 ; -O0: subs w8, w9, w8
3161 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
3162 ; -O1: ldxr w8, [x0]
3163 ; -O1: and w9, w8, w1
3165 ; -O1: stlxr w10, w9, [x0]
3166 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
3170 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3171 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
3172 ; -O0: and w9, w8, w9
3174 ; -O0: ldaxr w9, [x11]
3176 ; -O0: stlxr w10, w12, [x11]
3177 ; -O0: subs w8, w9, w8
3179 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
3180 ; -O1: ldaxr w8, [x0]
3181 ; -O1: and w9, w8, w1
3183 ; -O1: stlxr w10, w9, [x0]
3184 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
3188 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3189 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
3190 ; -O0: and w9, w8, w9
3192 ; -O0: ldaxr w9, [x11]
3194 ; -O0: stlxr w10, w12, [x11]
3195 ; -O0: subs w8, w9, w8
3197 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
3198 ; -O1: ldaxr w8, [x0]
3199 ; -O1: and w9, w8, w1
3201 ; -O1: stlxr w10, w9, [x0]
3202 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
3206 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3207 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
3208 ; -O0: and x9, x8, x9
3210 ; -O0: ldaxr x9, [x11]
3212 ; -O0: stlxr w10, x12, [x11]
3213 ; -O0: subs x8, x9, x8
3215 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
3216 ; -O1: ldxr x0, [x8]
3217 ; -O1: and x9, x0, x1
3219 ; -O1: stxr w10, x9, [x8]
3220 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
3224 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
3225 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
3226 ; -O0: and x9, x8, x9
3228 ; -O0: ldaxr x9, [x11]
3230 ; -O0: stlxr w10, x12, [x11]
3231 ; -O0: subs x8, x9, x8
3233 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
3234 ; -O1: ldaxr x0, [x8]
3235 ; -O1: and x9, x0, x1
3237 ; -O1: stxr w10, x9, [x8]
3238 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
3242 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
3243 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
3244 ; -O0: and x9, x8, x9
3246 ; -O0: ldaxr x9, [x11]
3248 ; -O0: stlxr w10, x12, [x11]
3249 ; -O0: subs x8, x9, x8
3251 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
3252 ; -O1: ldxr x0, [x8]
3253 ; -O1: and x9, x0, x1
3255 ; -O1: stlxr w10, x9, [x8]
3256 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
3260 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3261 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
3262 ; -O0: and x9, x8, x9
3264 ; -O0: ldaxr x9, [x11]
3266 ; -O0: stlxr w10, x12, [x11]
3267 ; -O0: subs x8, x9, x8
3269 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
3270 ; -O1: ldaxr x0, [x8]
3271 ; -O1: and x9, x0, x1
3273 ; -O1: stlxr w10, x9, [x8]
3274 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
3278 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3279 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
3280 ; -O0: and x9, x8, x9
3282 ; -O0: ldaxr x9, [x11]
3284 ; -O0: stlxr w10, x12, [x11]
3285 ; -O0: subs x8, x9, x8
3287 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
3288 ; -O1: ldaxr x0, [x8]
3289 ; -O1: and x9, x0, x1
3291 ; -O1: stlxr w10, x9, [x8]
3292 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
3296 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3297 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
3298 ; -O0: and x9, x8, x9
3299 ; -O0: and x8, x8, x10
3302 ; -O0: ldxp x10, x9, [x11]
3305 ; -O0: stxp w8, x14, x15, [x11]
3306 ; -O0: stxp w8, x10, x9, [x11]
3307 ; -O0: eor x8, x10, x8
3308 ; -O0: eor x11, x9, x11
3309 ; -O0: orr x8, x8, x11
3310 ; -O0: subs x8, x8, #0
3312 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
3313 ; -O1: ldxp x0, x1, [x8]
3314 ; -O1: and x9, x0, x2
3315 ; -O1: and x10, x1, x3
3318 ; -O1: stxp w11, x9, x10, [x8]
3319 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
3323 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
3324 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
3325 ; -O0: and x9, x8, x9
3326 ; -O0: and x8, x8, x10
3329 ; -O0: ldaxp x10, x9, [x11]
3332 ; -O0: stxp w8, x14, x15, [x11]
3333 ; -O0: stxp w8, x10, x9, [x11]
3334 ; -O0: eor x8, x10, x8
3335 ; -O0: eor x11, x9, x11
3336 ; -O0: orr x8, x8, x11
3337 ; -O0: subs x8, x8, #0
3339 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
3340 ; -O1: ldaxp x0, x1, [x8]
3341 ; -O1: and x9, x0, x2
3342 ; -O1: and x10, x1, x3
3345 ; -O1: stxp w11, x9, x10, [x8]
3346 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
3350 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
3351 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
3352 ; -O0: and x9, x8, x9
3353 ; -O0: and x8, x8, x10
3356 ; -O0: ldxp x10, x9, [x11]
3359 ; -O0: stlxp w8, x14, x15, [x11]
3360 ; -O0: stlxp w8, x10, x9, [x11]
3361 ; -O0: eor x8, x10, x8
3362 ; -O0: eor x11, x9, x11
3363 ; -O0: orr x8, x8, x11
3364 ; -O0: subs x8, x8, #0
3366 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
3367 ; -O1: ldxp x0, x1, [x8]
3368 ; -O1: and x9, x0, x2
3369 ; -O1: and x10, x1, x3
3372 ; -O1: stlxp w11, x9, x10, [x8]
3373 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
3377 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3378 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
3379 ; -O0: and x9, x8, x9
3380 ; -O0: and x8, x8, x10
3383 ; -O0: ldaxp x10, x9, [x11]
3386 ; -O0: stlxp w8, x14, x15, [x11]
3387 ; -O0: stlxp w8, x10, x9, [x11]
3388 ; -O0: eor x8, x10, x8
3389 ; -O0: eor x11, x9, x11
3390 ; -O0: orr x8, x8, x11
3391 ; -O0: subs x8, x8, #0
3393 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
3394 ; -O1: ldaxp x0, x1, [x8]
3395 ; -O1: and x9, x0, x2
3396 ; -O1: and x10, x1, x3
3399 ; -O1: stlxp w11, x9, x10, [x8]
3400 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
3404 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3405 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
3406 ; -O0: and x9, x8, x9
3407 ; -O0: and x8, x8, x10
3410 ; -O0: ldaxp x10, x9, [x11]
3413 ; -O0: stlxp w8, x14, x15, [x11]
3414 ; -O0: stlxp w8, x10, x9, [x11]
3415 ; -O0: eor x8, x10, x8
3416 ; -O0: eor x11, x9, x11
3417 ; -O0: orr x8, x8, x11
3418 ; -O0: subs x8, x8, #0
3420 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
3421 ; -O1: ldaxp x0, x1, [x8]
3422 ; -O1: and x9, x0, x2
3423 ; -O1: and x10, x1, x3
3426 ; -O1: stlxp w11, x9, x10, [x8]
3427 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
3431 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3432 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
3433 ; -O0: and w8, w10, w8
3435 ; -O0: ldaxrb w9, [x11]
3436 ; -O0: cmp w9, w10, uxtb
3437 ; -O0: stlxrb w8, w12, [x11]
3438 ; -O0: and w8, w9, #0xff
3439 ; -O0: subs w8, w8, w10, uxtb
3441 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
3442 ; -O1: ldxrb w8, [x0]
3443 ; -O1: and w9, w8, w1
3445 ; -O1: stxrb w10, w9, [x0]
3446 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
3450 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3451 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
3452 ; -O0: and w8, w10, w8
3454 ; -O0: ldaxrb w9, [x11]
3455 ; -O0: cmp w9, w10, uxtb
3456 ; -O0: stlxrb w8, w12, [x11]
3457 ; -O0: and w8, w9, #0xff
3458 ; -O0: subs w8, w8, w10, uxtb
3460 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
3461 ; -O1: ldaxrb w8, [x0]
3462 ; -O1: and w9, w8, w1
3464 ; -O1: stxrb w10, w9, [x0]
3465 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
3469 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
3470 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
3471 ; -O0: and w8, w10, w8
3473 ; -O0: ldaxrb w9, [x11]
3474 ; -O0: cmp w9, w10, uxtb
3475 ; -O0: stlxrb w8, w12, [x11]
3476 ; -O0: and w8, w9, #0xff
3477 ; -O0: subs w8, w8, w10, uxtb
3479 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
3480 ; -O1: ldxrb w8, [x0]
3481 ; -O1: and w9, w8, w1
3483 ; -O1: stlxrb w10, w9, [x0]
3484 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
3488 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3489 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
3490 ; -O0: and w8, w10, w8
3492 ; -O0: ldaxrb w9, [x11]
3493 ; -O0: cmp w9, w10, uxtb
3494 ; -O0: stlxrb w8, w12, [x11]
3495 ; -O0: and w8, w9, #0xff
3496 ; -O0: subs w8, w8, w10, uxtb
3498 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
3499 ; -O1: ldaxrb w8, [x0]
3500 ; -O1: and w9, w8, w1
3502 ; -O1: stlxrb w10, w9, [x0]
3503 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
3507 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3508 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
3509 ; -O0: and w8, w10, w8
3511 ; -O0: ldaxrb w9, [x11]
3512 ; -O0: cmp w9, w10, uxtb
3513 ; -O0: stlxrb w8, w12, [x11]
3514 ; -O0: and w8, w9, #0xff
3515 ; -O0: subs w8, w8, w10, uxtb
3517 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
3518 ; -O1: ldaxrb w8, [x0]
3519 ; -O1: and w9, w8, w1
3521 ; -O1: stlxrb w10, w9, [x0]
3522 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
3526 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3527 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
3528 ; -O0: and w8, w9, w8
3530 ; -O0: bl __atomic_compare_exchange
3532 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
3533 ; -O1: and w8, w0, w20
3535 ; -O1: bl __atomic_compare_exchange
3536 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
3540 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3541 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
3542 ; -O0: and w8, w9, w8
3544 ; -O0: bl __atomic_compare_exchange
3546 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
3547 ; -O1: and w8, w0, w20
3549 ; -O1: bl __atomic_compare_exchange
3550 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
3554 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
3555 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
3556 ; -O0: and w8, w9, w8
3558 ; -O0: bl __atomic_compare_exchange
3560 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
3561 ; -O1: and w8, w0, w20
3563 ; -O1: bl __atomic_compare_exchange
3564 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
3568 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3569 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
3570 ; -O0: and w8, w9, w8
3572 ; -O0: bl __atomic_compare_exchange
3574 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
3575 ; -O1: and w8, w0, w20
3577 ; -O1: bl __atomic_compare_exchange
3578 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
3582 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3583 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
3584 ; -O0: and w8, w9, w8
3586 ; -O0: bl __atomic_compare_exchange
3588 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
3589 ; -O1: and w8, w0, w20
3591 ; -O1: bl __atomic_compare_exchange
3592 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
3596 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3597 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
3598 ; -O0: and w8, w9, w8
3600 ; -O0: bl __atomic_compare_exchange
3602 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
3603 ; -O1: and w8, w0, w20
3605 ; -O1: bl __atomic_compare_exchange
3606 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
3610 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3611 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
3612 ; -O0: and w8, w9, w8
3614 ; -O0: bl __atomic_compare_exchange
3616 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
3617 ; -O1: and w8, w0, w20
3619 ; -O1: bl __atomic_compare_exchange
3620 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
3624 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
3625 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
3626 ; -O0: and w8, w9, w8
3628 ; -O0: bl __atomic_compare_exchange
3630 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
3631 ; -O1: and w8, w0, w20
3633 ; -O1: bl __atomic_compare_exchange
3634 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
3638 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3639 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
3640 ; -O0: and w8, w9, w8
3642 ; -O0: bl __atomic_compare_exchange
3644 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
3645 ; -O1: and w8, w0, w20
3647 ; -O1: bl __atomic_compare_exchange
3648 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
3652 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3653 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
3654 ; -O0: and w8, w9, w8
3656 ; -O0: bl __atomic_compare_exchange
3658 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
3659 ; -O1: and w8, w0, w20
3661 ; -O1: bl __atomic_compare_exchange
3662 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
3666 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3667 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3668 ; -O0: and x8, x9, x8
3670 ; -O0: bl __atomic_compare_exchange
3672 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3673 ; -O1: and x8, x0, x20
3675 ; -O1: bl __atomic_compare_exchange
3676 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
3680 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3681 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3682 ; -O0: and x8, x9, x8
3684 ; -O0: bl __atomic_compare_exchange
3686 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3687 ; -O1: and x8, x0, x20
3689 ; -O1: bl __atomic_compare_exchange
3690 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
3694 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
3695 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
3696 ; -O0: and x8, x9, x8
3698 ; -O0: bl __atomic_compare_exchange
3700 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
3701 ; -O1: and x8, x0, x20
3703 ; -O1: bl __atomic_compare_exchange
3704 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
3708 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3709 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3710 ; -O0: and x8, x9, x8
3712 ; -O0: bl __atomic_compare_exchange
3714 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3715 ; -O1: and x8, x0, x20
3717 ; -O1: bl __atomic_compare_exchange
3718 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
3722 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3723 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3724 ; -O0: and x8, x9, x8
3726 ; -O0: bl __atomic_compare_exchange
3728 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3729 ; -O1: and x8, x0, x20
3731 ; -O1: bl __atomic_compare_exchange
3732 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
3736 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3737 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3738 ; -O0: and x9, x8, x9
3739 ; -O0: and x8, x8, x10
3742 ; -O0: bl __atomic_compare_exchange
3744 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3745 ; -O1: ldp x0, x1, [x0]
3746 ; -O1: and x8, x1, x19
3747 ; -O1: and x9, x0, x21
3750 ; -O1: bl __atomic_compare_exchange
3751 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
3755 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3756 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3757 ; -O0: and x9, x8, x9
3758 ; -O0: and x8, x8, x10
3761 ; -O0: bl __atomic_compare_exchange
3763 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3764 ; -O1: ldp x0, x1, [x0]
3765 ; -O1: and x8, x1, x19
3766 ; -O1: and x9, x0, x21
3769 ; -O1: bl __atomic_compare_exchange
3770 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
3774 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
3775 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
3776 ; -O0: and x9, x8, x9
3777 ; -O0: and x8, x8, x10
3780 ; -O0: bl __atomic_compare_exchange
3782 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
3783 ; -O1: ldp x0, x1, [x0]
3784 ; -O1: and x8, x1, x19
3785 ; -O1: and x9, x0, x21
3788 ; -O1: bl __atomic_compare_exchange
3789 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
3793 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3794 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3795 ; -O0: and x9, x8, x9
3796 ; -O0: and x8, x8, x10
3799 ; -O0: bl __atomic_compare_exchange
3801 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3802 ; -O1: ldp x0, x1, [x0]
3803 ; -O1: and x8, x1, x19
3804 ; -O1: and x9, x0, x21
3807 ; -O1: bl __atomic_compare_exchange
3808 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
3812 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3813 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3814 ; -O0: and x9, x8, x9
3815 ; -O0: and x8, x8, x10
3818 ; -O0: bl __atomic_compare_exchange
3820 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3821 ; -O1: ldp x0, x1, [x0]
3822 ; -O1: and x8, x1, x19
3823 ; -O1: and x9, x0, x21
3826 ; -O1: bl __atomic_compare_exchange
3827 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
3831 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3832 ; -O0-LABEL: atomicrmw_or_i8_aligned_monotonic:
3833 ; -O0: orr w12, w10, w8
3834 ; -O0: ldaxrb w9, [x11]
3835 ; -O0: cmp w9, w10, uxtb
3836 ; -O0: stlxrb w8, w12, [x11]
3837 ; -O0: and w8, w9, #0xff
3838 ; -O0: subs w8, w8, w10, uxtb
3840 ; -O1-LABEL: atomicrmw_or_i8_aligned_monotonic:
3841 ; -O1: ldxrb w8, [x0]
3842 ; -O1: orr w9, w8, w1
3843 ; -O1: stxrb w10, w9, [x0]
3844 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3848 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
3849 ; -O0-LABEL: atomicrmw_or_i8_aligned_acquire:
3850 ; -O0: orr w12, w10, w8
3851 ; -O0: ldaxrb w9, [x11]
3852 ; -O0: cmp w9, w10, uxtb
3853 ; -O0: stlxrb w8, w12, [x11]
3854 ; -O0: and w8, w9, #0xff
3855 ; -O0: subs w8, w8, w10, uxtb
3857 ; -O1-LABEL: atomicrmw_or_i8_aligned_acquire:
3858 ; -O1: ldaxrb w8, [x0]
3859 ; -O1: orr w9, w8, w1
3860 ; -O1: stxrb w10, w9, [x0]
3861 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3865 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
3866 ; -O0-LABEL: atomicrmw_or_i8_aligned_release:
3867 ; -O0: orr w12, w10, w8
3868 ; -O0: ldaxrb w9, [x11]
3869 ; -O0: cmp w9, w10, uxtb
3870 ; -O0: stlxrb w8, w12, [x11]
3871 ; -O0: and w8, w9, #0xff
3872 ; -O0: subs w8, w8, w10, uxtb
3874 ; -O1-LABEL: atomicrmw_or_i8_aligned_release:
3875 ; -O1: ldxrb w8, [x0]
3876 ; -O1: orr w9, w8, w1
3877 ; -O1: stlxrb w10, w9, [x0]
3878 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3882 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3883 ; -O0-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3884 ; -O0: orr w12, w10, w8
3885 ; -O0: ldaxrb w9, [x11]
3886 ; -O0: cmp w9, w10, uxtb
3887 ; -O0: stlxrb w8, w12, [x11]
3888 ; -O0: and w8, w9, #0xff
3889 ; -O0: subs w8, w8, w10, uxtb
3891 ; -O1-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3892 ; -O1: ldaxrb w8, [x0]
3893 ; -O1: orr w9, w8, w1
3894 ; -O1: stlxrb w10, w9, [x0]
3895 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3899 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3900 ; -O0-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3901 ; -O0: orr w12, w10, w8
3902 ; -O0: ldaxrb w9, [x11]
3903 ; -O0: cmp w9, w10, uxtb
3904 ; -O0: stlxrb w8, w12, [x11]
3905 ; -O0: and w8, w9, #0xff
3906 ; -O0: subs w8, w8, w10, uxtb
3908 ; -O1-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3909 ; -O1: ldaxrb w8, [x0]
3910 ; -O1: orr w9, w8, w1
3911 ; -O1: stlxrb w10, w9, [x0]
3912 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3916 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3917 ; -O0-LABEL: atomicrmw_or_i16_aligned_monotonic:
3918 ; -O0: orr w12, w8, w9
3919 ; -O0: ldaxrh w9, [x11]
3920 ; -O0: cmp w9, w8, uxth
3921 ; -O0: stlxrh w10, w12, [x11]
3922 ; -O0: subs w8, w8, w9, uxth
3924 ; -O1-LABEL: atomicrmw_or_i16_aligned_monotonic:
3925 ; -O1: ldxrh w8, [x0]
3926 ; -O1: orr w9, w8, w1
3927 ; -O1: stxrh w10, w9, [x0]
3928 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
3932 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
3933 ; -O0-LABEL: atomicrmw_or_i16_aligned_acquire:
3934 ; -O0: orr w12, w8, w9
3935 ; -O0: ldaxrh w9, [x11]
3936 ; -O0: cmp w9, w8, uxth
3937 ; -O0: stlxrh w10, w12, [x11]
3938 ; -O0: subs w8, w8, w9, uxth
3940 ; -O1-LABEL: atomicrmw_or_i16_aligned_acquire:
3941 ; -O1: ldaxrh w8, [x0]
3942 ; -O1: orr w9, w8, w1
3943 ; -O1: stxrh w10, w9, [x0]
3944 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
3948 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
3949 ; -O0-LABEL: atomicrmw_or_i16_aligned_release:
3950 ; -O0: orr w12, w8, w9
3951 ; -O0: ldaxrh w9, [x11]
3952 ; -O0: cmp w9, w8, uxth
3953 ; -O0: stlxrh w10, w12, [x11]
3954 ; -O0: subs w8, w8, w9, uxth
3956 ; -O1-LABEL: atomicrmw_or_i16_aligned_release:
3957 ; -O1: ldxrh w8, [x0]
3958 ; -O1: orr w9, w8, w1
3959 ; -O1: stlxrh w10, w9, [x0]
3960 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
3964 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3965 ; -O0-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3966 ; -O0: orr w12, w8, w9
3967 ; -O0: ldaxrh w9, [x11]
3968 ; -O0: cmp w9, w8, uxth
3969 ; -O0: stlxrh w10, w12, [x11]
3970 ; -O0: subs w8, w8, w9, uxth
3972 ; -O1-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3973 ; -O1: ldaxrh w8, [x0]
3974 ; -O1: orr w9, w8, w1
3975 ; -O1: stlxrh w10, w9, [x0]
3976 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
3980 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3981 ; -O0-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3982 ; -O0: orr w12, w8, w9
3983 ; -O0: ldaxrh w9, [x11]
3984 ; -O0: cmp w9, w8, uxth
3985 ; -O0: stlxrh w10, w12, [x11]
3986 ; -O0: subs w8, w8, w9, uxth
3988 ; -O1-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3989 ; -O1: ldaxrh w8, [x0]
3990 ; -O1: orr w9, w8, w1
3991 ; -O1: stlxrh w10, w9, [x0]
3992 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
3996 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3997 ; -O0-LABEL: atomicrmw_or_i32_aligned_monotonic:
3998 ; -O0: orr w12, w8, w9
3999 ; -O0: ldaxr w9, [x11]
4001 ; -O0: stlxr w10, w12, [x11]
4002 ; -O0: subs w8, w9, w8
4004 ; -O1-LABEL: atomicrmw_or_i32_aligned_monotonic:
4005 ; -O1: ldxr w8, [x0]
4006 ; -O1: orr w9, w8, w1
4007 ; -O1: stxr w10, w9, [x0]
4008 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
4012 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
4013 ; -O0-LABEL: atomicrmw_or_i32_aligned_acquire:
4014 ; -O0: orr w12, w8, w9
4015 ; -O0: ldaxr w9, [x11]
4017 ; -O0: stlxr w10, w12, [x11]
4018 ; -O0: subs w8, w9, w8
4020 ; -O1-LABEL: atomicrmw_or_i32_aligned_acquire:
4021 ; -O1: ldaxr w8, [x0]
4022 ; -O1: orr w9, w8, w1
4023 ; -O1: stxr w10, w9, [x0]
4024 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
4028 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
4029 ; -O0-LABEL: atomicrmw_or_i32_aligned_release:
4030 ; -O0: orr w12, w8, w9
4031 ; -O0: ldaxr w9, [x11]
4033 ; -O0: stlxr w10, w12, [x11]
4034 ; -O0: subs w8, w9, w8
4036 ; -O1-LABEL: atomicrmw_or_i32_aligned_release:
4037 ; -O1: ldxr w8, [x0]
4038 ; -O1: orr w9, w8, w1
4039 ; -O1: stlxr w10, w9, [x0]
4040 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
4044 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4045 ; -O0-LABEL: atomicrmw_or_i32_aligned_acq_rel:
4046 ; -O0: orr w12, w8, w9
4047 ; -O0: ldaxr w9, [x11]
4049 ; -O0: stlxr w10, w12, [x11]
4050 ; -O0: subs w8, w9, w8
4052 ; -O1-LABEL: atomicrmw_or_i32_aligned_acq_rel:
4053 ; -O1: ldaxr w8, [x0]
4054 ; -O1: orr w9, w8, w1
4055 ; -O1: stlxr w10, w9, [x0]
4056 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
4060 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4061 ; -O0-LABEL: atomicrmw_or_i32_aligned_seq_cst:
4062 ; -O0: orr w12, w8, w9
4063 ; -O0: ldaxr w9, [x11]
4065 ; -O0: stlxr w10, w12, [x11]
4066 ; -O0: subs w8, w9, w8
4068 ; -O1-LABEL: atomicrmw_or_i32_aligned_seq_cst:
4069 ; -O1: ldaxr w8, [x0]
4070 ; -O1: orr w9, w8, w1
4071 ; -O1: stlxr w10, w9, [x0]
4072 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
4076 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4077 ; -O0-LABEL: atomicrmw_or_i64_aligned_monotonic:
4078 ; -O0: orr x12, x8, x9
4079 ; -O0: ldaxr x9, [x11]
4081 ; -O0: stlxr w10, x12, [x11]
4082 ; -O0: subs x8, x9, x8
4084 ; -O1-LABEL: atomicrmw_or_i64_aligned_monotonic:
4085 ; -O1: ldxr x0, [x8]
4086 ; -O1: orr x9, x0, x1
4087 ; -O1: stxr w10, x9, [x8]
4088 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
4092 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
4093 ; -O0-LABEL: atomicrmw_or_i64_aligned_acquire:
4094 ; -O0: orr x12, x8, x9
4095 ; -O0: ldaxr x9, [x11]
4097 ; -O0: stlxr w10, x12, [x11]
4098 ; -O0: subs x8, x9, x8
4100 ; -O1-LABEL: atomicrmw_or_i64_aligned_acquire:
4101 ; -O1: ldaxr x0, [x8]
4102 ; -O1: orr x9, x0, x1
4103 ; -O1: stxr w10, x9, [x8]
4104 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
4108 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
4109 ; -O0-LABEL: atomicrmw_or_i64_aligned_release:
4110 ; -O0: orr x12, x8, x9
4111 ; -O0: ldaxr x9, [x11]
4113 ; -O0: stlxr w10, x12, [x11]
4114 ; -O0: subs x8, x9, x8
4116 ; -O1-LABEL: atomicrmw_or_i64_aligned_release:
4117 ; -O1: ldxr x0, [x8]
4118 ; -O1: orr x9, x0, x1
4119 ; -O1: stlxr w10, x9, [x8]
4120 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
4124 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4125 ; -O0-LABEL: atomicrmw_or_i64_aligned_acq_rel:
4126 ; -O0: orr x12, x8, x9
4127 ; -O0: ldaxr x9, [x11]
4129 ; -O0: stlxr w10, x12, [x11]
4130 ; -O0: subs x8, x9, x8
4132 ; -O1-LABEL: atomicrmw_or_i64_aligned_acq_rel:
4133 ; -O1: ldaxr x0, [x8]
4134 ; -O1: orr x9, x0, x1
4135 ; -O1: stlxr w10, x9, [x8]
4136 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
4140 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4141 ; -O0-LABEL: atomicrmw_or_i64_aligned_seq_cst:
4142 ; -O0: orr x12, x8, x9
4143 ; -O0: ldaxr x9, [x11]
4145 ; -O0: stlxr w10, x12, [x11]
4146 ; -O0: subs x8, x9, x8
4148 ; -O1-LABEL: atomicrmw_or_i64_aligned_seq_cst:
4149 ; -O1: ldaxr x0, [x8]
4150 ; -O1: orr x9, x0, x1
4151 ; -O1: stlxr w10, x9, [x8]
4152 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
4156 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4157 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
4158 ; -O0: orr x14, x8, x10
4159 ; -O0: orr x15, x8, x9
4160 ; -O0: ldxp x10, x9, [x11]
4163 ; -O0: stxp w8, x14, x15, [x11]
4164 ; -O0: stxp w8, x10, x9, [x11]
4165 ; -O0: eor x8, x10, x8
4166 ; -O0: eor x11, x9, x11
4167 ; -O0: orr x8, x8, x11
4168 ; -O0: subs x8, x8, #0
4170 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
4171 ; -O1: ldxp x0, x1, [x8]
4172 ; -O1: orr x9, x1, x3
4173 ; -O1: orr x10, x0, x2
4174 ; -O1: stxp w11, x10, x9, [x8]
4175 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
4179 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
4180 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
4181 ; -O0: orr x14, x8, x10
4182 ; -O0: orr x15, x8, x9
4183 ; -O0: ldaxp x10, x9, [x11]
4186 ; -O0: stxp w8, x14, x15, [x11]
4187 ; -O0: stxp w8, x10, x9, [x11]
4188 ; -O0: eor x8, x10, x8
4189 ; -O0: eor x11, x9, x11
4190 ; -O0: orr x8, x8, x11
4191 ; -O0: subs x8, x8, #0
4193 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
4194 ; -O1: ldaxp x0, x1, [x8]
4195 ; -O1: orr x9, x1, x3
4196 ; -O1: orr x10, x0, x2
4197 ; -O1: stxp w11, x10, x9, [x8]
4198 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
4202 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
4203 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
4204 ; -O0: orr x14, x8, x10
4205 ; -O0: orr x15, x8, x9
4206 ; -O0: ldxp x10, x9, [x11]
4209 ; -O0: stlxp w8, x14, x15, [x11]
4210 ; -O0: stlxp w8, x10, x9, [x11]
4211 ; -O0: eor x8, x10, x8
4212 ; -O0: eor x11, x9, x11
4213 ; -O0: orr x8, x8, x11
4214 ; -O0: subs x8, x8, #0
4216 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
4217 ; -O1: ldxp x0, x1, [x8]
4218 ; -O1: orr x9, x1, x3
4219 ; -O1: orr x10, x0, x2
4220 ; -O1: stlxp w11, x10, x9, [x8]
4221 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
4225 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4226 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
4227 ; -O0: orr x14, x8, x10
4228 ; -O0: orr x15, x8, x9
4229 ; -O0: ldaxp x10, x9, [x11]
4232 ; -O0: stlxp w8, x14, x15, [x11]
4233 ; -O0: stlxp w8, x10, x9, [x11]
4234 ; -O0: eor x8, x10, x8
4235 ; -O0: eor x11, x9, x11
4236 ; -O0: orr x8, x8, x11
4237 ; -O0: subs x8, x8, #0
4239 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
4240 ; -O1: ldaxp x0, x1, [x8]
4241 ; -O1: orr x9, x1, x3
4242 ; -O1: orr x10, x0, x2
4243 ; -O1: stlxp w11, x10, x9, [x8]
4244 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
4248 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4249 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
4250 ; -O0: orr x14, x8, x10
4251 ; -O0: orr x15, x8, x9
4252 ; -O0: ldaxp x10, x9, [x11]
4255 ; -O0: stlxp w8, x14, x15, [x11]
4256 ; -O0: stlxp w8, x10, x9, [x11]
4257 ; -O0: eor x8, x10, x8
4258 ; -O0: eor x11, x9, x11
4259 ; -O0: orr x8, x8, x11
4260 ; -O0: subs x8, x8, #0
4262 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
4263 ; -O1: ldaxp x0, x1, [x8]
4264 ; -O1: orr x9, x1, x3
4265 ; -O1: orr x10, x0, x2
4266 ; -O1: stlxp w11, x10, x9, [x8]
4267 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
4271 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4272 ; -O0-LABEL: atomicrmw_or_i8_unaligned_monotonic:
4273 ; -O0: orr w12, w10, w8
4274 ; -O0: ldaxrb w9, [x11]
4275 ; -O0: cmp w9, w10, uxtb
4276 ; -O0: stlxrb w8, w12, [x11]
4277 ; -O0: and w8, w9, #0xff
4278 ; -O0: subs w8, w8, w10, uxtb
4280 ; -O1-LABEL: atomicrmw_or_i8_unaligned_monotonic:
4281 ; -O1: ldxrb w8, [x0]
4282 ; -O1: orr w9, w8, w1
4283 ; -O1: stxrb w10, w9, [x0]
4284 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
4288 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4289 ; -O0-LABEL: atomicrmw_or_i8_unaligned_acquire:
4290 ; -O0: orr w12, w10, w8
4291 ; -O0: ldaxrb w9, [x11]
4292 ; -O0: cmp w9, w10, uxtb
4293 ; -O0: stlxrb w8, w12, [x11]
4294 ; -O0: and w8, w9, #0xff
4295 ; -O0: subs w8, w8, w10, uxtb
4297 ; -O1-LABEL: atomicrmw_or_i8_unaligned_acquire:
4298 ; -O1: ldaxrb w8, [x0]
4299 ; -O1: orr w9, w8, w1
4300 ; -O1: stxrb w10, w9, [x0]
4301 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
4305 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
4306 ; -O0-LABEL: atomicrmw_or_i8_unaligned_release:
4307 ; -O0: orr w12, w10, w8
4308 ; -O0: ldaxrb w9, [x11]
4309 ; -O0: cmp w9, w10, uxtb
4310 ; -O0: stlxrb w8, w12, [x11]
4311 ; -O0: and w8, w9, #0xff
4312 ; -O0: subs w8, w8, w10, uxtb
4314 ; -O1-LABEL: atomicrmw_or_i8_unaligned_release:
4315 ; -O1: ldxrb w8, [x0]
4316 ; -O1: orr w9, w8, w1
4317 ; -O1: stlxrb w10, w9, [x0]
4318 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
4322 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4323 ; -O0-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
4324 ; -O0: orr w12, w10, w8
4325 ; -O0: ldaxrb w9, [x11]
4326 ; -O0: cmp w9, w10, uxtb
4327 ; -O0: stlxrb w8, w12, [x11]
4328 ; -O0: and w8, w9, #0xff
4329 ; -O0: subs w8, w8, w10, uxtb
4331 ; -O1-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
4332 ; -O1: ldaxrb w8, [x0]
4333 ; -O1: orr w9, w8, w1
4334 ; -O1: stlxrb w10, w9, [x0]
4335 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
4339 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4340 ; -O0-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
4341 ; -O0: orr w12, w10, w8
4342 ; -O0: ldaxrb w9, [x11]
4343 ; -O0: cmp w9, w10, uxtb
4344 ; -O0: stlxrb w8, w12, [x11]
4345 ; -O0: and w8, w9, #0xff
4346 ; -O0: subs w8, w8, w10, uxtb
4348 ; -O1-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
4349 ; -O1: ldaxrb w8, [x0]
4350 ; -O1: orr w9, w8, w1
4351 ; -O1: stlxrb w10, w9, [x0]
4352 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
4356 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4357 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
4358 ; -O0: orr w8, w9, w8
4359 ; -O0: bl __atomic_compare_exchange
4361 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
4362 ; -O1: orr w8, w0, w20
4363 ; -O1: bl __atomic_compare_exchange
4364 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
4368 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4369 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
4370 ; -O0: orr w8, w9, w8
4371 ; -O0: bl __atomic_compare_exchange
4373 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
4374 ; -O1: orr w8, w0, w20
4375 ; -O1: bl __atomic_compare_exchange
4376 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
4380 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
4381 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
4382 ; -O0: orr w8, w9, w8
4383 ; -O0: bl __atomic_compare_exchange
4385 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
4386 ; -O1: orr w8, w0, w20
4387 ; -O1: bl __atomic_compare_exchange
4388 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
4392 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4393 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
4394 ; -O0: orr w8, w9, w8
4395 ; -O0: bl __atomic_compare_exchange
4397 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
4398 ; -O1: orr w8, w0, w20
4399 ; -O1: bl __atomic_compare_exchange
4400 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
4404 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4405 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
4406 ; -O0: orr w8, w9, w8
4407 ; -O0: bl __atomic_compare_exchange
4409 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
4410 ; -O1: orr w8, w0, w20
4411 ; -O1: bl __atomic_compare_exchange
4412 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
4416 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4417 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
4418 ; -O0: orr w8, w9, w8
4419 ; -O0: bl __atomic_compare_exchange
4421 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
4422 ; -O1: orr w8, w0, w20
4423 ; -O1: bl __atomic_compare_exchange
4424 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
4428 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4429 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
4430 ; -O0: orr w8, w9, w8
4431 ; -O0: bl __atomic_compare_exchange
4433 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
4434 ; -O1: orr w8, w0, w20
4435 ; -O1: bl __atomic_compare_exchange
4436 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
4440 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
4441 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
4442 ; -O0: orr w8, w9, w8
4443 ; -O0: bl __atomic_compare_exchange
4445 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
4446 ; -O1: orr w8, w0, w20
4447 ; -O1: bl __atomic_compare_exchange
4448 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
4452 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4453 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
4454 ; -O0: orr w8, w9, w8
4455 ; -O0: bl __atomic_compare_exchange
4457 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
4458 ; -O1: orr w8, w0, w20
4459 ; -O1: bl __atomic_compare_exchange
4460 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
4464 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4465 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
4466 ; -O0: orr w8, w9, w8
4467 ; -O0: bl __atomic_compare_exchange
4469 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
4470 ; -O1: orr w8, w0, w20
4471 ; -O1: bl __atomic_compare_exchange
4472 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
4476 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4477 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
4478 ; -O0: orr x8, x9, x8
4479 ; -O0: bl __atomic_compare_exchange
4481 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
4482 ; -O1: orr x8, x0, x20
4483 ; -O1: bl __atomic_compare_exchange
4484 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
4488 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4489 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
4490 ; -O0: orr x8, x9, x8
4491 ; -O0: bl __atomic_compare_exchange
4493 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
4494 ; -O1: orr x8, x0, x20
4495 ; -O1: bl __atomic_compare_exchange
4496 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
4500 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
4501 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
4502 ; -O0: orr x8, x9, x8
4503 ; -O0: bl __atomic_compare_exchange
4505 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
4506 ; -O1: orr x8, x0, x20
4507 ; -O1: bl __atomic_compare_exchange
4508 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
4512 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4513 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
4514 ; -O0: orr x8, x9, x8
4515 ; -O0: bl __atomic_compare_exchange
4517 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
4518 ; -O1: orr x8, x0, x20
4519 ; -O1: bl __atomic_compare_exchange
4520 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
4524 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4525 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
4526 ; -O0: orr x8, x9, x8
4527 ; -O0: bl __atomic_compare_exchange
4529 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
4530 ; -O1: orr x8, x0, x20
4531 ; -O1: bl __atomic_compare_exchange
4532 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
4536 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4537 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
4538 ; -O0: orr x9, x8, x9
4539 ; -O0: orr x8, x8, x10
4540 ; -O0: bl __atomic_compare_exchange
4542 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
4543 ; -O1: ldp x0, x1, [x0]
4544 ; -O1: orr x8, x1, x19
4545 ; -O1: orr x9, x0, x21
4546 ; -O1: bl __atomic_compare_exchange
4547 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
4551 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4552 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
4553 ; -O0: orr x9, x8, x9
4554 ; -O0: orr x8, x8, x10
4555 ; -O0: bl __atomic_compare_exchange
4557 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
4558 ; -O1: ldp x0, x1, [x0]
4559 ; -O1: orr x8, x1, x19
4560 ; -O1: orr x9, x0, x21
4561 ; -O1: bl __atomic_compare_exchange
4562 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
4566 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
4567 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
4568 ; -O0: orr x9, x8, x9
4569 ; -O0: orr x8, x8, x10
4570 ; -O0: bl __atomic_compare_exchange
4572 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
4573 ; -O1: ldp x0, x1, [x0]
4574 ; -O1: orr x8, x1, x19
4575 ; -O1: orr x9, x0, x21
4576 ; -O1: bl __atomic_compare_exchange
4577 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
4581 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4582 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
4583 ; -O0: orr x9, x8, x9
4584 ; -O0: orr x8, x8, x10
4585 ; -O0: bl __atomic_compare_exchange
4587 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
4588 ; -O1: ldp x0, x1, [x0]
4589 ; -O1: orr x8, x1, x19
4590 ; -O1: orr x9, x0, x21
4591 ; -O1: bl __atomic_compare_exchange
4592 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
4596 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4597 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
4598 ; -O0: orr x9, x8, x9
4599 ; -O0: orr x8, x8, x10
4600 ; -O0: bl __atomic_compare_exchange
4602 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
4603 ; -O1: ldp x0, x1, [x0]
4604 ; -O1: orr x8, x1, x19
4605 ; -O1: orr x9, x0, x21
4606 ; -O1: bl __atomic_compare_exchange
4607 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
4611 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4612 ; -O0-LABEL: atomicrmw_xor_i8_aligned_monotonic:
4613 ; -O0: eor w12, w10, w8
4614 ; -O0: ldaxrb w9, [x11]
4615 ; -O0: cmp w9, w10, uxtb
4616 ; -O0: stlxrb w8, w12, [x11]
4617 ; -O0: and w8, w9, #0xff
4618 ; -O0: subs w8, w8, w10, uxtb
4620 ; -O1-LABEL: atomicrmw_xor_i8_aligned_monotonic:
4621 ; -O1: ldxrb w8, [x0]
4622 ; -O1: eor w9, w8, w1
4623 ; -O1: stxrb w10, w9, [x0]
4624 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
4628 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
4629 ; -O0-LABEL: atomicrmw_xor_i8_aligned_acquire:
4630 ; -O0: eor w12, w10, w8
4631 ; -O0: ldaxrb w9, [x11]
4632 ; -O0: cmp w9, w10, uxtb
4633 ; -O0: stlxrb w8, w12, [x11]
4634 ; -O0: and w8, w9, #0xff
4635 ; -O0: subs w8, w8, w10, uxtb
4637 ; -O1-LABEL: atomicrmw_xor_i8_aligned_acquire:
4638 ; -O1: ldaxrb w8, [x0]
4639 ; -O1: eor w9, w8, w1
4640 ; -O1: stxrb w10, w9, [x0]
4641 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
4645 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
4646 ; -O0-LABEL: atomicrmw_xor_i8_aligned_release:
4647 ; -O0: eor w12, w10, w8
4648 ; -O0: ldaxrb w9, [x11]
4649 ; -O0: cmp w9, w10, uxtb
4650 ; -O0: stlxrb w8, w12, [x11]
4651 ; -O0: and w8, w9, #0xff
4652 ; -O0: subs w8, w8, w10, uxtb
4654 ; -O1-LABEL: atomicrmw_xor_i8_aligned_release:
4655 ; -O1: ldxrb w8, [x0]
4656 ; -O1: eor w9, w8, w1
4657 ; -O1: stlxrb w10, w9, [x0]
4658 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
4662 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4663 ; -O0-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
4664 ; -O0: eor w12, w10, w8
4665 ; -O0: ldaxrb w9, [x11]
4666 ; -O0: cmp w9, w10, uxtb
4667 ; -O0: stlxrb w8, w12, [x11]
4668 ; -O0: and w8, w9, #0xff
4669 ; -O0: subs w8, w8, w10, uxtb
4671 ; -O1-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
4672 ; -O1: ldaxrb w8, [x0]
4673 ; -O1: eor w9, w8, w1
4674 ; -O1: stlxrb w10, w9, [x0]
4675 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
4679 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4680 ; -O0-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
4681 ; -O0: eor w12, w10, w8
4682 ; -O0: ldaxrb w9, [x11]
4683 ; -O0: cmp w9, w10, uxtb
4684 ; -O0: stlxrb w8, w12, [x11]
4685 ; -O0: and w8, w9, #0xff
4686 ; -O0: subs w8, w8, w10, uxtb
4688 ; -O1-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
4689 ; -O1: ldaxrb w8, [x0]
4690 ; -O1: eor w9, w8, w1
4691 ; -O1: stlxrb w10, w9, [x0]
4692 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
4696 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4697 ; -O0-LABEL: atomicrmw_xor_i16_aligned_monotonic:
4698 ; -O0: eor w12, w8, w9
4699 ; -O0: ldaxrh w9, [x11]
4700 ; -O0: cmp w9, w8, uxth
4701 ; -O0: stlxrh w10, w12, [x11]
4702 ; -O0: subs w8, w8, w9, uxth
4704 ; -O1-LABEL: atomicrmw_xor_i16_aligned_monotonic:
4705 ; -O1: ldxrh w8, [x0]
4706 ; -O1: eor w9, w8, w1
4707 ; -O1: stxrh w10, w9, [x0]
4708 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
4712 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
4713 ; -O0-LABEL: atomicrmw_xor_i16_aligned_acquire:
4714 ; -O0: eor w12, w8, w9
4715 ; -O0: ldaxrh w9, [x11]
4716 ; -O0: cmp w9, w8, uxth
4717 ; -O0: stlxrh w10, w12, [x11]
4718 ; -O0: subs w8, w8, w9, uxth
4720 ; -O1-LABEL: atomicrmw_xor_i16_aligned_acquire:
4721 ; -O1: ldaxrh w8, [x0]
4722 ; -O1: eor w9, w8, w1
4723 ; -O1: stxrh w10, w9, [x0]
4724 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
4728 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
4729 ; -O0-LABEL: atomicrmw_xor_i16_aligned_release:
4730 ; -O0: eor w12, w8, w9
4731 ; -O0: ldaxrh w9, [x11]
4732 ; -O0: cmp w9, w8, uxth
4733 ; -O0: stlxrh w10, w12, [x11]
4734 ; -O0: subs w8, w8, w9, uxth
4736 ; -O1-LABEL: atomicrmw_xor_i16_aligned_release:
4737 ; -O1: ldxrh w8, [x0]
4738 ; -O1: eor w9, w8, w1
4739 ; -O1: stlxrh w10, w9, [x0]
4740 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
4744 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4745 ; -O0-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
4746 ; -O0: eor w12, w8, w9
4747 ; -O0: ldaxrh w9, [x11]
4748 ; -O0: cmp w9, w8, uxth
4749 ; -O0: stlxrh w10, w12, [x11]
4750 ; -O0: subs w8, w8, w9, uxth
4752 ; -O1-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
4753 ; -O1: ldaxrh w8, [x0]
4754 ; -O1: eor w9, w8, w1
4755 ; -O1: stlxrh w10, w9, [x0]
4756 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
4760 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4761 ; -O0-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
4762 ; -O0: eor w12, w8, w9
4763 ; -O0: ldaxrh w9, [x11]
4764 ; -O0: cmp w9, w8, uxth
4765 ; -O0: stlxrh w10, w12, [x11]
4766 ; -O0: subs w8, w8, w9, uxth
4768 ; -O1-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
4769 ; -O1: ldaxrh w8, [x0]
4770 ; -O1: eor w9, w8, w1
4771 ; -O1: stlxrh w10, w9, [x0]
4772 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
4776 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4777 ; -O0-LABEL: atomicrmw_xor_i32_aligned_monotonic:
4778 ; -O0: eor w12, w8, w9
4779 ; -O0: ldaxr w9, [x11]
4781 ; -O0: stlxr w10, w12, [x11]
4782 ; -O0: subs w8, w9, w8
4784 ; -O1-LABEL: atomicrmw_xor_i32_aligned_monotonic:
4785 ; -O1: ldxr w8, [x0]
4786 ; -O1: eor w9, w8, w1
4787 ; -O1: stxr w10, w9, [x0]
4788 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
4792 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
4793 ; -O0-LABEL: atomicrmw_xor_i32_aligned_acquire:
4794 ; -O0: eor w12, w8, w9
4795 ; -O0: ldaxr w9, [x11]
4797 ; -O0: stlxr w10, w12, [x11]
4798 ; -O0: subs w8, w9, w8
4800 ; -O1-LABEL: atomicrmw_xor_i32_aligned_acquire:
4801 ; -O1: ldaxr w8, [x0]
4802 ; -O1: eor w9, w8, w1
4803 ; -O1: stxr w10, w9, [x0]
4804 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
4808 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
4809 ; -O0-LABEL: atomicrmw_xor_i32_aligned_release:
4810 ; -O0: eor w12, w8, w9
4811 ; -O0: ldaxr w9, [x11]
4813 ; -O0: stlxr w10, w12, [x11]
4814 ; -O0: subs w8, w9, w8
4816 ; -O1-LABEL: atomicrmw_xor_i32_aligned_release:
4817 ; -O1: ldxr w8, [x0]
4818 ; -O1: eor w9, w8, w1
4819 ; -O1: stlxr w10, w9, [x0]
4820 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
4824 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4825 ; -O0-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
4826 ; -O0: eor w12, w8, w9
4827 ; -O0: ldaxr w9, [x11]
4829 ; -O0: stlxr w10, w12, [x11]
4830 ; -O0: subs w8, w9, w8
4832 ; -O1-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
4833 ; -O1: ldaxr w8, [x0]
4834 ; -O1: eor w9, w8, w1
4835 ; -O1: stlxr w10, w9, [x0]
4836 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
4840 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4841 ; -O0-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
4842 ; -O0: eor w12, w8, w9
4843 ; -O0: ldaxr w9, [x11]
4845 ; -O0: stlxr w10, w12, [x11]
4846 ; -O0: subs w8, w9, w8
4848 ; -O1-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
4849 ; -O1: ldaxr w8, [x0]
4850 ; -O1: eor w9, w8, w1
4851 ; -O1: stlxr w10, w9, [x0]
4852 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
4856 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4857 ; -O0-LABEL: atomicrmw_xor_i64_aligned_monotonic:
4858 ; -O0: eor x12, x8, x9
4859 ; -O0: ldaxr x9, [x11]
4861 ; -O0: stlxr w10, x12, [x11]
4862 ; -O0: subs x8, x9, x8
4864 ; -O1-LABEL: atomicrmw_xor_i64_aligned_monotonic:
4865 ; -O1: ldxr x0, [x8]
4866 ; -O1: eor x9, x0, x1
4867 ; -O1: stxr w10, x9, [x8]
4868 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
4872 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
4873 ; -O0-LABEL: atomicrmw_xor_i64_aligned_acquire:
4874 ; -O0: eor x12, x8, x9
4875 ; -O0: ldaxr x9, [x11]
4877 ; -O0: stlxr w10, x12, [x11]
4878 ; -O0: subs x8, x9, x8
4880 ; -O1-LABEL: atomicrmw_xor_i64_aligned_acquire:
4881 ; -O1: ldaxr x0, [x8]
4882 ; -O1: eor x9, x0, x1
4883 ; -O1: stxr w10, x9, [x8]
4884 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
4888 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
4889 ; -O0-LABEL: atomicrmw_xor_i64_aligned_release:
4890 ; -O0: eor x12, x8, x9
4891 ; -O0: ldaxr x9, [x11]
4893 ; -O0: stlxr w10, x12, [x11]
4894 ; -O0: subs x8, x9, x8
4896 ; -O1-LABEL: atomicrmw_xor_i64_aligned_release:
4897 ; -O1: ldxr x0, [x8]
4898 ; -O1: eor x9, x0, x1
4899 ; -O1: stlxr w10, x9, [x8]
4900 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
4904 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4905 ; -O0-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
4906 ; -O0: eor x12, x8, x9
4907 ; -O0: ldaxr x9, [x11]
4909 ; -O0: stlxr w10, x12, [x11]
4910 ; -O0: subs x8, x9, x8
4912 ; -O1-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
4913 ; -O1: ldaxr x0, [x8]
4914 ; -O1: eor x9, x0, x1
4915 ; -O1: stlxr w10, x9, [x8]
4916 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
4920 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4921 ; -O0-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
4922 ; -O0: eor x12, x8, x9
4923 ; -O0: ldaxr x9, [x11]
4925 ; -O0: stlxr w10, x12, [x11]
4926 ; -O0: subs x8, x9, x8
4928 ; -O1-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
4929 ; -O1: ldaxr x0, [x8]
4930 ; -O1: eor x9, x0, x1
4931 ; -O1: stlxr w10, x9, [x8]
4932 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
4936 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4937 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
4938 ; -O0: eor x14, x8, x10
4939 ; -O0: eor x15, x8, x9
4940 ; -O0: ldxp x10, x9, [x11]
4943 ; -O0: stxp w8, x14, x15, [x11]
4944 ; -O0: stxp w8, x10, x9, [x11]
4945 ; -O0: eor x8, x10, x8
4946 ; -O0: eor x11, x9, x11
4947 ; -O0: orr x8, x8, x11
4948 ; -O0: subs x8, x8, #0
4950 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
4951 ; -O1: ldxp x0, x1, [x8]
4952 ; -O1: eor x9, x1, x3
4953 ; -O1: eor x10, x0, x2
4954 ; -O1: stxp w11, x10, x9, [x8]
4955 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
4959 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
4960 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
4961 ; -O0: eor x14, x8, x10
4962 ; -O0: eor x15, x8, x9
4963 ; -O0: ldaxp x10, x9, [x11]
4966 ; -O0: stxp w8, x14, x15, [x11]
4967 ; -O0: stxp w8, x10, x9, [x11]
4968 ; -O0: eor x8, x10, x8
4969 ; -O0: eor x11, x9, x11
4970 ; -O0: orr x8, x8, x11
4971 ; -O0: subs x8, x8, #0
4973 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
4974 ; -O1: ldaxp x0, x1, [x8]
4975 ; -O1: eor x9, x1, x3
4976 ; -O1: eor x10, x0, x2
4977 ; -O1: stxp w11, x10, x9, [x8]
4978 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
4982 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
4983 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
4984 ; -O0: eor x14, x8, x10
4985 ; -O0: eor x15, x8, x9
4986 ; -O0: ldxp x10, x9, [x11]
4989 ; -O0: stlxp w8, x14, x15, [x11]
4990 ; -O0: stlxp w8, x10, x9, [x11]
4991 ; -O0: eor x8, x10, x8
4992 ; -O0: eor x11, x9, x11
4993 ; -O0: orr x8, x8, x11
4994 ; -O0: subs x8, x8, #0
4996 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
4997 ; -O1: ldxp x0, x1, [x8]
4998 ; -O1: eor x9, x1, x3
4999 ; -O1: eor x10, x0, x2
5000 ; -O1: stlxp w11, x10, x9, [x8]
5001 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
5005 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5006 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
5007 ; -O0: eor x14, x8, x10
5008 ; -O0: eor x15, x8, x9
5009 ; -O0: ldaxp x10, x9, [x11]
5012 ; -O0: stlxp w8, x14, x15, [x11]
5013 ; -O0: stlxp w8, x10, x9, [x11]
5014 ; -O0: eor x8, x10, x8
5015 ; -O0: eor x11, x9, x11
5016 ; -O0: orr x8, x8, x11
5017 ; -O0: subs x8, x8, #0
5019 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
5020 ; -O1: ldaxp x0, x1, [x8]
5021 ; -O1: eor x9, x1, x3
5022 ; -O1: eor x10, x0, x2
5023 ; -O1: stlxp w11, x10, x9, [x8]
5024 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
5028 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5029 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
5030 ; -O0: eor x14, x8, x10
5031 ; -O0: eor x15, x8, x9
5032 ; -O0: ldaxp x10, x9, [x11]
5035 ; -O0: stlxp w8, x14, x15, [x11]
5036 ; -O0: stlxp w8, x10, x9, [x11]
5037 ; -O0: eor x8, x10, x8
5038 ; -O0: eor x11, x9, x11
5039 ; -O0: orr x8, x8, x11
5040 ; -O0: subs x8, x8, #0
5042 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
5043 ; -O1: ldaxp x0, x1, [x8]
5044 ; -O1: eor x9, x1, x3
5045 ; -O1: eor x10, x0, x2
5046 ; -O1: stlxp w11, x10, x9, [x8]
5047 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
5051 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5052 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
5053 ; -O0: eor w12, w10, w8
5054 ; -O0: ldaxrb w9, [x11]
5055 ; -O0: cmp w9, w10, uxtb
5056 ; -O0: stlxrb w8, w12, [x11]
5057 ; -O0: and w8, w9, #0xff
5058 ; -O0: subs w8, w8, w10, uxtb
5060 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
5061 ; -O1: ldxrb w8, [x0]
5062 ; -O1: eor w9, w8, w1
5063 ; -O1: stxrb w10, w9, [x0]
5064 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
5068 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5069 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_acquire:
5070 ; -O0: eor w12, w10, w8
5071 ; -O0: ldaxrb w9, [x11]
5072 ; -O0: cmp w9, w10, uxtb
5073 ; -O0: stlxrb w8, w12, [x11]
5074 ; -O0: and w8, w9, #0xff
5075 ; -O0: subs w8, w8, w10, uxtb
5077 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_acquire:
5078 ; -O1: ldaxrb w8, [x0]
5079 ; -O1: eor w9, w8, w1
5080 ; -O1: stxrb w10, w9, [x0]
5081 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
5085 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
5086 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_release:
5087 ; -O0: eor w12, w10, w8
5088 ; -O0: ldaxrb w9, [x11]
5089 ; -O0: cmp w9, w10, uxtb
5090 ; -O0: stlxrb w8, w12, [x11]
5091 ; -O0: and w8, w9, #0xff
5092 ; -O0: subs w8, w8, w10, uxtb
5094 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_release:
5095 ; -O1: ldxrb w8, [x0]
5096 ; -O1: eor w9, w8, w1
5097 ; -O1: stlxrb w10, w9, [x0]
5098 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
5102 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5103 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
5104 ; -O0: eor w12, w10, w8
5105 ; -O0: ldaxrb w9, [x11]
5106 ; -O0: cmp w9, w10, uxtb
5107 ; -O0: stlxrb w8, w12, [x11]
5108 ; -O0: and w8, w9, #0xff
5109 ; -O0: subs w8, w8, w10, uxtb
5111 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
5112 ; -O1: ldaxrb w8, [x0]
5113 ; -O1: eor w9, w8, w1
5114 ; -O1: stlxrb w10, w9, [x0]
5115 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
5119 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5120 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
5121 ; -O0: eor w12, w10, w8
5122 ; -O0: ldaxrb w9, [x11]
5123 ; -O0: cmp w9, w10, uxtb
5124 ; -O0: stlxrb w8, w12, [x11]
5125 ; -O0: and w8, w9, #0xff
5126 ; -O0: subs w8, w8, w10, uxtb
5128 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
5129 ; -O1: ldaxrb w8, [x0]
5130 ; -O1: eor w9, w8, w1
5131 ; -O1: stlxrb w10, w9, [x0]
5132 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
5136 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5137 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
5138 ; -O0: eor w8, w9, w8
5139 ; -O0: bl __atomic_compare_exchange
5141 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
5142 ; -O1: eor w8, w0, w20
5143 ; -O1: bl __atomic_compare_exchange
5144 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
5148 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5149 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
5150 ; -O0: eor w8, w9, w8
5151 ; -O0: bl __atomic_compare_exchange
5153 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
5154 ; -O1: eor w8, w0, w20
5155 ; -O1: bl __atomic_compare_exchange
5156 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
5160 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
5161 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
5162 ; -O0: eor w8, w9, w8
5163 ; -O0: bl __atomic_compare_exchange
5165 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
5166 ; -O1: eor w8, w0, w20
5167 ; -O1: bl __atomic_compare_exchange
5168 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
5172 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5173 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
5174 ; -O0: eor w8, w9, w8
5175 ; -O0: bl __atomic_compare_exchange
5177 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
5178 ; -O1: eor w8, w0, w20
5179 ; -O1: bl __atomic_compare_exchange
5180 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
5184 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5185 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
5186 ; -O0: eor w8, w9, w8
5187 ; -O0: bl __atomic_compare_exchange
5189 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
5190 ; -O1: eor w8, w0, w20
5191 ; -O1: bl __atomic_compare_exchange
5192 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
5196 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5197 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
5198 ; -O0: eor w8, w9, w8
5199 ; -O0: bl __atomic_compare_exchange
5201 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
5202 ; -O1: eor w8, w0, w20
5203 ; -O1: bl __atomic_compare_exchange
5204 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
5208 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5209 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
5210 ; -O0: eor w8, w9, w8
5211 ; -O0: bl __atomic_compare_exchange
5213 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
5214 ; -O1: eor w8, w0, w20
5215 ; -O1: bl __atomic_compare_exchange
5216 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
5220 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
5221 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
5222 ; -O0: eor w8, w9, w8
5223 ; -O0: bl __atomic_compare_exchange
5225 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
5226 ; -O1: eor w8, w0, w20
5227 ; -O1: bl __atomic_compare_exchange
5228 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
5232 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5233 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
5234 ; -O0: eor w8, w9, w8
5235 ; -O0: bl __atomic_compare_exchange
5237 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
5238 ; -O1: eor w8, w0, w20
5239 ; -O1: bl __atomic_compare_exchange
5240 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
5244 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5245 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
5246 ; -O0: eor w8, w9, w8
5247 ; -O0: bl __atomic_compare_exchange
5249 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
5250 ; -O1: eor w8, w0, w20
5251 ; -O1: bl __atomic_compare_exchange
5252 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
5256 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5257 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
5258 ; -O0: eor x8, x9, x8
5259 ; -O0: bl __atomic_compare_exchange
5261 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
5262 ; -O1: eor x8, x0, x20
5263 ; -O1: bl __atomic_compare_exchange
5264 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
5268 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5269 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
5270 ; -O0: eor x8, x9, x8
5271 ; -O0: bl __atomic_compare_exchange
5273 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
5274 ; -O1: eor x8, x0, x20
5275 ; -O1: bl __atomic_compare_exchange
5276 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
5280 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
5281 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
5282 ; -O0: eor x8, x9, x8
5283 ; -O0: bl __atomic_compare_exchange
5285 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
5286 ; -O1: eor x8, x0, x20
5287 ; -O1: bl __atomic_compare_exchange
5288 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
5292 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5293 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
5294 ; -O0: eor x8, x9, x8
5295 ; -O0: bl __atomic_compare_exchange
5297 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
5298 ; -O1: eor x8, x0, x20
5299 ; -O1: bl __atomic_compare_exchange
5300 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
5304 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5305 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
5306 ; -O0: eor x8, x9, x8
5307 ; -O0: bl __atomic_compare_exchange
5309 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
5310 ; -O1: eor x8, x0, x20
5311 ; -O1: bl __atomic_compare_exchange
5312 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
5316 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5317 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
5318 ; -O0: eor x9, x8, x9
5319 ; -O0: eor x8, x8, x10
5320 ; -O0: bl __atomic_compare_exchange
5322 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
5323 ; -O1: ldp x0, x1, [x0]
5324 ; -O1: eor x8, x1, x19
5325 ; -O1: eor x9, x0, x21
5326 ; -O1: bl __atomic_compare_exchange
5327 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
5331 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5332 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
5333 ; -O0: eor x9, x8, x9
5334 ; -O0: eor x8, x8, x10
5335 ; -O0: bl __atomic_compare_exchange
5337 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
5338 ; -O1: ldp x0, x1, [x0]
5339 ; -O1: eor x8, x1, x19
5340 ; -O1: eor x9, x0, x21
5341 ; -O1: bl __atomic_compare_exchange
5342 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
5346 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
5347 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
5348 ; -O0: eor x9, x8, x9
5349 ; -O0: eor x8, x8, x10
5350 ; -O0: bl __atomic_compare_exchange
5352 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
5353 ; -O1: ldp x0, x1, [x0]
5354 ; -O1: eor x8, x1, x19
5355 ; -O1: eor x9, x0, x21
5356 ; -O1: bl __atomic_compare_exchange
5357 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
5361 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5362 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
5363 ; -O0: eor x9, x8, x9
5364 ; -O0: eor x8, x8, x10
5365 ; -O0: bl __atomic_compare_exchange
5367 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
5368 ; -O1: ldp x0, x1, [x0]
5369 ; -O1: eor x8, x1, x19
5370 ; -O1: eor x9, x0, x21
5371 ; -O1: bl __atomic_compare_exchange
5372 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
5376 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5377 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
5378 ; -O0: eor x9, x8, x9
5379 ; -O0: eor x8, x8, x10
5380 ; -O0: bl __atomic_compare_exchange
5382 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
5383 ; -O1: ldp x0, x1, [x0]
5384 ; -O1: eor x8, x1, x19
5385 ; -O1: eor x9, x0, x21
5386 ; -O1: bl __atomic_compare_exchange
5387 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
5391 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5392 ; -O0-LABEL: atomicrmw_max_i8_aligned_monotonic:
5394 ; -O0: subs w9, w9, w8, sxtb
5395 ; -O0: and w9, w9, #0x1
5396 ; -O0: ands w9, w9, #0x1
5397 ; -O0: csel w12, w10, w8, ne
5398 ; -O0: ldaxrb w9, [x11]
5399 ; -O0: cmp w9, w10, uxtb
5400 ; -O0: stlxrb w8, w12, [x11]
5401 ; -O0: and w8, w9, #0xff
5402 ; -O0: subs w8, w8, w10, uxtb
5404 ; -O1-LABEL: atomicrmw_max_i8_aligned_monotonic:
5405 ; -O1: ldxrb w9, [x0]
5407 ; -O1: cmp w8, w1, sxtb
5408 ; -O1: csel w9, w9, w1, gt
5409 ; -O1: stxrb w10, w9, [x0]
5410 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
5414 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
5415 ; -O0-LABEL: atomicrmw_max_i8_aligned_acquire:
5417 ; -O0: subs w9, w9, w8, sxtb
5418 ; -O0: and w9, w9, #0x1
5419 ; -O0: ands w9, w9, #0x1
5420 ; -O0: csel w12, w10, w8, ne
5421 ; -O0: ldaxrb w9, [x11]
5422 ; -O0: cmp w9, w10, uxtb
5423 ; -O0: stlxrb w8, w12, [x11]
5424 ; -O0: and w8, w9, #0xff
5425 ; -O0: subs w8, w8, w10, uxtb
5427 ; -O1-LABEL: atomicrmw_max_i8_aligned_acquire:
5428 ; -O1: ldaxrb w9, [x0]
5430 ; -O1: cmp w8, w1, sxtb
5431 ; -O1: csel w9, w9, w1, gt
5432 ; -O1: stxrb w10, w9, [x0]
5433 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
5437 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
5438 ; -O0-LABEL: atomicrmw_max_i8_aligned_release:
5440 ; -O0: subs w9, w9, w8, sxtb
5441 ; -O0: and w9, w9, #0x1
5442 ; -O0: ands w9, w9, #0x1
5443 ; -O0: csel w12, w10, w8, ne
5444 ; -O0: ldaxrb w9, [x11]
5445 ; -O0: cmp w9, w10, uxtb
5446 ; -O0: stlxrb w8, w12, [x11]
5447 ; -O0: and w8, w9, #0xff
5448 ; -O0: subs w8, w8, w10, uxtb
5450 ; -O1-LABEL: atomicrmw_max_i8_aligned_release:
5451 ; -O1: ldxrb w9, [x0]
5453 ; -O1: cmp w8, w1, sxtb
5454 ; -O1: csel w9, w9, w1, gt
5455 ; -O1: stlxrb w10, w9, [x0]
5456 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
5460 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5461 ; -O0-LABEL: atomicrmw_max_i8_aligned_acq_rel:
5463 ; -O0: subs w9, w9, w8, sxtb
5464 ; -O0: and w9, w9, #0x1
5465 ; -O0: ands w9, w9, #0x1
5466 ; -O0: csel w12, w10, w8, ne
5467 ; -O0: ldaxrb w9, [x11]
5468 ; -O0: cmp w9, w10, uxtb
5469 ; -O0: stlxrb w8, w12, [x11]
5470 ; -O0: and w8, w9, #0xff
5471 ; -O0: subs w8, w8, w10, uxtb
5473 ; -O1-LABEL: atomicrmw_max_i8_aligned_acq_rel:
5474 ; -O1: ldaxrb w9, [x0]
5476 ; -O1: cmp w8, w1, sxtb
5477 ; -O1: csel w9, w9, w1, gt
5478 ; -O1: stlxrb w10, w9, [x0]
5479 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
5483 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5484 ; -O0-LABEL: atomicrmw_max_i8_aligned_seq_cst:
5486 ; -O0: subs w9, w9, w8, sxtb
5487 ; -O0: and w9, w9, #0x1
5488 ; -O0: ands w9, w9, #0x1
5489 ; -O0: csel w12, w10, w8, ne
5490 ; -O0: ldaxrb w9, [x11]
5491 ; -O0: cmp w9, w10, uxtb
5492 ; -O0: stlxrb w8, w12, [x11]
5493 ; -O0: and w8, w9, #0xff
5494 ; -O0: subs w8, w8, w10, uxtb
5496 ; -O1-LABEL: atomicrmw_max_i8_aligned_seq_cst:
5497 ; -O1: ldaxrb w9, [x0]
5499 ; -O1: cmp w8, w1, sxtb
5500 ; -O1: csel w9, w9, w1, gt
5501 ; -O1: stlxrb w10, w9, [x0]
5502 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
5506 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5507 ; -O0-LABEL: atomicrmw_max_i16_aligned_monotonic:
5509 ; -O0: subs w10, w10, w9, sxth
5510 ; -O0: and w10, w10, #0x1
5511 ; -O0: ands w10, w10, #0x1
5512 ; -O0: csel w12, w8, w9, ne
5513 ; -O0: ldaxrh w9, [x11]
5514 ; -O0: cmp w9, w8, uxth
5515 ; -O0: stlxrh w10, w12, [x11]
5516 ; -O0: subs w8, w8, w9, uxth
5518 ; -O1-LABEL: atomicrmw_max_i16_aligned_monotonic:
5519 ; -O1: ldxrh w9, [x0]
5521 ; -O1: cmp w8, w1, sxth
5522 ; -O1: csel w9, w9, w1, gt
5523 ; -O1: stxrh w10, w9, [x0]
5524 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
5528 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
5529 ; -O0-LABEL: atomicrmw_max_i16_aligned_acquire:
5531 ; -O0: subs w10, w10, w9, sxth
5532 ; -O0: and w10, w10, #0x1
5533 ; -O0: ands w10, w10, #0x1
5534 ; -O0: csel w12, w8, w9, ne
5535 ; -O0: ldaxrh w9, [x11]
5536 ; -O0: cmp w9, w8, uxth
5537 ; -O0: stlxrh w10, w12, [x11]
5538 ; -O0: subs w8, w8, w9, uxth
5540 ; -O1-LABEL: atomicrmw_max_i16_aligned_acquire:
5541 ; -O1: ldaxrh w9, [x0]
5543 ; -O1: cmp w8, w1, sxth
5544 ; -O1: csel w9, w9, w1, gt
5545 ; -O1: stxrh w10, w9, [x0]
5546 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
5550 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
5551 ; -O0-LABEL: atomicrmw_max_i16_aligned_release:
5553 ; -O0: subs w10, w10, w9, sxth
5554 ; -O0: and w10, w10, #0x1
5555 ; -O0: ands w10, w10, #0x1
5556 ; -O0: csel w12, w8, w9, ne
5557 ; -O0: ldaxrh w9, [x11]
5558 ; -O0: cmp w9, w8, uxth
5559 ; -O0: stlxrh w10, w12, [x11]
5560 ; -O0: subs w8, w8, w9, uxth
5562 ; -O1-LABEL: atomicrmw_max_i16_aligned_release:
5563 ; -O1: ldxrh w9, [x0]
5565 ; -O1: cmp w8, w1, sxth
5566 ; -O1: csel w9, w9, w1, gt
5567 ; -O1: stlxrh w10, w9, [x0]
5568 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
5572 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5573 ; -O0-LABEL: atomicrmw_max_i16_aligned_acq_rel:
5575 ; -O0: subs w10, w10, w9, sxth
5576 ; -O0: and w10, w10, #0x1
5577 ; -O0: ands w10, w10, #0x1
5578 ; -O0: csel w12, w8, w9, ne
5579 ; -O0: ldaxrh w9, [x11]
5580 ; -O0: cmp w9, w8, uxth
5581 ; -O0: stlxrh w10, w12, [x11]
5582 ; -O0: subs w8, w8, w9, uxth
5584 ; -O1-LABEL: atomicrmw_max_i16_aligned_acq_rel:
5585 ; -O1: ldaxrh w9, [x0]
5587 ; -O1: cmp w8, w1, sxth
5588 ; -O1: csel w9, w9, w1, gt
5589 ; -O1: stlxrh w10, w9, [x0]
5590 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
5594 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5595 ; -O0-LABEL: atomicrmw_max_i16_aligned_seq_cst:
5597 ; -O0: subs w10, w10, w9, sxth
5598 ; -O0: and w10, w10, #0x1
5599 ; -O0: ands w10, w10, #0x1
5600 ; -O0: csel w12, w8, w9, ne
5601 ; -O0: ldaxrh w9, [x11]
5602 ; -O0: cmp w9, w8, uxth
5603 ; -O0: stlxrh w10, w12, [x11]
5604 ; -O0: subs w8, w8, w9, uxth
5606 ; -O1-LABEL: atomicrmw_max_i16_aligned_seq_cst:
5607 ; -O1: ldaxrh w9, [x0]
5609 ; -O1: cmp w8, w1, sxth
5610 ; -O1: csel w9, w9, w1, gt
5611 ; -O1: stlxrh w10, w9, [x0]
5612 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
5616 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5617 ; -O0-LABEL: atomicrmw_max_i32_aligned_monotonic:
5618 ; -O0: subs w10, w8, w9
5619 ; -O0: and w10, w10, #0x1
5620 ; -O0: ands w10, w10, #0x1
5621 ; -O0: csel w12, w8, w9, ne
5622 ; -O0: ldaxr w9, [x11]
5624 ; -O0: stlxr w10, w12, [x11]
5625 ; -O0: subs w8, w9, w8
5627 ; -O1-LABEL: atomicrmw_max_i32_aligned_monotonic:
5628 ; -O1: ldxr w8, [x0]
5630 ; -O1: csel w9, w8, w1, gt
5631 ; -O1: stxr w10, w9, [x0]
5632 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
5636 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
5637 ; -O0-LABEL: atomicrmw_max_i32_aligned_acquire:
5638 ; -O0: subs w10, w8, w9
5639 ; -O0: and w10, w10, #0x1
5640 ; -O0: ands w10, w10, #0x1
5641 ; -O0: csel w12, w8, w9, ne
5642 ; -O0: ldaxr w9, [x11]
5644 ; -O0: stlxr w10, w12, [x11]
5645 ; -O0: subs w8, w9, w8
5647 ; -O1-LABEL: atomicrmw_max_i32_aligned_acquire:
5648 ; -O1: ldaxr w8, [x0]
5650 ; -O1: csel w9, w8, w1, gt
5651 ; -O1: stxr w10, w9, [x0]
5652 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
5656 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
5657 ; -O0-LABEL: atomicrmw_max_i32_aligned_release:
5658 ; -O0: subs w10, w8, w9
5659 ; -O0: and w10, w10, #0x1
5660 ; -O0: ands w10, w10, #0x1
5661 ; -O0: csel w12, w8, w9, ne
5662 ; -O0: ldaxr w9, [x11]
5664 ; -O0: stlxr w10, w12, [x11]
5665 ; -O0: subs w8, w9, w8
5667 ; -O1-LABEL: atomicrmw_max_i32_aligned_release:
5668 ; -O1: ldxr w8, [x0]
5670 ; -O1: csel w9, w8, w1, gt
5671 ; -O1: stlxr w10, w9, [x0]
5672 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
5676 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5677 ; -O0-LABEL: atomicrmw_max_i32_aligned_acq_rel:
5678 ; -O0: subs w10, w8, w9
5679 ; -O0: and w10, w10, #0x1
5680 ; -O0: ands w10, w10, #0x1
5681 ; -O0: csel w12, w8, w9, ne
5682 ; -O0: ldaxr w9, [x11]
5684 ; -O0: stlxr w10, w12, [x11]
5685 ; -O0: subs w8, w9, w8
5687 ; -O1-LABEL: atomicrmw_max_i32_aligned_acq_rel:
5688 ; -O1: ldaxr w8, [x0]
5690 ; -O1: csel w9, w8, w1, gt
5691 ; -O1: stlxr w10, w9, [x0]
5692 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
5696 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5697 ; -O0-LABEL: atomicrmw_max_i32_aligned_seq_cst:
5698 ; -O0: subs w10, w8, w9
5699 ; -O0: and w10, w10, #0x1
5700 ; -O0: ands w10, w10, #0x1
5701 ; -O0: csel w12, w8, w9, ne
5702 ; -O0: ldaxr w9, [x11]
5704 ; -O0: stlxr w10, w12, [x11]
5705 ; -O0: subs w8, w9, w8
5707 ; -O1-LABEL: atomicrmw_max_i32_aligned_seq_cst:
5708 ; -O1: ldaxr w8, [x0]
5710 ; -O1: csel w9, w8, w1, gt
5711 ; -O1: stlxr w10, w9, [x0]
5712 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
5716 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5717 ; -O0-LABEL: atomicrmw_max_i64_aligned_monotonic:
5718 ; -O0: subs x10, x8, x9
5719 ; -O0: and w10, w10, #0x1
5720 ; -O0: ands w10, w10, #0x1
5721 ; -O0: csel x12, x8, x9, ne
5722 ; -O0: ldaxr x9, [x11]
5724 ; -O0: stlxr w10, x12, [x11]
5725 ; -O0: subs x8, x9, x8
5727 ; -O1-LABEL: atomicrmw_max_i64_aligned_monotonic:
5728 ; -O1: ldxr x0, [x8]
5730 ; -O1: csel x9, x0, x1, gt
5731 ; -O1: stxr w10, x9, [x8]
5732 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
5736 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
5737 ; -O0-LABEL: atomicrmw_max_i64_aligned_acquire:
5738 ; -O0: subs x10, x8, x9
5739 ; -O0: and w10, w10, #0x1
5740 ; -O0: ands w10, w10, #0x1
5741 ; -O0: csel x12, x8, x9, ne
5742 ; -O0: ldaxr x9, [x11]
5744 ; -O0: stlxr w10, x12, [x11]
5745 ; -O0: subs x8, x9, x8
5747 ; -O1-LABEL: atomicrmw_max_i64_aligned_acquire:
5748 ; -O1: ldaxr x0, [x8]
5750 ; -O1: csel x9, x0, x1, gt
5751 ; -O1: stxr w10, x9, [x8]
5752 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
5756 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
5757 ; -O0-LABEL: atomicrmw_max_i64_aligned_release:
5758 ; -O0: subs x10, x8, x9
5759 ; -O0: and w10, w10, #0x1
5760 ; -O0: ands w10, w10, #0x1
5761 ; -O0: csel x12, x8, x9, ne
5762 ; -O0: ldaxr x9, [x11]
5764 ; -O0: stlxr w10, x12, [x11]
5765 ; -O0: subs x8, x9, x8
5767 ; -O1-LABEL: atomicrmw_max_i64_aligned_release:
5768 ; -O1: ldxr x0, [x8]
5770 ; -O1: csel x9, x0, x1, gt
5771 ; -O1: stlxr w10, x9, [x8]
5772 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
5776 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5777 ; -O0-LABEL: atomicrmw_max_i64_aligned_acq_rel:
5778 ; -O0: subs x10, x8, x9
5779 ; -O0: and w10, w10, #0x1
5780 ; -O0: ands w10, w10, #0x1
5781 ; -O0: csel x12, x8, x9, ne
5782 ; -O0: ldaxr x9, [x11]
5784 ; -O0: stlxr w10, x12, [x11]
5785 ; -O0: subs x8, x9, x8
5787 ; -O1-LABEL: atomicrmw_max_i64_aligned_acq_rel:
5788 ; -O1: ldaxr x0, [x8]
5790 ; -O1: csel x9, x0, x1, gt
5791 ; -O1: stlxr w10, x9, [x8]
5792 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
5796 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5797 ; -O0-LABEL: atomicrmw_max_i64_aligned_seq_cst:
5798 ; -O0: subs x10, x8, x9
5799 ; -O0: and w10, w10, #0x1
5800 ; -O0: ands w10, w10, #0x1
5801 ; -O0: csel x12, x8, x9, ne
5802 ; -O0: ldaxr x9, [x11]
5804 ; -O0: stlxr w10, x12, [x11]
5805 ; -O0: subs x8, x9, x8
5807 ; -O1-LABEL: atomicrmw_max_i64_aligned_seq_cst:
5808 ; -O1: ldaxr x0, [x8]
5810 ; -O1: csel x9, x0, x1, gt
5811 ; -O1: stlxr w10, x9, [x8]
5812 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
5816 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5817 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
5818 ; -O0: subs x8, x8, x9
5819 ; -O0: subs x8, x8, x9
5820 ; -O0: subs x8, x8, x12
5821 ; -O0: and w13, w13, #0x1
5822 ; -O0: ands w13, w13, #0x1
5823 ; -O0: csel w8, w8, w10, ne
5824 ; -O0: and w13, w8, #0x1
5825 ; -O0: ands w13, w13, #0x1
5826 ; -O0: csel x14, x10, x12, ne
5827 ; -O0: and w10, w8, #0x1
5828 ; -O0: ands w10, w10, #0x1
5829 ; -O0: csel x15, x8, x9, ne
5830 ; -O0: ldxp x10, x9, [x11]
5833 ; -O0: stxp w8, x14, x15, [x11]
5834 ; -O0: stxp w8, x10, x9, [x11]
5835 ; -O0: eor x8, x10, x8
5836 ; -O0: eor x11, x9, x11
5837 ; -O0: orr x8, x8, x11
5838 ; -O0: subs x8, x8, #0
5840 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
5841 ; -O1: ldxp x0, x1, [x8]
5843 ; -O1: csel x9, x1, x3, lt
5844 ; -O1: csel x10, x0, x2, lt
5845 ; -O1: stxp w11, x10, x9, [x8]
5846 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
5850 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
5851 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
5852 ; -O0: subs x8, x8, x9
5853 ; -O0: subs x8, x8, x9
5854 ; -O0: subs x8, x8, x12
5855 ; -O0: and w13, w13, #0x1
5856 ; -O0: ands w13, w13, #0x1
5857 ; -O0: csel w8, w8, w10, ne
5858 ; -O0: and w13, w8, #0x1
5859 ; -O0: ands w13, w13, #0x1
5860 ; -O0: csel x14, x10, x12, ne
5861 ; -O0: and w10, w8, #0x1
5862 ; -O0: ands w10, w10, #0x1
5863 ; -O0: csel x15, x8, x9, ne
5864 ; -O0: ldaxp x10, x9, [x11]
5867 ; -O0: stxp w8, x14, x15, [x11]
5868 ; -O0: stxp w8, x10, x9, [x11]
5869 ; -O0: eor x8, x10, x8
5870 ; -O0: eor x11, x9, x11
5871 ; -O0: orr x8, x8, x11
5872 ; -O0: subs x8, x8, #0
5874 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
5875 ; -O1: ldaxp x0, x1, [x8]
5877 ; -O1: csel x9, x1, x3, lt
5878 ; -O1: csel x10, x0, x2, lt
5879 ; -O1: stxp w11, x10, x9, [x8]
5880 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
5884 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
5885 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
5886 ; -O0: subs x8, x8, x9
5887 ; -O0: subs x8, x8, x9
5888 ; -O0: subs x8, x8, x12
5889 ; -O0: and w13, w13, #0x1
5890 ; -O0: ands w13, w13, #0x1
5891 ; -O0: csel w8, w8, w10, ne
5892 ; -O0: and w13, w8, #0x1
5893 ; -O0: ands w13, w13, #0x1
5894 ; -O0: csel x14, x10, x12, ne
5895 ; -O0: and w10, w8, #0x1
5896 ; -O0: ands w10, w10, #0x1
5897 ; -O0: csel x15, x8, x9, ne
5898 ; -O0: ldxp x10, x9, [x11]
5901 ; -O0: stlxp w8, x14, x15, [x11]
5902 ; -O0: stlxp w8, x10, x9, [x11]
5903 ; -O0: eor x8, x10, x8
5904 ; -O0: eor x11, x9, x11
5905 ; -O0: orr x8, x8, x11
5906 ; -O0: subs x8, x8, #0
5908 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
5909 ; -O1: ldxp x0, x1, [x8]
5911 ; -O1: csel x9, x1, x3, lt
5912 ; -O1: csel x10, x0, x2, lt
5913 ; -O1: stlxp w11, x10, x9, [x8]
5914 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
5918 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5919 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
5920 ; -O0: subs x8, x8, x9
5921 ; -O0: subs x8, x8, x9
5922 ; -O0: subs x8, x8, x12
5923 ; -O0: and w13, w13, #0x1
5924 ; -O0: ands w13, w13, #0x1
5925 ; -O0: csel w8, w8, w10, ne
5926 ; -O0: and w13, w8, #0x1
5927 ; -O0: ands w13, w13, #0x1
5928 ; -O0: csel x14, x10, x12, ne
5929 ; -O0: and w10, w8, #0x1
5930 ; -O0: ands w10, w10, #0x1
5931 ; -O0: csel x15, x8, x9, ne
5932 ; -O0: ldaxp x10, x9, [x11]
5935 ; -O0: stlxp w8, x14, x15, [x11]
5936 ; -O0: stlxp w8, x10, x9, [x11]
5937 ; -O0: eor x8, x10, x8
5938 ; -O0: eor x11, x9, x11
5939 ; -O0: orr x8, x8, x11
5940 ; -O0: subs x8, x8, #0
5942 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
5943 ; -O1: ldaxp x0, x1, [x8]
5945 ; -O1: csel x9, x1, x3, lt
5946 ; -O1: csel x10, x0, x2, lt
5947 ; -O1: stlxp w11, x10, x9, [x8]
5948 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
5952 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5953 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
5954 ; -O0: subs x8, x8, x9
5955 ; -O0: subs x8, x8, x9
5956 ; -O0: subs x8, x8, x12
5957 ; -O0: and w13, w13, #0x1
5958 ; -O0: ands w13, w13, #0x1
5959 ; -O0: csel w8, w8, w10, ne
5960 ; -O0: and w13, w8, #0x1
5961 ; -O0: ands w13, w13, #0x1
5962 ; -O0: csel x14, x10, x12, ne
5963 ; -O0: and w10, w8, #0x1
5964 ; -O0: ands w10, w10, #0x1
5965 ; -O0: csel x15, x8, x9, ne
5966 ; -O0: ldaxp x10, x9, [x11]
5969 ; -O0: stlxp w8, x14, x15, [x11]
5970 ; -O0: stlxp w8, x10, x9, [x11]
5971 ; -O0: eor x8, x10, x8
5972 ; -O0: eor x11, x9, x11
5973 ; -O0: orr x8, x8, x11
5974 ; -O0: subs x8, x8, #0
5976 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
5977 ; -O1: ldaxp x0, x1, [x8]
5979 ; -O1: csel x9, x1, x3, lt
5980 ; -O1: csel x10, x0, x2, lt
5981 ; -O1: stlxp w11, x10, x9, [x8]
5982 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
5986 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5987 ; -O0-LABEL: atomicrmw_max_i8_unaligned_monotonic:
5989 ; -O0: subs w9, w9, w8, sxtb
5990 ; -O0: and w9, w9, #0x1
5991 ; -O0: ands w9, w9, #0x1
5992 ; -O0: csel w12, w10, w8, ne
5993 ; -O0: ldaxrb w9, [x11]
5994 ; -O0: cmp w9, w10, uxtb
5995 ; -O0: stlxrb w8, w12, [x11]
5996 ; -O0: and w8, w9, #0xff
5997 ; -O0: subs w8, w8, w10, uxtb
5999 ; -O1-LABEL: atomicrmw_max_i8_unaligned_monotonic:
6000 ; -O1: ldxrb w9, [x0]
6002 ; -O1: cmp w8, w1, sxtb
6003 ; -O1: csel w9, w9, w1, gt
6004 ; -O1: stxrb w10, w9, [x0]
6005 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
6009 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6010 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acquire:
6012 ; -O0: subs w9, w9, w8, sxtb
6013 ; -O0: and w9, w9, #0x1
6014 ; -O0: ands w9, w9, #0x1
6015 ; -O0: csel w12, w10, w8, ne
6016 ; -O0: ldaxrb w9, [x11]
6017 ; -O0: cmp w9, w10, uxtb
6018 ; -O0: stlxrb w8, w12, [x11]
6019 ; -O0: and w8, w9, #0xff
6020 ; -O0: subs w8, w8, w10, uxtb
6022 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acquire:
6023 ; -O1: ldaxrb w9, [x0]
6025 ; -O1: cmp w8, w1, sxtb
6026 ; -O1: csel w9, w9, w1, gt
6027 ; -O1: stxrb w10, w9, [x0]
6028 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
6032 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
6033 ; -O0-LABEL: atomicrmw_max_i8_unaligned_release:
6035 ; -O0: subs w9, w9, w8, sxtb
6036 ; -O0: and w9, w9, #0x1
6037 ; -O0: ands w9, w9, #0x1
6038 ; -O0: csel w12, w10, w8, ne
6039 ; -O0: ldaxrb w9, [x11]
6040 ; -O0: cmp w9, w10, uxtb
6041 ; -O0: stlxrb w8, w12, [x11]
6042 ; -O0: and w8, w9, #0xff
6043 ; -O0: subs w8, w8, w10, uxtb
6045 ; -O1-LABEL: atomicrmw_max_i8_unaligned_release:
6046 ; -O1: ldxrb w9, [x0]
6048 ; -O1: cmp w8, w1, sxtb
6049 ; -O1: csel w9, w9, w1, gt
6050 ; -O1: stlxrb w10, w9, [x0]
6051 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
6055 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6056 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
6058 ; -O0: subs w9, w9, w8, sxtb
6059 ; -O0: and w9, w9, #0x1
6060 ; -O0: ands w9, w9, #0x1
6061 ; -O0: csel w12, w10, w8, ne
6062 ; -O0: ldaxrb w9, [x11]
6063 ; -O0: cmp w9, w10, uxtb
6064 ; -O0: stlxrb w8, w12, [x11]
6065 ; -O0: and w8, w9, #0xff
6066 ; -O0: subs w8, w8, w10, uxtb
6068 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
6069 ; -O1: ldaxrb w9, [x0]
6071 ; -O1: cmp w8, w1, sxtb
6072 ; -O1: csel w9, w9, w1, gt
6073 ; -O1: stlxrb w10, w9, [x0]
6074 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
6078 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6079 ; -O0-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
6081 ; -O0: subs w9, w9, w8, sxtb
6082 ; -O0: and w9, w9, #0x1
6083 ; -O0: ands w9, w9, #0x1
6084 ; -O0: csel w12, w10, w8, ne
6085 ; -O0: ldaxrb w9, [x11]
6086 ; -O0: cmp w9, w10, uxtb
6087 ; -O0: stlxrb w8, w12, [x11]
6088 ; -O0: and w8, w9, #0xff
6089 ; -O0: subs w8, w8, w10, uxtb
6091 ; -O1-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
6092 ; -O1: ldaxrb w9, [x0]
6094 ; -O1: cmp w8, w1, sxtb
6095 ; -O1: csel w9, w9, w1, gt
6096 ; -O1: stlxrb w10, w9, [x0]
6097 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
6101 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6102 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
6104 ; -O0: subs w10, w10, w8, sxth
6105 ; -O0: and w10, w10, #0x1
6106 ; -O0: ands w10, w10, #0x1
6107 ; -O0: csel w8, w9, w8, ne
6108 ; -O0: bl __atomic_compare_exchange
6110 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
6112 ; -O1: cmp w8, w20, sxth
6113 ; -O1: csel w8, w0, w20, gt
6114 ; -O1: bl __atomic_compare_exchange
6115 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
6119 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6120 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
6122 ; -O0: subs w10, w10, w8, sxth
6123 ; -O0: and w10, w10, #0x1
6124 ; -O0: ands w10, w10, #0x1
6125 ; -O0: csel w8, w9, w8, ne
6126 ; -O0: bl __atomic_compare_exchange
6128 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
6130 ; -O1: cmp w8, w20, sxth
6131 ; -O1: csel w8, w0, w20, gt
6132 ; -O1: bl __atomic_compare_exchange
6133 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
6137 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
6138 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
6140 ; -O0: subs w10, w10, w8, sxth
6141 ; -O0: and w10, w10, #0x1
6142 ; -O0: ands w10, w10, #0x1
6143 ; -O0: csel w8, w9, w8, ne
6144 ; -O0: bl __atomic_compare_exchange
6146 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
6148 ; -O1: cmp w8, w20, sxth
6149 ; -O1: csel w8, w0, w20, gt
6150 ; -O1: bl __atomic_compare_exchange
6151 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
6155 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6156 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
6158 ; -O0: subs w10, w10, w8, sxth
6159 ; -O0: and w10, w10, #0x1
6160 ; -O0: ands w10, w10, #0x1
6161 ; -O0: csel w8, w9, w8, ne
6162 ; -O0: bl __atomic_compare_exchange
6164 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
6166 ; -O1: cmp w8, w20, sxth
6167 ; -O1: csel w8, w0, w20, gt
6168 ; -O1: bl __atomic_compare_exchange
6169 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
6173 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6174 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
6176 ; -O0: subs w10, w10, w8, sxth
6177 ; -O0: and w10, w10, #0x1
6178 ; -O0: ands w10, w10, #0x1
6179 ; -O0: csel w8, w9, w8, ne
6180 ; -O0: bl __atomic_compare_exchange
6182 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
6184 ; -O1: cmp w8, w20, sxth
6185 ; -O1: csel w8, w0, w20, gt
6186 ; -O1: bl __atomic_compare_exchange
6187 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
6191 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6192 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
6193 ; -O0: subs w10, w9, w8
6194 ; -O0: and w10, w10, #0x1
6195 ; -O0: ands w10, w10, #0x1
6196 ; -O0: csel w8, w9, w8, ne
6197 ; -O0: bl __atomic_compare_exchange
6199 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
6201 ; -O1: csel w8, w0, w20, gt
6202 ; -O1: bl __atomic_compare_exchange
6203 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
6207 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6208 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
6209 ; -O0: subs w10, w9, w8
6210 ; -O0: and w10, w10, #0x1
6211 ; -O0: ands w10, w10, #0x1
6212 ; -O0: csel w8, w9, w8, ne
6213 ; -O0: bl __atomic_compare_exchange
6215 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
6217 ; -O1: csel w8, w0, w20, gt
6218 ; -O1: bl __atomic_compare_exchange
6219 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
6223 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
6224 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
6225 ; -O0: subs w10, w9, w8
6226 ; -O0: and w10, w10, #0x1
6227 ; -O0: ands w10, w10, #0x1
6228 ; -O0: csel w8, w9, w8, ne
6229 ; -O0: bl __atomic_compare_exchange
6231 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
6233 ; -O1: csel w8, w0, w20, gt
6234 ; -O1: bl __atomic_compare_exchange
6235 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
6239 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6240 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
6241 ; -O0: subs w10, w9, w8
6242 ; -O0: and w10, w10, #0x1
6243 ; -O0: ands w10, w10, #0x1
6244 ; -O0: csel w8, w9, w8, ne
6245 ; -O0: bl __atomic_compare_exchange
6247 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
6249 ; -O1: csel w8, w0, w20, gt
6250 ; -O1: bl __atomic_compare_exchange
6251 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
6255 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6256 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
6257 ; -O0: subs w10, w9, w8
6258 ; -O0: and w10, w10, #0x1
6259 ; -O0: ands w10, w10, #0x1
6260 ; -O0: csel w8, w9, w8, ne
6261 ; -O0: bl __atomic_compare_exchange
6263 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
6265 ; -O1: csel w8, w0, w20, gt
6266 ; -O1: bl __atomic_compare_exchange
6267 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
6271 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6272 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
6273 ; -O0: subs x10, x9, x8
6274 ; -O0: and w10, w10, #0x1
6275 ; -O0: ands w10, w10, #0x1
6276 ; -O0: csel x8, x9, x8, ne
6277 ; -O0: bl __atomic_compare_exchange
6279 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
6281 ; -O1: csel x8, x0, x20, gt
6282 ; -O1: bl __atomic_compare_exchange
6283 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
6287 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6288 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
6289 ; -O0: subs x10, x9, x8
6290 ; -O0: and w10, w10, #0x1
6291 ; -O0: ands w10, w10, #0x1
6292 ; -O0: csel x8, x9, x8, ne
6293 ; -O0: bl __atomic_compare_exchange
6295 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
6297 ; -O1: csel x8, x0, x20, gt
6298 ; -O1: bl __atomic_compare_exchange
6299 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
6303 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
6304 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
6305 ; -O0: subs x10, x9, x8
6306 ; -O0: and w10, w10, #0x1
6307 ; -O0: ands w10, w10, #0x1
6308 ; -O0: csel x8, x9, x8, ne
6309 ; -O0: bl __atomic_compare_exchange
6311 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
6313 ; -O1: csel x8, x0, x20, gt
6314 ; -O1: bl __atomic_compare_exchange
6315 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
6319 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6320 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
6321 ; -O0: subs x10, x9, x8
6322 ; -O0: and w10, w10, #0x1
6323 ; -O0: ands w10, w10, #0x1
6324 ; -O0: csel x8, x9, x8, ne
6325 ; -O0: bl __atomic_compare_exchange
6327 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
6329 ; -O1: csel x8, x0, x20, gt
6330 ; -O1: bl __atomic_compare_exchange
6331 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
6335 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6336 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
6337 ; -O0: subs x10, x9, x8
6338 ; -O0: and w10, w10, #0x1
6339 ; -O0: ands w10, w10, #0x1
6340 ; -O0: csel x8, x9, x8, ne
6341 ; -O0: bl __atomic_compare_exchange
6343 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
6345 ; -O1: csel x8, x0, x20, gt
6346 ; -O1: bl __atomic_compare_exchange
6347 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
6351 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6352 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
6353 ; -O0: subs x8, x8, x10
6354 ; -O0: subs x8, x8, x10
6355 ; -O0: subs x8, x8, x11
6356 ; -O0: and w12, w12, #0x1
6357 ; -O0: ands w12, w12, #0x1
6358 ; -O0: csel w8, w8, w9, ne
6359 ; -O0: and w12, w8, #0x1
6360 ; -O0: ands w12, w12, #0x1
6361 ; -O0: csel x9, x9, x11, ne
6362 ; -O0: and w11, w8, #0x1
6363 ; -O0: ands w11, w11, #0x1
6364 ; -O0: csel x8, x8, x10, ne
6365 ; -O0: bl __atomic_compare_exchange
6367 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
6368 ; -O1: ldp x0, x1, [x0]
6370 ; -O1: csel x8, x1, x19, lt
6371 ; -O1: csel x9, x0, x21, lt
6372 ; -O1: bl __atomic_compare_exchange
6373 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
6377 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6378 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
6379 ; -O0: subs x8, x8, x10
6380 ; -O0: subs x8, x8, x10
6381 ; -O0: subs x8, x8, x11
6382 ; -O0: and w12, w12, #0x1
6383 ; -O0: ands w12, w12, #0x1
6384 ; -O0: csel w8, w8, w9, ne
6385 ; -O0: and w12, w8, #0x1
6386 ; -O0: ands w12, w12, #0x1
6387 ; -O0: csel x9, x9, x11, ne
6388 ; -O0: and w11, w8, #0x1
6389 ; -O0: ands w11, w11, #0x1
6390 ; -O0: csel x8, x8, x10, ne
6391 ; -O0: bl __atomic_compare_exchange
6393 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
6394 ; -O1: ldp x0, x1, [x0]
6396 ; -O1: csel x8, x1, x19, lt
6397 ; -O1: csel x9, x0, x21, lt
6398 ; -O1: bl __atomic_compare_exchange
6399 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
6403 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
6404 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
6405 ; -O0: subs x8, x8, x10
6406 ; -O0: subs x8, x8, x10
6407 ; -O0: subs x8, x8, x11
6408 ; -O0: and w12, w12, #0x1
6409 ; -O0: ands w12, w12, #0x1
6410 ; -O0: csel w8, w8, w9, ne
6411 ; -O0: and w12, w8, #0x1
6412 ; -O0: ands w12, w12, #0x1
6413 ; -O0: csel x9, x9, x11, ne
6414 ; -O0: and w11, w8, #0x1
6415 ; -O0: ands w11, w11, #0x1
6416 ; -O0: csel x8, x8, x10, ne
6417 ; -O0: bl __atomic_compare_exchange
6419 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
6420 ; -O1: ldp x0, x1, [x0]
6422 ; -O1: csel x8, x1, x19, lt
6423 ; -O1: csel x9, x0, x21, lt
6424 ; -O1: bl __atomic_compare_exchange
6425 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
6429 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6430 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
6431 ; -O0: subs x8, x8, x10
6432 ; -O0: subs x8, x8, x10
6433 ; -O0: subs x8, x8, x11
6434 ; -O0: and w12, w12, #0x1
6435 ; -O0: ands w12, w12, #0x1
6436 ; -O0: csel w8, w8, w9, ne
6437 ; -O0: and w12, w8, #0x1
6438 ; -O0: ands w12, w12, #0x1
6439 ; -O0: csel x9, x9, x11, ne
6440 ; -O0: and w11, w8, #0x1
6441 ; -O0: ands w11, w11, #0x1
6442 ; -O0: csel x8, x8, x10, ne
6443 ; -O0: bl __atomic_compare_exchange
6445 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
6446 ; -O1: ldp x0, x1, [x0]
6448 ; -O1: csel x8, x1, x19, lt
6449 ; -O1: csel x9, x0, x21, lt
6450 ; -O1: bl __atomic_compare_exchange
6451 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
6455 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6456 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
6457 ; -O0: subs x8, x8, x10
6458 ; -O0: subs x8, x8, x10
6459 ; -O0: subs x8, x8, x11
6460 ; -O0: and w12, w12, #0x1
6461 ; -O0: ands w12, w12, #0x1
6462 ; -O0: csel w8, w8, w9, ne
6463 ; -O0: and w12, w8, #0x1
6464 ; -O0: ands w12, w12, #0x1
6465 ; -O0: csel x9, x9, x11, ne
6466 ; -O0: and w11, w8, #0x1
6467 ; -O0: ands w11, w11, #0x1
6468 ; -O0: csel x8, x8, x10, ne
6469 ; -O0: bl __atomic_compare_exchange
6471 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
6472 ; -O1: ldp x0, x1, [x0]
6474 ; -O1: csel x8, x1, x19, lt
6475 ; -O1: csel x9, x0, x21, lt
6476 ; -O1: bl __atomic_compare_exchange
6477 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
6481 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
6482 ; -O0-LABEL: atomicrmw_min_i8_aligned_monotonic:
6484 ; -O0: subs w9, w9, w8, sxtb
6485 ; -O0: and w9, w9, #0x1
6486 ; -O0: ands w9, w9, #0x1
6487 ; -O0: csel w12, w10, w8, ne
6488 ; -O0: ldaxrb w9, [x11]
6489 ; -O0: cmp w9, w10, uxtb
6490 ; -O0: stlxrb w8, w12, [x11]
6491 ; -O0: and w8, w9, #0xff
6492 ; -O0: subs w8, w8, w10, uxtb
6494 ; -O1-LABEL: atomicrmw_min_i8_aligned_monotonic:
6495 ; -O1: ldxrb w9, [x0]
6497 ; -O1: cmp w8, w1, sxtb
6498 ; -O1: csel w9, w9, w1, le
6499 ; -O1: stxrb w10, w9, [x0]
6500 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
6504 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
6505 ; -O0-LABEL: atomicrmw_min_i8_aligned_acquire:
6507 ; -O0: subs w9, w9, w8, sxtb
6508 ; -O0: and w9, w9, #0x1
6509 ; -O0: ands w9, w9, #0x1
6510 ; -O0: csel w12, w10, w8, ne
6511 ; -O0: ldaxrb w9, [x11]
6512 ; -O0: cmp w9, w10, uxtb
6513 ; -O0: stlxrb w8, w12, [x11]
6514 ; -O0: and w8, w9, #0xff
6515 ; -O0: subs w8, w8, w10, uxtb
6517 ; -O1-LABEL: atomicrmw_min_i8_aligned_acquire:
6518 ; -O1: ldaxrb w9, [x0]
6520 ; -O1: cmp w8, w1, sxtb
6521 ; -O1: csel w9, w9, w1, le
6522 ; -O1: stxrb w10, w9, [x0]
6523 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
6527 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
6528 ; -O0-LABEL: atomicrmw_min_i8_aligned_release:
6530 ; -O0: subs w9, w9, w8, sxtb
6531 ; -O0: and w9, w9, #0x1
6532 ; -O0: ands w9, w9, #0x1
6533 ; -O0: csel w12, w10, w8, ne
6534 ; -O0: ldaxrb w9, [x11]
6535 ; -O0: cmp w9, w10, uxtb
6536 ; -O0: stlxrb w8, w12, [x11]
6537 ; -O0: and w8, w9, #0xff
6538 ; -O0: subs w8, w8, w10, uxtb
6540 ; -O1-LABEL: atomicrmw_min_i8_aligned_release:
6541 ; -O1: ldxrb w9, [x0]
6543 ; -O1: cmp w8, w1, sxtb
6544 ; -O1: csel w9, w9, w1, le
6545 ; -O1: stlxrb w10, w9, [x0]
6546 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
6550 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
6551 ; -O0-LABEL: atomicrmw_min_i8_aligned_acq_rel:
6553 ; -O0: subs w9, w9, w8, sxtb
6554 ; -O0: and w9, w9, #0x1
6555 ; -O0: ands w9, w9, #0x1
6556 ; -O0: csel w12, w10, w8, ne
6557 ; -O0: ldaxrb w9, [x11]
6558 ; -O0: cmp w9, w10, uxtb
6559 ; -O0: stlxrb w8, w12, [x11]
6560 ; -O0: and w8, w9, #0xff
6561 ; -O0: subs w8, w8, w10, uxtb
6563 ; -O1-LABEL: atomicrmw_min_i8_aligned_acq_rel:
6564 ; -O1: ldaxrb w9, [x0]
6566 ; -O1: cmp w8, w1, sxtb
6567 ; -O1: csel w9, w9, w1, le
6568 ; -O1: stlxrb w10, w9, [x0]
6569 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
6573 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
6574 ; -O0-LABEL: atomicrmw_min_i8_aligned_seq_cst:
6576 ; -O0: subs w9, w9, w8, sxtb
6577 ; -O0: and w9, w9, #0x1
6578 ; -O0: ands w9, w9, #0x1
6579 ; -O0: csel w12, w10, w8, ne
6580 ; -O0: ldaxrb w9, [x11]
6581 ; -O0: cmp w9, w10, uxtb
6582 ; -O0: stlxrb w8, w12, [x11]
6583 ; -O0: and w8, w9, #0xff
6584 ; -O0: subs w8, w8, w10, uxtb
6586 ; -O1-LABEL: atomicrmw_min_i8_aligned_seq_cst:
6587 ; -O1: ldaxrb w9, [x0]
6589 ; -O1: cmp w8, w1, sxtb
6590 ; -O1: csel w9, w9, w1, le
6591 ; -O1: stlxrb w10, w9, [x0]
6592 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
6596 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
6597 ; -O0-LABEL: atomicrmw_min_i16_aligned_monotonic:
6599 ; -O0: subs w10, w10, w9, sxth
6600 ; -O0: and w10, w10, #0x1
6601 ; -O0: ands w10, w10, #0x1
6602 ; -O0: csel w12, w8, w9, ne
6603 ; -O0: ldaxrh w9, [x11]
6604 ; -O0: cmp w9, w8, uxth
6605 ; -O0: stlxrh w10, w12, [x11]
6606 ; -O0: subs w8, w8, w9, uxth
6608 ; -O1-LABEL: atomicrmw_min_i16_aligned_monotonic:
6609 ; -O1: ldxrh w9, [x0]
6611 ; -O1: cmp w8, w1, sxth
6612 ; -O1: csel w9, w9, w1, le
6613 ; -O1: stxrh w10, w9, [x0]
6614 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
6618 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
6619 ; -O0-LABEL: atomicrmw_min_i16_aligned_acquire:
6621 ; -O0: subs w10, w10, w9, sxth
6622 ; -O0: and w10, w10, #0x1
6623 ; -O0: ands w10, w10, #0x1
6624 ; -O0: csel w12, w8, w9, ne
6625 ; -O0: ldaxrh w9, [x11]
6626 ; -O0: cmp w9, w8, uxth
6627 ; -O0: stlxrh w10, w12, [x11]
6628 ; -O0: subs w8, w8, w9, uxth
6630 ; -O1-LABEL: atomicrmw_min_i16_aligned_acquire:
6631 ; -O1: ldaxrh w9, [x0]
6633 ; -O1: cmp w8, w1, sxth
6634 ; -O1: csel w9, w9, w1, le
6635 ; -O1: stxrh w10, w9, [x0]
6636 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
6640 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
6641 ; -O0-LABEL: atomicrmw_min_i16_aligned_release:
6643 ; -O0: subs w10, w10, w9, sxth
6644 ; -O0: and w10, w10, #0x1
6645 ; -O0: ands w10, w10, #0x1
6646 ; -O0: csel w12, w8, w9, ne
6647 ; -O0: ldaxrh w9, [x11]
6648 ; -O0: cmp w9, w8, uxth
6649 ; -O0: stlxrh w10, w12, [x11]
6650 ; -O0: subs w8, w8, w9, uxth
6652 ; -O1-LABEL: atomicrmw_min_i16_aligned_release:
6653 ; -O1: ldxrh w9, [x0]
6655 ; -O1: cmp w8, w1, sxth
6656 ; -O1: csel w9, w9, w1, le
6657 ; -O1: stlxrh w10, w9, [x0]
6658 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
6662 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6663 ; -O0-LABEL: atomicrmw_min_i16_aligned_acq_rel:
6665 ; -O0: subs w10, w10, w9, sxth
6666 ; -O0: and w10, w10, #0x1
6667 ; -O0: ands w10, w10, #0x1
6668 ; -O0: csel w12, w8, w9, ne
6669 ; -O0: ldaxrh w9, [x11]
6670 ; -O0: cmp w9, w8, uxth
6671 ; -O0: stlxrh w10, w12, [x11]
6672 ; -O0: subs w8, w8, w9, uxth
6674 ; -O1-LABEL: atomicrmw_min_i16_aligned_acq_rel:
6675 ; -O1: ldaxrh w9, [x0]
6677 ; -O1: cmp w8, w1, sxth
6678 ; -O1: csel w9, w9, w1, le
6679 ; -O1: stlxrh w10, w9, [x0]
6680 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
6684 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6685 ; -O0-LABEL: atomicrmw_min_i16_aligned_seq_cst:
6687 ; -O0: subs w10, w10, w9, sxth
6688 ; -O0: and w10, w10, #0x1
6689 ; -O0: ands w10, w10, #0x1
6690 ; -O0: csel w12, w8, w9, ne
6691 ; -O0: ldaxrh w9, [x11]
6692 ; -O0: cmp w9, w8, uxth
6693 ; -O0: stlxrh w10, w12, [x11]
6694 ; -O0: subs w8, w8, w9, uxth
6696 ; -O1-LABEL: atomicrmw_min_i16_aligned_seq_cst:
6697 ; -O1: ldaxrh w9, [x0]
6699 ; -O1: cmp w8, w1, sxth
6700 ; -O1: csel w9, w9, w1, le
6701 ; -O1: stlxrh w10, w9, [x0]
6702 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
6706 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6707 ; -O0-LABEL: atomicrmw_min_i32_aligned_monotonic:
6708 ; -O0: subs w10, w8, w9
6709 ; -O0: and w10, w10, #0x1
6710 ; -O0: ands w10, w10, #0x1
6711 ; -O0: csel w12, w8, w9, ne
6712 ; -O0: ldaxr w9, [x11]
6714 ; -O0: stlxr w10, w12, [x11]
6715 ; -O0: subs w8, w9, w8
6717 ; -O1-LABEL: atomicrmw_min_i32_aligned_monotonic:
6718 ; -O1: ldxr w8, [x0]
6720 ; -O1: csel w9, w8, w1, le
6721 ; -O1: stxr w10, w9, [x0]
6722 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
6726 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
6727 ; -O0-LABEL: atomicrmw_min_i32_aligned_acquire:
6728 ; -O0: subs w10, w8, w9
6729 ; -O0: and w10, w10, #0x1
6730 ; -O0: ands w10, w10, #0x1
6731 ; -O0: csel w12, w8, w9, ne
6732 ; -O0: ldaxr w9, [x11]
6734 ; -O0: stlxr w10, w12, [x11]
6735 ; -O0: subs w8, w9, w8
6737 ; -O1-LABEL: atomicrmw_min_i32_aligned_acquire:
6738 ; -O1: ldaxr w8, [x0]
6740 ; -O1: csel w9, w8, w1, le
6741 ; -O1: stxr w10, w9, [x0]
6742 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
6746 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
6747 ; -O0-LABEL: atomicrmw_min_i32_aligned_release:
6748 ; -O0: subs w10, w8, w9
6749 ; -O0: and w10, w10, #0x1
6750 ; -O0: ands w10, w10, #0x1
6751 ; -O0: csel w12, w8, w9, ne
6752 ; -O0: ldaxr w9, [x11]
6754 ; -O0: stlxr w10, w12, [x11]
6755 ; -O0: subs w8, w9, w8
6757 ; -O1-LABEL: atomicrmw_min_i32_aligned_release:
6758 ; -O1: ldxr w8, [x0]
6760 ; -O1: csel w9, w8, w1, le
6761 ; -O1: stlxr w10, w9, [x0]
6762 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
6766 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6767 ; -O0-LABEL: atomicrmw_min_i32_aligned_acq_rel:
6768 ; -O0: subs w10, w8, w9
6769 ; -O0: and w10, w10, #0x1
6770 ; -O0: ands w10, w10, #0x1
6771 ; -O0: csel w12, w8, w9, ne
6772 ; -O0: ldaxr w9, [x11]
6774 ; -O0: stlxr w10, w12, [x11]
6775 ; -O0: subs w8, w9, w8
6777 ; -O1-LABEL: atomicrmw_min_i32_aligned_acq_rel:
6778 ; -O1: ldaxr w8, [x0]
6780 ; -O1: csel w9, w8, w1, le
6781 ; -O1: stlxr w10, w9, [x0]
6782 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
6786 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6787 ; -O0-LABEL: atomicrmw_min_i32_aligned_seq_cst:
6788 ; -O0: subs w10, w8, w9
6789 ; -O0: and w10, w10, #0x1
6790 ; -O0: ands w10, w10, #0x1
6791 ; -O0: csel w12, w8, w9, ne
6792 ; -O0: ldaxr w9, [x11]
6794 ; -O0: stlxr w10, w12, [x11]
6795 ; -O0: subs w8, w9, w8
6797 ; -O1-LABEL: atomicrmw_min_i32_aligned_seq_cst:
6798 ; -O1: ldaxr w8, [x0]
6800 ; -O1: csel w9, w8, w1, le
6801 ; -O1: stlxr w10, w9, [x0]
6802 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
6806 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6807 ; -O0-LABEL: atomicrmw_min_i64_aligned_monotonic:
6808 ; -O0: subs x10, x8, x9
6809 ; -O0: and w10, w10, #0x1
6810 ; -O0: ands w10, w10, #0x1
6811 ; -O0: csel x12, x8, x9, ne
6812 ; -O0: ldaxr x9, [x11]
6814 ; -O0: stlxr w10, x12, [x11]
6815 ; -O0: subs x8, x9, x8
6817 ; -O1-LABEL: atomicrmw_min_i64_aligned_monotonic:
6818 ; -O1: ldxr x0, [x8]
6820 ; -O1: csel x9, x0, x1, le
6821 ; -O1: stxr w10, x9, [x8]
6822 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
6826 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
6827 ; -O0-LABEL: atomicrmw_min_i64_aligned_acquire:
6828 ; -O0: subs x10, x8, x9
6829 ; -O0: and w10, w10, #0x1
6830 ; -O0: ands w10, w10, #0x1
6831 ; -O0: csel x12, x8, x9, ne
6832 ; -O0: ldaxr x9, [x11]
6834 ; -O0: stlxr w10, x12, [x11]
6835 ; -O0: subs x8, x9, x8
6837 ; -O1-LABEL: atomicrmw_min_i64_aligned_acquire:
6838 ; -O1: ldaxr x0, [x8]
6840 ; -O1: csel x9, x0, x1, le
6841 ; -O1: stxr w10, x9, [x8]
6842 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
6846 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
6847 ; -O0-LABEL: atomicrmw_min_i64_aligned_release:
6848 ; -O0: subs x10, x8, x9
6849 ; -O0: and w10, w10, #0x1
6850 ; -O0: ands w10, w10, #0x1
6851 ; -O0: csel x12, x8, x9, ne
6852 ; -O0: ldaxr x9, [x11]
6854 ; -O0: stlxr w10, x12, [x11]
6855 ; -O0: subs x8, x9, x8
6857 ; -O1-LABEL: atomicrmw_min_i64_aligned_release:
6858 ; -O1: ldxr x0, [x8]
6860 ; -O1: csel x9, x0, x1, le
6861 ; -O1: stlxr w10, x9, [x8]
6862 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
6866 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6867 ; -O0-LABEL: atomicrmw_min_i64_aligned_acq_rel:
6868 ; -O0: subs x10, x8, x9
6869 ; -O0: and w10, w10, #0x1
6870 ; -O0: ands w10, w10, #0x1
6871 ; -O0: csel x12, x8, x9, ne
6872 ; -O0: ldaxr x9, [x11]
6874 ; -O0: stlxr w10, x12, [x11]
6875 ; -O0: subs x8, x9, x8
6877 ; -O1-LABEL: atomicrmw_min_i64_aligned_acq_rel:
6878 ; -O1: ldaxr x0, [x8]
6880 ; -O1: csel x9, x0, x1, le
6881 ; -O1: stlxr w10, x9, [x8]
6882 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
6886 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6887 ; -O0-LABEL: atomicrmw_min_i64_aligned_seq_cst:
6888 ; -O0: subs x10, x8, x9
6889 ; -O0: and w10, w10, #0x1
6890 ; -O0: ands w10, w10, #0x1
6891 ; -O0: csel x12, x8, x9, ne
6892 ; -O0: ldaxr x9, [x11]
6894 ; -O0: stlxr w10, x12, [x11]
6895 ; -O0: subs x8, x9, x8
6897 ; -O1-LABEL: atomicrmw_min_i64_aligned_seq_cst:
6898 ; -O1: ldaxr x0, [x8]
6900 ; -O1: csel x9, x0, x1, le
6901 ; -O1: stlxr w10, x9, [x8]
6902 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
6906 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6907 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
6908 ; -O0: subs x8, x8, x9
6909 ; -O0: subs x8, x8, x9
6910 ; -O0: subs x8, x8, x12
6911 ; -O0: and w13, w13, #0x1
6912 ; -O0: ands w13, w13, #0x1
6913 ; -O0: csel w8, w8, w10, ne
6914 ; -O0: and w13, w8, #0x1
6915 ; -O0: ands w13, w13, #0x1
6916 ; -O0: csel x14, x10, x12, ne
6917 ; -O0: and w10, w8, #0x1
6918 ; -O0: ands w10, w10, #0x1
6919 ; -O0: csel x15, x8, x9, ne
6920 ; -O0: ldxp x10, x9, [x11]
6923 ; -O0: stxp w8, x14, x15, [x11]
6924 ; -O0: stxp w8, x10, x9, [x11]
6925 ; -O0: eor x8, x10, x8
6926 ; -O0: eor x11, x9, x11
6927 ; -O0: orr x8, x8, x11
6928 ; -O0: subs x8, x8, #0
6930 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
6931 ; -O1: ldxp x0, x1, [x8]
6933 ; -O1: csel x9, x1, x3, ge
6934 ; -O1: csel x10, x0, x2, ge
6935 ; -O1: stxp w11, x10, x9, [x8]
6936 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
6940 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
6941 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
6942 ; -O0: subs x8, x8, x9
6943 ; -O0: subs x8, x8, x9
6944 ; -O0: subs x8, x8, x12
6945 ; -O0: and w13, w13, #0x1
6946 ; -O0: ands w13, w13, #0x1
6947 ; -O0: csel w8, w8, w10, ne
6948 ; -O0: and w13, w8, #0x1
6949 ; -O0: ands w13, w13, #0x1
6950 ; -O0: csel x14, x10, x12, ne
6951 ; -O0: and w10, w8, #0x1
6952 ; -O0: ands w10, w10, #0x1
6953 ; -O0: csel x15, x8, x9, ne
6954 ; -O0: ldaxp x10, x9, [x11]
6957 ; -O0: stxp w8, x14, x15, [x11]
6958 ; -O0: stxp w8, x10, x9, [x11]
6959 ; -O0: eor x8, x10, x8
6960 ; -O0: eor x11, x9, x11
6961 ; -O0: orr x8, x8, x11
6962 ; -O0: subs x8, x8, #0
6964 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
6965 ; -O1: ldaxp x0, x1, [x8]
6967 ; -O1: csel x9, x1, x3, ge
6968 ; -O1: csel x10, x0, x2, ge
6969 ; -O1: stxp w11, x10, x9, [x8]
6970 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
6974 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
6975 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
6976 ; -O0: subs x8, x8, x9
6977 ; -O0: subs x8, x8, x9
6978 ; -O0: subs x8, x8, x12
6979 ; -O0: and w13, w13, #0x1
6980 ; -O0: ands w13, w13, #0x1
6981 ; -O0: csel w8, w8, w10, ne
6982 ; -O0: and w13, w8, #0x1
6983 ; -O0: ands w13, w13, #0x1
6984 ; -O0: csel x14, x10, x12, ne
6985 ; -O0: and w10, w8, #0x1
6986 ; -O0: ands w10, w10, #0x1
6987 ; -O0: csel x15, x8, x9, ne
6988 ; -O0: ldxp x10, x9, [x11]
6991 ; -O0: stlxp w8, x14, x15, [x11]
6992 ; -O0: stlxp w8, x10, x9, [x11]
6993 ; -O0: eor x8, x10, x8
6994 ; -O0: eor x11, x9, x11
6995 ; -O0: orr x8, x8, x11
6996 ; -O0: subs x8, x8, #0
6998 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
6999 ; -O1: ldxp x0, x1, [x8]
7001 ; -O1: csel x9, x1, x3, ge
7002 ; -O1: csel x10, x0, x2, ge
7003 ; -O1: stlxp w11, x10, x9, [x8]
7004 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
7008 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
7009 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
7010 ; -O0: subs x8, x8, x9
7011 ; -O0: subs x8, x8, x9
7012 ; -O0: subs x8, x8, x12
7013 ; -O0: and w13, w13, #0x1
7014 ; -O0: ands w13, w13, #0x1
7015 ; -O0: csel w8, w8, w10, ne
7016 ; -O0: and w13, w8, #0x1
7017 ; -O0: ands w13, w13, #0x1
7018 ; -O0: csel x14, x10, x12, ne
7019 ; -O0: and w10, w8, #0x1
7020 ; -O0: ands w10, w10, #0x1
7021 ; -O0: csel x15, x8, x9, ne
7022 ; -O0: ldaxp x10, x9, [x11]
7025 ; -O0: stlxp w8, x14, x15, [x11]
7026 ; -O0: stlxp w8, x10, x9, [x11]
7027 ; -O0: eor x8, x10, x8
7028 ; -O0: eor x11, x9, x11
7029 ; -O0: orr x8, x8, x11
7030 ; -O0: subs x8, x8, #0
7032 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
7033 ; -O1: ldaxp x0, x1, [x8]
7035 ; -O1: csel x9, x1, x3, ge
7036 ; -O1: csel x10, x0, x2, ge
7037 ; -O1: stlxp w11, x10, x9, [x8]
7038 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
7042 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
7043 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
7044 ; -O0: subs x8, x8, x9
7045 ; -O0: subs x8, x8, x9
7046 ; -O0: subs x8, x8, x12
7047 ; -O0: and w13, w13, #0x1
7048 ; -O0: ands w13, w13, #0x1
7049 ; -O0: csel w8, w8, w10, ne
7050 ; -O0: and w13, w8, #0x1
7051 ; -O0: ands w13, w13, #0x1
7052 ; -O0: csel x14, x10, x12, ne
7053 ; -O0: and w10, w8, #0x1
7054 ; -O0: ands w10, w10, #0x1
7055 ; -O0: csel x15, x8, x9, ne
7056 ; -O0: ldaxp x10, x9, [x11]
7059 ; -O0: stlxp w8, x14, x15, [x11]
7060 ; -O0: stlxp w8, x10, x9, [x11]
7061 ; -O0: eor x8, x10, x8
7062 ; -O0: eor x11, x9, x11
7063 ; -O0: orr x8, x8, x11
7064 ; -O0: subs x8, x8, #0
7066 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
7067 ; -O1: ldaxp x0, x1, [x8]
7069 ; -O1: csel x9, x1, x3, ge
7070 ; -O1: csel x10, x0, x2, ge
7071 ; -O1: stlxp w11, x10, x9, [x8]
7072 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
7076 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
7077 ; -O0-LABEL: atomicrmw_min_i8_unaligned_monotonic:
7079 ; -O0: subs w9, w9, w8, sxtb
7080 ; -O0: and w9, w9, #0x1
7081 ; -O0: ands w9, w9, #0x1
7082 ; -O0: csel w12, w10, w8, ne
7083 ; -O0: ldaxrb w9, [x11]
7084 ; -O0: cmp w9, w10, uxtb
7085 ; -O0: stlxrb w8, w12, [x11]
7086 ; -O0: and w8, w9, #0xff
7087 ; -O0: subs w8, w8, w10, uxtb
7089 ; -O1-LABEL: atomicrmw_min_i8_unaligned_monotonic:
7090 ; -O1: ldxrb w9, [x0]
7092 ; -O1: cmp w8, w1, sxtb
7093 ; -O1: csel w9, w9, w1, le
7094 ; -O1: stxrb w10, w9, [x0]
7095 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
7099 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
7100 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acquire:
7102 ; -O0: subs w9, w9, w8, sxtb
7103 ; -O0: and w9, w9, #0x1
7104 ; -O0: ands w9, w9, #0x1
7105 ; -O0: csel w12, w10, w8, ne
7106 ; -O0: ldaxrb w9, [x11]
7107 ; -O0: cmp w9, w10, uxtb
7108 ; -O0: stlxrb w8, w12, [x11]
7109 ; -O0: and w8, w9, #0xff
7110 ; -O0: subs w8, w8, w10, uxtb
7112 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acquire:
7113 ; -O1: ldaxrb w9, [x0]
7115 ; -O1: cmp w8, w1, sxtb
7116 ; -O1: csel w9, w9, w1, le
7117 ; -O1: stxrb w10, w9, [x0]
7118 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
7122 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
7123 ; -O0-LABEL: atomicrmw_min_i8_unaligned_release:
7125 ; -O0: subs w9, w9, w8, sxtb
7126 ; -O0: and w9, w9, #0x1
7127 ; -O0: ands w9, w9, #0x1
7128 ; -O0: csel w12, w10, w8, ne
7129 ; -O0: ldaxrb w9, [x11]
7130 ; -O0: cmp w9, w10, uxtb
7131 ; -O0: stlxrb w8, w12, [x11]
7132 ; -O0: and w8, w9, #0xff
7133 ; -O0: subs w8, w8, w10, uxtb
7135 ; -O1-LABEL: atomicrmw_min_i8_unaligned_release:
7136 ; -O1: ldxrb w9, [x0]
7138 ; -O1: cmp w8, w1, sxtb
7139 ; -O1: csel w9, w9, w1, le
7140 ; -O1: stlxrb w10, w9, [x0]
7141 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
7145 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
7146 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
7148 ; -O0: subs w9, w9, w8, sxtb
7149 ; -O0: and w9, w9, #0x1
7150 ; -O0: ands w9, w9, #0x1
7151 ; -O0: csel w12, w10, w8, ne
7152 ; -O0: ldaxrb w9, [x11]
7153 ; -O0: cmp w9, w10, uxtb
7154 ; -O0: stlxrb w8, w12, [x11]
7155 ; -O0: and w8, w9, #0xff
7156 ; -O0: subs w8, w8, w10, uxtb
7158 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
7159 ; -O1: ldaxrb w9, [x0]
7161 ; -O1: cmp w8, w1, sxtb
7162 ; -O1: csel w9, w9, w1, le
7163 ; -O1: stlxrb w10, w9, [x0]
7164 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
7168 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
7169 ; -O0-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
7171 ; -O0: subs w9, w9, w8, sxtb
7172 ; -O0: and w9, w9, #0x1
7173 ; -O0: ands w9, w9, #0x1
7174 ; -O0: csel w12, w10, w8, ne
7175 ; -O0: ldaxrb w9, [x11]
7176 ; -O0: cmp w9, w10, uxtb
7177 ; -O0: stlxrb w8, w12, [x11]
7178 ; -O0: and w8, w9, #0xff
7179 ; -O0: subs w8, w8, w10, uxtb
7181 ; -O1-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
7182 ; -O1: ldaxrb w9, [x0]
7184 ; -O1: cmp w8, w1, sxtb
7185 ; -O1: csel w9, w9, w1, le
7186 ; -O1: stlxrb w10, w9, [x0]
7187 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
7191 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
7192 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
7194 ; -O0: subs w10, w10, w8, sxth
7195 ; -O0: and w10, w10, #0x1
7196 ; -O0: ands w10, w10, #0x1
7197 ; -O0: csel w8, w9, w8, ne
7198 ; -O0: bl __atomic_compare_exchange
7200 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
7202 ; -O1: cmp w8, w20, sxth
7203 ; -O1: csel w8, w0, w20, le
7204 ; -O1: bl __atomic_compare_exchange
7205 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
7209 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
7210 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
7212 ; -O0: subs w10, w10, w8, sxth
7213 ; -O0: and w10, w10, #0x1
7214 ; -O0: ands w10, w10, #0x1
7215 ; -O0: csel w8, w9, w8, ne
7216 ; -O0: bl __atomic_compare_exchange
7218 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
7220 ; -O1: cmp w8, w20, sxth
7221 ; -O1: csel w8, w0, w20, le
7222 ; -O1: bl __atomic_compare_exchange
7223 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
7227 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
7228 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
7230 ; -O0: subs w10, w10, w8, sxth
7231 ; -O0: and w10, w10, #0x1
7232 ; -O0: ands w10, w10, #0x1
7233 ; -O0: csel w8, w9, w8, ne
7234 ; -O0: bl __atomic_compare_exchange
7236 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
7238 ; -O1: cmp w8, w20, sxth
7239 ; -O1: csel w8, w0, w20, le
7240 ; -O1: bl __atomic_compare_exchange
7241 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
7245 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
7246 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
7248 ; -O0: subs w10, w10, w8, sxth
7249 ; -O0: and w10, w10, #0x1
7250 ; -O0: ands w10, w10, #0x1
7251 ; -O0: csel w8, w9, w8, ne
7252 ; -O0: bl __atomic_compare_exchange
7254 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
7256 ; -O1: cmp w8, w20, sxth
7257 ; -O1: csel w8, w0, w20, le
7258 ; -O1: bl __atomic_compare_exchange
7259 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
7263 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
7264 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
7266 ; -O0: subs w10, w10, w8, sxth
7267 ; -O0: and w10, w10, #0x1
7268 ; -O0: ands w10, w10, #0x1
7269 ; -O0: csel w8, w9, w8, ne
7270 ; -O0: bl __atomic_compare_exchange
7272 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
7274 ; -O1: cmp w8, w20, sxth
7275 ; -O1: csel w8, w0, w20, le
7276 ; -O1: bl __atomic_compare_exchange
7277 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
7281 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
7282 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
7283 ; -O0: subs w10, w9, w8
7284 ; -O0: and w10, w10, #0x1
7285 ; -O0: ands w10, w10, #0x1
7286 ; -O0: csel w8, w9, w8, ne
7287 ; -O0: bl __atomic_compare_exchange
7289 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
7291 ; -O1: csel w8, w0, w20, le
7292 ; -O1: bl __atomic_compare_exchange
7293 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
7297 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
7298 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
7299 ; -O0: subs w10, w9, w8
7300 ; -O0: and w10, w10, #0x1
7301 ; -O0: ands w10, w10, #0x1
7302 ; -O0: csel w8, w9, w8, ne
7303 ; -O0: bl __atomic_compare_exchange
7305 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
7307 ; -O1: csel w8, w0, w20, le
7308 ; -O1: bl __atomic_compare_exchange
7309 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
7313 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
7314 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
7315 ; -O0: subs w10, w9, w8
7316 ; -O0: and w10, w10, #0x1
7317 ; -O0: ands w10, w10, #0x1
7318 ; -O0: csel w8, w9, w8, ne
7319 ; -O0: bl __atomic_compare_exchange
7321 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
7323 ; -O1: csel w8, w0, w20, le
7324 ; -O1: bl __atomic_compare_exchange
7325 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
7329 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
7330 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
7331 ; -O0: subs w10, w9, w8
7332 ; -O0: and w10, w10, #0x1
7333 ; -O0: ands w10, w10, #0x1
7334 ; -O0: csel w8, w9, w8, ne
7335 ; -O0: bl __atomic_compare_exchange
7337 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
7339 ; -O1: csel w8, w0, w20, le
7340 ; -O1: bl __atomic_compare_exchange
7341 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
7345 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
7346 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
7347 ; -O0: subs w10, w9, w8
7348 ; -O0: and w10, w10, #0x1
7349 ; -O0: ands w10, w10, #0x1
7350 ; -O0: csel w8, w9, w8, ne
7351 ; -O0: bl __atomic_compare_exchange
7353 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
7355 ; -O1: csel w8, w0, w20, le
7356 ; -O1: bl __atomic_compare_exchange
7357 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
7361 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
7362 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
7363 ; -O0: subs x10, x9, x8
7364 ; -O0: and w10, w10, #0x1
7365 ; -O0: ands w10, w10, #0x1
7366 ; -O0: csel x8, x9, x8, ne
7367 ; -O0: bl __atomic_compare_exchange
7369 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
7371 ; -O1: csel x8, x0, x20, le
7372 ; -O1: bl __atomic_compare_exchange
7373 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
7377 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
7378 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
7379 ; -O0: subs x10, x9, x8
7380 ; -O0: and w10, w10, #0x1
7381 ; -O0: ands w10, w10, #0x1
7382 ; -O0: csel x8, x9, x8, ne
7383 ; -O0: bl __atomic_compare_exchange
7385 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
7387 ; -O1: csel x8, x0, x20, le
7388 ; -O1: bl __atomic_compare_exchange
7389 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
7393 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
7394 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
7395 ; -O0: subs x10, x9, x8
7396 ; -O0: and w10, w10, #0x1
7397 ; -O0: ands w10, w10, #0x1
7398 ; -O0: csel x8, x9, x8, ne
7399 ; -O0: bl __atomic_compare_exchange
7401 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
7403 ; -O1: csel x8, x0, x20, le
7404 ; -O1: bl __atomic_compare_exchange
7405 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
7409 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
7410 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
7411 ; -O0: subs x10, x9, x8
7412 ; -O0: and w10, w10, #0x1
7413 ; -O0: ands w10, w10, #0x1
7414 ; -O0: csel x8, x9, x8, ne
7415 ; -O0: bl __atomic_compare_exchange
7417 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
7419 ; -O1: csel x8, x0, x20, le
7420 ; -O1: bl __atomic_compare_exchange
7421 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
7425 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
7426 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
7427 ; -O0: subs x10, x9, x8
7428 ; -O0: and w10, w10, #0x1
7429 ; -O0: ands w10, w10, #0x1
7430 ; -O0: csel x8, x9, x8, ne
7431 ; -O0: bl __atomic_compare_exchange
7433 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
7435 ; -O1: csel x8, x0, x20, le
7436 ; -O1: bl __atomic_compare_exchange
7437 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
7441 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
7442 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
7443 ; -O0: subs x8, x8, x10
7444 ; -O0: subs x8, x8, x10
7445 ; -O0: subs x8, x8, x11
7446 ; -O0: and w12, w12, #0x1
7447 ; -O0: ands w12, w12, #0x1
7448 ; -O0: csel w8, w8, w9, ne
7449 ; -O0: and w12, w8, #0x1
7450 ; -O0: ands w12, w12, #0x1
7451 ; -O0: csel x9, x9, x11, ne
7452 ; -O0: and w11, w8, #0x1
7453 ; -O0: ands w11, w11, #0x1
7454 ; -O0: csel x8, x8, x10, ne
7455 ; -O0: bl __atomic_compare_exchange
7457 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
7458 ; -O1: ldp x0, x1, [x0]
7460 ; -O1: csel x8, x1, x19, ge
7461 ; -O1: csel x9, x0, x21, ge
7462 ; -O1: bl __atomic_compare_exchange
7463 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
7467 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
7468 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
7469 ; -O0: subs x8, x8, x10
7470 ; -O0: subs x8, x8, x10
7471 ; -O0: subs x8, x8, x11
7472 ; -O0: and w12, w12, #0x1
7473 ; -O0: ands w12, w12, #0x1
7474 ; -O0: csel w8, w8, w9, ne
7475 ; -O0: and w12, w8, #0x1
7476 ; -O0: ands w12, w12, #0x1
7477 ; -O0: csel x9, x9, x11, ne
7478 ; -O0: and w11, w8, #0x1
7479 ; -O0: ands w11, w11, #0x1
7480 ; -O0: csel x8, x8, x10, ne
7481 ; -O0: bl __atomic_compare_exchange
7483 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
7484 ; -O1: ldp x0, x1, [x0]
7486 ; -O1: csel x8, x1, x19, ge
7487 ; -O1: csel x9, x0, x21, ge
7488 ; -O1: bl __atomic_compare_exchange
7489 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
7493 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
7494 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
7495 ; -O0: subs x8, x8, x10
7496 ; -O0: subs x8, x8, x10
7497 ; -O0: subs x8, x8, x11
7498 ; -O0: and w12, w12, #0x1
7499 ; -O0: ands w12, w12, #0x1
7500 ; -O0: csel w8, w8, w9, ne
7501 ; -O0: and w12, w8, #0x1
7502 ; -O0: ands w12, w12, #0x1
7503 ; -O0: csel x9, x9, x11, ne
7504 ; -O0: and w11, w8, #0x1
7505 ; -O0: ands w11, w11, #0x1
7506 ; -O0: csel x8, x8, x10, ne
7507 ; -O0: bl __atomic_compare_exchange
7509 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
7510 ; -O1: ldp x0, x1, [x0]
7512 ; -O1: csel x8, x1, x19, ge
7513 ; -O1: csel x9, x0, x21, ge
7514 ; -O1: bl __atomic_compare_exchange
7515 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
7519 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
7520 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
7521 ; -O0: subs x8, x8, x10
7522 ; -O0: subs x8, x8, x10
7523 ; -O0: subs x8, x8, x11
7524 ; -O0: and w12, w12, #0x1
7525 ; -O0: ands w12, w12, #0x1
7526 ; -O0: csel w8, w8, w9, ne
7527 ; -O0: and w12, w8, #0x1
7528 ; -O0: ands w12, w12, #0x1
7529 ; -O0: csel x9, x9, x11, ne
7530 ; -O0: and w11, w8, #0x1
7531 ; -O0: ands w11, w11, #0x1
7532 ; -O0: csel x8, x8, x10, ne
7533 ; -O0: bl __atomic_compare_exchange
7535 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
7536 ; -O1: ldp x0, x1, [x0]
7538 ; -O1: csel x8, x1, x19, ge
7539 ; -O1: csel x9, x0, x21, ge
7540 ; -O1: bl __atomic_compare_exchange
7541 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
7545 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
7546 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
7547 ; -O0: subs x8, x8, x10
7548 ; -O0: subs x8, x8, x10
7549 ; -O0: subs x8, x8, x11
7550 ; -O0: and w12, w12, #0x1
7551 ; -O0: ands w12, w12, #0x1
7552 ; -O0: csel w8, w8, w9, ne
7553 ; -O0: and w12, w8, #0x1
7554 ; -O0: ands w12, w12, #0x1
7555 ; -O0: csel x9, x9, x11, ne
7556 ; -O0: and w11, w8, #0x1
7557 ; -O0: ands w11, w11, #0x1
7558 ; -O0: csel x8, x8, x10, ne
7559 ; -O0: bl __atomic_compare_exchange
7561 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
7562 ; -O1: ldp x0, x1, [x0]
7564 ; -O1: csel x8, x1, x19, ge
7565 ; -O1: csel x9, x0, x21, ge
7566 ; -O1: bl __atomic_compare_exchange
7567 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
7571 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
7572 ; -O0-LABEL: atomicrmw_umax_i8_aligned_monotonic:
7573 ; -O0: and w9, w10, #0xff
7574 ; -O0: subs w9, w9, w8, uxtb
7575 ; -O0: and w9, w9, #0x1
7576 ; -O0: ands w9, w9, #0x1
7577 ; -O0: csel w12, w10, w8, ne
7578 ; -O0: ldaxrb w9, [x11]
7579 ; -O0: cmp w9, w10, uxtb
7580 ; -O0: stlxrb w8, w12, [x11]
7581 ; -O0: and w8, w9, #0xff
7582 ; -O0: subs w8, w8, w10, uxtb
7584 ; -O1-LABEL: atomicrmw_umax_i8_aligned_monotonic:
7585 ; -O1: and w9, w1, #0xff
7586 ; -O1: ldxrb w8, [x0]
7588 ; -O1: csel w10, w8, w9, hi
7589 ; -O1: stxrb w11, w10, [x0]
7590 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
7594 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
7595 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acquire:
7596 ; -O0: and w9, w10, #0xff
7597 ; -O0: subs w9, w9, w8, uxtb
7598 ; -O0: and w9, w9, #0x1
7599 ; -O0: ands w9, w9, #0x1
7600 ; -O0: csel w12, w10, w8, ne
7601 ; -O0: ldaxrb w9, [x11]
7602 ; -O0: cmp w9, w10, uxtb
7603 ; -O0: stlxrb w8, w12, [x11]
7604 ; -O0: and w8, w9, #0xff
7605 ; -O0: subs w8, w8, w10, uxtb
7607 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acquire:
7608 ; -O1: and w9, w1, #0xff
7609 ; -O1: ldaxrb w8, [x0]
7611 ; -O1: csel w10, w8, w9, hi
7612 ; -O1: stxrb w11, w10, [x0]
7613 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
7617 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
7618 ; -O0-LABEL: atomicrmw_umax_i8_aligned_release:
7619 ; -O0: and w9, w10, #0xff
7620 ; -O0: subs w9, w9, w8, uxtb
7621 ; -O0: and w9, w9, #0x1
7622 ; -O0: ands w9, w9, #0x1
7623 ; -O0: csel w12, w10, w8, ne
7624 ; -O0: ldaxrb w9, [x11]
7625 ; -O0: cmp w9, w10, uxtb
7626 ; -O0: stlxrb w8, w12, [x11]
7627 ; -O0: and w8, w9, #0xff
7628 ; -O0: subs w8, w8, w10, uxtb
7630 ; -O1-LABEL: atomicrmw_umax_i8_aligned_release:
7631 ; -O1: and w9, w1, #0xff
7632 ; -O1: ldxrb w8, [x0]
7634 ; -O1: csel w10, w8, w9, hi
7635 ; -O1: stlxrb w11, w10, [x0]
7636 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
7640 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
7641 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
7642 ; -O0: and w9, w10, #0xff
7643 ; -O0: subs w9, w9, w8, uxtb
7644 ; -O0: and w9, w9, #0x1
7645 ; -O0: ands w9, w9, #0x1
7646 ; -O0: csel w12, w10, w8, ne
7647 ; -O0: ldaxrb w9, [x11]
7648 ; -O0: cmp w9, w10, uxtb
7649 ; -O0: stlxrb w8, w12, [x11]
7650 ; -O0: and w8, w9, #0xff
7651 ; -O0: subs w8, w8, w10, uxtb
7653 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
7654 ; -O1: and w9, w1, #0xff
7655 ; -O1: ldaxrb w8, [x0]
7657 ; -O1: csel w10, w8, w9, hi
7658 ; -O1: stlxrb w11, w10, [x0]
7659 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
7663 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
7664 ; -O0-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
7665 ; -O0: and w9, w10, #0xff
7666 ; -O0: subs w9, w9, w8, uxtb
7667 ; -O0: and w9, w9, #0x1
7668 ; -O0: ands w9, w9, #0x1
7669 ; -O0: csel w12, w10, w8, ne
7670 ; -O0: ldaxrb w9, [x11]
7671 ; -O0: cmp w9, w10, uxtb
7672 ; -O0: stlxrb w8, w12, [x11]
7673 ; -O0: and w8, w9, #0xff
7674 ; -O0: subs w8, w8, w10, uxtb
7676 ; -O1-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
7677 ; -O1: and w9, w1, #0xff
7678 ; -O1: ldaxrb w8, [x0]
7680 ; -O1: csel w10, w8, w9, hi
7681 ; -O1: stlxrb w11, w10, [x0]
7682 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
7686 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
7687 ; -O0-LABEL: atomicrmw_umax_i16_aligned_monotonic:
7688 ; -O0: subs w10, w10, w9, uxth
7689 ; -O0: and w10, w10, #0x1
7690 ; -O0: ands w10, w10, #0x1
7691 ; -O0: csel w12, w8, w9, ne
7692 ; -O0: ldaxrh w9, [x11]
7693 ; -O0: cmp w9, w8, uxth
7694 ; -O0: stlxrh w10, w12, [x11]
7695 ; -O0: subs w8, w8, w9, uxth
7697 ; -O1-LABEL: atomicrmw_umax_i16_aligned_monotonic:
7698 ; -O1: and w9, w1, #0xffff
7699 ; -O1: ldxrh w8, [x0]
7701 ; -O1: csel w10, w8, w9, hi
7702 ; -O1: stxrh w11, w10, [x0]
7703 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
7707 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
7708 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acquire:
7709 ; -O0: subs w10, w10, w9, uxth
7710 ; -O0: and w10, w10, #0x1
7711 ; -O0: ands w10, w10, #0x1
7712 ; -O0: csel w12, w8, w9, ne
7713 ; -O0: ldaxrh w9, [x11]
7714 ; -O0: cmp w9, w8, uxth
7715 ; -O0: stlxrh w10, w12, [x11]
7716 ; -O0: subs w8, w8, w9, uxth
7718 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acquire:
7719 ; -O1: and w9, w1, #0xffff
7720 ; -O1: ldaxrh w8, [x0]
7722 ; -O1: csel w10, w8, w9, hi
7723 ; -O1: stxrh w11, w10, [x0]
7724 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
7728 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
7729 ; -O0-LABEL: atomicrmw_umax_i16_aligned_release:
7730 ; -O0: subs w10, w10, w9, uxth
7731 ; -O0: and w10, w10, #0x1
7732 ; -O0: ands w10, w10, #0x1
7733 ; -O0: csel w12, w8, w9, ne
7734 ; -O0: ldaxrh w9, [x11]
7735 ; -O0: cmp w9, w8, uxth
7736 ; -O0: stlxrh w10, w12, [x11]
7737 ; -O0: subs w8, w8, w9, uxth
7739 ; -O1-LABEL: atomicrmw_umax_i16_aligned_release:
7740 ; -O1: and w9, w1, #0xffff
7741 ; -O1: ldxrh w8, [x0]
7743 ; -O1: csel w10, w8, w9, hi
7744 ; -O1: stlxrh w11, w10, [x0]
7745 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
7749 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
7750 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
7751 ; -O0: subs w10, w10, w9, uxth
7752 ; -O0: and w10, w10, #0x1
7753 ; -O0: ands w10, w10, #0x1
7754 ; -O0: csel w12, w8, w9, ne
7755 ; -O0: ldaxrh w9, [x11]
7756 ; -O0: cmp w9, w8, uxth
7757 ; -O0: stlxrh w10, w12, [x11]
7758 ; -O0: subs w8, w8, w9, uxth
7760 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
7761 ; -O1: and w9, w1, #0xffff
7762 ; -O1: ldaxrh w8, [x0]
7764 ; -O1: csel w10, w8, w9, hi
7765 ; -O1: stlxrh w11, w10, [x0]
7766 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
7770 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
7771 ; -O0-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
7772 ; -O0: subs w10, w10, w9, uxth
7773 ; -O0: and w10, w10, #0x1
7774 ; -O0: ands w10, w10, #0x1
7775 ; -O0: csel w12, w8, w9, ne
7776 ; -O0: ldaxrh w9, [x11]
7777 ; -O0: cmp w9, w8, uxth
7778 ; -O0: stlxrh w10, w12, [x11]
7779 ; -O0: subs w8, w8, w9, uxth
7781 ; -O1-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
7782 ; -O1: and w9, w1, #0xffff
7783 ; -O1: ldaxrh w8, [x0]
7785 ; -O1: csel w10, w8, w9, hi
7786 ; -O1: stlxrh w11, w10, [x0]
7787 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
7791 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
7792 ; -O0-LABEL: atomicrmw_umax_i32_aligned_monotonic:
7793 ; -O0: subs w10, w8, w9
7794 ; -O0: and w10, w10, #0x1
7795 ; -O0: ands w10, w10, #0x1
7796 ; -O0: csel w12, w8, w9, ne
7797 ; -O0: ldaxr w9, [x11]
7799 ; -O0: stlxr w10, w12, [x11]
7800 ; -O0: subs w8, w9, w8
7802 ; -O1-LABEL: atomicrmw_umax_i32_aligned_monotonic:
7803 ; -O1: ldxr w8, [x0]
7805 ; -O1: csel w9, w8, w1, hi
7806 ; -O1: stxr w10, w9, [x0]
7807 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
7811 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
7812 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acquire:
7813 ; -O0: subs w10, w8, w9
7814 ; -O0: and w10, w10, #0x1
7815 ; -O0: ands w10, w10, #0x1
7816 ; -O0: csel w12, w8, w9, ne
7817 ; -O0: ldaxr w9, [x11]
7819 ; -O0: stlxr w10, w12, [x11]
7820 ; -O0: subs w8, w9, w8
7822 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acquire:
7823 ; -O1: ldaxr w8, [x0]
7825 ; -O1: csel w9, w8, w1, hi
7826 ; -O1: stxr w10, w9, [x0]
7827 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
7831 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
7832 ; -O0-LABEL: atomicrmw_umax_i32_aligned_release:
7833 ; -O0: subs w10, w8, w9
7834 ; -O0: and w10, w10, #0x1
7835 ; -O0: ands w10, w10, #0x1
7836 ; -O0: csel w12, w8, w9, ne
7837 ; -O0: ldaxr w9, [x11]
7839 ; -O0: stlxr w10, w12, [x11]
7840 ; -O0: subs w8, w9, w8
7842 ; -O1-LABEL: atomicrmw_umax_i32_aligned_release:
7843 ; -O1: ldxr w8, [x0]
7845 ; -O1: csel w9, w8, w1, hi
7846 ; -O1: stlxr w10, w9, [x0]
7847 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
7851 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
7852 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
7853 ; -O0: subs w10, w8, w9
7854 ; -O0: and w10, w10, #0x1
7855 ; -O0: ands w10, w10, #0x1
7856 ; -O0: csel w12, w8, w9, ne
7857 ; -O0: ldaxr w9, [x11]
7859 ; -O0: stlxr w10, w12, [x11]
7860 ; -O0: subs w8, w9, w8
7862 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
7863 ; -O1: ldaxr w8, [x0]
7865 ; -O1: csel w9, w8, w1, hi
7866 ; -O1: stlxr w10, w9, [x0]
7867 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
7871 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
7872 ; -O0-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
7873 ; -O0: subs w10, w8, w9
7874 ; -O0: and w10, w10, #0x1
7875 ; -O0: ands w10, w10, #0x1
7876 ; -O0: csel w12, w8, w9, ne
7877 ; -O0: ldaxr w9, [x11]
7879 ; -O0: stlxr w10, w12, [x11]
7880 ; -O0: subs w8, w9, w8
7882 ; -O1-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
7883 ; -O1: ldaxr w8, [x0]
7885 ; -O1: csel w9, w8, w1, hi
7886 ; -O1: stlxr w10, w9, [x0]
7887 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
7891 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
7892 ; -O0-LABEL: atomicrmw_umax_i64_aligned_monotonic:
7893 ; -O0: subs x10, x8, x9
7894 ; -O0: and w10, w10, #0x1
7895 ; -O0: ands w10, w10, #0x1
7896 ; -O0: csel x12, x8, x9, ne
7897 ; -O0: ldaxr x9, [x11]
7899 ; -O0: stlxr w10, x12, [x11]
7900 ; -O0: subs x8, x9, x8
7902 ; -O1-LABEL: atomicrmw_umax_i64_aligned_monotonic:
7903 ; -O1: ldxr x0, [x8]
7905 ; -O1: csel x9, x0, x1, hi
7906 ; -O1: stxr w10, x9, [x8]
7907 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
7911 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
7912 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acquire:
7913 ; -O0: subs x10, x8, x9
7914 ; -O0: and w10, w10, #0x1
7915 ; -O0: ands w10, w10, #0x1
7916 ; -O0: csel x12, x8, x9, ne
7917 ; -O0: ldaxr x9, [x11]
7919 ; -O0: stlxr w10, x12, [x11]
7920 ; -O0: subs x8, x9, x8
7922 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acquire:
7923 ; -O1: ldaxr x0, [x8]
7925 ; -O1: csel x9, x0, x1, hi
7926 ; -O1: stxr w10, x9, [x8]
7927 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
7931 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
7932 ; -O0-LABEL: atomicrmw_umax_i64_aligned_release:
7933 ; -O0: subs x10, x8, x9
7934 ; -O0: and w10, w10, #0x1
7935 ; -O0: ands w10, w10, #0x1
7936 ; -O0: csel x12, x8, x9, ne
7937 ; -O0: ldaxr x9, [x11]
7939 ; -O0: stlxr w10, x12, [x11]
7940 ; -O0: subs x8, x9, x8
7942 ; -O1-LABEL: atomicrmw_umax_i64_aligned_release:
7943 ; -O1: ldxr x0, [x8]
7945 ; -O1: csel x9, x0, x1, hi
7946 ; -O1: stlxr w10, x9, [x8]
7947 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
7951 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
7952 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
7953 ; -O0: subs x10, x8, x9
7954 ; -O0: and w10, w10, #0x1
7955 ; -O0: ands w10, w10, #0x1
7956 ; -O0: csel x12, x8, x9, ne
7957 ; -O0: ldaxr x9, [x11]
7959 ; -O0: stlxr w10, x12, [x11]
7960 ; -O0: subs x8, x9, x8
7962 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
7963 ; -O1: ldaxr x0, [x8]
7965 ; -O1: csel x9, x0, x1, hi
7966 ; -O1: stlxr w10, x9, [x8]
7967 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
7971 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
7972 ; -O0-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
7973 ; -O0: subs x10, x8, x9
7974 ; -O0: and w10, w10, #0x1
7975 ; -O0: ands w10, w10, #0x1
7976 ; -O0: csel x12, x8, x9, ne
7977 ; -O0: ldaxr x9, [x11]
7979 ; -O0: stlxr w10, x12, [x11]
7980 ; -O0: subs x8, x9, x8
7982 ; -O1-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
7983 ; -O1: ldaxr x0, [x8]
7985 ; -O1: csel x9, x0, x1, hi
7986 ; -O1: stlxr w10, x9, [x8]
7987 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
7991 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
7992 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
7993 ; -O0: subs x8, x8, x9
7994 ; -O0: subs x8, x8, x9
7995 ; -O0: subs x8, x8, x12
7996 ; -O0: and w13, w13, #0x1
7997 ; -O0: ands w13, w13, #0x1
7998 ; -O0: csel w8, w8, w10, ne
7999 ; -O0: and w13, w8, #0x1
8000 ; -O0: ands w13, w13, #0x1
8001 ; -O0: csel x14, x10, x12, ne
8002 ; -O0: and w10, w8, #0x1
8003 ; -O0: ands w10, w10, #0x1
8004 ; -O0: csel x15, x8, x9, ne
8005 ; -O0: ldxp x10, x9, [x11]
8008 ; -O0: stxp w8, x14, x15, [x11]
8009 ; -O0: stxp w8, x10, x9, [x11]
8010 ; -O0: eor x8, x10, x8
8011 ; -O0: eor x11, x9, x11
8012 ; -O0: orr x8, x8, x11
8013 ; -O0: subs x8, x8, #0
8015 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
8016 ; -O1: ldxp x0, x1, [x8]
8018 ; -O1: csel x9, x1, x3, lo
8019 ; -O1: csel x10, x0, x2, lo
8020 ; -O1: stxp w11, x10, x9, [x8]
8021 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
8025 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
8026 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
8027 ; -O0: subs x8, x8, x9
8028 ; -O0: subs x8, x8, x9
8029 ; -O0: subs x8, x8, x12
8030 ; -O0: and w13, w13, #0x1
8031 ; -O0: ands w13, w13, #0x1
8032 ; -O0: csel w8, w8, w10, ne
8033 ; -O0: and w13, w8, #0x1
8034 ; -O0: ands w13, w13, #0x1
8035 ; -O0: csel x14, x10, x12, ne
8036 ; -O0: and w10, w8, #0x1
8037 ; -O0: ands w10, w10, #0x1
8038 ; -O0: csel x15, x8, x9, ne
8039 ; -O0: ldaxp x10, x9, [x11]
8042 ; -O0: stxp w8, x14, x15, [x11]
8043 ; -O0: stxp w8, x10, x9, [x11]
8044 ; -O0: eor x8, x10, x8
8045 ; -O0: eor x11, x9, x11
8046 ; -O0: orr x8, x8, x11
8047 ; -O0: subs x8, x8, #0
8049 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
8050 ; -O1: ldaxp x0, x1, [x8]
8052 ; -O1: csel x9, x1, x3, lo
8053 ; -O1: csel x10, x0, x2, lo
8054 ; -O1: stxp w11, x10, x9, [x8]
8055 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
8059 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
8060 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
8061 ; -O0: subs x8, x8, x9
8062 ; -O0: subs x8, x8, x9
8063 ; -O0: subs x8, x8, x12
8064 ; -O0: and w13, w13, #0x1
8065 ; -O0: ands w13, w13, #0x1
8066 ; -O0: csel w8, w8, w10, ne
8067 ; -O0: and w13, w8, #0x1
8068 ; -O0: ands w13, w13, #0x1
8069 ; -O0: csel x14, x10, x12, ne
8070 ; -O0: and w10, w8, #0x1
8071 ; -O0: ands w10, w10, #0x1
8072 ; -O0: csel x15, x8, x9, ne
8073 ; -O0: ldxp x10, x9, [x11]
8076 ; -O0: stlxp w8, x14, x15, [x11]
8077 ; -O0: stlxp w8, x10, x9, [x11]
8078 ; -O0: eor x8, x10, x8
8079 ; -O0: eor x11, x9, x11
8080 ; -O0: orr x8, x8, x11
8081 ; -O0: subs x8, x8, #0
8083 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
8084 ; -O1: ldxp x0, x1, [x8]
8086 ; -O1: csel x9, x1, x3, lo
8087 ; -O1: csel x10, x0, x2, lo
8088 ; -O1: stlxp w11, x10, x9, [x8]
8089 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
8093 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
8094 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
8095 ; -O0: subs x8, x8, x9
8096 ; -O0: subs x8, x8, x9
8097 ; -O0: subs x8, x8, x12
8098 ; -O0: and w13, w13, #0x1
8099 ; -O0: ands w13, w13, #0x1
8100 ; -O0: csel w8, w8, w10, ne
8101 ; -O0: and w13, w8, #0x1
8102 ; -O0: ands w13, w13, #0x1
8103 ; -O0: csel x14, x10, x12, ne
8104 ; -O0: and w10, w8, #0x1
8105 ; -O0: ands w10, w10, #0x1
8106 ; -O0: csel x15, x8, x9, ne
8107 ; -O0: ldaxp x10, x9, [x11]
8110 ; -O0: stlxp w8, x14, x15, [x11]
8111 ; -O0: stlxp w8, x10, x9, [x11]
8112 ; -O0: eor x8, x10, x8
8113 ; -O0: eor x11, x9, x11
8114 ; -O0: orr x8, x8, x11
8115 ; -O0: subs x8, x8, #0
8117 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
8118 ; -O1: ldaxp x0, x1, [x8]
8120 ; -O1: csel x9, x1, x3, lo
8121 ; -O1: csel x10, x0, x2, lo
8122 ; -O1: stlxp w11, x10, x9, [x8]
8123 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
8127 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
8128 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
8129 ; -O0: subs x8, x8, x9
8130 ; -O0: subs x8, x8, x9
8131 ; -O0: subs x8, x8, x12
8132 ; -O0: and w13, w13, #0x1
8133 ; -O0: ands w13, w13, #0x1
8134 ; -O0: csel w8, w8, w10, ne
8135 ; -O0: and w13, w8, #0x1
8136 ; -O0: ands w13, w13, #0x1
8137 ; -O0: csel x14, x10, x12, ne
8138 ; -O0: and w10, w8, #0x1
8139 ; -O0: ands w10, w10, #0x1
8140 ; -O0: csel x15, x8, x9, ne
8141 ; -O0: ldaxp x10, x9, [x11]
8144 ; -O0: stlxp w8, x14, x15, [x11]
8145 ; -O0: stlxp w8, x10, x9, [x11]
8146 ; -O0: eor x8, x10, x8
8147 ; -O0: eor x11, x9, x11
8148 ; -O0: orr x8, x8, x11
8149 ; -O0: subs x8, x8, #0
8151 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
8152 ; -O1: ldaxp x0, x1, [x8]
8154 ; -O1: csel x9, x1, x3, lo
8155 ; -O1: csel x10, x0, x2, lo
8156 ; -O1: stlxp w11, x10, x9, [x8]
8157 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
8161 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
8162 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
8163 ; -O0: and w9, w10, #0xff
8164 ; -O0: subs w9, w9, w8, uxtb
8165 ; -O0: and w9, w9, #0x1
8166 ; -O0: ands w9, w9, #0x1
8167 ; -O0: csel w12, w10, w8, ne
8168 ; -O0: ldaxrb w9, [x11]
8169 ; -O0: cmp w9, w10, uxtb
8170 ; -O0: stlxrb w8, w12, [x11]
8171 ; -O0: and w8, w9, #0xff
8172 ; -O0: subs w8, w8, w10, uxtb
8174 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
8175 ; -O1: and w9, w1, #0xff
8176 ; -O1: ldxrb w8, [x0]
8178 ; -O1: csel w10, w8, w9, hi
8179 ; -O1: stxrb w11, w10, [x0]
8180 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
8184 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
8185 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acquire:
8186 ; -O0: and w9, w10, #0xff
8187 ; -O0: subs w9, w9, w8, uxtb
8188 ; -O0: and w9, w9, #0x1
8189 ; -O0: ands w9, w9, #0x1
8190 ; -O0: csel w12, w10, w8, ne
8191 ; -O0: ldaxrb w9, [x11]
8192 ; -O0: cmp w9, w10, uxtb
8193 ; -O0: stlxrb w8, w12, [x11]
8194 ; -O0: and w8, w9, #0xff
8195 ; -O0: subs w8, w8, w10, uxtb
8197 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acquire:
8198 ; -O1: and w9, w1, #0xff
8199 ; -O1: ldaxrb w8, [x0]
8201 ; -O1: csel w10, w8, w9, hi
8202 ; -O1: stxrb w11, w10, [x0]
8203 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
8207 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
8208 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_release:
8209 ; -O0: and w9, w10, #0xff
8210 ; -O0: subs w9, w9, w8, uxtb
8211 ; -O0: and w9, w9, #0x1
8212 ; -O0: ands w9, w9, #0x1
8213 ; -O0: csel w12, w10, w8, ne
8214 ; -O0: ldaxrb w9, [x11]
8215 ; -O0: cmp w9, w10, uxtb
8216 ; -O0: stlxrb w8, w12, [x11]
8217 ; -O0: and w8, w9, #0xff
8218 ; -O0: subs w8, w8, w10, uxtb
8220 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_release:
8221 ; -O1: and w9, w1, #0xff
8222 ; -O1: ldxrb w8, [x0]
8224 ; -O1: csel w10, w8, w9, hi
8225 ; -O1: stlxrb w11, w10, [x0]
8226 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
8230 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
8231 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
8232 ; -O0: and w9, w10, #0xff
8233 ; -O0: subs w9, w9, w8, uxtb
8234 ; -O0: and w9, w9, #0x1
8235 ; -O0: ands w9, w9, #0x1
8236 ; -O0: csel w12, w10, w8, ne
8237 ; -O0: ldaxrb w9, [x11]
8238 ; -O0: cmp w9, w10, uxtb
8239 ; -O0: stlxrb w8, w12, [x11]
8240 ; -O0: and w8, w9, #0xff
8241 ; -O0: subs w8, w8, w10, uxtb
8243 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
8244 ; -O1: and w9, w1, #0xff
8245 ; -O1: ldaxrb w8, [x0]
8247 ; -O1: csel w10, w8, w9, hi
8248 ; -O1: stlxrb w11, w10, [x0]
8249 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
8253 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
8254 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
8255 ; -O0: and w9, w10, #0xff
8256 ; -O0: subs w9, w9, w8, uxtb
8257 ; -O0: and w9, w9, #0x1
8258 ; -O0: ands w9, w9, #0x1
8259 ; -O0: csel w12, w10, w8, ne
8260 ; -O0: ldaxrb w9, [x11]
8261 ; -O0: cmp w9, w10, uxtb
8262 ; -O0: stlxrb w8, w12, [x11]
8263 ; -O0: and w8, w9, #0xff
8264 ; -O0: subs w8, w8, w10, uxtb
8266 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
8267 ; -O1: and w9, w1, #0xff
8268 ; -O1: ldaxrb w8, [x0]
8270 ; -O1: csel w10, w8, w9, hi
8271 ; -O1: stlxrb w11, w10, [x0]
8272 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
8276 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
8277 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
8278 ; -O0: subs w10, w10, w8, uxth
8279 ; -O0: and w10, w10, #0x1
8280 ; -O0: ands w10, w10, #0x1
8281 ; -O0: csel w8, w9, w8, ne
8282 ; -O0: bl __atomic_compare_exchange
8284 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
8285 ; -O1: and w8, w0, #0xffff
8286 ; -O1: cmp w8, w20, uxth
8287 ; -O1: csel w8, w0, w20, hi
8288 ; -O1: bl __atomic_compare_exchange
8289 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
8293 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
8294 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
8295 ; -O0: subs w10, w10, w8, uxth
8296 ; -O0: and w10, w10, #0x1
8297 ; -O0: ands w10, w10, #0x1
8298 ; -O0: csel w8, w9, w8, ne
8299 ; -O0: bl __atomic_compare_exchange
8301 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
8302 ; -O1: and w8, w0, #0xffff
8303 ; -O1: cmp w8, w20, uxth
8304 ; -O1: csel w8, w0, w20, hi
8305 ; -O1: bl __atomic_compare_exchange
8306 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
8310 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
8311 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
8312 ; -O0: subs w10, w10, w8, uxth
8313 ; -O0: and w10, w10, #0x1
8314 ; -O0: ands w10, w10, #0x1
8315 ; -O0: csel w8, w9, w8, ne
8316 ; -O0: bl __atomic_compare_exchange
8318 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
8319 ; -O1: and w8, w0, #0xffff
8320 ; -O1: cmp w8, w20, uxth
8321 ; -O1: csel w8, w0, w20, hi
8322 ; -O1: bl __atomic_compare_exchange
8323 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
8327 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
8328 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
8329 ; -O0: subs w10, w10, w8, uxth
8330 ; -O0: and w10, w10, #0x1
8331 ; -O0: ands w10, w10, #0x1
8332 ; -O0: csel w8, w9, w8, ne
8333 ; -O0: bl __atomic_compare_exchange
8335 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
8336 ; -O1: and w8, w0, #0xffff
8337 ; -O1: cmp w8, w20, uxth
8338 ; -O1: csel w8, w0, w20, hi
8339 ; -O1: bl __atomic_compare_exchange
8340 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
8344 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
8345 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
8346 ; -O0: subs w10, w10, w8, uxth
8347 ; -O0: and w10, w10, #0x1
8348 ; -O0: ands w10, w10, #0x1
8349 ; -O0: csel w8, w9, w8, ne
8350 ; -O0: bl __atomic_compare_exchange
8352 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
8353 ; -O1: and w8, w0, #0xffff
8354 ; -O1: cmp w8, w20, uxth
8355 ; -O1: csel w8, w0, w20, hi
8356 ; -O1: bl __atomic_compare_exchange
8357 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
8361 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
8362 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
8363 ; -O0: subs w10, w9, w8
8364 ; -O0: and w10, w10, #0x1
8365 ; -O0: ands w10, w10, #0x1
8366 ; -O0: csel w8, w9, w8, ne
8367 ; -O0: bl __atomic_compare_exchange
8369 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
8371 ; -O1: csel w8, w0, w20, hi
8372 ; -O1: bl __atomic_compare_exchange
8373 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
8377 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
8378 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
8379 ; -O0: subs w10, w9, w8
8380 ; -O0: and w10, w10, #0x1
8381 ; -O0: ands w10, w10, #0x1
8382 ; -O0: csel w8, w9, w8, ne
8383 ; -O0: bl __atomic_compare_exchange
8385 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
8387 ; -O1: csel w8, w0, w20, hi
8388 ; -O1: bl __atomic_compare_exchange
8389 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
8393 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
8394 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
8395 ; -O0: subs w10, w9, w8
8396 ; -O0: and w10, w10, #0x1
8397 ; -O0: ands w10, w10, #0x1
8398 ; -O0: csel w8, w9, w8, ne
8399 ; -O0: bl __atomic_compare_exchange
8401 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
8403 ; -O1: csel w8, w0, w20, hi
8404 ; -O1: bl __atomic_compare_exchange
8405 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
8409 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
8410 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
8411 ; -O0: subs w10, w9, w8
8412 ; -O0: and w10, w10, #0x1
8413 ; -O0: ands w10, w10, #0x1
8414 ; -O0: csel w8, w9, w8, ne
8415 ; -O0: bl __atomic_compare_exchange
8417 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
8419 ; -O1: csel w8, w0, w20, hi
8420 ; -O1: bl __atomic_compare_exchange
8421 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
8425 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
8426 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
8427 ; -O0: subs w10, w9, w8
8428 ; -O0: and w10, w10, #0x1
8429 ; -O0: ands w10, w10, #0x1
8430 ; -O0: csel w8, w9, w8, ne
8431 ; -O0: bl __atomic_compare_exchange
8433 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
8435 ; -O1: csel w8, w0, w20, hi
8436 ; -O1: bl __atomic_compare_exchange
8437 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
8441 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
8442 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
8443 ; -O0: subs x10, x9, x8
8444 ; -O0: and w10, w10, #0x1
8445 ; -O0: ands w10, w10, #0x1
8446 ; -O0: csel x8, x9, x8, ne
8447 ; -O0: bl __atomic_compare_exchange
8449 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
8451 ; -O1: csel x8, x0, x20, hi
8452 ; -O1: bl __atomic_compare_exchange
8453 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
8457 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
8458 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
8459 ; -O0: subs x10, x9, x8
8460 ; -O0: and w10, w10, #0x1
8461 ; -O0: ands w10, w10, #0x1
8462 ; -O0: csel x8, x9, x8, ne
8463 ; -O0: bl __atomic_compare_exchange
8465 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
8467 ; -O1: csel x8, x0, x20, hi
8468 ; -O1: bl __atomic_compare_exchange
8469 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
8473 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
8474 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
8475 ; -O0: subs x10, x9, x8
8476 ; -O0: and w10, w10, #0x1
8477 ; -O0: ands w10, w10, #0x1
8478 ; -O0: csel x8, x9, x8, ne
8479 ; -O0: bl __atomic_compare_exchange
8481 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
8483 ; -O1: csel x8, x0, x20, hi
8484 ; -O1: bl __atomic_compare_exchange
8485 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
8489 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
8490 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
8491 ; -O0: subs x10, x9, x8
8492 ; -O0: and w10, w10, #0x1
8493 ; -O0: ands w10, w10, #0x1
8494 ; -O0: csel x8, x9, x8, ne
8495 ; -O0: bl __atomic_compare_exchange
8497 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
8499 ; -O1: csel x8, x0, x20, hi
8500 ; -O1: bl __atomic_compare_exchange
8501 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
8505 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
8506 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
8507 ; -O0: subs x10, x9, x8
8508 ; -O0: and w10, w10, #0x1
8509 ; -O0: ands w10, w10, #0x1
8510 ; -O0: csel x8, x9, x8, ne
8511 ; -O0: bl __atomic_compare_exchange
8513 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
8515 ; -O1: csel x8, x0, x20, hi
8516 ; -O1: bl __atomic_compare_exchange
8517 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
8521 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
8522 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
8523 ; -O0: subs x8, x8, x10
8524 ; -O0: subs x8, x8, x10
8525 ; -O0: subs x8, x8, x11
8526 ; -O0: and w12, w12, #0x1
8527 ; -O0: ands w12, w12, #0x1
8528 ; -O0: csel w8, w8, w9, ne
8529 ; -O0: and w12, w8, #0x1
8530 ; -O0: ands w12, w12, #0x1
8531 ; -O0: csel x9, x9, x11, ne
8532 ; -O0: and w11, w8, #0x1
8533 ; -O0: ands w11, w11, #0x1
8534 ; -O0: csel x8, x8, x10, ne
8535 ; -O0: bl __atomic_compare_exchange
8537 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
8538 ; -O1: ldp x0, x1, [x0]
8540 ; -O1: csel x8, x1, x19, lo
8541 ; -O1: csel x9, x0, x21, lo
8542 ; -O1: bl __atomic_compare_exchange
8543 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
8547 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
8548 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
8549 ; -O0: subs x8, x8, x10
8550 ; -O0: subs x8, x8, x10
8551 ; -O0: subs x8, x8, x11
8552 ; -O0: and w12, w12, #0x1
8553 ; -O0: ands w12, w12, #0x1
8554 ; -O0: csel w8, w8, w9, ne
8555 ; -O0: and w12, w8, #0x1
8556 ; -O0: ands w12, w12, #0x1
8557 ; -O0: csel x9, x9, x11, ne
8558 ; -O0: and w11, w8, #0x1
8559 ; -O0: ands w11, w11, #0x1
8560 ; -O0: csel x8, x8, x10, ne
8561 ; -O0: bl __atomic_compare_exchange
8563 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
8564 ; -O1: ldp x0, x1, [x0]
8566 ; -O1: csel x8, x1, x19, lo
8567 ; -O1: csel x9, x0, x21, lo
8568 ; -O1: bl __atomic_compare_exchange
8569 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
8573 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
8574 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
8575 ; -O0: subs x8, x8, x10
8576 ; -O0: subs x8, x8, x10
8577 ; -O0: subs x8, x8, x11
8578 ; -O0: and w12, w12, #0x1
8579 ; -O0: ands w12, w12, #0x1
8580 ; -O0: csel w8, w8, w9, ne
8581 ; -O0: and w12, w8, #0x1
8582 ; -O0: ands w12, w12, #0x1
8583 ; -O0: csel x9, x9, x11, ne
8584 ; -O0: and w11, w8, #0x1
8585 ; -O0: ands w11, w11, #0x1
8586 ; -O0: csel x8, x8, x10, ne
8587 ; -O0: bl __atomic_compare_exchange
8589 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
8590 ; -O1: ldp x0, x1, [x0]
8592 ; -O1: csel x8, x1, x19, lo
8593 ; -O1: csel x9, x0, x21, lo
8594 ; -O1: bl __atomic_compare_exchange
8595 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
8599 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
8600 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
8601 ; -O0: subs x8, x8, x10
8602 ; -O0: subs x8, x8, x10
8603 ; -O0: subs x8, x8, x11
8604 ; -O0: and w12, w12, #0x1
8605 ; -O0: ands w12, w12, #0x1
8606 ; -O0: csel w8, w8, w9, ne
8607 ; -O0: and w12, w8, #0x1
8608 ; -O0: ands w12, w12, #0x1
8609 ; -O0: csel x9, x9, x11, ne
8610 ; -O0: and w11, w8, #0x1
8611 ; -O0: ands w11, w11, #0x1
8612 ; -O0: csel x8, x8, x10, ne
8613 ; -O0: bl __atomic_compare_exchange
8615 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
8616 ; -O1: ldp x0, x1, [x0]
8618 ; -O1: csel x8, x1, x19, lo
8619 ; -O1: csel x9, x0, x21, lo
8620 ; -O1: bl __atomic_compare_exchange
8621 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
8625 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
8626 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
8627 ; -O0: subs x8, x8, x10
8628 ; -O0: subs x8, x8, x10
8629 ; -O0: subs x8, x8, x11
8630 ; -O0: and w12, w12, #0x1
8631 ; -O0: ands w12, w12, #0x1
8632 ; -O0: csel w8, w8, w9, ne
8633 ; -O0: and w12, w8, #0x1
8634 ; -O0: ands w12, w12, #0x1
8635 ; -O0: csel x9, x9, x11, ne
8636 ; -O0: and w11, w8, #0x1
8637 ; -O0: ands w11, w11, #0x1
8638 ; -O0: csel x8, x8, x10, ne
8639 ; -O0: bl __atomic_compare_exchange
8641 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
8642 ; -O1: ldp x0, x1, [x0]
8644 ; -O1: csel x8, x1, x19, lo
8645 ; -O1: csel x9, x0, x21, lo
8646 ; -O1: bl __atomic_compare_exchange
8647 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
8651 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
8652 ; -O0-LABEL: atomicrmw_umin_i8_aligned_monotonic:
8653 ; -O0: and w9, w10, #0xff
8654 ; -O0: subs w9, w9, w8, uxtb
8655 ; -O0: and w9, w9, #0x1
8656 ; -O0: ands w9, w9, #0x1
8657 ; -O0: csel w12, w10, w8, ne
8658 ; -O0: ldaxrb w9, [x11]
8659 ; -O0: cmp w9, w10, uxtb
8660 ; -O0: stlxrb w8, w12, [x11]
8661 ; -O0: and w8, w9, #0xff
8662 ; -O0: subs w8, w8, w10, uxtb
8664 ; -O1-LABEL: atomicrmw_umin_i8_aligned_monotonic:
8665 ; -O1: and w9, w1, #0xff
8666 ; -O1: ldxrb w8, [x0]
8668 ; -O1: csel w10, w8, w9, ls
8669 ; -O1: stxrb w11, w10, [x0]
8670 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
8674 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
8675 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acquire:
8676 ; -O0: and w9, w10, #0xff
8677 ; -O0: subs w9, w9, w8, uxtb
8678 ; -O0: and w9, w9, #0x1
8679 ; -O0: ands w9, w9, #0x1
8680 ; -O0: csel w12, w10, w8, ne
8681 ; -O0: ldaxrb w9, [x11]
8682 ; -O0: cmp w9, w10, uxtb
8683 ; -O0: stlxrb w8, w12, [x11]
8684 ; -O0: and w8, w9, #0xff
8685 ; -O0: subs w8, w8, w10, uxtb
8687 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acquire:
8688 ; -O1: and w9, w1, #0xff
8689 ; -O1: ldaxrb w8, [x0]
8691 ; -O1: csel w10, w8, w9, ls
8692 ; -O1: stxrb w11, w10, [x0]
8693 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
8697 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
8698 ; -O0-LABEL: atomicrmw_umin_i8_aligned_release:
8699 ; -O0: and w9, w10, #0xff
8700 ; -O0: subs w9, w9, w8, uxtb
8701 ; -O0: and w9, w9, #0x1
8702 ; -O0: ands w9, w9, #0x1
8703 ; -O0: csel w12, w10, w8, ne
8704 ; -O0: ldaxrb w9, [x11]
8705 ; -O0: cmp w9, w10, uxtb
8706 ; -O0: stlxrb w8, w12, [x11]
8707 ; -O0: and w8, w9, #0xff
8708 ; -O0: subs w8, w8, w10, uxtb
8710 ; -O1-LABEL: atomicrmw_umin_i8_aligned_release:
8711 ; -O1: and w9, w1, #0xff
8712 ; -O1: ldxrb w8, [x0]
8714 ; -O1: csel w10, w8, w9, ls
8715 ; -O1: stlxrb w11, w10, [x0]
8716 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
8720 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
8721 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
8722 ; -O0: and w9, w10, #0xff
8723 ; -O0: subs w9, w9, w8, uxtb
8724 ; -O0: and w9, w9, #0x1
8725 ; -O0: ands w9, w9, #0x1
8726 ; -O0: csel w12, w10, w8, ne
8727 ; -O0: ldaxrb w9, [x11]
8728 ; -O0: cmp w9, w10, uxtb
8729 ; -O0: stlxrb w8, w12, [x11]
8730 ; -O0: and w8, w9, #0xff
8731 ; -O0: subs w8, w8, w10, uxtb
8733 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
8734 ; -O1: and w9, w1, #0xff
8735 ; -O1: ldaxrb w8, [x0]
8737 ; -O1: csel w10, w8, w9, ls
8738 ; -O1: stlxrb w11, w10, [x0]
8739 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
8743 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
8744 ; -O0-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
8745 ; -O0: and w9, w10, #0xff
8746 ; -O0: subs w9, w9, w8, uxtb
8747 ; -O0: and w9, w9, #0x1
8748 ; -O0: ands w9, w9, #0x1
8749 ; -O0: csel w12, w10, w8, ne
8750 ; -O0: ldaxrb w9, [x11]
8751 ; -O0: cmp w9, w10, uxtb
8752 ; -O0: stlxrb w8, w12, [x11]
8753 ; -O0: and w8, w9, #0xff
8754 ; -O0: subs w8, w8, w10, uxtb
8756 ; -O1-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
8757 ; -O1: and w9, w1, #0xff
8758 ; -O1: ldaxrb w8, [x0]
8760 ; -O1: csel w10, w8, w9, ls
8761 ; -O1: stlxrb w11, w10, [x0]
8762 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
8766 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
8767 ; -O0-LABEL: atomicrmw_umin_i16_aligned_monotonic:
8768 ; -O0: subs w10, w10, w9, uxth
8769 ; -O0: and w10, w10, #0x1
8770 ; -O0: ands w10, w10, #0x1
8771 ; -O0: csel w12, w8, w9, ne
8772 ; -O0: ldaxrh w9, [x11]
8773 ; -O0: cmp w9, w8, uxth
8774 ; -O0: stlxrh w10, w12, [x11]
8775 ; -O0: subs w8, w8, w9, uxth
8777 ; -O1-LABEL: atomicrmw_umin_i16_aligned_monotonic:
8778 ; -O1: and w9, w1, #0xffff
8779 ; -O1: ldxrh w8, [x0]
8781 ; -O1: csel w10, w8, w9, ls
8782 ; -O1: stxrh w11, w10, [x0]
8783 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
8787 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
8788 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acquire:
8789 ; -O0: subs w10, w10, w9, uxth
8790 ; -O0: and w10, w10, #0x1
8791 ; -O0: ands w10, w10, #0x1
8792 ; -O0: csel w12, w8, w9, ne
8793 ; -O0: ldaxrh w9, [x11]
8794 ; -O0: cmp w9, w8, uxth
8795 ; -O0: stlxrh w10, w12, [x11]
8796 ; -O0: subs w8, w8, w9, uxth
8798 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acquire:
8799 ; -O1: and w9, w1, #0xffff
8800 ; -O1: ldaxrh w8, [x0]
8802 ; -O1: csel w10, w8, w9, ls
8803 ; -O1: stxrh w11, w10, [x0]
8804 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
8808 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
8809 ; -O0-LABEL: atomicrmw_umin_i16_aligned_release:
8810 ; -O0: subs w10, w10, w9, uxth
8811 ; -O0: and w10, w10, #0x1
8812 ; -O0: ands w10, w10, #0x1
8813 ; -O0: csel w12, w8, w9, ne
8814 ; -O0: ldaxrh w9, [x11]
8815 ; -O0: cmp w9, w8, uxth
8816 ; -O0: stlxrh w10, w12, [x11]
8817 ; -O0: subs w8, w8, w9, uxth
8819 ; -O1-LABEL: atomicrmw_umin_i16_aligned_release:
8820 ; -O1: and w9, w1, #0xffff
8821 ; -O1: ldxrh w8, [x0]
8823 ; -O1: csel w10, w8, w9, ls
8824 ; -O1: stlxrh w11, w10, [x0]
8825 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
8829 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
8830 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
8831 ; -O0: subs w10, w10, w9, uxth
8832 ; -O0: and w10, w10, #0x1
8833 ; -O0: ands w10, w10, #0x1
8834 ; -O0: csel w12, w8, w9, ne
8835 ; -O0: ldaxrh w9, [x11]
8836 ; -O0: cmp w9, w8, uxth
8837 ; -O0: stlxrh w10, w12, [x11]
8838 ; -O0: subs w8, w8, w9, uxth
8840 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
8841 ; -O1: and w9, w1, #0xffff
8842 ; -O1: ldaxrh w8, [x0]
8844 ; -O1: csel w10, w8, w9, ls
8845 ; -O1: stlxrh w11, w10, [x0]
8846 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
8850 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
8851 ; -O0-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
8852 ; -O0: subs w10, w10, w9, uxth
8853 ; -O0: and w10, w10, #0x1
8854 ; -O0: ands w10, w10, #0x1
8855 ; -O0: csel w12, w8, w9, ne
8856 ; -O0: ldaxrh w9, [x11]
8857 ; -O0: cmp w9, w8, uxth
8858 ; -O0: stlxrh w10, w12, [x11]
8859 ; -O0: subs w8, w8, w9, uxth
8861 ; -O1-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
8862 ; -O1: and w9, w1, #0xffff
8863 ; -O1: ldaxrh w8, [x0]
8865 ; -O1: csel w10, w8, w9, ls
8866 ; -O1: stlxrh w11, w10, [x0]
8867 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
8871 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
8872 ; -O0-LABEL: atomicrmw_umin_i32_aligned_monotonic:
8873 ; -O0: subs w10, w8, w9
8874 ; -O0: and w10, w10, #0x1
8875 ; -O0: ands w10, w10, #0x1
8876 ; -O0: csel w12, w8, w9, ne
8877 ; -O0: ldaxr w9, [x11]
8879 ; -O0: stlxr w10, w12, [x11]
8880 ; -O0: subs w8, w9, w8
8882 ; -O1-LABEL: atomicrmw_umin_i32_aligned_monotonic:
8883 ; -O1: ldxr w8, [x0]
8885 ; -O1: csel w9, w8, w1, ls
8886 ; -O1: stxr w10, w9, [x0]
8887 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
8891 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
8892 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acquire:
8893 ; -O0: subs w10, w8, w9
8894 ; -O0: and w10, w10, #0x1
8895 ; -O0: ands w10, w10, #0x1
8896 ; -O0: csel w12, w8, w9, ne
8897 ; -O0: ldaxr w9, [x11]
8899 ; -O0: stlxr w10, w12, [x11]
8900 ; -O0: subs w8, w9, w8
8902 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acquire:
8903 ; -O1: ldaxr w8, [x0]
8905 ; -O1: csel w9, w8, w1, ls
8906 ; -O1: stxr w10, w9, [x0]
8907 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
8911 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
8912 ; -O0-LABEL: atomicrmw_umin_i32_aligned_release:
8913 ; -O0: subs w10, w8, w9
8914 ; -O0: and w10, w10, #0x1
8915 ; -O0: ands w10, w10, #0x1
8916 ; -O0: csel w12, w8, w9, ne
8917 ; -O0: ldaxr w9, [x11]
8919 ; -O0: stlxr w10, w12, [x11]
8920 ; -O0: subs w8, w9, w8
8922 ; -O1-LABEL: atomicrmw_umin_i32_aligned_release:
8923 ; -O1: ldxr w8, [x0]
8925 ; -O1: csel w9, w8, w1, ls
8926 ; -O1: stlxr w10, w9, [x0]
8927 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
8931 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
8932 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
8933 ; -O0: subs w10, w8, w9
8934 ; -O0: and w10, w10, #0x1
8935 ; -O0: ands w10, w10, #0x1
8936 ; -O0: csel w12, w8, w9, ne
8937 ; -O0: ldaxr w9, [x11]
8939 ; -O0: stlxr w10, w12, [x11]
8940 ; -O0: subs w8, w9, w8
8942 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
8943 ; -O1: ldaxr w8, [x0]
8945 ; -O1: csel w9, w8, w1, ls
8946 ; -O1: stlxr w10, w9, [x0]
8947 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
8951 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
8952 ; -O0-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
8953 ; -O0: subs w10, w8, w9
8954 ; -O0: and w10, w10, #0x1
8955 ; -O0: ands w10, w10, #0x1
8956 ; -O0: csel w12, w8, w9, ne
8957 ; -O0: ldaxr w9, [x11]
8959 ; -O0: stlxr w10, w12, [x11]
8960 ; -O0: subs w8, w9, w8
8962 ; -O1-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
8963 ; -O1: ldaxr w8, [x0]
8965 ; -O1: csel w9, w8, w1, ls
8966 ; -O1: stlxr w10, w9, [x0]
8967 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
8971 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
8972 ; -O0-LABEL: atomicrmw_umin_i64_aligned_monotonic:
8973 ; -O0: subs x10, x8, x9
8974 ; -O0: and w10, w10, #0x1
8975 ; -O0: ands w10, w10, #0x1
8976 ; -O0: csel x12, x8, x9, ne
8977 ; -O0: ldaxr x9, [x11]
8979 ; -O0: stlxr w10, x12, [x11]
8980 ; -O0: subs x8, x9, x8
8982 ; -O1-LABEL: atomicrmw_umin_i64_aligned_monotonic:
8983 ; -O1: ldxr x0, [x8]
8985 ; -O1: csel x9, x0, x1, ls
8986 ; -O1: stxr w10, x9, [x8]
8987 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
8991 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
8992 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acquire:
8993 ; -O0: subs x10, x8, x9
8994 ; -O0: and w10, w10, #0x1
8995 ; -O0: ands w10, w10, #0x1
8996 ; -O0: csel x12, x8, x9, ne
8997 ; -O0: ldaxr x9, [x11]
8999 ; -O0: stlxr w10, x12, [x11]
9000 ; -O0: subs x8, x9, x8
9002 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acquire:
9003 ; -O1: ldaxr x0, [x8]
9005 ; -O1: csel x9, x0, x1, ls
9006 ; -O1: stxr w10, x9, [x8]
9007 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
9011 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
9012 ; -O0-LABEL: atomicrmw_umin_i64_aligned_release:
9013 ; -O0: subs x10, x8, x9
9014 ; -O0: and w10, w10, #0x1
9015 ; -O0: ands w10, w10, #0x1
9016 ; -O0: csel x12, x8, x9, ne
9017 ; -O0: ldaxr x9, [x11]
9019 ; -O0: stlxr w10, x12, [x11]
9020 ; -O0: subs x8, x9, x8
9022 ; -O1-LABEL: atomicrmw_umin_i64_aligned_release:
9023 ; -O1: ldxr x0, [x8]
9025 ; -O1: csel x9, x0, x1, ls
9026 ; -O1: stlxr w10, x9, [x8]
9027 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
9031 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
9032 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
9033 ; -O0: subs x10, x8, x9
9034 ; -O0: and w10, w10, #0x1
9035 ; -O0: ands w10, w10, #0x1
9036 ; -O0: csel x12, x8, x9, ne
9037 ; -O0: ldaxr x9, [x11]
9039 ; -O0: stlxr w10, x12, [x11]
9040 ; -O0: subs x8, x9, x8
9042 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
9043 ; -O1: ldaxr x0, [x8]
9045 ; -O1: csel x9, x0, x1, ls
9046 ; -O1: stlxr w10, x9, [x8]
9047 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
9051 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
9052 ; -O0-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
9053 ; -O0: subs x10, x8, x9
9054 ; -O0: and w10, w10, #0x1
9055 ; -O0: ands w10, w10, #0x1
9056 ; -O0: csel x12, x8, x9, ne
9057 ; -O0: ldaxr x9, [x11]
9059 ; -O0: stlxr w10, x12, [x11]
9060 ; -O0: subs x8, x9, x8
9062 ; -O1-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
9063 ; -O1: ldaxr x0, [x8]
9065 ; -O1: csel x9, x0, x1, ls
9066 ; -O1: stlxr w10, x9, [x8]
9067 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
9071 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
9072 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
9073 ; -O0: subs x8, x8, x9
9074 ; -O0: subs x8, x8, x9
9075 ; -O0: subs x8, x8, x12
9076 ; -O0: and w13, w13, #0x1
9077 ; -O0: ands w13, w13, #0x1
9078 ; -O0: csel w8, w8, w10, ne
9079 ; -O0: and w13, w8, #0x1
9080 ; -O0: ands w13, w13, #0x1
9081 ; -O0: csel x14, x10, x12, ne
9082 ; -O0: and w10, w8, #0x1
9083 ; -O0: ands w10, w10, #0x1
9084 ; -O0: csel x15, x8, x9, ne
9085 ; -O0: ldxp x10, x9, [x11]
9088 ; -O0: stxp w8, x14, x15, [x11]
9089 ; -O0: stxp w8, x10, x9, [x11]
9090 ; -O0: eor x8, x10, x8
9091 ; -O0: eor x11, x9, x11
9092 ; -O0: orr x8, x8, x11
9093 ; -O0: subs x8, x8, #0
9095 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
9096 ; -O1: ldxp x0, x1, [x8]
9098 ; -O1: csel x9, x1, x3, hs
9099 ; -O1: csel x10, x0, x2, hs
9100 ; -O1: stxp w11, x10, x9, [x8]
9101 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
9105 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
9106 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
9107 ; -O0: subs x8, x8, x9
9108 ; -O0: subs x8, x8, x9
9109 ; -O0: subs x8, x8, x12
9110 ; -O0: and w13, w13, #0x1
9111 ; -O0: ands w13, w13, #0x1
9112 ; -O0: csel w8, w8, w10, ne
9113 ; -O0: and w13, w8, #0x1
9114 ; -O0: ands w13, w13, #0x1
9115 ; -O0: csel x14, x10, x12, ne
9116 ; -O0: and w10, w8, #0x1
9117 ; -O0: ands w10, w10, #0x1
9118 ; -O0: csel x15, x8, x9, ne
9119 ; -O0: ldaxp x10, x9, [x11]
9122 ; -O0: stxp w8, x14, x15, [x11]
9123 ; -O0: stxp w8, x10, x9, [x11]
9124 ; -O0: eor x8, x10, x8
9125 ; -O0: eor x11, x9, x11
9126 ; -O0: orr x8, x8, x11
9127 ; -O0: subs x8, x8, #0
9129 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
9130 ; -O1: ldaxp x0, x1, [x8]
9132 ; -O1: csel x9, x1, x3, hs
9133 ; -O1: csel x10, x0, x2, hs
9134 ; -O1: stxp w11, x10, x9, [x8]
9135 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
9139 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
9140 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
9141 ; -O0: subs x8, x8, x9
9142 ; -O0: subs x8, x8, x9
9143 ; -O0: subs x8, x8, x12
9144 ; -O0: and w13, w13, #0x1
9145 ; -O0: ands w13, w13, #0x1
9146 ; -O0: csel w8, w8, w10, ne
9147 ; -O0: and w13, w8, #0x1
9148 ; -O0: ands w13, w13, #0x1
9149 ; -O0: csel x14, x10, x12, ne
9150 ; -O0: and w10, w8, #0x1
9151 ; -O0: ands w10, w10, #0x1
9152 ; -O0: csel x15, x8, x9, ne
9153 ; -O0: ldxp x10, x9, [x11]
9156 ; -O0: stlxp w8, x14, x15, [x11]
9157 ; -O0: stlxp w8, x10, x9, [x11]
9158 ; -O0: eor x8, x10, x8
9159 ; -O0: eor x11, x9, x11
9160 ; -O0: orr x8, x8, x11
9161 ; -O0: subs x8, x8, #0
9163 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
9164 ; -O1: ldxp x0, x1, [x8]
9166 ; -O1: csel x9, x1, x3, hs
9167 ; -O1: csel x10, x0, x2, hs
9168 ; -O1: stlxp w11, x10, x9, [x8]
9169 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
9173 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
9174 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
9175 ; -O0: subs x8, x8, x9
9176 ; -O0: subs x8, x8, x9
9177 ; -O0: subs x8, x8, x12
9178 ; -O0: and w13, w13, #0x1
9179 ; -O0: ands w13, w13, #0x1
9180 ; -O0: csel w8, w8, w10, ne
9181 ; -O0: and w13, w8, #0x1
9182 ; -O0: ands w13, w13, #0x1
9183 ; -O0: csel x14, x10, x12, ne
9184 ; -O0: and w10, w8, #0x1
9185 ; -O0: ands w10, w10, #0x1
9186 ; -O0: csel x15, x8, x9, ne
9187 ; -O0: ldaxp x10, x9, [x11]
9190 ; -O0: stlxp w8, x14, x15, [x11]
9191 ; -O0: stlxp w8, x10, x9, [x11]
9192 ; -O0: eor x8, x10, x8
9193 ; -O0: eor x11, x9, x11
9194 ; -O0: orr x8, x8, x11
9195 ; -O0: subs x8, x8, #0
9197 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
9198 ; -O1: ldaxp x0, x1, [x8]
9200 ; -O1: csel x9, x1, x3, hs
9201 ; -O1: csel x10, x0, x2, hs
9202 ; -O1: stlxp w11, x10, x9, [x8]
9203 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
9207 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
9208 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
9209 ; -O0: subs x8, x8, x9
9210 ; -O0: subs x8, x8, x9
9211 ; -O0: subs x8, x8, x12
9212 ; -O0: and w13, w13, #0x1
9213 ; -O0: ands w13, w13, #0x1
9214 ; -O0: csel w8, w8, w10, ne
9215 ; -O0: and w13, w8, #0x1
9216 ; -O0: ands w13, w13, #0x1
9217 ; -O0: csel x14, x10, x12, ne
9218 ; -O0: and w10, w8, #0x1
9219 ; -O0: ands w10, w10, #0x1
9220 ; -O0: csel x15, x8, x9, ne
9221 ; -O0: ldaxp x10, x9, [x11]
9224 ; -O0: stlxp w8, x14, x15, [x11]
9225 ; -O0: stlxp w8, x10, x9, [x11]
9226 ; -O0: eor x8, x10, x8
9227 ; -O0: eor x11, x9, x11
9228 ; -O0: orr x8, x8, x11
9229 ; -O0: subs x8, x8, #0
9231 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
9232 ; -O1: ldaxp x0, x1, [x8]
9234 ; -O1: csel x9, x1, x3, hs
9235 ; -O1: csel x10, x0, x2, hs
9236 ; -O1: stlxp w11, x10, x9, [x8]
9237 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
9241 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
9242 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
9243 ; -O0: and w9, w10, #0xff
9244 ; -O0: subs w9, w9, w8, uxtb
9245 ; -O0: and w9, w9, #0x1
9246 ; -O0: ands w9, w9, #0x1
9247 ; -O0: csel w12, w10, w8, ne
9248 ; -O0: ldaxrb w9, [x11]
9249 ; -O0: cmp w9, w10, uxtb
9250 ; -O0: stlxrb w8, w12, [x11]
9251 ; -O0: and w8, w9, #0xff
9252 ; -O0: subs w8, w8, w10, uxtb
9254 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
9255 ; -O1: and w9, w1, #0xff
9256 ; -O1: ldxrb w8, [x0]
9258 ; -O1: csel w10, w8, w9, ls
9259 ; -O1: stxrb w11, w10, [x0]
9260 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
9264 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
9265 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acquire:
9266 ; -O0: and w9, w10, #0xff
9267 ; -O0: subs w9, w9, w8, uxtb
9268 ; -O0: and w9, w9, #0x1
9269 ; -O0: ands w9, w9, #0x1
9270 ; -O0: csel w12, w10, w8, ne
9271 ; -O0: ldaxrb w9, [x11]
9272 ; -O0: cmp w9, w10, uxtb
9273 ; -O0: stlxrb w8, w12, [x11]
9274 ; -O0: and w8, w9, #0xff
9275 ; -O0: subs w8, w8, w10, uxtb
9277 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acquire:
9278 ; -O1: and w9, w1, #0xff
9279 ; -O1: ldaxrb w8, [x0]
9281 ; -O1: csel w10, w8, w9, ls
9282 ; -O1: stxrb w11, w10, [x0]
9283 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
9287 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
9288 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_release:
9289 ; -O0: and w9, w10, #0xff
9290 ; -O0: subs w9, w9, w8, uxtb
9291 ; -O0: and w9, w9, #0x1
9292 ; -O0: ands w9, w9, #0x1
9293 ; -O0: csel w12, w10, w8, ne
9294 ; -O0: ldaxrb w9, [x11]
9295 ; -O0: cmp w9, w10, uxtb
9296 ; -O0: stlxrb w8, w12, [x11]
9297 ; -O0: and w8, w9, #0xff
9298 ; -O0: subs w8, w8, w10, uxtb
9300 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_release:
9301 ; -O1: and w9, w1, #0xff
9302 ; -O1: ldxrb w8, [x0]
9304 ; -O1: csel w10, w8, w9, ls
9305 ; -O1: stlxrb w11, w10, [x0]
9306 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
9310 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
9311 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
9312 ; -O0: and w9, w10, #0xff
9313 ; -O0: subs w9, w9, w8, uxtb
9314 ; -O0: and w9, w9, #0x1
9315 ; -O0: ands w9, w9, #0x1
9316 ; -O0: csel w12, w10, w8, ne
9317 ; -O0: ldaxrb w9, [x11]
9318 ; -O0: cmp w9, w10, uxtb
9319 ; -O0: stlxrb w8, w12, [x11]
9320 ; -O0: and w8, w9, #0xff
9321 ; -O0: subs w8, w8, w10, uxtb
9323 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
9324 ; -O1: and w9, w1, #0xff
9325 ; -O1: ldaxrb w8, [x0]
9327 ; -O1: csel w10, w8, w9, ls
9328 ; -O1: stlxrb w11, w10, [x0]
9329 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
9333 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
9334 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
9335 ; -O0: and w9, w10, #0xff
9336 ; -O0: subs w9, w9, w8, uxtb
9337 ; -O0: and w9, w9, #0x1
9338 ; -O0: ands w9, w9, #0x1
9339 ; -O0: csel w12, w10, w8, ne
9340 ; -O0: ldaxrb w9, [x11]
9341 ; -O0: cmp w9, w10, uxtb
9342 ; -O0: stlxrb w8, w12, [x11]
9343 ; -O0: and w8, w9, #0xff
9344 ; -O0: subs w8, w8, w10, uxtb
9346 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
9347 ; -O1: and w9, w1, #0xff
9348 ; -O1: ldaxrb w8, [x0]
9350 ; -O1: csel w10, w8, w9, ls
9351 ; -O1: stlxrb w11, w10, [x0]
9352 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
9356 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
9357 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
9358 ; -O0: subs w10, w10, w8, uxth
9359 ; -O0: and w10, w10, #0x1
9360 ; -O0: ands w10, w10, #0x1
9361 ; -O0: csel w8, w9, w8, ne
9362 ; -O0: bl __atomic_compare_exchange
9364 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
9365 ; -O1: and w8, w0, #0xffff
9366 ; -O1: cmp w8, w20, uxth
9367 ; -O1: csel w8, w0, w20, ls
9368 ; -O1: bl __atomic_compare_exchange
9369 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
9373 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
9374 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
9375 ; -O0: subs w10, w10, w8, uxth
9376 ; -O0: and w10, w10, #0x1
9377 ; -O0: ands w10, w10, #0x1
9378 ; -O0: csel w8, w9, w8, ne
9379 ; -O0: bl __atomic_compare_exchange
9381 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
9382 ; -O1: and w8, w0, #0xffff
9383 ; -O1: cmp w8, w20, uxth
9384 ; -O1: csel w8, w0, w20, ls
9385 ; -O1: bl __atomic_compare_exchange
9386 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
9390 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
9391 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
9392 ; -O0: subs w10, w10, w8, uxth
9393 ; -O0: and w10, w10, #0x1
9394 ; -O0: ands w10, w10, #0x1
9395 ; -O0: csel w8, w9, w8, ne
9396 ; -O0: bl __atomic_compare_exchange
9398 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
9399 ; -O1: and w8, w0, #0xffff
9400 ; -O1: cmp w8, w20, uxth
9401 ; -O1: csel w8, w0, w20, ls
9402 ; -O1: bl __atomic_compare_exchange
9403 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
9407 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
9408 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
9409 ; -O0: subs w10, w10, w8, uxth
9410 ; -O0: and w10, w10, #0x1
9411 ; -O0: ands w10, w10, #0x1
9412 ; -O0: csel w8, w9, w8, ne
9413 ; -O0: bl __atomic_compare_exchange
9415 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
9416 ; -O1: and w8, w0, #0xffff
9417 ; -O1: cmp w8, w20, uxth
9418 ; -O1: csel w8, w0, w20, ls
9419 ; -O1: bl __atomic_compare_exchange
9420 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
9424 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
9425 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
9426 ; -O0: subs w10, w10, w8, uxth
9427 ; -O0: and w10, w10, #0x1
9428 ; -O0: ands w10, w10, #0x1
9429 ; -O0: csel w8, w9, w8, ne
9430 ; -O0: bl __atomic_compare_exchange
9432 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
9433 ; -O1: and w8, w0, #0xffff
9434 ; -O1: cmp w8, w20, uxth
9435 ; -O1: csel w8, w0, w20, ls
9436 ; -O1: bl __atomic_compare_exchange
9437 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
9441 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
9442 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
9443 ; -O0: subs w10, w9, w8
9444 ; -O0: and w10, w10, #0x1
9445 ; -O0: ands w10, w10, #0x1
9446 ; -O0: csel w8, w9, w8, ne
9447 ; -O0: bl __atomic_compare_exchange
9449 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
9451 ; -O1: csel w8, w0, w20, ls
9452 ; -O1: bl __atomic_compare_exchange
9453 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
9457 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
9458 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
9459 ; -O0: subs w10, w9, w8
9460 ; -O0: and w10, w10, #0x1
9461 ; -O0: ands w10, w10, #0x1
9462 ; -O0: csel w8, w9, w8, ne
9463 ; -O0: bl __atomic_compare_exchange
9465 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
9467 ; -O1: csel w8, w0, w20, ls
9468 ; -O1: bl __atomic_compare_exchange
9469 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
9473 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
9474 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
9475 ; -O0: subs w10, w9, w8
9476 ; -O0: and w10, w10, #0x1
9477 ; -O0: ands w10, w10, #0x1
9478 ; -O0: csel w8, w9, w8, ne
9479 ; -O0: bl __atomic_compare_exchange
9481 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
9483 ; -O1: csel w8, w0, w20, ls
9484 ; -O1: bl __atomic_compare_exchange
9485 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
9489 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
9490 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
9491 ; -O0: subs w10, w9, w8
9492 ; -O0: and w10, w10, #0x1
9493 ; -O0: ands w10, w10, #0x1
9494 ; -O0: csel w8, w9, w8, ne
9495 ; -O0: bl __atomic_compare_exchange
9497 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
9499 ; -O1: csel w8, w0, w20, ls
9500 ; -O1: bl __atomic_compare_exchange
9501 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
9505 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
9506 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
9507 ; -O0: subs w10, w9, w8
9508 ; -O0: and w10, w10, #0x1
9509 ; -O0: ands w10, w10, #0x1
9510 ; -O0: csel w8, w9, w8, ne
9511 ; -O0: bl __atomic_compare_exchange
9513 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
9515 ; -O1: csel w8, w0, w20, ls
9516 ; -O1: bl __atomic_compare_exchange
9517 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
9521 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
9522 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
9523 ; -O0: subs x10, x9, x8
9524 ; -O0: and w10, w10, #0x1
9525 ; -O0: ands w10, w10, #0x1
9526 ; -O0: csel x8, x9, x8, ne
9527 ; -O0: bl __atomic_compare_exchange
9529 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
9531 ; -O1: csel x8, x0, x20, ls
9532 ; -O1: bl __atomic_compare_exchange
9533 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
9537 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
9538 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
9539 ; -O0: subs x10, x9, x8
9540 ; -O0: and w10, w10, #0x1
9541 ; -O0: ands w10, w10, #0x1
9542 ; -O0: csel x8, x9, x8, ne
9543 ; -O0: bl __atomic_compare_exchange
9545 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
9547 ; -O1: csel x8, x0, x20, ls
9548 ; -O1: bl __atomic_compare_exchange
9549 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
9553 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
9554 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
9555 ; -O0: subs x10, x9, x8
9556 ; -O0: and w10, w10, #0x1
9557 ; -O0: ands w10, w10, #0x1
9558 ; -O0: csel x8, x9, x8, ne
9559 ; -O0: bl __atomic_compare_exchange
9561 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
9563 ; -O1: csel x8, x0, x20, ls
9564 ; -O1: bl __atomic_compare_exchange
9565 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
9569 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
9570 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
9571 ; -O0: subs x10, x9, x8
9572 ; -O0: and w10, w10, #0x1
9573 ; -O0: ands w10, w10, #0x1
9574 ; -O0: csel x8, x9, x8, ne
9575 ; -O0: bl __atomic_compare_exchange
9577 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
9579 ; -O1: csel x8, x0, x20, ls
9580 ; -O1: bl __atomic_compare_exchange
9581 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
9585 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
9586 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
9587 ; -O0: subs x10, x9, x8
9588 ; -O0: and w10, w10, #0x1
9589 ; -O0: ands w10, w10, #0x1
9590 ; -O0: csel x8, x9, x8, ne
9591 ; -O0: bl __atomic_compare_exchange
9593 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
9595 ; -O1: csel x8, x0, x20, ls
9596 ; -O1: bl __atomic_compare_exchange
9597 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
9601 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
9602 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
9603 ; -O0: subs x8, x8, x10
9604 ; -O0: subs x8, x8, x10
9605 ; -O0: subs x8, x8, x11
9606 ; -O0: and w12, w12, #0x1
9607 ; -O0: ands w12, w12, #0x1
9608 ; -O0: csel w8, w8, w9, ne
9609 ; -O0: and w12, w8, #0x1
9610 ; -O0: ands w12, w12, #0x1
9611 ; -O0: csel x9, x9, x11, ne
9612 ; -O0: and w11, w8, #0x1
9613 ; -O0: ands w11, w11, #0x1
9614 ; -O0: csel x8, x8, x10, ne
9615 ; -O0: bl __atomic_compare_exchange
9617 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
9618 ; -O1: ldp x0, x1, [x0]
9620 ; -O1: csel x8, x1, x19, hs
9621 ; -O1: csel x9, x0, x21, hs
9622 ; -O1: bl __atomic_compare_exchange
9623 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
9627 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
9628 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
9629 ; -O0: subs x8, x8, x10
9630 ; -O0: subs x8, x8, x10
9631 ; -O0: subs x8, x8, x11
9632 ; -O0: and w12, w12, #0x1
9633 ; -O0: ands w12, w12, #0x1
9634 ; -O0: csel w8, w8, w9, ne
9635 ; -O0: and w12, w8, #0x1
9636 ; -O0: ands w12, w12, #0x1
9637 ; -O0: csel x9, x9, x11, ne
9638 ; -O0: and w11, w8, #0x1
9639 ; -O0: ands w11, w11, #0x1
9640 ; -O0: csel x8, x8, x10, ne
9641 ; -O0: bl __atomic_compare_exchange
9643 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
9644 ; -O1: ldp x0, x1, [x0]
9646 ; -O1: csel x8, x1, x19, hs
9647 ; -O1: csel x9, x0, x21, hs
9648 ; -O1: bl __atomic_compare_exchange
9649 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
9653 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
9654 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
9655 ; -O0: subs x8, x8, x10
9656 ; -O0: subs x8, x8, x10
9657 ; -O0: subs x8, x8, x11
9658 ; -O0: and w12, w12, #0x1
9659 ; -O0: ands w12, w12, #0x1
9660 ; -O0: csel w8, w8, w9, ne
9661 ; -O0: and w12, w8, #0x1
9662 ; -O0: ands w12, w12, #0x1
9663 ; -O0: csel x9, x9, x11, ne
9664 ; -O0: and w11, w8, #0x1
9665 ; -O0: ands w11, w11, #0x1
9666 ; -O0: csel x8, x8, x10, ne
9667 ; -O0: bl __atomic_compare_exchange
9669 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
9670 ; -O1: ldp x0, x1, [x0]
9672 ; -O1: csel x8, x1, x19, hs
9673 ; -O1: csel x9, x0, x21, hs
9674 ; -O1: bl __atomic_compare_exchange
9675 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
9679 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
9680 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
9681 ; -O0: subs x8, x8, x10
9682 ; -O0: subs x8, x8, x10
9683 ; -O0: subs x8, x8, x11
9684 ; -O0: and w12, w12, #0x1
9685 ; -O0: ands w12, w12, #0x1
9686 ; -O0: csel w8, w8, w9, ne
9687 ; -O0: and w12, w8, #0x1
9688 ; -O0: ands w12, w12, #0x1
9689 ; -O0: csel x9, x9, x11, ne
9690 ; -O0: and w11, w8, #0x1
9691 ; -O0: ands w11, w11, #0x1
9692 ; -O0: csel x8, x8, x10, ne
9693 ; -O0: bl __atomic_compare_exchange
9695 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
9696 ; -O1: ldp x0, x1, [x0]
9698 ; -O1: csel x8, x1, x19, hs
9699 ; -O1: csel x9, x0, x21, hs
9700 ; -O1: bl __atomic_compare_exchange
9701 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
9705 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
9706 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
9707 ; -O0: subs x8, x8, x10
9708 ; -O0: subs x8, x8, x10
9709 ; -O0: subs x8, x8, x11
9710 ; -O0: and w12, w12, #0x1
9711 ; -O0: ands w12, w12, #0x1
9712 ; -O0: csel w8, w8, w9, ne
9713 ; -O0: and w12, w8, #0x1
9714 ; -O0: ands w12, w12, #0x1
9715 ; -O0: csel x9, x9, x11, ne
9716 ; -O0: and w11, w8, #0x1
9717 ; -O0: ands w11, w11, #0x1
9718 ; -O0: csel x8, x8, x10, ne
9719 ; -O0: bl __atomic_compare_exchange
9721 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
9722 ; -O1: ldp x0, x1, [x0]
9724 ; -O1: csel x8, x1, x19, hs
9725 ; -O1: csel x9, x0, x21, hs
9726 ; -O1: bl __atomic_compare_exchange
9727 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1