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=+rcpc -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+rcpc -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: subs w10, w10, #1
930 ; -O0: ldxp x10, x9, [x11]
933 ; -O0: stxp w8, x14, x15, [x11]
934 ; -O0: stxp w8, x10, x9, [x11]
935 ; -O0: eor x8, x10, x8
936 ; -O0: eor x11, x9, x11
937 ; -O0: orr x8, x8, x11
938 ; -O0: subs x8, x8, #0
940 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
941 ; -O1: ldxp x0, x1, [x8]
942 ; -O1: adds x9, x0, x2
943 ; -O1: stxp w11, x9, x10, [x8]
944 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
948 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
949 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
950 ; -O0: adds x14, x8, x10
951 ; -O0: subs w10, w10, #1
952 ; -O0: ldaxp x10, x9, [x11]
955 ; -O0: stxp w8, x14, x15, [x11]
956 ; -O0: stxp w8, x10, x9, [x11]
957 ; -O0: eor x8, x10, x8
958 ; -O0: eor x11, x9, x11
959 ; -O0: orr x8, x8, x11
960 ; -O0: subs x8, x8, #0
962 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
963 ; -O1: ldaxp x0, x1, [x8]
964 ; -O1: adds x9, x0, x2
965 ; -O1: stxp w11, x9, x10, [x8]
966 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
970 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
971 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
972 ; -O0: adds x14, x8, x10
973 ; -O0: subs w10, w10, #1
974 ; -O0: ldxp x10, x9, [x11]
977 ; -O0: stlxp w8, x14, x15, [x11]
978 ; -O0: stlxp w8, x10, x9, [x11]
979 ; -O0: eor x8, x10, x8
980 ; -O0: eor x11, x9, x11
981 ; -O0: orr x8, x8, x11
982 ; -O0: subs x8, x8, #0
984 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
985 ; -O1: ldxp x0, x1, [x8]
986 ; -O1: adds x9, x0, x2
987 ; -O1: stlxp w11, x9, x10, [x8]
988 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
992 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
993 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
994 ; -O0: adds x14, x8, x10
995 ; -O0: subs w10, w10, #1
996 ; -O0: ldaxp x10, x9, [x11]
999 ; -O0: stlxp w8, x14, x15, [x11]
1000 ; -O0: stlxp w8, x10, x9, [x11]
1001 ; -O0: eor x8, x10, x8
1002 ; -O0: eor x11, x9, x11
1003 ; -O0: orr x8, x8, x11
1004 ; -O0: subs x8, x8, #0
1006 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
1007 ; -O1: ldaxp x0, x1, [x8]
1008 ; -O1: adds x9, x0, x2
1009 ; -O1: stlxp w11, x9, x10, [x8]
1010 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
1014 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1015 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
1016 ; -O0: adds x14, x8, x10
1017 ; -O0: subs w10, w10, #1
1018 ; -O0: ldaxp x10, x9, [x11]
1021 ; -O0: stlxp w8, x14, x15, [x11]
1022 ; -O0: stlxp w8, x10, x9, [x11]
1023 ; -O0: eor x8, x10, x8
1024 ; -O0: eor x11, x9, x11
1025 ; -O0: orr x8, x8, x11
1026 ; -O0: subs x8, x8, #0
1028 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
1029 ; -O1: ldaxp x0, x1, [x8]
1030 ; -O1: adds x9, x0, x2
1031 ; -O1: stlxp w11, x9, x10, [x8]
1032 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
1036 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1037 ; -O0-LABEL: atomicrmw_add_i8_unaligned_monotonic:
1038 ; -O0: add w12, w8, w10, uxth
1039 ; -O0: ldaxrb w9, [x11]
1040 ; -O0: cmp w9, w10, uxtb
1041 ; -O0: stlxrb w8, w12, [x11]
1042 ; -O0: and w8, w9, #0xff
1043 ; -O0: subs w8, w8, w10, uxtb
1045 ; -O1-LABEL: atomicrmw_add_i8_unaligned_monotonic:
1046 ; -O1: ldxrb w8, [x0]
1047 ; -O1: add w9, w8, w1
1048 ; -O1: stxrb w10, w9, [x0]
1049 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
1053 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1054 ; -O0-LABEL: atomicrmw_add_i8_unaligned_acquire:
1055 ; -O0: add w12, w8, w10, uxth
1056 ; -O0: ldaxrb w9, [x11]
1057 ; -O0: cmp w9, w10, uxtb
1058 ; -O0: stlxrb w8, w12, [x11]
1059 ; -O0: and w8, w9, #0xff
1060 ; -O0: subs w8, w8, w10, uxtb
1062 ; -O1-LABEL: atomicrmw_add_i8_unaligned_acquire:
1063 ; -O1: ldaxrb w8, [x0]
1064 ; -O1: add w9, w8, w1
1065 ; -O1: stxrb w10, w9, [x0]
1066 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
1070 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
1071 ; -O0-LABEL: atomicrmw_add_i8_unaligned_release:
1072 ; -O0: add w12, w8, w10, uxth
1073 ; -O0: ldaxrb w9, [x11]
1074 ; -O0: cmp w9, w10, uxtb
1075 ; -O0: stlxrb w8, w12, [x11]
1076 ; -O0: and w8, w9, #0xff
1077 ; -O0: subs w8, w8, w10, uxtb
1079 ; -O1-LABEL: atomicrmw_add_i8_unaligned_release:
1080 ; -O1: ldxrb w8, [x0]
1081 ; -O1: add w9, w8, w1
1082 ; -O1: stlxrb w10, w9, [x0]
1083 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
1087 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1088 ; -O0-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
1089 ; -O0: add w12, w8, w10, uxth
1090 ; -O0: ldaxrb w9, [x11]
1091 ; -O0: cmp w9, w10, uxtb
1092 ; -O0: stlxrb w8, w12, [x11]
1093 ; -O0: and w8, w9, #0xff
1094 ; -O0: subs w8, w8, w10, uxtb
1096 ; -O1-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
1097 ; -O1: ldaxrb w8, [x0]
1098 ; -O1: add w9, w8, w1
1099 ; -O1: stlxrb w10, w9, [x0]
1100 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
1104 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1105 ; -O0-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
1106 ; -O0: add w12, w8, w10, uxth
1107 ; -O0: ldaxrb w9, [x11]
1108 ; -O0: cmp w9, w10, uxtb
1109 ; -O0: stlxrb w8, w12, [x11]
1110 ; -O0: and w8, w9, #0xff
1111 ; -O0: subs w8, w8, w10, uxtb
1113 ; -O1-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
1114 ; -O1: ldaxrb w8, [x0]
1115 ; -O1: add w9, w8, w1
1116 ; -O1: stlxrb w10, w9, [x0]
1117 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
1121 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1122 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
1123 ; -O0: add w8, w8, w9, uxth
1124 ; -O0: bl __atomic_compare_exchange
1126 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
1127 ; -O1: add w8, w0, w20
1128 ; -O1: bl __atomic_compare_exchange
1129 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
1133 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1134 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
1135 ; -O0: add w8, w8, w9, uxth
1136 ; -O0: bl __atomic_compare_exchange
1138 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
1139 ; -O1: add w8, w0, w20
1140 ; -O1: bl __atomic_compare_exchange
1141 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
1145 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
1146 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
1147 ; -O0: add w8, w8, w9, uxth
1148 ; -O0: bl __atomic_compare_exchange
1150 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
1151 ; -O1: add w8, w0, w20
1152 ; -O1: bl __atomic_compare_exchange
1153 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
1157 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1158 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
1159 ; -O0: add w8, w8, w9, uxth
1160 ; -O0: bl __atomic_compare_exchange
1162 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
1163 ; -O1: add w8, w0, w20
1164 ; -O1: bl __atomic_compare_exchange
1165 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
1169 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1170 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
1171 ; -O0: add w8, w8, w9, uxth
1172 ; -O0: bl __atomic_compare_exchange
1174 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
1175 ; -O1: add w8, w0, w20
1176 ; -O1: bl __atomic_compare_exchange
1177 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
1181 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1182 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
1183 ; -O0: add w8, w9, w8
1184 ; -O0: bl __atomic_compare_exchange
1186 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
1187 ; -O1: add w8, w0, w20
1188 ; -O1: bl __atomic_compare_exchange
1189 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
1193 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1194 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
1195 ; -O0: add w8, w9, w8
1196 ; -O0: bl __atomic_compare_exchange
1198 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
1199 ; -O1: add w8, w0, w20
1200 ; -O1: bl __atomic_compare_exchange
1201 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
1205 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
1206 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
1207 ; -O0: add w8, w9, w8
1208 ; -O0: bl __atomic_compare_exchange
1210 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
1211 ; -O1: add w8, w0, w20
1212 ; -O1: bl __atomic_compare_exchange
1213 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
1217 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1218 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
1219 ; -O0: add w8, w9, w8
1220 ; -O0: bl __atomic_compare_exchange
1222 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
1223 ; -O1: add w8, w0, w20
1224 ; -O1: bl __atomic_compare_exchange
1225 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
1229 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1230 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
1231 ; -O0: add w8, w9, w8
1232 ; -O0: bl __atomic_compare_exchange
1234 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
1235 ; -O1: add w8, w0, w20
1236 ; -O1: bl __atomic_compare_exchange
1237 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
1241 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1242 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
1243 ; -O0: add x8, x9, x8
1244 ; -O0: bl __atomic_compare_exchange
1246 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
1247 ; -O1: add x8, x0, x20
1248 ; -O1: bl __atomic_compare_exchange
1249 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
1253 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1254 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
1255 ; -O0: add x8, x9, x8
1256 ; -O0: bl __atomic_compare_exchange
1258 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
1259 ; -O1: add x8, x0, x20
1260 ; -O1: bl __atomic_compare_exchange
1261 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
1265 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
1266 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
1267 ; -O0: add x8, x9, x8
1268 ; -O0: bl __atomic_compare_exchange
1270 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
1271 ; -O1: add x8, x0, x20
1272 ; -O1: bl __atomic_compare_exchange
1273 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
1277 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1278 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
1279 ; -O0: add x8, x9, x8
1280 ; -O0: bl __atomic_compare_exchange
1282 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
1283 ; -O1: add x8, x0, x20
1284 ; -O1: bl __atomic_compare_exchange
1285 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
1289 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1290 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
1291 ; -O0: add x8, x9, x8
1292 ; -O0: bl __atomic_compare_exchange
1294 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
1295 ; -O1: add x8, x0, x20
1296 ; -O1: bl __atomic_compare_exchange
1297 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
1301 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1302 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
1303 ; -O0: adds x9, x8, x9
1304 ; -O0: subs w11, w11, #1
1305 ; -O0: bl __atomic_compare_exchange
1307 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
1308 ; -O1: ldp x0, x1, [x0]
1309 ; -O1: adds x8, x0, x21
1310 ; -O1: bl __atomic_compare_exchange
1311 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
1315 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1316 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
1317 ; -O0: adds x9, x8, x9
1318 ; -O0: subs w11, w11, #1
1319 ; -O0: bl __atomic_compare_exchange
1321 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
1322 ; -O1: ldp x0, x1, [x0]
1323 ; -O1: adds x8, x0, x21
1324 ; -O1: bl __atomic_compare_exchange
1325 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
1329 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
1330 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
1331 ; -O0: adds x9, x8, x9
1332 ; -O0: subs w11, w11, #1
1333 ; -O0: bl __atomic_compare_exchange
1335 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
1336 ; -O1: ldp x0, x1, [x0]
1337 ; -O1: adds x8, x0, x21
1338 ; -O1: bl __atomic_compare_exchange
1339 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
1343 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1344 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
1345 ; -O0: adds x9, x8, x9
1346 ; -O0: subs w11, w11, #1
1347 ; -O0: bl __atomic_compare_exchange
1349 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
1350 ; -O1: ldp x0, x1, [x0]
1351 ; -O1: adds x8, x0, x21
1352 ; -O1: bl __atomic_compare_exchange
1353 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
1357 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1358 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
1359 ; -O0: adds x9, x8, x9
1360 ; -O0: subs w11, w11, #1
1361 ; -O0: bl __atomic_compare_exchange
1363 ; -O1-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
1364 ; -O1: ldp x0, x1, [x0]
1365 ; -O1: adds x8, x0, x21
1366 ; -O1: bl __atomic_compare_exchange
1367 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 1
1371 define dso_local i8 @atomicrmw_sub_i8_aligned_monotonic(ptr %ptr, i8 %value) {
1372 ; -O0-LABEL: atomicrmw_sub_i8_aligned_monotonic:
1373 ; -O0: subs w12, w10, w8
1374 ; -O0: ldaxrb w9, [x11]
1375 ; -O0: cmp w9, w10, uxtb
1376 ; -O0: stlxrb w8, w12, [x11]
1377 ; -O0: and w8, w9, #0xff
1378 ; -O0: subs w8, w8, w10, uxtb
1380 ; -O1-LABEL: atomicrmw_sub_i8_aligned_monotonic:
1381 ; -O1: ldxrb w8, [x0]
1382 ; -O1: sub w9, w8, w1
1383 ; -O1: stxrb w10, w9, [x0]
1384 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1388 define dso_local i8 @atomicrmw_sub_i8_aligned_acquire(ptr %ptr, i8 %value) {
1389 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acquire:
1390 ; -O0: subs w12, w10, w8
1391 ; -O0: ldaxrb w9, [x11]
1392 ; -O0: cmp w9, w10, uxtb
1393 ; -O0: stlxrb w8, w12, [x11]
1394 ; -O0: and w8, w9, #0xff
1395 ; -O0: subs w8, w8, w10, uxtb
1397 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acquire:
1398 ; -O1: ldaxrb w8, [x0]
1399 ; -O1: sub w9, w8, w1
1400 ; -O1: stxrb w10, w9, [x0]
1401 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1405 define dso_local i8 @atomicrmw_sub_i8_aligned_release(ptr %ptr, i8 %value) {
1406 ; -O0-LABEL: atomicrmw_sub_i8_aligned_release:
1407 ; -O0: subs w12, w10, w8
1408 ; -O0: ldaxrb w9, [x11]
1409 ; -O0: cmp w9, w10, uxtb
1410 ; -O0: stlxrb w8, w12, [x11]
1411 ; -O0: and w8, w9, #0xff
1412 ; -O0: subs w8, w8, w10, uxtb
1414 ; -O1-LABEL: atomicrmw_sub_i8_aligned_release:
1415 ; -O1: ldxrb w8, [x0]
1416 ; -O1: sub w9, w8, w1
1417 ; -O1: stlxrb w10, w9, [x0]
1418 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1422 define dso_local i8 @atomicrmw_sub_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
1423 ; -O0-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
1424 ; -O0: subs w12, w10, w8
1425 ; -O0: ldaxrb w9, [x11]
1426 ; -O0: cmp w9, w10, uxtb
1427 ; -O0: stlxrb w8, w12, [x11]
1428 ; -O0: and w8, w9, #0xff
1429 ; -O0: subs w8, w8, w10, uxtb
1431 ; -O1-LABEL: atomicrmw_sub_i8_aligned_acq_rel:
1432 ; -O1: ldaxrb w8, [x0]
1433 ; -O1: sub w9, w8, w1
1434 ; -O1: stlxrb w10, w9, [x0]
1435 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1439 define dso_local i8 @atomicrmw_sub_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
1440 ; -O0-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
1441 ; -O0: subs w12, w10, w8
1442 ; -O0: ldaxrb w9, [x11]
1443 ; -O0: cmp w9, w10, uxtb
1444 ; -O0: stlxrb w8, w12, [x11]
1445 ; -O0: and w8, w9, #0xff
1446 ; -O0: subs w8, w8, w10, uxtb
1448 ; -O1-LABEL: atomicrmw_sub_i8_aligned_seq_cst:
1449 ; -O1: ldaxrb w8, [x0]
1450 ; -O1: sub w9, w8, w1
1451 ; -O1: stlxrb w10, w9, [x0]
1452 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1456 define dso_local i16 @atomicrmw_sub_i16_aligned_monotonic(ptr %ptr, i16 %value) {
1457 ; -O0-LABEL: atomicrmw_sub_i16_aligned_monotonic:
1458 ; -O0: subs w12, w8, w9
1459 ; -O0: ldaxrh w9, [x11]
1460 ; -O0: cmp w9, w8, uxth
1461 ; -O0: stlxrh w10, w12, [x11]
1462 ; -O0: subs w8, w8, w9, uxth
1464 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
1465 ; -O1: ldxrh w8, [x0]
1466 ; -O1: sub w9, w8, w1
1467 ; -O1: stxrh w10, w9, [x0]
1468 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
1472 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
1473 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
1474 ; -O0: subs w12, w8, w9
1475 ; -O0: ldaxrh w9, [x11]
1476 ; -O0: cmp w9, w8, uxth
1477 ; -O0: stlxrh w10, w12, [x11]
1478 ; -O0: subs w8, w8, w9, uxth
1480 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
1481 ; -O1: ldaxrh w8, [x0]
1482 ; -O1: sub w9, w8, w1
1483 ; -O1: stxrh w10, w9, [x0]
1484 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
1488 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
1489 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
1490 ; -O0: subs w12, w8, w9
1491 ; -O0: ldaxrh w9, [x11]
1492 ; -O0: cmp w9, w8, uxth
1493 ; -O0: stlxrh w10, w12, [x11]
1494 ; -O0: subs w8, w8, w9, uxth
1496 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
1497 ; -O1: ldxrh w8, [x0]
1498 ; -O1: sub w9, w8, w1
1499 ; -O1: stlxrh w10, w9, [x0]
1500 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
1504 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1505 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1506 ; -O0: subs w12, w8, w9
1507 ; -O0: ldaxrh w9, [x11]
1508 ; -O0: cmp w9, w8, uxth
1509 ; -O0: stlxrh w10, w12, [x11]
1510 ; -O0: subs w8, w8, w9, uxth
1512 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1513 ; -O1: ldaxrh w8, [x0]
1514 ; -O1: sub w9, w8, w1
1515 ; -O1: stlxrh w10, w9, [x0]
1516 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
1520 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1521 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1522 ; -O0: subs w12, w8, w9
1523 ; -O0: ldaxrh w9, [x11]
1524 ; -O0: cmp w9, w8, uxth
1525 ; -O0: stlxrh w10, w12, [x11]
1526 ; -O0: subs w8, w8, w9, uxth
1528 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1529 ; -O1: ldaxrh w8, [x0]
1530 ; -O1: sub w9, w8, w1
1531 ; -O1: stlxrh w10, w9, [x0]
1532 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1536 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1537 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1538 ; -O0: subs w12, w8, w9
1539 ; -O0: ldaxr w9, [x11]
1541 ; -O0: stlxr w10, w12, [x11]
1542 ; -O0: subs w8, w9, w8
1544 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1545 ; -O1: ldxr w8, [x0]
1546 ; -O1: sub w9, w8, w1
1547 ; -O1: stxr w10, w9, [x0]
1548 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1552 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1553 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
1554 ; -O0: subs w12, w8, w9
1555 ; -O0: ldaxr w9, [x11]
1557 ; -O0: stlxr w10, w12, [x11]
1558 ; -O0: subs w8, w9, w8
1560 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1561 ; -O1: ldaxr w8, [x0]
1562 ; -O1: sub w9, w8, w1
1563 ; -O1: stxr w10, w9, [x0]
1564 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1568 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1569 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1570 ; -O0: subs w12, w8, w9
1571 ; -O0: ldaxr w9, [x11]
1573 ; -O0: stlxr w10, w12, [x11]
1574 ; -O0: subs w8, w9, w8
1576 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1577 ; -O1: ldxr w8, [x0]
1578 ; -O1: sub w9, w8, w1
1579 ; -O1: stlxr w10, w9, [x0]
1580 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1584 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1585 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1586 ; -O0: subs w12, w8, w9
1587 ; -O0: ldaxr w9, [x11]
1589 ; -O0: stlxr w10, w12, [x11]
1590 ; -O0: subs w8, w9, w8
1592 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1593 ; -O1: ldaxr w8, [x0]
1594 ; -O1: sub w9, w8, w1
1595 ; -O1: stlxr w10, w9, [x0]
1596 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1600 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1601 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1602 ; -O0: subs w12, w8, w9
1603 ; -O0: ldaxr w9, [x11]
1605 ; -O0: stlxr w10, w12, [x11]
1606 ; -O0: subs w8, w9, w8
1608 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1609 ; -O1: ldaxr w8, [x0]
1610 ; -O1: sub w9, w8, w1
1611 ; -O1: stlxr w10, w9, [x0]
1612 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1616 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1617 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1618 ; -O0: subs x12, x8, x9
1619 ; -O0: ldaxr x9, [x11]
1621 ; -O0: stlxr w10, x12, [x11]
1622 ; -O0: subs x8, x9, x8
1624 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1625 ; -O1: ldxr x0, [x8]
1626 ; -O1: sub x9, x0, x1
1627 ; -O1: stxr w10, x9, [x8]
1628 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1632 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1633 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1634 ; -O0: subs x12, x8, x9
1635 ; -O0: ldaxr x9, [x11]
1637 ; -O0: stlxr w10, x12, [x11]
1638 ; -O0: subs x8, x9, x8
1640 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1641 ; -O1: ldaxr x0, [x8]
1642 ; -O1: sub x9, x0, x1
1643 ; -O1: stxr w10, x9, [x8]
1644 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1648 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1649 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1650 ; -O0: subs x12, x8, x9
1651 ; -O0: ldaxr x9, [x11]
1653 ; -O0: stlxr w10, x12, [x11]
1654 ; -O0: subs x8, x9, x8
1656 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1657 ; -O1: ldxr x0, [x8]
1658 ; -O1: sub x9, x0, x1
1659 ; -O1: stlxr w10, x9, [x8]
1660 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1664 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1665 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1666 ; -O0: subs x12, x8, x9
1667 ; -O0: ldaxr x9, [x11]
1669 ; -O0: stlxr w10, x12, [x11]
1670 ; -O0: subs x8, x9, x8
1672 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1673 ; -O1: ldaxr x0, [x8]
1674 ; -O1: sub x9, x0, x1
1675 ; -O1: stlxr w10, x9, [x8]
1676 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1680 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1681 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1682 ; -O0: subs x12, x8, x9
1683 ; -O0: ldaxr x9, [x11]
1685 ; -O0: stlxr w10, x12, [x11]
1686 ; -O0: subs x8, x9, x8
1688 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1689 ; -O1: ldaxr x0, [x8]
1690 ; -O1: sub x9, x0, x1
1691 ; -O1: stlxr w10, x9, [x8]
1692 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1696 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1697 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1698 ; -O0: subs x14, x8, x10
1699 ; -O0: ldxp x10, x9, [x11]
1702 ; -O0: stxp w8, x14, x15, [x11]
1703 ; -O0: stxp w8, x10, x9, [x11]
1704 ; -O0: eor x8, x10, x8
1705 ; -O0: eor x11, x9, x11
1706 ; -O0: orr x8, x8, x11
1707 ; -O0: subs x8, x8, #0
1709 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1710 ; -O1: ldxp x0, x1, [x8]
1711 ; -O1: subs x9, x0, x2
1712 ; -O1: stxp w11, x9, x10, [x8]
1713 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1717 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1718 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1719 ; -O0: subs x14, x8, x10
1720 ; -O0: ldaxp x10, x9, [x11]
1723 ; -O0: stxp w8, x14, x15, [x11]
1724 ; -O0: stxp w8, x10, x9, [x11]
1725 ; -O0: eor x8, x10, x8
1726 ; -O0: eor x11, x9, x11
1727 ; -O0: orr x8, x8, x11
1728 ; -O0: subs x8, x8, #0
1730 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1731 ; -O1: ldaxp x0, x1, [x8]
1732 ; -O1: subs x9, x0, x2
1733 ; -O1: stxp w11, x9, x10, [x8]
1734 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1738 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1739 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1740 ; -O0: subs x14, x8, x10
1741 ; -O0: ldxp x10, x9, [x11]
1744 ; -O0: stlxp w8, x14, x15, [x11]
1745 ; -O0: stlxp w8, x10, x9, [x11]
1746 ; -O0: eor x8, x10, x8
1747 ; -O0: eor x11, x9, x11
1748 ; -O0: orr x8, x8, x11
1749 ; -O0: subs x8, x8, #0
1751 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1752 ; -O1: ldxp x0, x1, [x8]
1753 ; -O1: subs x9, x0, x2
1754 ; -O1: stlxp w11, x9, x10, [x8]
1755 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1759 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1760 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1761 ; -O0: subs x14, x8, x10
1762 ; -O0: ldaxp x10, x9, [x11]
1765 ; -O0: stlxp w8, x14, x15, [x11]
1766 ; -O0: stlxp w8, x10, x9, [x11]
1767 ; -O0: eor x8, x10, x8
1768 ; -O0: eor x11, x9, x11
1769 ; -O0: orr x8, x8, x11
1770 ; -O0: subs x8, x8, #0
1772 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1773 ; -O1: ldaxp x0, x1, [x8]
1774 ; -O1: subs x9, x0, x2
1775 ; -O1: stlxp w11, x9, x10, [x8]
1776 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1780 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1781 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1782 ; -O0: subs x14, x8, x10
1783 ; -O0: ldaxp x10, x9, [x11]
1786 ; -O0: stlxp w8, x14, x15, [x11]
1787 ; -O0: stlxp w8, x10, x9, [x11]
1788 ; -O0: eor x8, x10, x8
1789 ; -O0: eor x11, x9, x11
1790 ; -O0: orr x8, x8, x11
1791 ; -O0: subs x8, x8, #0
1793 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1794 ; -O1: ldaxp x0, x1, [x8]
1795 ; -O1: subs x9, x0, x2
1796 ; -O1: stlxp w11, x9, x10, [x8]
1797 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1801 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1802 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1803 ; -O0: subs w12, w10, w8
1804 ; -O0: ldaxrb w9, [x11]
1805 ; -O0: cmp w9, w10, uxtb
1806 ; -O0: stlxrb w8, w12, [x11]
1807 ; -O0: and w8, w9, #0xff
1808 ; -O0: subs w8, w8, w10, uxtb
1810 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1811 ; -O1: ldxrb w8, [x0]
1812 ; -O1: sub w9, w8, w1
1813 ; -O1: stxrb w10, w9, [x0]
1814 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1818 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1819 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1820 ; -O0: subs w12, w10, w8
1821 ; -O0: ldaxrb w9, [x11]
1822 ; -O0: cmp w9, w10, uxtb
1823 ; -O0: stlxrb w8, w12, [x11]
1824 ; -O0: and w8, w9, #0xff
1825 ; -O0: subs w8, w8, w10, uxtb
1827 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1828 ; -O1: ldaxrb w8, [x0]
1829 ; -O1: sub w9, w8, w1
1830 ; -O1: stxrb w10, w9, [x0]
1831 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1835 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1836 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1837 ; -O0: subs w12, w10, w8
1838 ; -O0: ldaxrb w9, [x11]
1839 ; -O0: cmp w9, w10, uxtb
1840 ; -O0: stlxrb w8, w12, [x11]
1841 ; -O0: and w8, w9, #0xff
1842 ; -O0: subs w8, w8, w10, uxtb
1844 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1845 ; -O1: ldxrb w8, [x0]
1846 ; -O1: sub w9, w8, w1
1847 ; -O1: stlxrb w10, w9, [x0]
1848 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1852 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1853 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1854 ; -O0: subs w12, w10, w8
1855 ; -O0: ldaxrb w9, [x11]
1856 ; -O0: cmp w9, w10, uxtb
1857 ; -O0: stlxrb w8, w12, [x11]
1858 ; -O0: and w8, w9, #0xff
1859 ; -O0: subs w8, w8, w10, uxtb
1861 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1862 ; -O1: ldaxrb w8, [x0]
1863 ; -O1: sub w9, w8, w1
1864 ; -O1: stlxrb w10, w9, [x0]
1865 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1869 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1870 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1871 ; -O0: subs w12, w10, w8
1872 ; -O0: ldaxrb w9, [x11]
1873 ; -O0: cmp w9, w10, uxtb
1874 ; -O0: stlxrb w8, w12, [x11]
1875 ; -O0: and w8, w9, #0xff
1876 ; -O0: subs w8, w8, w10, uxtb
1878 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1879 ; -O1: ldaxrb w8, [x0]
1880 ; -O1: sub w9, w8, w1
1881 ; -O1: stlxrb w10, w9, [x0]
1882 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1886 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1887 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1888 ; -O0: subs w8, w9, w8
1889 ; -O0: bl __atomic_compare_exchange
1891 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1892 ; -O1: sub w8, w0, w20
1893 ; -O1: bl __atomic_compare_exchange
1894 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1898 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1899 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1900 ; -O0: subs w8, w9, w8
1901 ; -O0: bl __atomic_compare_exchange
1903 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1904 ; -O1: sub w8, w0, w20
1905 ; -O1: bl __atomic_compare_exchange
1906 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1910 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1911 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1912 ; -O0: subs w8, w9, w8
1913 ; -O0: bl __atomic_compare_exchange
1915 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1916 ; -O1: sub w8, w0, w20
1917 ; -O1: bl __atomic_compare_exchange
1918 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1922 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1923 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1924 ; -O0: subs w8, w9, w8
1925 ; -O0: bl __atomic_compare_exchange
1927 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1928 ; -O1: sub w8, w0, w20
1929 ; -O1: bl __atomic_compare_exchange
1930 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1934 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1935 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1936 ; -O0: subs w8, w9, w8
1937 ; -O0: bl __atomic_compare_exchange
1939 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1940 ; -O1: sub w8, w0, w20
1941 ; -O1: bl __atomic_compare_exchange
1942 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1946 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1947 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1948 ; -O0: subs w8, w9, w8
1949 ; -O0: bl __atomic_compare_exchange
1951 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1952 ; -O1: sub w8, w0, w20
1953 ; -O1: bl __atomic_compare_exchange
1954 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1958 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1959 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1960 ; -O0: subs w8, w9, w8
1961 ; -O0: bl __atomic_compare_exchange
1963 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1964 ; -O1: sub w8, w0, w20
1965 ; -O1: bl __atomic_compare_exchange
1966 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1970 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1971 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1972 ; -O0: subs w8, w9, w8
1973 ; -O0: bl __atomic_compare_exchange
1975 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1976 ; -O1: sub w8, w0, w20
1977 ; -O1: bl __atomic_compare_exchange
1978 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1982 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1983 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1984 ; -O0: subs w8, w9, w8
1985 ; -O0: bl __atomic_compare_exchange
1987 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1988 ; -O1: sub w8, w0, w20
1989 ; -O1: bl __atomic_compare_exchange
1990 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1994 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1995 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
1996 ; -O0: subs w8, w9, w8
1997 ; -O0: bl __atomic_compare_exchange
1999 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
2000 ; -O1: sub w8, w0, w20
2001 ; -O1: bl __atomic_compare_exchange
2002 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
2006 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2007 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
2008 ; -O0: subs x8, x9, x8
2009 ; -O0: bl __atomic_compare_exchange
2011 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
2012 ; -O1: sub x8, x0, x20
2013 ; -O1: bl __atomic_compare_exchange
2014 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
2018 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2019 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
2020 ; -O0: subs x8, x9, x8
2021 ; -O0: bl __atomic_compare_exchange
2023 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
2024 ; -O1: sub x8, x0, x20
2025 ; -O1: bl __atomic_compare_exchange
2026 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
2030 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
2031 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
2032 ; -O0: subs x8, x9, x8
2033 ; -O0: bl __atomic_compare_exchange
2035 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
2036 ; -O1: sub x8, x0, x20
2037 ; -O1: bl __atomic_compare_exchange
2038 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
2042 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2043 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
2044 ; -O0: subs x8, x9, x8
2045 ; -O0: bl __atomic_compare_exchange
2047 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
2048 ; -O1: sub x8, x0, x20
2049 ; -O1: bl __atomic_compare_exchange
2050 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
2054 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2055 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
2056 ; -O0: subs x8, x9, x8
2057 ; -O0: bl __atomic_compare_exchange
2059 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
2060 ; -O1: sub x8, x0, x20
2061 ; -O1: bl __atomic_compare_exchange
2062 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
2066 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2067 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
2068 ; -O0: subs x9, x8, x9
2069 ; -O0: bl __atomic_compare_exchange
2071 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
2072 ; -O1: ldp x0, x1, [x0]
2073 ; -O1: subs x8, x0, x21
2074 ; -O1: bl __atomic_compare_exchange
2075 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
2079 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2080 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
2081 ; -O0: subs x9, x8, x9
2082 ; -O0: bl __atomic_compare_exchange
2084 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
2085 ; -O1: ldp x0, x1, [x0]
2086 ; -O1: subs x8, x0, x21
2087 ; -O1: bl __atomic_compare_exchange
2088 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
2092 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
2093 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
2094 ; -O0: subs x9, x8, x9
2095 ; -O0: bl __atomic_compare_exchange
2097 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
2098 ; -O1: ldp x0, x1, [x0]
2099 ; -O1: subs x8, x0, x21
2100 ; -O1: bl __atomic_compare_exchange
2101 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
2105 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2106 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
2107 ; -O0: subs x9, x8, x9
2108 ; -O0: bl __atomic_compare_exchange
2110 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
2111 ; -O1: ldp x0, x1, [x0]
2112 ; -O1: subs x8, x0, x21
2113 ; -O1: bl __atomic_compare_exchange
2114 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
2118 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2119 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
2120 ; -O0: subs x9, x8, x9
2121 ; -O0: bl __atomic_compare_exchange
2123 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
2124 ; -O1: ldp x0, x1, [x0]
2125 ; -O1: subs x8, x0, x21
2126 ; -O1: bl __atomic_compare_exchange
2127 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
2131 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2132 ; -O0-LABEL: atomicrmw_and_i8_aligned_monotonic:
2133 ; -O0: and w12, w10, w8
2134 ; -O0: ldaxrb w9, [x11]
2135 ; -O0: cmp w9, w10, uxtb
2136 ; -O0: stlxrb w8, w12, [x11]
2137 ; -O0: and w8, w9, #0xff
2138 ; -O0: subs w8, w8, w10, uxtb
2140 ; -O1-LABEL: atomicrmw_and_i8_aligned_monotonic:
2141 ; -O1: ldxrb w8, [x0]
2142 ; -O1: and w9, w8, w1
2143 ; -O1: stxrb w10, w9, [x0]
2144 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
2148 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
2149 ; -O0-LABEL: atomicrmw_and_i8_aligned_acquire:
2150 ; -O0: and w12, w10, w8
2151 ; -O0: ldaxrb w9, [x11]
2152 ; -O0: cmp w9, w10, uxtb
2153 ; -O0: stlxrb w8, w12, [x11]
2154 ; -O0: and w8, w9, #0xff
2155 ; -O0: subs w8, w8, w10, uxtb
2157 ; -O1-LABEL: atomicrmw_and_i8_aligned_acquire:
2158 ; -O1: ldaxrb w8, [x0]
2159 ; -O1: and w9, w8, w1
2160 ; -O1: stxrb w10, w9, [x0]
2161 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
2165 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
2166 ; -O0-LABEL: atomicrmw_and_i8_aligned_release:
2167 ; -O0: and w12, w10, w8
2168 ; -O0: ldaxrb w9, [x11]
2169 ; -O0: cmp w9, w10, uxtb
2170 ; -O0: stlxrb w8, w12, [x11]
2171 ; -O0: and w8, w9, #0xff
2172 ; -O0: subs w8, w8, w10, uxtb
2174 ; -O1-LABEL: atomicrmw_and_i8_aligned_release:
2175 ; -O1: ldxrb w8, [x0]
2176 ; -O1: and w9, w8, w1
2177 ; -O1: stlxrb w10, w9, [x0]
2178 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
2182 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2183 ; -O0-LABEL: atomicrmw_and_i8_aligned_acq_rel:
2184 ; -O0: and w12, w10, w8
2185 ; -O0: ldaxrb w9, [x11]
2186 ; -O0: cmp w9, w10, uxtb
2187 ; -O0: stlxrb w8, w12, [x11]
2188 ; -O0: and w8, w9, #0xff
2189 ; -O0: subs w8, w8, w10, uxtb
2191 ; -O1-LABEL: atomicrmw_and_i8_aligned_acq_rel:
2192 ; -O1: ldaxrb w8, [x0]
2193 ; -O1: and w9, w8, w1
2194 ; -O1: stlxrb w10, w9, [x0]
2195 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
2199 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2200 ; -O0-LABEL: atomicrmw_and_i8_aligned_seq_cst:
2201 ; -O0: and w12, w10, w8
2202 ; -O0: ldaxrb w9, [x11]
2203 ; -O0: cmp w9, w10, uxtb
2204 ; -O0: stlxrb w8, w12, [x11]
2205 ; -O0: and w8, w9, #0xff
2206 ; -O0: subs w8, w8, w10, uxtb
2208 ; -O1-LABEL: atomicrmw_and_i8_aligned_seq_cst:
2209 ; -O1: ldaxrb w8, [x0]
2210 ; -O1: and w9, w8, w1
2211 ; -O1: stlxrb w10, w9, [x0]
2212 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
2216 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2217 ; -O0-LABEL: atomicrmw_and_i16_aligned_monotonic:
2218 ; -O0: and w12, w8, w9
2219 ; -O0: ldaxrh w9, [x11]
2220 ; -O0: cmp w9, w8, uxth
2221 ; -O0: stlxrh w10, w12, [x11]
2222 ; -O0: subs w8, w8, w9, uxth
2224 ; -O1-LABEL: atomicrmw_and_i16_aligned_monotonic:
2225 ; -O1: ldxrh w8, [x0]
2226 ; -O1: and w9, w8, w1
2227 ; -O1: stxrh w10, w9, [x0]
2228 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
2232 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
2233 ; -O0-LABEL: atomicrmw_and_i16_aligned_acquire:
2234 ; -O0: and w12, w8, w9
2235 ; -O0: ldaxrh w9, [x11]
2236 ; -O0: cmp w9, w8, uxth
2237 ; -O0: stlxrh w10, w12, [x11]
2238 ; -O0: subs w8, w8, w9, uxth
2240 ; -O1-LABEL: atomicrmw_and_i16_aligned_acquire:
2241 ; -O1: ldaxrh w8, [x0]
2242 ; -O1: and w9, w8, w1
2243 ; -O1: stxrh w10, w9, [x0]
2244 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
2248 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
2249 ; -O0-LABEL: atomicrmw_and_i16_aligned_release:
2250 ; -O0: and w12, w8, w9
2251 ; -O0: ldaxrh w9, [x11]
2252 ; -O0: cmp w9, w8, uxth
2253 ; -O0: stlxrh w10, w12, [x11]
2254 ; -O0: subs w8, w8, w9, uxth
2256 ; -O1-LABEL: atomicrmw_and_i16_aligned_release:
2257 ; -O1: ldxrh w8, [x0]
2258 ; -O1: and w9, w8, w1
2259 ; -O1: stlxrh w10, w9, [x0]
2260 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
2264 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2265 ; -O0-LABEL: atomicrmw_and_i16_aligned_acq_rel:
2266 ; -O0: and w12, w8, w9
2267 ; -O0: ldaxrh w9, [x11]
2268 ; -O0: cmp w9, w8, uxth
2269 ; -O0: stlxrh w10, w12, [x11]
2270 ; -O0: subs w8, w8, w9, uxth
2272 ; -O1-LABEL: atomicrmw_and_i16_aligned_acq_rel:
2273 ; -O1: ldaxrh w8, [x0]
2274 ; -O1: and w9, w8, w1
2275 ; -O1: stlxrh w10, w9, [x0]
2276 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
2280 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2281 ; -O0-LABEL: atomicrmw_and_i16_aligned_seq_cst:
2282 ; -O0: and w12, w8, w9
2283 ; -O0: ldaxrh w9, [x11]
2284 ; -O0: cmp w9, w8, uxth
2285 ; -O0: stlxrh w10, w12, [x11]
2286 ; -O0: subs w8, w8, w9, uxth
2288 ; -O1-LABEL: atomicrmw_and_i16_aligned_seq_cst:
2289 ; -O1: ldaxrh w8, [x0]
2290 ; -O1: and w9, w8, w1
2291 ; -O1: stlxrh w10, w9, [x0]
2292 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
2296 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2297 ; -O0-LABEL: atomicrmw_and_i32_aligned_monotonic:
2298 ; -O0: and w12, w8, w9
2299 ; -O0: ldaxr w9, [x11]
2301 ; -O0: stlxr w10, w12, [x11]
2302 ; -O0: subs w8, w9, w8
2304 ; -O1-LABEL: atomicrmw_and_i32_aligned_monotonic:
2305 ; -O1: ldxr w8, [x0]
2306 ; -O1: and w9, w8, w1
2307 ; -O1: stxr w10, w9, [x0]
2308 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
2312 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
2313 ; -O0-LABEL: atomicrmw_and_i32_aligned_acquire:
2314 ; -O0: and w12, w8, w9
2315 ; -O0: ldaxr w9, [x11]
2317 ; -O0: stlxr w10, w12, [x11]
2318 ; -O0: subs w8, w9, w8
2320 ; -O1-LABEL: atomicrmw_and_i32_aligned_acquire:
2321 ; -O1: ldaxr w8, [x0]
2322 ; -O1: and w9, w8, w1
2323 ; -O1: stxr w10, w9, [x0]
2324 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
2328 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
2329 ; -O0-LABEL: atomicrmw_and_i32_aligned_release:
2330 ; -O0: and w12, w8, w9
2331 ; -O0: ldaxr w9, [x11]
2333 ; -O0: stlxr w10, w12, [x11]
2334 ; -O0: subs w8, w9, w8
2336 ; -O1-LABEL: atomicrmw_and_i32_aligned_release:
2337 ; -O1: ldxr w8, [x0]
2338 ; -O1: and w9, w8, w1
2339 ; -O1: stlxr w10, w9, [x0]
2340 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
2344 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2345 ; -O0-LABEL: atomicrmw_and_i32_aligned_acq_rel:
2346 ; -O0: and w12, w8, w9
2347 ; -O0: ldaxr w9, [x11]
2349 ; -O0: stlxr w10, w12, [x11]
2350 ; -O0: subs w8, w9, w8
2352 ; -O1-LABEL: atomicrmw_and_i32_aligned_acq_rel:
2353 ; -O1: ldaxr w8, [x0]
2354 ; -O1: and w9, w8, w1
2355 ; -O1: stlxr w10, w9, [x0]
2356 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
2360 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2361 ; -O0-LABEL: atomicrmw_and_i32_aligned_seq_cst:
2362 ; -O0: and w12, w8, w9
2363 ; -O0: ldaxr w9, [x11]
2365 ; -O0: stlxr w10, w12, [x11]
2366 ; -O0: subs w8, w9, w8
2368 ; -O1-LABEL: atomicrmw_and_i32_aligned_seq_cst:
2369 ; -O1: ldaxr w8, [x0]
2370 ; -O1: and w9, w8, w1
2371 ; -O1: stlxr w10, w9, [x0]
2372 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
2376 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2377 ; -O0-LABEL: atomicrmw_and_i64_aligned_monotonic:
2378 ; -O0: and x12, x8, x9
2379 ; -O0: ldaxr x9, [x11]
2381 ; -O0: stlxr w10, x12, [x11]
2382 ; -O0: subs x8, x9, x8
2384 ; -O1-LABEL: atomicrmw_and_i64_aligned_monotonic:
2385 ; -O1: ldxr x0, [x8]
2386 ; -O1: and x9, x0, x1
2387 ; -O1: stxr w10, x9, [x8]
2388 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
2392 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
2393 ; -O0-LABEL: atomicrmw_and_i64_aligned_acquire:
2394 ; -O0: and x12, x8, x9
2395 ; -O0: ldaxr x9, [x11]
2397 ; -O0: stlxr w10, x12, [x11]
2398 ; -O0: subs x8, x9, x8
2400 ; -O1-LABEL: atomicrmw_and_i64_aligned_acquire:
2401 ; -O1: ldaxr x0, [x8]
2402 ; -O1: and x9, x0, x1
2403 ; -O1: stxr w10, x9, [x8]
2404 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
2408 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
2409 ; -O0-LABEL: atomicrmw_and_i64_aligned_release:
2410 ; -O0: and x12, x8, x9
2411 ; -O0: ldaxr x9, [x11]
2413 ; -O0: stlxr w10, x12, [x11]
2414 ; -O0: subs x8, x9, x8
2416 ; -O1-LABEL: atomicrmw_and_i64_aligned_release:
2417 ; -O1: ldxr x0, [x8]
2418 ; -O1: and x9, x0, x1
2419 ; -O1: stlxr w10, x9, [x8]
2420 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
2424 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2425 ; -O0-LABEL: atomicrmw_and_i64_aligned_acq_rel:
2426 ; -O0: and x12, x8, x9
2427 ; -O0: ldaxr x9, [x11]
2429 ; -O0: stlxr w10, x12, [x11]
2430 ; -O0: subs x8, x9, x8
2432 ; -O1-LABEL: atomicrmw_and_i64_aligned_acq_rel:
2433 ; -O1: ldaxr x0, [x8]
2434 ; -O1: and x9, x0, x1
2435 ; -O1: stlxr w10, x9, [x8]
2436 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
2440 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2441 ; -O0-LABEL: atomicrmw_and_i64_aligned_seq_cst:
2442 ; -O0: and x12, x8, x9
2443 ; -O0: ldaxr x9, [x11]
2445 ; -O0: stlxr w10, x12, [x11]
2446 ; -O0: subs x8, x9, x8
2448 ; -O1-LABEL: atomicrmw_and_i64_aligned_seq_cst:
2449 ; -O1: ldaxr x0, [x8]
2450 ; -O1: and x9, x0, x1
2451 ; -O1: stlxr w10, x9, [x8]
2452 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
2456 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2457 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
2458 ; -O0: and x14, x8, x10
2459 ; -O0: and x15, x8, x9
2460 ; -O0: ldxp x10, x9, [x11]
2463 ; -O0: stxp w8, x14, x15, [x11]
2464 ; -O0: stxp w8, x10, x9, [x11]
2465 ; -O0: eor x8, x10, x8
2466 ; -O0: eor x11, x9, x11
2467 ; -O0: orr x8, x8, x11
2468 ; -O0: subs x8, x8, #0
2470 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
2471 ; -O1: ldxp x0, x1, [x8]
2472 ; -O1: and x9, x1, x3
2473 ; -O1: and x10, x0, x2
2474 ; -O1: stxp w11, x10, x9, [x8]
2475 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
2479 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
2480 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
2481 ; -O0: and x14, x8, x10
2482 ; -O0: and x15, x8, x9
2483 ; -O0: ldaxp x10, x9, [x11]
2486 ; -O0: stxp w8, x14, x15, [x11]
2487 ; -O0: stxp w8, x10, x9, [x11]
2488 ; -O0: eor x8, x10, x8
2489 ; -O0: eor x11, x9, x11
2490 ; -O0: orr x8, x8, x11
2491 ; -O0: subs x8, x8, #0
2493 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
2494 ; -O1: ldaxp x0, x1, [x8]
2495 ; -O1: and x9, x1, x3
2496 ; -O1: and x10, x0, x2
2497 ; -O1: stxp w11, x10, x9, [x8]
2498 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
2502 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
2503 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
2504 ; -O0: and x14, x8, x10
2505 ; -O0: and x15, x8, x9
2506 ; -O0: ldxp x10, x9, [x11]
2509 ; -O0: stlxp w8, x14, x15, [x11]
2510 ; -O0: stlxp w8, x10, x9, [x11]
2511 ; -O0: eor x8, x10, x8
2512 ; -O0: eor x11, x9, x11
2513 ; -O0: orr x8, x8, x11
2514 ; -O0: subs x8, x8, #0
2516 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
2517 ; -O1: ldxp x0, x1, [x8]
2518 ; -O1: and x9, x1, x3
2519 ; -O1: and x10, x0, x2
2520 ; -O1: stlxp w11, x10, x9, [x8]
2521 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
2525 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2526 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
2527 ; -O0: and x14, x8, x10
2528 ; -O0: and x15, x8, x9
2529 ; -O0: ldaxp x10, x9, [x11]
2532 ; -O0: stlxp w8, x14, x15, [x11]
2533 ; -O0: stlxp w8, x10, x9, [x11]
2534 ; -O0: eor x8, x10, x8
2535 ; -O0: eor x11, x9, x11
2536 ; -O0: orr x8, x8, x11
2537 ; -O0: subs x8, x8, #0
2539 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
2540 ; -O1: ldaxp x0, x1, [x8]
2541 ; -O1: and x9, x1, x3
2542 ; -O1: and x10, x0, x2
2543 ; -O1: stlxp w11, x10, x9, [x8]
2544 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
2548 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2549 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
2550 ; -O0: and x14, x8, x10
2551 ; -O0: and x15, x8, x9
2552 ; -O0: ldaxp x10, x9, [x11]
2555 ; -O0: stlxp w8, x14, x15, [x11]
2556 ; -O0: stlxp w8, x10, x9, [x11]
2557 ; -O0: eor x8, x10, x8
2558 ; -O0: eor x11, x9, x11
2559 ; -O0: orr x8, x8, x11
2560 ; -O0: subs x8, x8, #0
2562 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
2563 ; -O1: ldaxp x0, x1, [x8]
2564 ; -O1: and x9, x1, x3
2565 ; -O1: and x10, x0, x2
2566 ; -O1: stlxp w11, x10, x9, [x8]
2567 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
2571 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2572 ; -O0-LABEL: atomicrmw_and_i8_unaligned_monotonic:
2573 ; -O0: and w12, w10, w8
2574 ; -O0: ldaxrb w9, [x11]
2575 ; -O0: cmp w9, w10, uxtb
2576 ; -O0: stlxrb w8, w12, [x11]
2577 ; -O0: and w8, w9, #0xff
2578 ; -O0: subs w8, w8, w10, uxtb
2580 ; -O1-LABEL: atomicrmw_and_i8_unaligned_monotonic:
2581 ; -O1: ldxrb w8, [x0]
2582 ; -O1: and w9, w8, w1
2583 ; -O1: stxrb w10, w9, [x0]
2584 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
2588 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2589 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acquire:
2590 ; -O0: and w12, w10, w8
2591 ; -O0: ldaxrb w9, [x11]
2592 ; -O0: cmp w9, w10, uxtb
2593 ; -O0: stlxrb w8, w12, [x11]
2594 ; -O0: and w8, w9, #0xff
2595 ; -O0: subs w8, w8, w10, uxtb
2597 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acquire:
2598 ; -O1: ldaxrb w8, [x0]
2599 ; -O1: and w9, w8, w1
2600 ; -O1: stxrb w10, w9, [x0]
2601 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
2605 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
2606 ; -O0-LABEL: atomicrmw_and_i8_unaligned_release:
2607 ; -O0: and w12, w10, w8
2608 ; -O0: ldaxrb w9, [x11]
2609 ; -O0: cmp w9, w10, uxtb
2610 ; -O0: stlxrb w8, w12, [x11]
2611 ; -O0: and w8, w9, #0xff
2612 ; -O0: subs w8, w8, w10, uxtb
2614 ; -O1-LABEL: atomicrmw_and_i8_unaligned_release:
2615 ; -O1: ldxrb w8, [x0]
2616 ; -O1: and w9, w8, w1
2617 ; -O1: stlxrb w10, w9, [x0]
2618 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
2622 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2623 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
2624 ; -O0: and w12, w10, w8
2625 ; -O0: ldaxrb w9, [x11]
2626 ; -O0: cmp w9, w10, uxtb
2627 ; -O0: stlxrb w8, w12, [x11]
2628 ; -O0: and w8, w9, #0xff
2629 ; -O0: subs w8, w8, w10, uxtb
2631 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
2632 ; -O1: ldaxrb w8, [x0]
2633 ; -O1: and w9, w8, w1
2634 ; -O1: stlxrb w10, w9, [x0]
2635 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
2639 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2640 ; -O0-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2641 ; -O0: and w12, w10, w8
2642 ; -O0: ldaxrb w9, [x11]
2643 ; -O0: cmp w9, w10, uxtb
2644 ; -O0: stlxrb w8, w12, [x11]
2645 ; -O0: and w8, w9, #0xff
2646 ; -O0: subs w8, w8, w10, uxtb
2648 ; -O1-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2649 ; -O1: ldaxrb w8, [x0]
2650 ; -O1: and w9, w8, w1
2651 ; -O1: stlxrb w10, w9, [x0]
2652 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
2656 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2657 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2658 ; -O0: and w8, w9, w8
2659 ; -O0: bl __atomic_compare_exchange
2661 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2662 ; -O1: and w8, w0, w20
2663 ; -O1: bl __atomic_compare_exchange
2664 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
2668 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2669 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
2670 ; -O0: and w8, w9, w8
2671 ; -O0: bl __atomic_compare_exchange
2673 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
2674 ; -O1: and w8, w0, w20
2675 ; -O1: bl __atomic_compare_exchange
2676 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
2680 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
2681 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
2682 ; -O0: and w8, w9, w8
2683 ; -O0: bl __atomic_compare_exchange
2685 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
2686 ; -O1: and w8, w0, w20
2687 ; -O1: bl __atomic_compare_exchange
2688 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
2692 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2693 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2694 ; -O0: and w8, w9, w8
2695 ; -O0: bl __atomic_compare_exchange
2697 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2698 ; -O1: and w8, w0, w20
2699 ; -O1: bl __atomic_compare_exchange
2700 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
2704 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2705 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2706 ; -O0: and w8, w9, w8
2707 ; -O0: bl __atomic_compare_exchange
2709 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2710 ; -O1: and w8, w0, w20
2711 ; -O1: bl __atomic_compare_exchange
2712 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
2716 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2717 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2718 ; -O0: and w8, w9, w8
2719 ; -O0: bl __atomic_compare_exchange
2721 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2722 ; -O1: and w8, w0, w20
2723 ; -O1: bl __atomic_compare_exchange
2724 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
2728 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2729 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
2730 ; -O0: and w8, w9, w8
2731 ; -O0: bl __atomic_compare_exchange
2733 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
2734 ; -O1: and w8, w0, w20
2735 ; -O1: bl __atomic_compare_exchange
2736 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
2740 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
2741 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
2742 ; -O0: and w8, w9, w8
2743 ; -O0: bl __atomic_compare_exchange
2745 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
2746 ; -O1: and w8, w0, w20
2747 ; -O1: bl __atomic_compare_exchange
2748 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
2752 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2753 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2754 ; -O0: and w8, w9, w8
2755 ; -O0: bl __atomic_compare_exchange
2757 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2758 ; -O1: and w8, w0, w20
2759 ; -O1: bl __atomic_compare_exchange
2760 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
2764 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2765 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2766 ; -O0: and w8, w9, w8
2767 ; -O0: bl __atomic_compare_exchange
2769 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2770 ; -O1: and w8, w0, w20
2771 ; -O1: bl __atomic_compare_exchange
2772 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
2776 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2777 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2778 ; -O0: and x8, x9, x8
2779 ; -O0: bl __atomic_compare_exchange
2781 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2782 ; -O1: and x8, x0, x20
2783 ; -O1: bl __atomic_compare_exchange
2784 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
2788 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2789 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
2790 ; -O0: and x8, x9, x8
2791 ; -O0: bl __atomic_compare_exchange
2793 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
2794 ; -O1: and x8, x0, x20
2795 ; -O1: bl __atomic_compare_exchange
2796 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
2800 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
2801 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
2802 ; -O0: and x8, x9, x8
2803 ; -O0: bl __atomic_compare_exchange
2805 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
2806 ; -O1: and x8, x0, x20
2807 ; -O1: bl __atomic_compare_exchange
2808 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
2812 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2813 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2814 ; -O0: and x8, x9, x8
2815 ; -O0: bl __atomic_compare_exchange
2817 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2818 ; -O1: and x8, x0, x20
2819 ; -O1: bl __atomic_compare_exchange
2820 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
2824 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2825 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2826 ; -O0: and x8, x9, x8
2827 ; -O0: bl __atomic_compare_exchange
2829 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2830 ; -O1: and x8, x0, x20
2831 ; -O1: bl __atomic_compare_exchange
2832 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
2836 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2837 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2838 ; -O0: and x9, x8, x9
2839 ; -O0: and x8, x8, x10
2840 ; -O0: bl __atomic_compare_exchange
2842 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2843 ; -O1: ldp x0, x1, [x0]
2844 ; -O1: and x8, x1, x19
2845 ; -O1: and x9, x0, x21
2846 ; -O1: bl __atomic_compare_exchange
2847 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
2851 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2852 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
2853 ; -O0: and x9, x8, x9
2854 ; -O0: and x8, x8, x10
2855 ; -O0: bl __atomic_compare_exchange
2857 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
2858 ; -O1: ldp x0, x1, [x0]
2859 ; -O1: and x8, x1, x19
2860 ; -O1: and x9, x0, x21
2861 ; -O1: bl __atomic_compare_exchange
2862 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
2866 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
2867 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
2868 ; -O0: and x9, x8, x9
2869 ; -O0: and x8, x8, x10
2870 ; -O0: bl __atomic_compare_exchange
2872 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
2873 ; -O1: ldp x0, x1, [x0]
2874 ; -O1: and x8, x1, x19
2875 ; -O1: and x9, x0, x21
2876 ; -O1: bl __atomic_compare_exchange
2877 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
2881 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2882 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2883 ; -O0: and x9, x8, x9
2884 ; -O0: and x8, x8, x10
2885 ; -O0: bl __atomic_compare_exchange
2887 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2888 ; -O1: ldp x0, x1, [x0]
2889 ; -O1: and x8, x1, x19
2890 ; -O1: and x9, x0, x21
2891 ; -O1: bl __atomic_compare_exchange
2892 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2896 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2897 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2898 ; -O0: and x9, x8, x9
2899 ; -O0: and x8, x8, x10
2900 ; -O0: bl __atomic_compare_exchange
2902 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2903 ; -O1: ldp x0, x1, [x0]
2904 ; -O1: and x8, x1, x19
2905 ; -O1: and x9, x0, x21
2906 ; -O1: bl __atomic_compare_exchange
2907 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2911 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2912 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2913 ; -O0: and w8, w10, w8
2915 ; -O0: ldaxrb w9, [x11]
2916 ; -O0: cmp w9, w10, uxtb
2917 ; -O0: stlxrb w8, w12, [x11]
2918 ; -O0: and w8, w9, #0xff
2919 ; -O0: subs w8, w8, w10, uxtb
2921 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2922 ; -O1: ldxrb w8, [x0]
2923 ; -O1: and w9, w8, w1
2925 ; -O1: stxrb w10, w9, [x0]
2926 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2930 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2931 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2932 ; -O0: and w8, w10, w8
2934 ; -O0: ldaxrb w9, [x11]
2935 ; -O0: cmp w9, w10, uxtb
2936 ; -O0: stlxrb w8, w12, [x11]
2937 ; -O0: and w8, w9, #0xff
2938 ; -O0: subs w8, w8, w10, uxtb
2940 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2941 ; -O1: ldaxrb w8, [x0]
2942 ; -O1: and w9, w8, w1
2944 ; -O1: stxrb w10, w9, [x0]
2945 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2949 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2950 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2951 ; -O0: and w8, w10, w8
2953 ; -O0: ldaxrb w9, [x11]
2954 ; -O0: cmp w9, w10, uxtb
2955 ; -O0: stlxrb w8, w12, [x11]
2956 ; -O0: and w8, w9, #0xff
2957 ; -O0: subs w8, w8, w10, uxtb
2959 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2960 ; -O1: ldxrb w8, [x0]
2961 ; -O1: and w9, w8, w1
2963 ; -O1: stlxrb w10, w9, [x0]
2964 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2968 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2969 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2970 ; -O0: and w8, w10, w8
2972 ; -O0: ldaxrb w9, [x11]
2973 ; -O0: cmp w9, w10, uxtb
2974 ; -O0: stlxrb w8, w12, [x11]
2975 ; -O0: and w8, w9, #0xff
2976 ; -O0: subs w8, w8, w10, uxtb
2978 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2979 ; -O1: ldaxrb w8, [x0]
2980 ; -O1: and w9, w8, w1
2982 ; -O1: stlxrb w10, w9, [x0]
2983 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2987 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2988 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2989 ; -O0: and w8, w10, w8
2991 ; -O0: ldaxrb w9, [x11]
2992 ; -O0: cmp w9, w10, uxtb
2993 ; -O0: stlxrb w8, w12, [x11]
2994 ; -O0: and w8, w9, #0xff
2995 ; -O0: subs w8, w8, w10, uxtb
2997 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2998 ; -O1: ldaxrb w8, [x0]
2999 ; -O1: and w9, w8, w1
3001 ; -O1: stlxrb w10, w9, [x0]
3002 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
3006 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3007 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
3008 ; -O0: and w9, w8, w9
3010 ; -O0: ldaxrh w9, [x11]
3011 ; -O0: cmp w9, w8, uxth
3012 ; -O0: stlxrh w10, w12, [x11]
3013 ; -O0: subs w8, w8, w9, uxth
3015 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
3016 ; -O1: ldxrh w8, [x0]
3017 ; -O1: and w9, w8, w1
3019 ; -O1: stxrh w10, w9, [x0]
3020 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
3024 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
3025 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
3026 ; -O0: and w9, w8, w9
3028 ; -O0: ldaxrh w9, [x11]
3029 ; -O0: cmp w9, w8, uxth
3030 ; -O0: stlxrh w10, w12, [x11]
3031 ; -O0: subs w8, w8, w9, uxth
3033 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
3034 ; -O1: ldaxrh w8, [x0]
3035 ; -O1: and w9, w8, w1
3037 ; -O1: stxrh w10, w9, [x0]
3038 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
3042 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
3043 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
3044 ; -O0: and w9, w8, w9
3046 ; -O0: ldaxrh w9, [x11]
3047 ; -O0: cmp w9, w8, uxth
3048 ; -O0: stlxrh w10, w12, [x11]
3049 ; -O0: subs w8, w8, w9, uxth
3051 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
3052 ; -O1: ldxrh w8, [x0]
3053 ; -O1: and w9, w8, w1
3055 ; -O1: stlxrh w10, w9, [x0]
3056 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
3060 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3061 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
3062 ; -O0: and w9, w8, w9
3064 ; -O0: ldaxrh w9, [x11]
3065 ; -O0: cmp w9, w8, uxth
3066 ; -O0: stlxrh w10, w12, [x11]
3067 ; -O0: subs w8, w8, w9, uxth
3069 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
3070 ; -O1: ldaxrh w8, [x0]
3071 ; -O1: and w9, w8, w1
3073 ; -O1: stlxrh w10, w9, [x0]
3074 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
3078 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3079 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
3080 ; -O0: and w9, w8, w9
3082 ; -O0: ldaxrh w9, [x11]
3083 ; -O0: cmp w9, w8, uxth
3084 ; -O0: stlxrh w10, w12, [x11]
3085 ; -O0: subs w8, w8, w9, uxth
3087 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
3088 ; -O1: ldaxrh w8, [x0]
3089 ; -O1: and w9, w8, w1
3091 ; -O1: stlxrh w10, w9, [x0]
3092 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
3096 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3097 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
3098 ; -O0: and w9, w8, w9
3100 ; -O0: ldaxr w9, [x11]
3102 ; -O0: stlxr w10, w12, [x11]
3103 ; -O0: subs w8, w9, w8
3105 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
3106 ; -O1: ldxr w8, [x0]
3107 ; -O1: and w9, w8, w1
3109 ; -O1: stxr w10, w9, [x0]
3110 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
3114 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
3115 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
3116 ; -O0: and w9, w8, w9
3118 ; -O0: ldaxr w9, [x11]
3120 ; -O0: stlxr w10, w12, [x11]
3121 ; -O0: subs w8, w9, w8
3123 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
3124 ; -O1: ldaxr w8, [x0]
3125 ; -O1: and w9, w8, w1
3127 ; -O1: stxr w10, w9, [x0]
3128 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
3132 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
3133 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
3134 ; -O0: and w9, w8, w9
3136 ; -O0: ldaxr w9, [x11]
3138 ; -O0: stlxr w10, w12, [x11]
3139 ; -O0: subs w8, w9, w8
3141 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
3142 ; -O1: ldxr w8, [x0]
3143 ; -O1: and w9, w8, w1
3145 ; -O1: stlxr w10, w9, [x0]
3146 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
3150 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3151 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
3152 ; -O0: and w9, w8, w9
3154 ; -O0: ldaxr w9, [x11]
3156 ; -O0: stlxr w10, w12, [x11]
3157 ; -O0: subs w8, w9, w8
3159 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
3160 ; -O1: ldaxr w8, [x0]
3161 ; -O1: and w9, w8, w1
3163 ; -O1: stlxr w10, w9, [x0]
3164 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
3168 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3169 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
3170 ; -O0: and w9, w8, w9
3172 ; -O0: ldaxr w9, [x11]
3174 ; -O0: stlxr w10, w12, [x11]
3175 ; -O0: subs w8, w9, w8
3177 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
3178 ; -O1: ldaxr w8, [x0]
3179 ; -O1: and w9, w8, w1
3181 ; -O1: stlxr w10, w9, [x0]
3182 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
3186 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3187 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
3188 ; -O0: and x9, x8, x9
3190 ; -O0: ldaxr x9, [x11]
3192 ; -O0: stlxr w10, x12, [x11]
3193 ; -O0: subs x8, x9, x8
3195 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
3196 ; -O1: ldxr x0, [x8]
3197 ; -O1: and x9, x0, x1
3199 ; -O1: stxr w10, x9, [x8]
3200 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
3204 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
3205 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
3206 ; -O0: and x9, x8, x9
3208 ; -O0: ldaxr x9, [x11]
3210 ; -O0: stlxr w10, x12, [x11]
3211 ; -O0: subs x8, x9, x8
3213 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
3214 ; -O1: ldaxr x0, [x8]
3215 ; -O1: and x9, x0, x1
3217 ; -O1: stxr w10, x9, [x8]
3218 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
3222 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
3223 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
3224 ; -O0: and x9, x8, x9
3226 ; -O0: ldaxr x9, [x11]
3228 ; -O0: stlxr w10, x12, [x11]
3229 ; -O0: subs x8, x9, x8
3231 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
3232 ; -O1: ldxr x0, [x8]
3233 ; -O1: and x9, x0, x1
3235 ; -O1: stlxr w10, x9, [x8]
3236 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
3240 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3241 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
3242 ; -O0: and x9, x8, x9
3244 ; -O0: ldaxr x9, [x11]
3246 ; -O0: stlxr w10, x12, [x11]
3247 ; -O0: subs x8, x9, x8
3249 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
3250 ; -O1: ldaxr x0, [x8]
3251 ; -O1: and x9, x0, x1
3253 ; -O1: stlxr w10, x9, [x8]
3254 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
3258 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3259 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
3260 ; -O0: and x9, x8, x9
3262 ; -O0: ldaxr x9, [x11]
3264 ; -O0: stlxr w10, x12, [x11]
3265 ; -O0: subs x8, x9, x8
3267 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
3268 ; -O1: ldaxr x0, [x8]
3269 ; -O1: and x9, x0, x1
3271 ; -O1: stlxr w10, x9, [x8]
3272 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
3276 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3277 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
3278 ; -O0: and x9, x8, x9
3279 ; -O0: and x8, x8, x10
3282 ; -O0: ldxp x10, x9, [x11]
3285 ; -O0: stxp w8, x14, x15, [x11]
3286 ; -O0: stxp w8, x10, x9, [x11]
3287 ; -O0: eor x8, x10, x8
3288 ; -O0: eor x11, x9, x11
3289 ; -O0: orr x8, x8, x11
3290 ; -O0: subs x8, x8, #0
3292 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
3293 ; -O1: ldxp x0, x1, [x8]
3294 ; -O1: and x9, x0, x2
3295 ; -O1: and x10, x1, x3
3298 ; -O1: stxp w11, x9, x10, [x8]
3299 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
3303 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
3304 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
3305 ; -O0: and x9, x8, x9
3306 ; -O0: and x8, x8, x10
3309 ; -O0: ldaxp x10, x9, [x11]
3312 ; -O0: stxp w8, x14, x15, [x11]
3313 ; -O0: stxp w8, x10, x9, [x11]
3314 ; -O0: eor x8, x10, x8
3315 ; -O0: eor x11, x9, x11
3316 ; -O0: orr x8, x8, x11
3317 ; -O0: subs x8, x8, #0
3319 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
3320 ; -O1: ldaxp x0, x1, [x8]
3321 ; -O1: and x9, x0, x2
3322 ; -O1: and x10, x1, x3
3325 ; -O1: stxp w11, x9, x10, [x8]
3326 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
3330 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
3331 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
3332 ; -O0: and x9, x8, x9
3333 ; -O0: and x8, x8, x10
3336 ; -O0: ldxp x10, x9, [x11]
3339 ; -O0: stlxp w8, x14, x15, [x11]
3340 ; -O0: stlxp w8, x10, x9, [x11]
3341 ; -O0: eor x8, x10, x8
3342 ; -O0: eor x11, x9, x11
3343 ; -O0: orr x8, x8, x11
3344 ; -O0: subs x8, x8, #0
3346 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
3347 ; -O1: ldxp x0, x1, [x8]
3348 ; -O1: and x9, x0, x2
3349 ; -O1: and x10, x1, x3
3352 ; -O1: stlxp w11, x9, x10, [x8]
3353 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
3357 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3358 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
3359 ; -O0: and x9, x8, x9
3360 ; -O0: and x8, x8, x10
3363 ; -O0: ldaxp x10, x9, [x11]
3366 ; -O0: stlxp w8, x14, x15, [x11]
3367 ; -O0: stlxp w8, x10, x9, [x11]
3368 ; -O0: eor x8, x10, x8
3369 ; -O0: eor x11, x9, x11
3370 ; -O0: orr x8, x8, x11
3371 ; -O0: subs x8, x8, #0
3373 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
3374 ; -O1: ldaxp x0, x1, [x8]
3375 ; -O1: and x9, x0, x2
3376 ; -O1: and x10, x1, x3
3379 ; -O1: stlxp w11, x9, x10, [x8]
3380 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
3384 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3385 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
3386 ; -O0: and x9, x8, x9
3387 ; -O0: and x8, x8, x10
3390 ; -O0: ldaxp x10, x9, [x11]
3393 ; -O0: stlxp w8, x14, x15, [x11]
3394 ; -O0: stlxp w8, x10, x9, [x11]
3395 ; -O0: eor x8, x10, x8
3396 ; -O0: eor x11, x9, x11
3397 ; -O0: orr x8, x8, x11
3398 ; -O0: subs x8, x8, #0
3400 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
3401 ; -O1: ldaxp x0, x1, [x8]
3402 ; -O1: and x9, x0, x2
3403 ; -O1: and x10, x1, x3
3406 ; -O1: stlxp w11, x9, x10, [x8]
3407 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
3411 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3412 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
3413 ; -O0: and w8, w10, w8
3415 ; -O0: ldaxrb w9, [x11]
3416 ; -O0: cmp w9, w10, uxtb
3417 ; -O0: stlxrb w8, w12, [x11]
3418 ; -O0: and w8, w9, #0xff
3419 ; -O0: subs w8, w8, w10, uxtb
3421 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
3422 ; -O1: ldxrb w8, [x0]
3423 ; -O1: and w9, w8, w1
3425 ; -O1: stxrb w10, w9, [x0]
3426 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
3430 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3431 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
3432 ; -O0: and w8, w10, w8
3434 ; -O0: ldaxrb w9, [x11]
3435 ; -O0: cmp w9, w10, uxtb
3436 ; -O0: stlxrb w8, w12, [x11]
3437 ; -O0: and w8, w9, #0xff
3438 ; -O0: subs w8, w8, w10, uxtb
3440 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
3441 ; -O1: ldaxrb w8, [x0]
3442 ; -O1: and w9, w8, w1
3444 ; -O1: stxrb w10, w9, [x0]
3445 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
3449 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
3450 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
3451 ; -O0: and w8, w10, w8
3453 ; -O0: ldaxrb w9, [x11]
3454 ; -O0: cmp w9, w10, uxtb
3455 ; -O0: stlxrb w8, w12, [x11]
3456 ; -O0: and w8, w9, #0xff
3457 ; -O0: subs w8, w8, w10, uxtb
3459 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
3460 ; -O1: ldxrb w8, [x0]
3461 ; -O1: and w9, w8, w1
3463 ; -O1: stlxrb w10, w9, [x0]
3464 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
3468 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3469 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
3470 ; -O0: and w8, w10, w8
3472 ; -O0: ldaxrb w9, [x11]
3473 ; -O0: cmp w9, w10, uxtb
3474 ; -O0: stlxrb w8, w12, [x11]
3475 ; -O0: and w8, w9, #0xff
3476 ; -O0: subs w8, w8, w10, uxtb
3478 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
3479 ; -O1: ldaxrb w8, [x0]
3480 ; -O1: and w9, w8, w1
3482 ; -O1: stlxrb w10, w9, [x0]
3483 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
3487 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3488 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
3489 ; -O0: and w8, w10, w8
3491 ; -O0: ldaxrb w9, [x11]
3492 ; -O0: cmp w9, w10, uxtb
3493 ; -O0: stlxrb w8, w12, [x11]
3494 ; -O0: and w8, w9, #0xff
3495 ; -O0: subs w8, w8, w10, uxtb
3497 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
3498 ; -O1: ldaxrb w8, [x0]
3499 ; -O1: and w9, w8, w1
3501 ; -O1: stlxrb w10, w9, [x0]
3502 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
3506 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3507 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
3508 ; -O0: and w8, w9, w8
3510 ; -O0: bl __atomic_compare_exchange
3512 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
3513 ; -O1: and w8, w0, w20
3515 ; -O1: bl __atomic_compare_exchange
3516 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
3520 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3521 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
3522 ; -O0: and w8, w9, w8
3524 ; -O0: bl __atomic_compare_exchange
3526 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
3527 ; -O1: and w8, w0, w20
3529 ; -O1: bl __atomic_compare_exchange
3530 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
3534 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
3535 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
3536 ; -O0: and w8, w9, w8
3538 ; -O0: bl __atomic_compare_exchange
3540 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
3541 ; -O1: and w8, w0, w20
3543 ; -O1: bl __atomic_compare_exchange
3544 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
3548 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3549 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
3550 ; -O0: and w8, w9, w8
3552 ; -O0: bl __atomic_compare_exchange
3554 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
3555 ; -O1: and w8, w0, w20
3557 ; -O1: bl __atomic_compare_exchange
3558 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
3562 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3563 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
3564 ; -O0: and w8, w9, w8
3566 ; -O0: bl __atomic_compare_exchange
3568 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
3569 ; -O1: and w8, w0, w20
3571 ; -O1: bl __atomic_compare_exchange
3572 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
3576 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3577 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
3578 ; -O0: and w8, w9, w8
3580 ; -O0: bl __atomic_compare_exchange
3582 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
3583 ; -O1: and w8, w0, w20
3585 ; -O1: bl __atomic_compare_exchange
3586 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
3590 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3591 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
3592 ; -O0: and w8, w9, w8
3594 ; -O0: bl __atomic_compare_exchange
3596 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
3597 ; -O1: and w8, w0, w20
3599 ; -O1: bl __atomic_compare_exchange
3600 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
3604 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
3605 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
3606 ; -O0: and w8, w9, w8
3608 ; -O0: bl __atomic_compare_exchange
3610 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
3611 ; -O1: and w8, w0, w20
3613 ; -O1: bl __atomic_compare_exchange
3614 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
3618 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3619 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
3620 ; -O0: and w8, w9, w8
3622 ; -O0: bl __atomic_compare_exchange
3624 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
3625 ; -O1: and w8, w0, w20
3627 ; -O1: bl __atomic_compare_exchange
3628 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
3632 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3633 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
3634 ; -O0: and w8, w9, w8
3636 ; -O0: bl __atomic_compare_exchange
3638 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
3639 ; -O1: and w8, w0, w20
3641 ; -O1: bl __atomic_compare_exchange
3642 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
3646 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3647 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3648 ; -O0: and x8, x9, x8
3650 ; -O0: bl __atomic_compare_exchange
3652 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3653 ; -O1: and x8, x0, x20
3655 ; -O1: bl __atomic_compare_exchange
3656 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
3660 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3661 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3662 ; -O0: and x8, x9, x8
3664 ; -O0: bl __atomic_compare_exchange
3666 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3667 ; -O1: and x8, x0, x20
3669 ; -O1: bl __atomic_compare_exchange
3670 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
3674 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
3675 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
3676 ; -O0: and x8, x9, x8
3678 ; -O0: bl __atomic_compare_exchange
3680 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
3681 ; -O1: and x8, x0, x20
3683 ; -O1: bl __atomic_compare_exchange
3684 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
3688 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3689 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3690 ; -O0: and x8, x9, x8
3692 ; -O0: bl __atomic_compare_exchange
3694 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3695 ; -O1: and x8, x0, x20
3697 ; -O1: bl __atomic_compare_exchange
3698 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
3702 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3703 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3704 ; -O0: and x8, x9, x8
3706 ; -O0: bl __atomic_compare_exchange
3708 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3709 ; -O1: and x8, x0, x20
3711 ; -O1: bl __atomic_compare_exchange
3712 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
3716 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3717 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3718 ; -O0: and x9, x8, x9
3719 ; -O0: and x8, x8, x10
3722 ; -O0: bl __atomic_compare_exchange
3724 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3725 ; -O1: ldp x0, x1, [x0]
3726 ; -O1: and x8, x1, x19
3727 ; -O1: and x9, x0, x21
3730 ; -O1: bl __atomic_compare_exchange
3731 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
3735 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3736 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3737 ; -O0: and x9, x8, x9
3738 ; -O0: and x8, x8, x10
3741 ; -O0: bl __atomic_compare_exchange
3743 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3744 ; -O1: ldp x0, x1, [x0]
3745 ; -O1: and x8, x1, x19
3746 ; -O1: and x9, x0, x21
3749 ; -O1: bl __atomic_compare_exchange
3750 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
3754 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
3755 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
3756 ; -O0: and x9, x8, x9
3757 ; -O0: and x8, x8, x10
3760 ; -O0: bl __atomic_compare_exchange
3762 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
3763 ; -O1: ldp x0, x1, [x0]
3764 ; -O1: and x8, x1, x19
3765 ; -O1: and x9, x0, x21
3768 ; -O1: bl __atomic_compare_exchange
3769 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
3773 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3774 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3775 ; -O0: and x9, x8, x9
3776 ; -O0: and x8, x8, x10
3779 ; -O0: bl __atomic_compare_exchange
3781 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3782 ; -O1: ldp x0, x1, [x0]
3783 ; -O1: and x8, x1, x19
3784 ; -O1: and x9, x0, x21
3787 ; -O1: bl __atomic_compare_exchange
3788 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
3792 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3793 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3794 ; -O0: and x9, x8, x9
3795 ; -O0: and x8, x8, x10
3798 ; -O0: bl __atomic_compare_exchange
3800 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3801 ; -O1: ldp x0, x1, [x0]
3802 ; -O1: and x8, x1, x19
3803 ; -O1: and x9, x0, x21
3806 ; -O1: bl __atomic_compare_exchange
3807 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
3811 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3812 ; -O0-LABEL: atomicrmw_or_i8_aligned_monotonic:
3813 ; -O0: orr w12, w10, w8
3814 ; -O0: ldaxrb w9, [x11]
3815 ; -O0: cmp w9, w10, uxtb
3816 ; -O0: stlxrb w8, w12, [x11]
3817 ; -O0: and w8, w9, #0xff
3818 ; -O0: subs w8, w8, w10, uxtb
3820 ; -O1-LABEL: atomicrmw_or_i8_aligned_monotonic:
3821 ; -O1: ldxrb w8, [x0]
3822 ; -O1: orr w9, w8, w1
3823 ; -O1: stxrb w10, w9, [x0]
3824 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3828 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
3829 ; -O0-LABEL: atomicrmw_or_i8_aligned_acquire:
3830 ; -O0: orr w12, w10, w8
3831 ; -O0: ldaxrb w9, [x11]
3832 ; -O0: cmp w9, w10, uxtb
3833 ; -O0: stlxrb w8, w12, [x11]
3834 ; -O0: and w8, w9, #0xff
3835 ; -O0: subs w8, w8, w10, uxtb
3837 ; -O1-LABEL: atomicrmw_or_i8_aligned_acquire:
3838 ; -O1: ldaxrb w8, [x0]
3839 ; -O1: orr w9, w8, w1
3840 ; -O1: stxrb w10, w9, [x0]
3841 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3845 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
3846 ; -O0-LABEL: atomicrmw_or_i8_aligned_release:
3847 ; -O0: orr w12, w10, w8
3848 ; -O0: ldaxrb w9, [x11]
3849 ; -O0: cmp w9, w10, uxtb
3850 ; -O0: stlxrb w8, w12, [x11]
3851 ; -O0: and w8, w9, #0xff
3852 ; -O0: subs w8, w8, w10, uxtb
3854 ; -O1-LABEL: atomicrmw_or_i8_aligned_release:
3855 ; -O1: ldxrb w8, [x0]
3856 ; -O1: orr w9, w8, w1
3857 ; -O1: stlxrb w10, w9, [x0]
3858 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3862 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3863 ; -O0-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3864 ; -O0: orr w12, w10, w8
3865 ; -O0: ldaxrb w9, [x11]
3866 ; -O0: cmp w9, w10, uxtb
3867 ; -O0: stlxrb w8, w12, [x11]
3868 ; -O0: and w8, w9, #0xff
3869 ; -O0: subs w8, w8, w10, uxtb
3871 ; -O1-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3872 ; -O1: ldaxrb w8, [x0]
3873 ; -O1: orr w9, w8, w1
3874 ; -O1: stlxrb w10, w9, [x0]
3875 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3879 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3880 ; -O0-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3881 ; -O0: orr w12, w10, w8
3882 ; -O0: ldaxrb w9, [x11]
3883 ; -O0: cmp w9, w10, uxtb
3884 ; -O0: stlxrb w8, w12, [x11]
3885 ; -O0: and w8, w9, #0xff
3886 ; -O0: subs w8, w8, w10, uxtb
3888 ; -O1-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3889 ; -O1: ldaxrb w8, [x0]
3890 ; -O1: orr w9, w8, w1
3891 ; -O1: stlxrb w10, w9, [x0]
3892 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3896 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3897 ; -O0-LABEL: atomicrmw_or_i16_aligned_monotonic:
3898 ; -O0: orr w12, w8, w9
3899 ; -O0: ldaxrh w9, [x11]
3900 ; -O0: cmp w9, w8, uxth
3901 ; -O0: stlxrh w10, w12, [x11]
3902 ; -O0: subs w8, w8, w9, uxth
3904 ; -O1-LABEL: atomicrmw_or_i16_aligned_monotonic:
3905 ; -O1: ldxrh w8, [x0]
3906 ; -O1: orr w9, w8, w1
3907 ; -O1: stxrh w10, w9, [x0]
3908 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
3912 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
3913 ; -O0-LABEL: atomicrmw_or_i16_aligned_acquire:
3914 ; -O0: orr w12, w8, w9
3915 ; -O0: ldaxrh w9, [x11]
3916 ; -O0: cmp w9, w8, uxth
3917 ; -O0: stlxrh w10, w12, [x11]
3918 ; -O0: subs w8, w8, w9, uxth
3920 ; -O1-LABEL: atomicrmw_or_i16_aligned_acquire:
3921 ; -O1: ldaxrh w8, [x0]
3922 ; -O1: orr w9, w8, w1
3923 ; -O1: stxrh w10, w9, [x0]
3924 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
3928 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
3929 ; -O0-LABEL: atomicrmw_or_i16_aligned_release:
3930 ; -O0: orr w12, w8, w9
3931 ; -O0: ldaxrh w9, [x11]
3932 ; -O0: cmp w9, w8, uxth
3933 ; -O0: stlxrh w10, w12, [x11]
3934 ; -O0: subs w8, w8, w9, uxth
3936 ; -O1-LABEL: atomicrmw_or_i16_aligned_release:
3937 ; -O1: ldxrh w8, [x0]
3938 ; -O1: orr w9, w8, w1
3939 ; -O1: stlxrh w10, w9, [x0]
3940 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
3944 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3945 ; -O0-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3946 ; -O0: orr w12, w8, w9
3947 ; -O0: ldaxrh w9, [x11]
3948 ; -O0: cmp w9, w8, uxth
3949 ; -O0: stlxrh w10, w12, [x11]
3950 ; -O0: subs w8, w8, w9, uxth
3952 ; -O1-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3953 ; -O1: ldaxrh w8, [x0]
3954 ; -O1: orr w9, w8, w1
3955 ; -O1: stlxrh w10, w9, [x0]
3956 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
3960 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3961 ; -O0-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3962 ; -O0: orr w12, w8, w9
3963 ; -O0: ldaxrh w9, [x11]
3964 ; -O0: cmp w9, w8, uxth
3965 ; -O0: stlxrh w10, w12, [x11]
3966 ; -O0: subs w8, w8, w9, uxth
3968 ; -O1-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3969 ; -O1: ldaxrh w8, [x0]
3970 ; -O1: orr w9, w8, w1
3971 ; -O1: stlxrh w10, w9, [x0]
3972 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
3976 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3977 ; -O0-LABEL: atomicrmw_or_i32_aligned_monotonic:
3978 ; -O0: orr w12, w8, w9
3979 ; -O0: ldaxr w9, [x11]
3981 ; -O0: stlxr w10, w12, [x11]
3982 ; -O0: subs w8, w9, w8
3984 ; -O1-LABEL: atomicrmw_or_i32_aligned_monotonic:
3985 ; -O1: ldxr w8, [x0]
3986 ; -O1: orr w9, w8, w1
3987 ; -O1: stxr w10, w9, [x0]
3988 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
3992 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
3993 ; -O0-LABEL: atomicrmw_or_i32_aligned_acquire:
3994 ; -O0: orr w12, w8, w9
3995 ; -O0: ldaxr w9, [x11]
3997 ; -O0: stlxr w10, w12, [x11]
3998 ; -O0: subs w8, w9, w8
4000 ; -O1-LABEL: atomicrmw_or_i32_aligned_acquire:
4001 ; -O1: ldaxr w8, [x0]
4002 ; -O1: orr w9, w8, w1
4003 ; -O1: stxr w10, w9, [x0]
4004 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
4008 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
4009 ; -O0-LABEL: atomicrmw_or_i32_aligned_release:
4010 ; -O0: orr w12, w8, w9
4011 ; -O0: ldaxr w9, [x11]
4013 ; -O0: stlxr w10, w12, [x11]
4014 ; -O0: subs w8, w9, w8
4016 ; -O1-LABEL: atomicrmw_or_i32_aligned_release:
4017 ; -O1: ldxr w8, [x0]
4018 ; -O1: orr w9, w8, w1
4019 ; -O1: stlxr w10, w9, [x0]
4020 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
4024 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4025 ; -O0-LABEL: atomicrmw_or_i32_aligned_acq_rel:
4026 ; -O0: orr w12, w8, w9
4027 ; -O0: ldaxr w9, [x11]
4029 ; -O0: stlxr w10, w12, [x11]
4030 ; -O0: subs w8, w9, w8
4032 ; -O1-LABEL: atomicrmw_or_i32_aligned_acq_rel:
4033 ; -O1: ldaxr w8, [x0]
4034 ; -O1: orr w9, w8, w1
4035 ; -O1: stlxr w10, w9, [x0]
4036 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
4040 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4041 ; -O0-LABEL: atomicrmw_or_i32_aligned_seq_cst:
4042 ; -O0: orr w12, w8, w9
4043 ; -O0: ldaxr w9, [x11]
4045 ; -O0: stlxr w10, w12, [x11]
4046 ; -O0: subs w8, w9, w8
4048 ; -O1-LABEL: atomicrmw_or_i32_aligned_seq_cst:
4049 ; -O1: ldaxr w8, [x0]
4050 ; -O1: orr w9, w8, w1
4051 ; -O1: stlxr w10, w9, [x0]
4052 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
4056 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4057 ; -O0-LABEL: atomicrmw_or_i64_aligned_monotonic:
4058 ; -O0: orr x12, x8, x9
4059 ; -O0: ldaxr x9, [x11]
4061 ; -O0: stlxr w10, x12, [x11]
4062 ; -O0: subs x8, x9, x8
4064 ; -O1-LABEL: atomicrmw_or_i64_aligned_monotonic:
4065 ; -O1: ldxr x0, [x8]
4066 ; -O1: orr x9, x0, x1
4067 ; -O1: stxr w10, x9, [x8]
4068 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
4072 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
4073 ; -O0-LABEL: atomicrmw_or_i64_aligned_acquire:
4074 ; -O0: orr x12, x8, x9
4075 ; -O0: ldaxr x9, [x11]
4077 ; -O0: stlxr w10, x12, [x11]
4078 ; -O0: subs x8, x9, x8
4080 ; -O1-LABEL: atomicrmw_or_i64_aligned_acquire:
4081 ; -O1: ldaxr x0, [x8]
4082 ; -O1: orr x9, x0, x1
4083 ; -O1: stxr w10, x9, [x8]
4084 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
4088 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
4089 ; -O0-LABEL: atomicrmw_or_i64_aligned_release:
4090 ; -O0: orr x12, x8, x9
4091 ; -O0: ldaxr x9, [x11]
4093 ; -O0: stlxr w10, x12, [x11]
4094 ; -O0: subs x8, x9, x8
4096 ; -O1-LABEL: atomicrmw_or_i64_aligned_release:
4097 ; -O1: ldxr x0, [x8]
4098 ; -O1: orr x9, x0, x1
4099 ; -O1: stlxr w10, x9, [x8]
4100 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
4104 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4105 ; -O0-LABEL: atomicrmw_or_i64_aligned_acq_rel:
4106 ; -O0: orr x12, x8, x9
4107 ; -O0: ldaxr x9, [x11]
4109 ; -O0: stlxr w10, x12, [x11]
4110 ; -O0: subs x8, x9, x8
4112 ; -O1-LABEL: atomicrmw_or_i64_aligned_acq_rel:
4113 ; -O1: ldaxr x0, [x8]
4114 ; -O1: orr x9, x0, x1
4115 ; -O1: stlxr w10, x9, [x8]
4116 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
4120 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4121 ; -O0-LABEL: atomicrmw_or_i64_aligned_seq_cst:
4122 ; -O0: orr x12, x8, x9
4123 ; -O0: ldaxr x9, [x11]
4125 ; -O0: stlxr w10, x12, [x11]
4126 ; -O0: subs x8, x9, x8
4128 ; -O1-LABEL: atomicrmw_or_i64_aligned_seq_cst:
4129 ; -O1: ldaxr x0, [x8]
4130 ; -O1: orr x9, x0, x1
4131 ; -O1: stlxr w10, x9, [x8]
4132 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
4136 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4137 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
4138 ; -O0: orr x14, x8, x10
4139 ; -O0: orr x15, x8, x9
4140 ; -O0: ldxp x10, x9, [x11]
4143 ; -O0: stxp w8, x14, x15, [x11]
4144 ; -O0: stxp w8, x10, x9, [x11]
4145 ; -O0: eor x8, x10, x8
4146 ; -O0: eor x11, x9, x11
4147 ; -O0: orr x8, x8, x11
4148 ; -O0: subs x8, x8, #0
4150 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
4151 ; -O1: ldxp x0, x1, [x8]
4152 ; -O1: orr x9, x1, x3
4153 ; -O1: orr x10, x0, x2
4154 ; -O1: stxp w11, x10, x9, [x8]
4155 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
4159 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
4160 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
4161 ; -O0: orr x14, x8, x10
4162 ; -O0: orr x15, x8, x9
4163 ; -O0: ldaxp x10, x9, [x11]
4166 ; -O0: stxp w8, x14, x15, [x11]
4167 ; -O0: stxp w8, x10, x9, [x11]
4168 ; -O0: eor x8, x10, x8
4169 ; -O0: eor x11, x9, x11
4170 ; -O0: orr x8, x8, x11
4171 ; -O0: subs x8, x8, #0
4173 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
4174 ; -O1: ldaxp x0, x1, [x8]
4175 ; -O1: orr x9, x1, x3
4176 ; -O1: orr x10, x0, x2
4177 ; -O1: stxp w11, x10, x9, [x8]
4178 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
4182 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
4183 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
4184 ; -O0: orr x14, x8, x10
4185 ; -O0: orr x15, x8, x9
4186 ; -O0: ldxp x10, x9, [x11]
4189 ; -O0: stlxp w8, x14, x15, [x11]
4190 ; -O0: stlxp w8, x10, x9, [x11]
4191 ; -O0: eor x8, x10, x8
4192 ; -O0: eor x11, x9, x11
4193 ; -O0: orr x8, x8, x11
4194 ; -O0: subs x8, x8, #0
4196 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
4197 ; -O1: ldxp x0, x1, [x8]
4198 ; -O1: orr x9, x1, x3
4199 ; -O1: orr x10, x0, x2
4200 ; -O1: stlxp w11, x10, x9, [x8]
4201 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
4205 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4206 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
4207 ; -O0: orr x14, x8, x10
4208 ; -O0: orr x15, x8, x9
4209 ; -O0: ldaxp x10, x9, [x11]
4212 ; -O0: stlxp w8, x14, x15, [x11]
4213 ; -O0: stlxp w8, x10, x9, [x11]
4214 ; -O0: eor x8, x10, x8
4215 ; -O0: eor x11, x9, x11
4216 ; -O0: orr x8, x8, x11
4217 ; -O0: subs x8, x8, #0
4219 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
4220 ; -O1: ldaxp x0, x1, [x8]
4221 ; -O1: orr x9, x1, x3
4222 ; -O1: orr x10, x0, x2
4223 ; -O1: stlxp w11, x10, x9, [x8]
4224 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
4228 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4229 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
4230 ; -O0: orr x14, x8, x10
4231 ; -O0: orr x15, x8, x9
4232 ; -O0: ldaxp x10, x9, [x11]
4235 ; -O0: stlxp w8, x14, x15, [x11]
4236 ; -O0: stlxp w8, x10, x9, [x11]
4237 ; -O0: eor x8, x10, x8
4238 ; -O0: eor x11, x9, x11
4239 ; -O0: orr x8, x8, x11
4240 ; -O0: subs x8, x8, #0
4242 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
4243 ; -O1: ldaxp x0, x1, [x8]
4244 ; -O1: orr x9, x1, x3
4245 ; -O1: orr x10, x0, x2
4246 ; -O1: stlxp w11, x10, x9, [x8]
4247 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
4251 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4252 ; -O0-LABEL: atomicrmw_or_i8_unaligned_monotonic:
4253 ; -O0: orr w12, w10, w8
4254 ; -O0: ldaxrb w9, [x11]
4255 ; -O0: cmp w9, w10, uxtb
4256 ; -O0: stlxrb w8, w12, [x11]
4257 ; -O0: and w8, w9, #0xff
4258 ; -O0: subs w8, w8, w10, uxtb
4260 ; -O1-LABEL: atomicrmw_or_i8_unaligned_monotonic:
4261 ; -O1: ldxrb w8, [x0]
4262 ; -O1: orr w9, w8, w1
4263 ; -O1: stxrb w10, w9, [x0]
4264 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
4268 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4269 ; -O0-LABEL: atomicrmw_or_i8_unaligned_acquire:
4270 ; -O0: orr w12, w10, w8
4271 ; -O0: ldaxrb w9, [x11]
4272 ; -O0: cmp w9, w10, uxtb
4273 ; -O0: stlxrb w8, w12, [x11]
4274 ; -O0: and w8, w9, #0xff
4275 ; -O0: subs w8, w8, w10, uxtb
4277 ; -O1-LABEL: atomicrmw_or_i8_unaligned_acquire:
4278 ; -O1: ldaxrb w8, [x0]
4279 ; -O1: orr w9, w8, w1
4280 ; -O1: stxrb w10, w9, [x0]
4281 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
4285 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
4286 ; -O0-LABEL: atomicrmw_or_i8_unaligned_release:
4287 ; -O0: orr w12, w10, w8
4288 ; -O0: ldaxrb w9, [x11]
4289 ; -O0: cmp w9, w10, uxtb
4290 ; -O0: stlxrb w8, w12, [x11]
4291 ; -O0: and w8, w9, #0xff
4292 ; -O0: subs w8, w8, w10, uxtb
4294 ; -O1-LABEL: atomicrmw_or_i8_unaligned_release:
4295 ; -O1: ldxrb w8, [x0]
4296 ; -O1: orr w9, w8, w1
4297 ; -O1: stlxrb w10, w9, [x0]
4298 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
4302 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4303 ; -O0-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
4304 ; -O0: orr w12, w10, w8
4305 ; -O0: ldaxrb w9, [x11]
4306 ; -O0: cmp w9, w10, uxtb
4307 ; -O0: stlxrb w8, w12, [x11]
4308 ; -O0: and w8, w9, #0xff
4309 ; -O0: subs w8, w8, w10, uxtb
4311 ; -O1-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
4312 ; -O1: ldaxrb w8, [x0]
4313 ; -O1: orr w9, w8, w1
4314 ; -O1: stlxrb w10, w9, [x0]
4315 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
4319 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4320 ; -O0-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
4321 ; -O0: orr w12, w10, w8
4322 ; -O0: ldaxrb w9, [x11]
4323 ; -O0: cmp w9, w10, uxtb
4324 ; -O0: stlxrb w8, w12, [x11]
4325 ; -O0: and w8, w9, #0xff
4326 ; -O0: subs w8, w8, w10, uxtb
4328 ; -O1-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
4329 ; -O1: ldaxrb w8, [x0]
4330 ; -O1: orr w9, w8, w1
4331 ; -O1: stlxrb w10, w9, [x0]
4332 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
4336 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4337 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
4338 ; -O0: orr w8, w9, w8
4339 ; -O0: bl __atomic_compare_exchange
4341 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
4342 ; -O1: orr w8, w0, w20
4343 ; -O1: bl __atomic_compare_exchange
4344 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
4348 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4349 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
4350 ; -O0: orr w8, w9, w8
4351 ; -O0: bl __atomic_compare_exchange
4353 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
4354 ; -O1: orr w8, w0, w20
4355 ; -O1: bl __atomic_compare_exchange
4356 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
4360 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
4361 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
4362 ; -O0: orr w8, w9, w8
4363 ; -O0: bl __atomic_compare_exchange
4365 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
4366 ; -O1: orr w8, w0, w20
4367 ; -O1: bl __atomic_compare_exchange
4368 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
4372 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4373 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
4374 ; -O0: orr w8, w9, w8
4375 ; -O0: bl __atomic_compare_exchange
4377 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
4378 ; -O1: orr w8, w0, w20
4379 ; -O1: bl __atomic_compare_exchange
4380 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
4384 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4385 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
4386 ; -O0: orr w8, w9, w8
4387 ; -O0: bl __atomic_compare_exchange
4389 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
4390 ; -O1: orr w8, w0, w20
4391 ; -O1: bl __atomic_compare_exchange
4392 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
4396 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4397 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
4398 ; -O0: orr w8, w9, w8
4399 ; -O0: bl __atomic_compare_exchange
4401 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
4402 ; -O1: orr w8, w0, w20
4403 ; -O1: bl __atomic_compare_exchange
4404 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
4408 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4409 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
4410 ; -O0: orr w8, w9, w8
4411 ; -O0: bl __atomic_compare_exchange
4413 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
4414 ; -O1: orr w8, w0, w20
4415 ; -O1: bl __atomic_compare_exchange
4416 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
4420 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
4421 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
4422 ; -O0: orr w8, w9, w8
4423 ; -O0: bl __atomic_compare_exchange
4425 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
4426 ; -O1: orr w8, w0, w20
4427 ; -O1: bl __atomic_compare_exchange
4428 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
4432 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4433 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
4434 ; -O0: orr w8, w9, w8
4435 ; -O0: bl __atomic_compare_exchange
4437 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
4438 ; -O1: orr w8, w0, w20
4439 ; -O1: bl __atomic_compare_exchange
4440 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
4444 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4445 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
4446 ; -O0: orr w8, w9, w8
4447 ; -O0: bl __atomic_compare_exchange
4449 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
4450 ; -O1: orr w8, w0, w20
4451 ; -O1: bl __atomic_compare_exchange
4452 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
4456 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4457 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
4458 ; -O0: orr x8, x9, x8
4459 ; -O0: bl __atomic_compare_exchange
4461 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
4462 ; -O1: orr x8, x0, x20
4463 ; -O1: bl __atomic_compare_exchange
4464 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
4468 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4469 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
4470 ; -O0: orr x8, x9, x8
4471 ; -O0: bl __atomic_compare_exchange
4473 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
4474 ; -O1: orr x8, x0, x20
4475 ; -O1: bl __atomic_compare_exchange
4476 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
4480 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
4481 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
4482 ; -O0: orr x8, x9, x8
4483 ; -O0: bl __atomic_compare_exchange
4485 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
4486 ; -O1: orr x8, x0, x20
4487 ; -O1: bl __atomic_compare_exchange
4488 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
4492 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4493 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
4494 ; -O0: orr x8, x9, x8
4495 ; -O0: bl __atomic_compare_exchange
4497 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
4498 ; -O1: orr x8, x0, x20
4499 ; -O1: bl __atomic_compare_exchange
4500 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
4504 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4505 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
4506 ; -O0: orr x8, x9, x8
4507 ; -O0: bl __atomic_compare_exchange
4509 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
4510 ; -O1: orr x8, x0, x20
4511 ; -O1: bl __atomic_compare_exchange
4512 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
4516 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4517 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
4518 ; -O0: orr x9, x8, x9
4519 ; -O0: orr x8, x8, x10
4520 ; -O0: bl __atomic_compare_exchange
4522 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
4523 ; -O1: ldp x0, x1, [x0]
4524 ; -O1: orr x8, x1, x19
4525 ; -O1: orr x9, x0, x21
4526 ; -O1: bl __atomic_compare_exchange
4527 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
4531 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4532 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
4533 ; -O0: orr x9, x8, x9
4534 ; -O0: orr x8, x8, x10
4535 ; -O0: bl __atomic_compare_exchange
4537 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
4538 ; -O1: ldp x0, x1, [x0]
4539 ; -O1: orr x8, x1, x19
4540 ; -O1: orr x9, x0, x21
4541 ; -O1: bl __atomic_compare_exchange
4542 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
4546 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
4547 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
4548 ; -O0: orr x9, x8, x9
4549 ; -O0: orr x8, x8, x10
4550 ; -O0: bl __atomic_compare_exchange
4552 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
4553 ; -O1: ldp x0, x1, [x0]
4554 ; -O1: orr x8, x1, x19
4555 ; -O1: orr x9, x0, x21
4556 ; -O1: bl __atomic_compare_exchange
4557 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
4561 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4562 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
4563 ; -O0: orr x9, x8, x9
4564 ; -O0: orr x8, x8, x10
4565 ; -O0: bl __atomic_compare_exchange
4567 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
4568 ; -O1: ldp x0, x1, [x0]
4569 ; -O1: orr x8, x1, x19
4570 ; -O1: orr x9, x0, x21
4571 ; -O1: bl __atomic_compare_exchange
4572 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
4576 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4577 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
4578 ; -O0: orr x9, x8, x9
4579 ; -O0: orr x8, x8, x10
4580 ; -O0: bl __atomic_compare_exchange
4582 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
4583 ; -O1: ldp x0, x1, [x0]
4584 ; -O1: orr x8, x1, x19
4585 ; -O1: orr x9, x0, x21
4586 ; -O1: bl __atomic_compare_exchange
4587 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
4591 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4592 ; -O0-LABEL: atomicrmw_xor_i8_aligned_monotonic:
4593 ; -O0: eor w12, w10, w8
4594 ; -O0: ldaxrb w9, [x11]
4595 ; -O0: cmp w9, w10, uxtb
4596 ; -O0: stlxrb w8, w12, [x11]
4597 ; -O0: and w8, w9, #0xff
4598 ; -O0: subs w8, w8, w10, uxtb
4600 ; -O1-LABEL: atomicrmw_xor_i8_aligned_monotonic:
4601 ; -O1: ldxrb w8, [x0]
4602 ; -O1: eor w9, w8, w1
4603 ; -O1: stxrb w10, w9, [x0]
4604 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
4608 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
4609 ; -O0-LABEL: atomicrmw_xor_i8_aligned_acquire:
4610 ; -O0: eor w12, w10, w8
4611 ; -O0: ldaxrb w9, [x11]
4612 ; -O0: cmp w9, w10, uxtb
4613 ; -O0: stlxrb w8, w12, [x11]
4614 ; -O0: and w8, w9, #0xff
4615 ; -O0: subs w8, w8, w10, uxtb
4617 ; -O1-LABEL: atomicrmw_xor_i8_aligned_acquire:
4618 ; -O1: ldaxrb w8, [x0]
4619 ; -O1: eor w9, w8, w1
4620 ; -O1: stxrb w10, w9, [x0]
4621 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
4625 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
4626 ; -O0-LABEL: atomicrmw_xor_i8_aligned_release:
4627 ; -O0: eor w12, w10, w8
4628 ; -O0: ldaxrb w9, [x11]
4629 ; -O0: cmp w9, w10, uxtb
4630 ; -O0: stlxrb w8, w12, [x11]
4631 ; -O0: and w8, w9, #0xff
4632 ; -O0: subs w8, w8, w10, uxtb
4634 ; -O1-LABEL: atomicrmw_xor_i8_aligned_release:
4635 ; -O1: ldxrb w8, [x0]
4636 ; -O1: eor w9, w8, w1
4637 ; -O1: stlxrb w10, w9, [x0]
4638 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
4642 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4643 ; -O0-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
4644 ; -O0: eor w12, w10, w8
4645 ; -O0: ldaxrb w9, [x11]
4646 ; -O0: cmp w9, w10, uxtb
4647 ; -O0: stlxrb w8, w12, [x11]
4648 ; -O0: and w8, w9, #0xff
4649 ; -O0: subs w8, w8, w10, uxtb
4651 ; -O1-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
4652 ; -O1: ldaxrb w8, [x0]
4653 ; -O1: eor w9, w8, w1
4654 ; -O1: stlxrb w10, w9, [x0]
4655 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
4659 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4660 ; -O0-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
4661 ; -O0: eor w12, w10, w8
4662 ; -O0: ldaxrb w9, [x11]
4663 ; -O0: cmp w9, w10, uxtb
4664 ; -O0: stlxrb w8, w12, [x11]
4665 ; -O0: and w8, w9, #0xff
4666 ; -O0: subs w8, w8, w10, uxtb
4668 ; -O1-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
4669 ; -O1: ldaxrb w8, [x0]
4670 ; -O1: eor w9, w8, w1
4671 ; -O1: stlxrb w10, w9, [x0]
4672 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
4676 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4677 ; -O0-LABEL: atomicrmw_xor_i16_aligned_monotonic:
4678 ; -O0: eor w12, w8, w9
4679 ; -O0: ldaxrh w9, [x11]
4680 ; -O0: cmp w9, w8, uxth
4681 ; -O0: stlxrh w10, w12, [x11]
4682 ; -O0: subs w8, w8, w9, uxth
4684 ; -O1-LABEL: atomicrmw_xor_i16_aligned_monotonic:
4685 ; -O1: ldxrh w8, [x0]
4686 ; -O1: eor w9, w8, w1
4687 ; -O1: stxrh w10, w9, [x0]
4688 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
4692 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
4693 ; -O0-LABEL: atomicrmw_xor_i16_aligned_acquire:
4694 ; -O0: eor w12, w8, w9
4695 ; -O0: ldaxrh w9, [x11]
4696 ; -O0: cmp w9, w8, uxth
4697 ; -O0: stlxrh w10, w12, [x11]
4698 ; -O0: subs w8, w8, w9, uxth
4700 ; -O1-LABEL: atomicrmw_xor_i16_aligned_acquire:
4701 ; -O1: ldaxrh w8, [x0]
4702 ; -O1: eor w9, w8, w1
4703 ; -O1: stxrh w10, w9, [x0]
4704 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
4708 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
4709 ; -O0-LABEL: atomicrmw_xor_i16_aligned_release:
4710 ; -O0: eor w12, w8, w9
4711 ; -O0: ldaxrh w9, [x11]
4712 ; -O0: cmp w9, w8, uxth
4713 ; -O0: stlxrh w10, w12, [x11]
4714 ; -O0: subs w8, w8, w9, uxth
4716 ; -O1-LABEL: atomicrmw_xor_i16_aligned_release:
4717 ; -O1: ldxrh w8, [x0]
4718 ; -O1: eor w9, w8, w1
4719 ; -O1: stlxrh w10, w9, [x0]
4720 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
4724 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4725 ; -O0-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
4726 ; -O0: eor w12, w8, w9
4727 ; -O0: ldaxrh w9, [x11]
4728 ; -O0: cmp w9, w8, uxth
4729 ; -O0: stlxrh w10, w12, [x11]
4730 ; -O0: subs w8, w8, w9, uxth
4732 ; -O1-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
4733 ; -O1: ldaxrh w8, [x0]
4734 ; -O1: eor w9, w8, w1
4735 ; -O1: stlxrh w10, w9, [x0]
4736 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
4740 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4741 ; -O0-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
4742 ; -O0: eor w12, w8, w9
4743 ; -O0: ldaxrh w9, [x11]
4744 ; -O0: cmp w9, w8, uxth
4745 ; -O0: stlxrh w10, w12, [x11]
4746 ; -O0: subs w8, w8, w9, uxth
4748 ; -O1-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
4749 ; -O1: ldaxrh w8, [x0]
4750 ; -O1: eor w9, w8, w1
4751 ; -O1: stlxrh w10, w9, [x0]
4752 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
4756 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4757 ; -O0-LABEL: atomicrmw_xor_i32_aligned_monotonic:
4758 ; -O0: eor w12, w8, w9
4759 ; -O0: ldaxr w9, [x11]
4761 ; -O0: stlxr w10, w12, [x11]
4762 ; -O0: subs w8, w9, w8
4764 ; -O1-LABEL: atomicrmw_xor_i32_aligned_monotonic:
4765 ; -O1: ldxr w8, [x0]
4766 ; -O1: eor w9, w8, w1
4767 ; -O1: stxr w10, w9, [x0]
4768 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
4772 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
4773 ; -O0-LABEL: atomicrmw_xor_i32_aligned_acquire:
4774 ; -O0: eor w12, w8, w9
4775 ; -O0: ldaxr w9, [x11]
4777 ; -O0: stlxr w10, w12, [x11]
4778 ; -O0: subs w8, w9, w8
4780 ; -O1-LABEL: atomicrmw_xor_i32_aligned_acquire:
4781 ; -O1: ldaxr w8, [x0]
4782 ; -O1: eor w9, w8, w1
4783 ; -O1: stxr w10, w9, [x0]
4784 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
4788 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
4789 ; -O0-LABEL: atomicrmw_xor_i32_aligned_release:
4790 ; -O0: eor w12, w8, w9
4791 ; -O0: ldaxr w9, [x11]
4793 ; -O0: stlxr w10, w12, [x11]
4794 ; -O0: subs w8, w9, w8
4796 ; -O1-LABEL: atomicrmw_xor_i32_aligned_release:
4797 ; -O1: ldxr w8, [x0]
4798 ; -O1: eor w9, w8, w1
4799 ; -O1: stlxr w10, w9, [x0]
4800 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
4804 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4805 ; -O0-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
4806 ; -O0: eor w12, w8, w9
4807 ; -O0: ldaxr w9, [x11]
4809 ; -O0: stlxr w10, w12, [x11]
4810 ; -O0: subs w8, w9, w8
4812 ; -O1-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
4813 ; -O1: ldaxr w8, [x0]
4814 ; -O1: eor w9, w8, w1
4815 ; -O1: stlxr w10, w9, [x0]
4816 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
4820 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4821 ; -O0-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
4822 ; -O0: eor w12, w8, w9
4823 ; -O0: ldaxr w9, [x11]
4825 ; -O0: stlxr w10, w12, [x11]
4826 ; -O0: subs w8, w9, w8
4828 ; -O1-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
4829 ; -O1: ldaxr w8, [x0]
4830 ; -O1: eor w9, w8, w1
4831 ; -O1: stlxr w10, w9, [x0]
4832 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
4836 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4837 ; -O0-LABEL: atomicrmw_xor_i64_aligned_monotonic:
4838 ; -O0: eor x12, x8, x9
4839 ; -O0: ldaxr x9, [x11]
4841 ; -O0: stlxr w10, x12, [x11]
4842 ; -O0: subs x8, x9, x8
4844 ; -O1-LABEL: atomicrmw_xor_i64_aligned_monotonic:
4845 ; -O1: ldxr x0, [x8]
4846 ; -O1: eor x9, x0, x1
4847 ; -O1: stxr w10, x9, [x8]
4848 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
4852 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
4853 ; -O0-LABEL: atomicrmw_xor_i64_aligned_acquire:
4854 ; -O0: eor x12, x8, x9
4855 ; -O0: ldaxr x9, [x11]
4857 ; -O0: stlxr w10, x12, [x11]
4858 ; -O0: subs x8, x9, x8
4860 ; -O1-LABEL: atomicrmw_xor_i64_aligned_acquire:
4861 ; -O1: ldaxr x0, [x8]
4862 ; -O1: eor x9, x0, x1
4863 ; -O1: stxr w10, x9, [x8]
4864 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
4868 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
4869 ; -O0-LABEL: atomicrmw_xor_i64_aligned_release:
4870 ; -O0: eor x12, x8, x9
4871 ; -O0: ldaxr x9, [x11]
4873 ; -O0: stlxr w10, x12, [x11]
4874 ; -O0: subs x8, x9, x8
4876 ; -O1-LABEL: atomicrmw_xor_i64_aligned_release:
4877 ; -O1: ldxr x0, [x8]
4878 ; -O1: eor x9, x0, x1
4879 ; -O1: stlxr w10, x9, [x8]
4880 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
4884 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4885 ; -O0-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
4886 ; -O0: eor x12, x8, x9
4887 ; -O0: ldaxr x9, [x11]
4889 ; -O0: stlxr w10, x12, [x11]
4890 ; -O0: subs x8, x9, x8
4892 ; -O1-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
4893 ; -O1: ldaxr x0, [x8]
4894 ; -O1: eor x9, x0, x1
4895 ; -O1: stlxr w10, x9, [x8]
4896 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
4900 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4901 ; -O0-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
4902 ; -O0: eor x12, x8, x9
4903 ; -O0: ldaxr x9, [x11]
4905 ; -O0: stlxr w10, x12, [x11]
4906 ; -O0: subs x8, x9, x8
4908 ; -O1-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
4909 ; -O1: ldaxr x0, [x8]
4910 ; -O1: eor x9, x0, x1
4911 ; -O1: stlxr w10, x9, [x8]
4912 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
4916 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4917 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
4918 ; -O0: eor x14, x8, x10
4919 ; -O0: eor x15, x8, x9
4920 ; -O0: ldxp x10, x9, [x11]
4923 ; -O0: stxp w8, x14, x15, [x11]
4924 ; -O0: stxp w8, x10, x9, [x11]
4925 ; -O0: eor x8, x10, x8
4926 ; -O0: eor x11, x9, x11
4927 ; -O0: orr x8, x8, x11
4928 ; -O0: subs x8, x8, #0
4930 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
4931 ; -O1: ldxp x0, x1, [x8]
4932 ; -O1: eor x9, x1, x3
4933 ; -O1: eor x10, x0, x2
4934 ; -O1: stxp w11, x10, x9, [x8]
4935 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
4939 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
4940 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
4941 ; -O0: eor x14, x8, x10
4942 ; -O0: eor x15, x8, x9
4943 ; -O0: ldaxp x10, x9, [x11]
4946 ; -O0: stxp w8, x14, x15, [x11]
4947 ; -O0: stxp w8, x10, x9, [x11]
4948 ; -O0: eor x8, x10, x8
4949 ; -O0: eor x11, x9, x11
4950 ; -O0: orr x8, x8, x11
4951 ; -O0: subs x8, x8, #0
4953 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
4954 ; -O1: ldaxp x0, x1, [x8]
4955 ; -O1: eor x9, x1, x3
4956 ; -O1: eor x10, x0, x2
4957 ; -O1: stxp w11, x10, x9, [x8]
4958 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
4962 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
4963 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
4964 ; -O0: eor x14, x8, x10
4965 ; -O0: eor x15, x8, x9
4966 ; -O0: ldxp x10, x9, [x11]
4969 ; -O0: stlxp w8, x14, x15, [x11]
4970 ; -O0: stlxp w8, x10, x9, [x11]
4971 ; -O0: eor x8, x10, x8
4972 ; -O0: eor x11, x9, x11
4973 ; -O0: orr x8, x8, x11
4974 ; -O0: subs x8, x8, #0
4976 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
4977 ; -O1: ldxp x0, x1, [x8]
4978 ; -O1: eor x9, x1, x3
4979 ; -O1: eor x10, x0, x2
4980 ; -O1: stlxp w11, x10, x9, [x8]
4981 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
4985 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4986 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
4987 ; -O0: eor x14, x8, x10
4988 ; -O0: eor x15, x8, x9
4989 ; -O0: ldaxp x10, x9, [x11]
4992 ; -O0: stlxp w8, x14, x15, [x11]
4993 ; -O0: stlxp w8, x10, x9, [x11]
4994 ; -O0: eor x8, x10, x8
4995 ; -O0: eor x11, x9, x11
4996 ; -O0: orr x8, x8, x11
4997 ; -O0: subs x8, x8, #0
4999 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
5000 ; -O1: ldaxp x0, x1, [x8]
5001 ; -O1: eor x9, x1, x3
5002 ; -O1: eor x10, x0, x2
5003 ; -O1: stlxp w11, x10, x9, [x8]
5004 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
5008 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5009 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
5010 ; -O0: eor x14, x8, x10
5011 ; -O0: eor x15, x8, x9
5012 ; -O0: ldaxp x10, x9, [x11]
5015 ; -O0: stlxp w8, x14, x15, [x11]
5016 ; -O0: stlxp w8, x10, x9, [x11]
5017 ; -O0: eor x8, x10, x8
5018 ; -O0: eor x11, x9, x11
5019 ; -O0: orr x8, x8, x11
5020 ; -O0: subs x8, x8, #0
5022 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
5023 ; -O1: ldaxp x0, x1, [x8]
5024 ; -O1: eor x9, x1, x3
5025 ; -O1: eor x10, x0, x2
5026 ; -O1: stlxp w11, x10, x9, [x8]
5027 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
5031 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5032 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
5033 ; -O0: eor w12, w10, w8
5034 ; -O0: ldaxrb w9, [x11]
5035 ; -O0: cmp w9, w10, uxtb
5036 ; -O0: stlxrb w8, w12, [x11]
5037 ; -O0: and w8, w9, #0xff
5038 ; -O0: subs w8, w8, w10, uxtb
5040 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
5041 ; -O1: ldxrb w8, [x0]
5042 ; -O1: eor w9, w8, w1
5043 ; -O1: stxrb w10, w9, [x0]
5044 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
5048 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5049 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_acquire:
5050 ; -O0: eor w12, w10, w8
5051 ; -O0: ldaxrb w9, [x11]
5052 ; -O0: cmp w9, w10, uxtb
5053 ; -O0: stlxrb w8, w12, [x11]
5054 ; -O0: and w8, w9, #0xff
5055 ; -O0: subs w8, w8, w10, uxtb
5057 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_acquire:
5058 ; -O1: ldaxrb w8, [x0]
5059 ; -O1: eor w9, w8, w1
5060 ; -O1: stxrb w10, w9, [x0]
5061 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
5065 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
5066 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_release:
5067 ; -O0: eor w12, w10, w8
5068 ; -O0: ldaxrb w9, [x11]
5069 ; -O0: cmp w9, w10, uxtb
5070 ; -O0: stlxrb w8, w12, [x11]
5071 ; -O0: and w8, w9, #0xff
5072 ; -O0: subs w8, w8, w10, uxtb
5074 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_release:
5075 ; -O1: ldxrb w8, [x0]
5076 ; -O1: eor w9, w8, w1
5077 ; -O1: stlxrb w10, w9, [x0]
5078 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
5082 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5083 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
5084 ; -O0: eor w12, w10, w8
5085 ; -O0: ldaxrb w9, [x11]
5086 ; -O0: cmp w9, w10, uxtb
5087 ; -O0: stlxrb w8, w12, [x11]
5088 ; -O0: and w8, w9, #0xff
5089 ; -O0: subs w8, w8, w10, uxtb
5091 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
5092 ; -O1: ldaxrb w8, [x0]
5093 ; -O1: eor w9, w8, w1
5094 ; -O1: stlxrb w10, w9, [x0]
5095 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
5099 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5100 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
5101 ; -O0: eor w12, w10, w8
5102 ; -O0: ldaxrb w9, [x11]
5103 ; -O0: cmp w9, w10, uxtb
5104 ; -O0: stlxrb w8, w12, [x11]
5105 ; -O0: and w8, w9, #0xff
5106 ; -O0: subs w8, w8, w10, uxtb
5108 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
5109 ; -O1: ldaxrb w8, [x0]
5110 ; -O1: eor w9, w8, w1
5111 ; -O1: stlxrb w10, w9, [x0]
5112 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
5116 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5117 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
5118 ; -O0: eor w8, w9, w8
5119 ; -O0: bl __atomic_compare_exchange
5121 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
5122 ; -O1: eor w8, w0, w20
5123 ; -O1: bl __atomic_compare_exchange
5124 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
5128 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5129 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
5130 ; -O0: eor w8, w9, w8
5131 ; -O0: bl __atomic_compare_exchange
5133 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
5134 ; -O1: eor w8, w0, w20
5135 ; -O1: bl __atomic_compare_exchange
5136 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
5140 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
5141 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
5142 ; -O0: eor w8, w9, w8
5143 ; -O0: bl __atomic_compare_exchange
5145 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
5146 ; -O1: eor w8, w0, w20
5147 ; -O1: bl __atomic_compare_exchange
5148 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
5152 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5153 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
5154 ; -O0: eor w8, w9, w8
5155 ; -O0: bl __atomic_compare_exchange
5157 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
5158 ; -O1: eor w8, w0, w20
5159 ; -O1: bl __atomic_compare_exchange
5160 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
5164 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5165 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
5166 ; -O0: eor w8, w9, w8
5167 ; -O0: bl __atomic_compare_exchange
5169 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
5170 ; -O1: eor w8, w0, w20
5171 ; -O1: bl __atomic_compare_exchange
5172 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
5176 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5177 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
5178 ; -O0: eor w8, w9, w8
5179 ; -O0: bl __atomic_compare_exchange
5181 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
5182 ; -O1: eor w8, w0, w20
5183 ; -O1: bl __atomic_compare_exchange
5184 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
5188 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5189 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
5190 ; -O0: eor w8, w9, w8
5191 ; -O0: bl __atomic_compare_exchange
5193 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
5194 ; -O1: eor w8, w0, w20
5195 ; -O1: bl __atomic_compare_exchange
5196 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
5200 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
5201 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
5202 ; -O0: eor w8, w9, w8
5203 ; -O0: bl __atomic_compare_exchange
5205 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
5206 ; -O1: eor w8, w0, w20
5207 ; -O1: bl __atomic_compare_exchange
5208 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
5212 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5213 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
5214 ; -O0: eor w8, w9, w8
5215 ; -O0: bl __atomic_compare_exchange
5217 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
5218 ; -O1: eor w8, w0, w20
5219 ; -O1: bl __atomic_compare_exchange
5220 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
5224 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5225 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
5226 ; -O0: eor w8, w9, w8
5227 ; -O0: bl __atomic_compare_exchange
5229 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
5230 ; -O1: eor w8, w0, w20
5231 ; -O1: bl __atomic_compare_exchange
5232 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
5236 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5237 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
5238 ; -O0: eor x8, x9, x8
5239 ; -O0: bl __atomic_compare_exchange
5241 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
5242 ; -O1: eor x8, x0, x20
5243 ; -O1: bl __atomic_compare_exchange
5244 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
5248 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5249 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
5250 ; -O0: eor x8, x9, x8
5251 ; -O0: bl __atomic_compare_exchange
5253 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
5254 ; -O1: eor x8, x0, x20
5255 ; -O1: bl __atomic_compare_exchange
5256 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
5260 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
5261 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
5262 ; -O0: eor x8, x9, x8
5263 ; -O0: bl __atomic_compare_exchange
5265 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
5266 ; -O1: eor x8, x0, x20
5267 ; -O1: bl __atomic_compare_exchange
5268 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
5272 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5273 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
5274 ; -O0: eor x8, x9, x8
5275 ; -O0: bl __atomic_compare_exchange
5277 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
5278 ; -O1: eor x8, x0, x20
5279 ; -O1: bl __atomic_compare_exchange
5280 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
5284 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5285 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
5286 ; -O0: eor x8, x9, x8
5287 ; -O0: bl __atomic_compare_exchange
5289 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
5290 ; -O1: eor x8, x0, x20
5291 ; -O1: bl __atomic_compare_exchange
5292 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
5296 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5297 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
5298 ; -O0: eor x9, x8, x9
5299 ; -O0: eor x8, x8, x10
5300 ; -O0: bl __atomic_compare_exchange
5302 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
5303 ; -O1: ldp x0, x1, [x0]
5304 ; -O1: eor x8, x1, x19
5305 ; -O1: eor x9, x0, x21
5306 ; -O1: bl __atomic_compare_exchange
5307 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
5311 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5312 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
5313 ; -O0: eor x9, x8, x9
5314 ; -O0: eor x8, x8, x10
5315 ; -O0: bl __atomic_compare_exchange
5317 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
5318 ; -O1: ldp x0, x1, [x0]
5319 ; -O1: eor x8, x1, x19
5320 ; -O1: eor x9, x0, x21
5321 ; -O1: bl __atomic_compare_exchange
5322 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
5326 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
5327 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
5328 ; -O0: eor x9, x8, x9
5329 ; -O0: eor x8, x8, x10
5330 ; -O0: bl __atomic_compare_exchange
5332 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
5333 ; -O1: ldp x0, x1, [x0]
5334 ; -O1: eor x8, x1, x19
5335 ; -O1: eor x9, x0, x21
5336 ; -O1: bl __atomic_compare_exchange
5337 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
5341 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5342 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
5343 ; -O0: eor x9, x8, x9
5344 ; -O0: eor x8, x8, x10
5345 ; -O0: bl __atomic_compare_exchange
5347 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
5348 ; -O1: ldp x0, x1, [x0]
5349 ; -O1: eor x8, x1, x19
5350 ; -O1: eor x9, x0, x21
5351 ; -O1: bl __atomic_compare_exchange
5352 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
5356 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5357 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
5358 ; -O0: eor x9, x8, x9
5359 ; -O0: eor x8, x8, x10
5360 ; -O0: bl __atomic_compare_exchange
5362 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
5363 ; -O1: ldp x0, x1, [x0]
5364 ; -O1: eor x8, x1, x19
5365 ; -O1: eor x9, x0, x21
5366 ; -O1: bl __atomic_compare_exchange
5367 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
5371 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5372 ; -O0-LABEL: atomicrmw_max_i8_aligned_monotonic:
5374 ; -O0: subs w9, w9, w8, sxtb
5375 ; -O0: csel w12, w10, w8, gt
5376 ; -O0: ldaxrb w9, [x11]
5377 ; -O0: cmp w9, w10, uxtb
5378 ; -O0: stlxrb w8, w12, [x11]
5379 ; -O0: and w8, w9, #0xff
5380 ; -O0: subs w8, w8, w10, uxtb
5382 ; -O1-LABEL: atomicrmw_max_i8_aligned_monotonic:
5383 ; -O1: ldxrb w9, [x0]
5385 ; -O1: cmp w8, w1, sxtb
5386 ; -O1: csel w9, w9, w1, gt
5387 ; -O1: stxrb w10, w9, [x0]
5388 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
5392 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
5393 ; -O0-LABEL: atomicrmw_max_i8_aligned_acquire:
5395 ; -O0: subs w9, w9, w8, sxtb
5396 ; -O0: csel w12, w10, w8, gt
5397 ; -O0: ldaxrb w9, [x11]
5398 ; -O0: cmp w9, w10, uxtb
5399 ; -O0: stlxrb w8, w12, [x11]
5400 ; -O0: and w8, w9, #0xff
5401 ; -O0: subs w8, w8, w10, uxtb
5403 ; -O1-LABEL: atomicrmw_max_i8_aligned_acquire:
5404 ; -O1: ldaxrb w9, [x0]
5406 ; -O1: cmp w8, w1, sxtb
5407 ; -O1: csel w9, w9, w1, gt
5408 ; -O1: stxrb w10, w9, [x0]
5409 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
5413 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
5414 ; -O0-LABEL: atomicrmw_max_i8_aligned_release:
5416 ; -O0: subs w9, w9, w8, sxtb
5417 ; -O0: csel w12, w10, w8, gt
5418 ; -O0: ldaxrb w9, [x11]
5419 ; -O0: cmp w9, w10, uxtb
5420 ; -O0: stlxrb w8, w12, [x11]
5421 ; -O0: and w8, w9, #0xff
5422 ; -O0: subs w8, w8, w10, uxtb
5424 ; -O1-LABEL: atomicrmw_max_i8_aligned_release:
5425 ; -O1: ldxrb w9, [x0]
5427 ; -O1: cmp w8, w1, sxtb
5428 ; -O1: csel w9, w9, w1, gt
5429 ; -O1: stlxrb w10, w9, [x0]
5430 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
5434 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5435 ; -O0-LABEL: atomicrmw_max_i8_aligned_acq_rel:
5437 ; -O0: subs w9, w9, w8, sxtb
5438 ; -O0: csel w12, w10, w8, gt
5439 ; -O0: ldaxrb w9, [x11]
5440 ; -O0: cmp w9, w10, uxtb
5441 ; -O0: stlxrb w8, w12, [x11]
5442 ; -O0: and w8, w9, #0xff
5443 ; -O0: subs w8, w8, w10, uxtb
5445 ; -O1-LABEL: atomicrmw_max_i8_aligned_acq_rel:
5446 ; -O1: ldaxrb w9, [x0]
5448 ; -O1: cmp w8, w1, sxtb
5449 ; -O1: csel w9, w9, w1, gt
5450 ; -O1: stlxrb w10, w9, [x0]
5451 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
5455 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5456 ; -O0-LABEL: atomicrmw_max_i8_aligned_seq_cst:
5458 ; -O0: subs w9, w9, w8, sxtb
5459 ; -O0: csel w12, w10, w8, gt
5460 ; -O0: ldaxrb w9, [x11]
5461 ; -O0: cmp w9, w10, uxtb
5462 ; -O0: stlxrb w8, w12, [x11]
5463 ; -O0: and w8, w9, #0xff
5464 ; -O0: subs w8, w8, w10, uxtb
5466 ; -O1-LABEL: atomicrmw_max_i8_aligned_seq_cst:
5467 ; -O1: ldaxrb w9, [x0]
5469 ; -O1: cmp w8, w1, sxtb
5470 ; -O1: csel w9, w9, w1, gt
5471 ; -O1: stlxrb w10, w9, [x0]
5472 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
5476 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5477 ; -O0-LABEL: atomicrmw_max_i16_aligned_monotonic:
5479 ; -O0: subs w10, w10, w9, sxth
5480 ; -O0: csel w12, w8, w9, gt
5481 ; -O0: ldaxrh w9, [x11]
5482 ; -O0: cmp w9, w8, uxth
5483 ; -O0: stlxrh w10, w12, [x11]
5484 ; -O0: subs w8, w8, w9, uxth
5486 ; -O1-LABEL: atomicrmw_max_i16_aligned_monotonic:
5487 ; -O1: ldxrh w9, [x0]
5489 ; -O1: cmp w8, w1, sxth
5490 ; -O1: csel w9, w9, w1, gt
5491 ; -O1: stxrh w10, w9, [x0]
5492 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
5496 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
5497 ; -O0-LABEL: atomicrmw_max_i16_aligned_acquire:
5499 ; -O0: subs w10, w10, w9, sxth
5500 ; -O0: csel w12, w8, w9, gt
5501 ; -O0: ldaxrh w9, [x11]
5502 ; -O0: cmp w9, w8, uxth
5503 ; -O0: stlxrh w10, w12, [x11]
5504 ; -O0: subs w8, w8, w9, uxth
5506 ; -O1-LABEL: atomicrmw_max_i16_aligned_acquire:
5507 ; -O1: ldaxrh w9, [x0]
5509 ; -O1: cmp w8, w1, sxth
5510 ; -O1: csel w9, w9, w1, gt
5511 ; -O1: stxrh w10, w9, [x0]
5512 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
5516 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
5517 ; -O0-LABEL: atomicrmw_max_i16_aligned_release:
5519 ; -O0: subs w10, w10, w9, sxth
5520 ; -O0: csel w12, w8, w9, gt
5521 ; -O0: ldaxrh w9, [x11]
5522 ; -O0: cmp w9, w8, uxth
5523 ; -O0: stlxrh w10, w12, [x11]
5524 ; -O0: subs w8, w8, w9, uxth
5526 ; -O1-LABEL: atomicrmw_max_i16_aligned_release:
5527 ; -O1: ldxrh w9, [x0]
5529 ; -O1: cmp w8, w1, sxth
5530 ; -O1: csel w9, w9, w1, gt
5531 ; -O1: stlxrh w10, w9, [x0]
5532 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
5536 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5537 ; -O0-LABEL: atomicrmw_max_i16_aligned_acq_rel:
5539 ; -O0: subs w10, w10, w9, sxth
5540 ; -O0: csel w12, w8, w9, gt
5541 ; -O0: ldaxrh w9, [x11]
5542 ; -O0: cmp w9, w8, uxth
5543 ; -O0: stlxrh w10, w12, [x11]
5544 ; -O0: subs w8, w8, w9, uxth
5546 ; -O1-LABEL: atomicrmw_max_i16_aligned_acq_rel:
5547 ; -O1: ldaxrh w9, [x0]
5549 ; -O1: cmp w8, w1, sxth
5550 ; -O1: csel w9, w9, w1, gt
5551 ; -O1: stlxrh w10, w9, [x0]
5552 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
5556 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5557 ; -O0-LABEL: atomicrmw_max_i16_aligned_seq_cst:
5559 ; -O0: subs w10, w10, w9, sxth
5560 ; -O0: csel w12, w8, w9, gt
5561 ; -O0: ldaxrh w9, [x11]
5562 ; -O0: cmp w9, w8, uxth
5563 ; -O0: stlxrh w10, w12, [x11]
5564 ; -O0: subs w8, w8, w9, uxth
5566 ; -O1-LABEL: atomicrmw_max_i16_aligned_seq_cst:
5567 ; -O1: ldaxrh w9, [x0]
5569 ; -O1: cmp w8, w1, sxth
5570 ; -O1: csel w9, w9, w1, gt
5571 ; -O1: stlxrh w10, w9, [x0]
5572 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
5576 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5577 ; -O0-LABEL: atomicrmw_max_i32_aligned_monotonic:
5578 ; -O0: subs w10, w8, w9
5579 ; -O0: csel w12, w8, w9, gt
5580 ; -O0: ldaxr w9, [x11]
5582 ; -O0: stlxr w10, w12, [x11]
5583 ; -O0: subs w8, w9, w8
5585 ; -O1-LABEL: atomicrmw_max_i32_aligned_monotonic:
5586 ; -O1: ldxr w8, [x0]
5588 ; -O1: csel w9, w8, w1, gt
5589 ; -O1: stxr w10, w9, [x0]
5590 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
5594 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
5595 ; -O0-LABEL: atomicrmw_max_i32_aligned_acquire:
5596 ; -O0: subs w10, w8, w9
5597 ; -O0: csel w12, w8, w9, gt
5598 ; -O0: ldaxr w9, [x11]
5600 ; -O0: stlxr w10, w12, [x11]
5601 ; -O0: subs w8, w9, w8
5603 ; -O1-LABEL: atomicrmw_max_i32_aligned_acquire:
5604 ; -O1: ldaxr w8, [x0]
5606 ; -O1: csel w9, w8, w1, gt
5607 ; -O1: stxr w10, w9, [x0]
5608 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
5612 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
5613 ; -O0-LABEL: atomicrmw_max_i32_aligned_release:
5614 ; -O0: subs w10, w8, w9
5615 ; -O0: csel w12, w8, w9, gt
5616 ; -O0: ldaxr w9, [x11]
5618 ; -O0: stlxr w10, w12, [x11]
5619 ; -O0: subs w8, w9, w8
5621 ; -O1-LABEL: atomicrmw_max_i32_aligned_release:
5622 ; -O1: ldxr w8, [x0]
5624 ; -O1: csel w9, w8, w1, gt
5625 ; -O1: stlxr w10, w9, [x0]
5626 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
5630 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5631 ; -O0-LABEL: atomicrmw_max_i32_aligned_acq_rel:
5632 ; -O0: subs w10, w8, w9
5633 ; -O0: csel w12, w8, w9, gt
5634 ; -O0: ldaxr w9, [x11]
5636 ; -O0: stlxr w10, w12, [x11]
5637 ; -O0: subs w8, w9, w8
5639 ; -O1-LABEL: atomicrmw_max_i32_aligned_acq_rel:
5640 ; -O1: ldaxr w8, [x0]
5642 ; -O1: csel w9, w8, w1, gt
5643 ; -O1: stlxr w10, w9, [x0]
5644 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
5648 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5649 ; -O0-LABEL: atomicrmw_max_i32_aligned_seq_cst:
5650 ; -O0: subs w10, w8, w9
5651 ; -O0: csel w12, w8, w9, gt
5652 ; -O0: ldaxr w9, [x11]
5654 ; -O0: stlxr w10, w12, [x11]
5655 ; -O0: subs w8, w9, w8
5657 ; -O1-LABEL: atomicrmw_max_i32_aligned_seq_cst:
5658 ; -O1: ldaxr w8, [x0]
5660 ; -O1: csel w9, w8, w1, gt
5661 ; -O1: stlxr w10, w9, [x0]
5662 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
5666 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5667 ; -O0-LABEL: atomicrmw_max_i64_aligned_monotonic:
5668 ; -O0: subs x10, x8, x9
5669 ; -O0: csel x12, x8, x9, gt
5670 ; -O0: ldaxr x9, [x11]
5672 ; -O0: stlxr w10, x12, [x11]
5673 ; -O0: subs x8, x9, x8
5675 ; -O1-LABEL: atomicrmw_max_i64_aligned_monotonic:
5676 ; -O1: ldxr x0, [x8]
5678 ; -O1: csel x9, x0, x1, gt
5679 ; -O1: stxr w10, x9, [x8]
5680 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
5684 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
5685 ; -O0-LABEL: atomicrmw_max_i64_aligned_acquire:
5686 ; -O0: subs x10, x8, x9
5687 ; -O0: csel x12, x8, x9, gt
5688 ; -O0: ldaxr x9, [x11]
5690 ; -O0: stlxr w10, x12, [x11]
5691 ; -O0: subs x8, x9, x8
5693 ; -O1-LABEL: atomicrmw_max_i64_aligned_acquire:
5694 ; -O1: ldaxr x0, [x8]
5696 ; -O1: csel x9, x0, x1, gt
5697 ; -O1: stxr w10, x9, [x8]
5698 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
5702 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
5703 ; -O0-LABEL: atomicrmw_max_i64_aligned_release:
5704 ; -O0: subs x10, x8, x9
5705 ; -O0: csel x12, x8, x9, gt
5706 ; -O0: ldaxr x9, [x11]
5708 ; -O0: stlxr w10, x12, [x11]
5709 ; -O0: subs x8, x9, x8
5711 ; -O1-LABEL: atomicrmw_max_i64_aligned_release:
5712 ; -O1: ldxr x0, [x8]
5714 ; -O1: csel x9, x0, x1, gt
5715 ; -O1: stlxr w10, x9, [x8]
5716 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
5720 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5721 ; -O0-LABEL: atomicrmw_max_i64_aligned_acq_rel:
5722 ; -O0: subs x10, x8, x9
5723 ; -O0: csel x12, x8, x9, gt
5724 ; -O0: ldaxr x9, [x11]
5726 ; -O0: stlxr w10, x12, [x11]
5727 ; -O0: subs x8, x9, x8
5729 ; -O1-LABEL: atomicrmw_max_i64_aligned_acq_rel:
5730 ; -O1: ldaxr x0, [x8]
5732 ; -O1: csel x9, x0, x1, gt
5733 ; -O1: stlxr w10, x9, [x8]
5734 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
5738 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5739 ; -O0-LABEL: atomicrmw_max_i64_aligned_seq_cst:
5740 ; -O0: subs x10, x8, x9
5741 ; -O0: csel x12, x8, x9, gt
5742 ; -O0: ldaxr x9, [x11]
5744 ; -O0: stlxr w10, x12, [x11]
5745 ; -O0: subs x8, x9, x8
5747 ; -O1-LABEL: atomicrmw_max_i64_aligned_seq_cst:
5748 ; -O1: ldaxr x0, [x8]
5750 ; -O1: csel x9, x0, x1, gt
5751 ; -O1: stlxr w10, x9, [x8]
5752 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
5756 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5757 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
5758 ; -O0: subs x8, x8, x9
5759 ; -O0: subs x8, x8, x12
5760 ; -O0: subs x13, x13, x9
5761 ; -O0: csel w10, w8, w10, eq
5762 ; -O0: ands w13, w10, #0x1
5763 ; -O0: csel x14, x8, x12, ne
5764 ; -O0: ands w10, w10, #0x1
5765 ; -O0: csel x15, x8, x9, ne
5766 ; -O0: ldxp x10, x9, [x11]
5769 ; -O0: stxp w8, x14, x15, [x11]
5770 ; -O0: stxp w8, x10, x9, [x11]
5771 ; -O0: eor x8, x10, x8
5772 ; -O0: eor x11, x9, x11
5773 ; -O0: orr x8, x8, x11
5774 ; -O0: subs x8, x8, #0
5776 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
5777 ; -O1: ldxp x0, x1, [x8]
5779 ; -O1: csel x9, x1, x3, lt
5780 ; -O1: csel x10, x0, x2, lt
5781 ; -O1: stxp w11, x10, x9, [x8]
5782 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
5786 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
5787 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
5788 ; -O0: subs x8, x8, x9
5789 ; -O0: subs x8, x8, x12
5790 ; -O0: subs x13, x13, x9
5791 ; -O0: csel w10, w8, w10, eq
5792 ; -O0: ands w13, w10, #0x1
5793 ; -O0: csel x14, x8, x12, ne
5794 ; -O0: ands w10, w10, #0x1
5795 ; -O0: csel x15, x8, x9, ne
5796 ; -O0: ldaxp x10, x9, [x11]
5799 ; -O0: stxp w8, x14, x15, [x11]
5800 ; -O0: stxp w8, x10, x9, [x11]
5801 ; -O0: eor x8, x10, x8
5802 ; -O0: eor x11, x9, x11
5803 ; -O0: orr x8, x8, x11
5804 ; -O0: subs x8, x8, #0
5806 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
5807 ; -O1: ldaxp x0, x1, [x8]
5809 ; -O1: csel x9, x1, x3, lt
5810 ; -O1: csel x10, x0, x2, lt
5811 ; -O1: stxp w11, x10, x9, [x8]
5812 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
5816 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
5817 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
5818 ; -O0: subs x8, x8, x9
5819 ; -O0: subs x8, x8, x12
5820 ; -O0: subs x13, x13, x9
5821 ; -O0: csel w10, w8, w10, eq
5822 ; -O0: ands w13, w10, #0x1
5823 ; -O0: csel x14, x8, x12, ne
5824 ; -O0: ands w10, w10, #0x1
5825 ; -O0: csel x15, x8, x9, ne
5826 ; -O0: ldxp x10, x9, [x11]
5829 ; -O0: stlxp w8, x14, x15, [x11]
5830 ; -O0: stlxp w8, x10, x9, [x11]
5831 ; -O0: eor x8, x10, x8
5832 ; -O0: eor x11, x9, x11
5833 ; -O0: orr x8, x8, x11
5834 ; -O0: subs x8, x8, #0
5836 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
5837 ; -O1: ldxp x0, x1, [x8]
5839 ; -O1: csel x9, x1, x3, lt
5840 ; -O1: csel x10, x0, x2, lt
5841 ; -O1: stlxp w11, x10, x9, [x8]
5842 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
5846 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5847 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
5848 ; -O0: subs x8, x8, x9
5849 ; -O0: subs x8, x8, x12
5850 ; -O0: subs x13, x13, x9
5851 ; -O0: csel w10, w8, w10, eq
5852 ; -O0: ands w13, w10, #0x1
5853 ; -O0: csel x14, x8, x12, ne
5854 ; -O0: ands w10, w10, #0x1
5855 ; -O0: csel x15, x8, x9, ne
5856 ; -O0: ldaxp x10, x9, [x11]
5859 ; -O0: stlxp w8, x14, x15, [x11]
5860 ; -O0: stlxp w8, x10, x9, [x11]
5861 ; -O0: eor x8, x10, x8
5862 ; -O0: eor x11, x9, x11
5863 ; -O0: orr x8, x8, x11
5864 ; -O0: subs x8, x8, #0
5866 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
5867 ; -O1: ldaxp x0, x1, [x8]
5869 ; -O1: csel x9, x1, x3, lt
5870 ; -O1: csel x10, x0, x2, lt
5871 ; -O1: stlxp w11, x10, x9, [x8]
5872 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
5876 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5877 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
5878 ; -O0: subs x8, x8, x9
5879 ; -O0: subs x8, x8, x12
5880 ; -O0: subs x13, x13, x9
5881 ; -O0: csel w10, w8, w10, eq
5882 ; -O0: ands w13, w10, #0x1
5883 ; -O0: csel x14, x8, x12, ne
5884 ; -O0: ands w10, w10, #0x1
5885 ; -O0: csel x15, x8, x9, ne
5886 ; -O0: ldaxp x10, x9, [x11]
5889 ; -O0: stlxp w8, x14, x15, [x11]
5890 ; -O0: stlxp w8, x10, x9, [x11]
5891 ; -O0: eor x8, x10, x8
5892 ; -O0: eor x11, x9, x11
5893 ; -O0: orr x8, x8, x11
5894 ; -O0: subs x8, x8, #0
5896 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
5897 ; -O1: ldaxp x0, x1, [x8]
5899 ; -O1: csel x9, x1, x3, lt
5900 ; -O1: csel x10, x0, x2, lt
5901 ; -O1: stlxp w11, x10, x9, [x8]
5902 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
5906 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5907 ; -O0-LABEL: atomicrmw_max_i8_unaligned_monotonic:
5909 ; -O0: subs w9, w9, w8, sxtb
5910 ; -O0: csel w12, w10, w8, gt
5911 ; -O0: ldaxrb w9, [x11]
5912 ; -O0: cmp w9, w10, uxtb
5913 ; -O0: stlxrb w8, w12, [x11]
5914 ; -O0: and w8, w9, #0xff
5915 ; -O0: subs w8, w8, w10, uxtb
5917 ; -O1-LABEL: atomicrmw_max_i8_unaligned_monotonic:
5918 ; -O1: ldxrb w9, [x0]
5920 ; -O1: cmp w8, w1, sxtb
5921 ; -O1: csel w9, w9, w1, gt
5922 ; -O1: stxrb w10, w9, [x0]
5923 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
5927 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5928 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acquire:
5930 ; -O0: subs w9, w9, w8, sxtb
5931 ; -O0: csel w12, w10, w8, gt
5932 ; -O0: ldaxrb w9, [x11]
5933 ; -O0: cmp w9, w10, uxtb
5934 ; -O0: stlxrb w8, w12, [x11]
5935 ; -O0: and w8, w9, #0xff
5936 ; -O0: subs w8, w8, w10, uxtb
5938 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acquire:
5939 ; -O1: ldaxrb w9, [x0]
5941 ; -O1: cmp w8, w1, sxtb
5942 ; -O1: csel w9, w9, w1, gt
5943 ; -O1: stxrb w10, w9, [x0]
5944 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
5948 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
5949 ; -O0-LABEL: atomicrmw_max_i8_unaligned_release:
5951 ; -O0: subs w9, w9, w8, sxtb
5952 ; -O0: csel w12, w10, w8, gt
5953 ; -O0: ldaxrb w9, [x11]
5954 ; -O0: cmp w9, w10, uxtb
5955 ; -O0: stlxrb w8, w12, [x11]
5956 ; -O0: and w8, w9, #0xff
5957 ; -O0: subs w8, w8, w10, uxtb
5959 ; -O1-LABEL: atomicrmw_max_i8_unaligned_release:
5960 ; -O1: ldxrb w9, [x0]
5962 ; -O1: cmp w8, w1, sxtb
5963 ; -O1: csel w9, w9, w1, gt
5964 ; -O1: stlxrb w10, w9, [x0]
5965 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
5969 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5970 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
5972 ; -O0: subs w9, w9, w8, sxtb
5973 ; -O0: csel w12, w10, w8, gt
5974 ; -O0: ldaxrb w9, [x11]
5975 ; -O0: cmp w9, w10, uxtb
5976 ; -O0: stlxrb w8, w12, [x11]
5977 ; -O0: and w8, w9, #0xff
5978 ; -O0: subs w8, w8, w10, uxtb
5980 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
5981 ; -O1: ldaxrb w9, [x0]
5983 ; -O1: cmp w8, w1, sxtb
5984 ; -O1: csel w9, w9, w1, gt
5985 ; -O1: stlxrb w10, w9, [x0]
5986 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
5990 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5991 ; -O0-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
5993 ; -O0: subs w9, w9, w8, sxtb
5994 ; -O0: csel w12, w10, w8, gt
5995 ; -O0: ldaxrb w9, [x11]
5996 ; -O0: cmp w9, w10, uxtb
5997 ; -O0: stlxrb w8, w12, [x11]
5998 ; -O0: and w8, w9, #0xff
5999 ; -O0: subs w8, w8, w10, uxtb
6001 ; -O1-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
6002 ; -O1: ldaxrb w9, [x0]
6004 ; -O1: cmp w8, w1, sxtb
6005 ; -O1: csel w9, w9, w1, gt
6006 ; -O1: stlxrb w10, w9, [x0]
6007 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
6011 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6012 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
6014 ; -O0: subs w10, w10, w8, sxth
6015 ; -O0: csel w8, w9, w8, gt
6016 ; -O0: bl __atomic_compare_exchange
6018 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
6020 ; -O1: cmp w8, w20, sxth
6021 ; -O1: csel w8, w0, w20, gt
6022 ; -O1: bl __atomic_compare_exchange
6023 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
6027 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6028 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
6030 ; -O0: subs w10, w10, w8, sxth
6031 ; -O0: csel w8, w9, w8, gt
6032 ; -O0: bl __atomic_compare_exchange
6034 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
6036 ; -O1: cmp w8, w20, sxth
6037 ; -O1: csel w8, w0, w20, gt
6038 ; -O1: bl __atomic_compare_exchange
6039 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
6043 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
6044 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
6046 ; -O0: subs w10, w10, w8, sxth
6047 ; -O0: csel w8, w9, w8, gt
6048 ; -O0: bl __atomic_compare_exchange
6050 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
6052 ; -O1: cmp w8, w20, sxth
6053 ; -O1: csel w8, w0, w20, gt
6054 ; -O1: bl __atomic_compare_exchange
6055 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
6059 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6060 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
6062 ; -O0: subs w10, w10, w8, sxth
6063 ; -O0: csel w8, w9, w8, gt
6064 ; -O0: bl __atomic_compare_exchange
6066 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
6068 ; -O1: cmp w8, w20, sxth
6069 ; -O1: csel w8, w0, w20, gt
6070 ; -O1: bl __atomic_compare_exchange
6071 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
6075 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6076 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
6078 ; -O0: subs w10, w10, w8, sxth
6079 ; -O0: csel w8, w9, w8, gt
6080 ; -O0: bl __atomic_compare_exchange
6082 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
6084 ; -O1: cmp w8, w20, sxth
6085 ; -O1: csel w8, w0, w20, gt
6086 ; -O1: bl __atomic_compare_exchange
6087 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
6091 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6092 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
6093 ; -O0: subs w10, w9, w8
6094 ; -O0: csel w8, w9, w8, gt
6095 ; -O0: bl __atomic_compare_exchange
6097 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
6099 ; -O1: csel w8, w0, w20, gt
6100 ; -O1: bl __atomic_compare_exchange
6101 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
6105 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6106 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
6107 ; -O0: subs w10, w9, w8
6108 ; -O0: csel w8, w9, w8, gt
6109 ; -O0: bl __atomic_compare_exchange
6111 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
6113 ; -O1: csel w8, w0, w20, gt
6114 ; -O1: bl __atomic_compare_exchange
6115 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
6119 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
6120 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
6121 ; -O0: subs w10, w9, w8
6122 ; -O0: csel w8, w9, w8, gt
6123 ; -O0: bl __atomic_compare_exchange
6125 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
6127 ; -O1: csel w8, w0, w20, gt
6128 ; -O1: bl __atomic_compare_exchange
6129 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
6133 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6134 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
6135 ; -O0: subs w10, w9, w8
6136 ; -O0: csel w8, w9, w8, gt
6137 ; -O0: bl __atomic_compare_exchange
6139 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
6141 ; -O1: csel w8, w0, w20, gt
6142 ; -O1: bl __atomic_compare_exchange
6143 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
6147 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6148 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
6149 ; -O0: subs w10, w9, w8
6150 ; -O0: csel w8, w9, w8, gt
6151 ; -O0: bl __atomic_compare_exchange
6153 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
6155 ; -O1: csel w8, w0, w20, gt
6156 ; -O1: bl __atomic_compare_exchange
6157 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
6161 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6162 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
6163 ; -O0: subs x10, x9, x8
6164 ; -O0: csel x8, x9, x8, gt
6165 ; -O0: bl __atomic_compare_exchange
6167 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
6169 ; -O1: csel x8, x0, x20, gt
6170 ; -O1: bl __atomic_compare_exchange
6171 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
6175 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6176 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
6177 ; -O0: subs x10, x9, x8
6178 ; -O0: csel x8, x9, x8, gt
6179 ; -O0: bl __atomic_compare_exchange
6181 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
6183 ; -O1: csel x8, x0, x20, gt
6184 ; -O1: bl __atomic_compare_exchange
6185 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
6189 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
6190 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
6191 ; -O0: subs x10, x9, x8
6192 ; -O0: csel x8, x9, x8, gt
6193 ; -O0: bl __atomic_compare_exchange
6195 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
6197 ; -O1: csel x8, x0, x20, gt
6198 ; -O1: bl __atomic_compare_exchange
6199 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
6203 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6204 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
6205 ; -O0: subs x10, x9, x8
6206 ; -O0: csel x8, x9, x8, gt
6207 ; -O0: bl __atomic_compare_exchange
6209 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
6211 ; -O1: csel x8, x0, x20, gt
6212 ; -O1: bl __atomic_compare_exchange
6213 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
6217 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6218 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
6219 ; -O0: subs x10, x9, x8
6220 ; -O0: csel x8, x9, x8, gt
6221 ; -O0: bl __atomic_compare_exchange
6223 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
6225 ; -O1: csel x8, x0, x20, gt
6226 ; -O1: bl __atomic_compare_exchange
6227 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
6231 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6232 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
6233 ; -O0: subs x8, x8, x10
6234 ; -O0: subs x8, x8, x9
6235 ; -O0: subs x12, x12, x10
6236 ; -O0: csel w11, w8, w11, eq
6237 ; -O0: ands w12, w11, #0x1
6238 ; -O0: csel x9, x8, x9, ne
6239 ; -O0: ands w11, w11, #0x1
6240 ; -O0: csel x8, x8, x10, ne
6241 ; -O0: bl __atomic_compare_exchange
6243 ; -O1-LABEL: atomicrmw_max_i128_unaligned_monotonic:
6244 ; -O1: ldp x0, x1, [x0]
6246 ; -O1: csel x8, x1, x19, lt
6247 ; -O1: csel x9, x0, x21, lt
6248 ; -O1: bl __atomic_compare_exchange
6249 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 1
6253 define dso_local i128 @atomicrmw_max_i128_unaligned_acquire(ptr %ptr, i128 %value) {
6254 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acquire:
6255 ; -O0: subs x8, x8, x10
6256 ; -O0: subs x8, x8, x9
6257 ; -O0: subs x12, x12, x10
6258 ; -O0: csel w11, w8, w11, eq
6259 ; -O0: ands w12, w11, #0x1
6260 ; -O0: csel x9, x8, x9, ne
6261 ; -O0: ands w11, w11, #0x1
6262 ; -O0: csel x8, x8, x10, ne
6263 ; -O0: bl __atomic_compare_exchange
6265 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
6266 ; -O1: ldp x0, x1, [x0]
6268 ; -O1: csel x8, x1, x19, lt
6269 ; -O1: csel x9, x0, x21, lt
6270 ; -O1: bl __atomic_compare_exchange
6271 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
6275 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
6276 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
6277 ; -O0: subs x8, x8, x10
6278 ; -O0: subs x8, x8, x9
6279 ; -O0: subs x12, x12, x10
6280 ; -O0: csel w11, w8, w11, eq
6281 ; -O0: ands w12, w11, #0x1
6282 ; -O0: csel x9, x8, x9, ne
6283 ; -O0: ands w11, w11, #0x1
6284 ; -O0: csel x8, x8, x10, ne
6285 ; -O0: bl __atomic_compare_exchange
6287 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
6288 ; -O1: ldp x0, x1, [x0]
6290 ; -O1: csel x8, x1, x19, lt
6291 ; -O1: csel x9, x0, x21, lt
6292 ; -O1: bl __atomic_compare_exchange
6293 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
6297 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6298 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
6299 ; -O0: subs x8, x8, x10
6300 ; -O0: subs x8, x8, x9
6301 ; -O0: subs x12, x12, x10
6302 ; -O0: csel w11, w8, w11, eq
6303 ; -O0: ands w12, w11, #0x1
6304 ; -O0: csel x9, x8, x9, ne
6305 ; -O0: ands w11, w11, #0x1
6306 ; -O0: csel x8, x8, x10, ne
6307 ; -O0: bl __atomic_compare_exchange
6309 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
6310 ; -O1: ldp x0, x1, [x0]
6312 ; -O1: csel x8, x1, x19, lt
6313 ; -O1: csel x9, x0, x21, lt
6314 ; -O1: bl __atomic_compare_exchange
6315 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
6319 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6320 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
6321 ; -O0: subs x8, x8, x10
6322 ; -O0: subs x8, x8, x9
6323 ; -O0: subs x12, x12, x10
6324 ; -O0: csel w11, w8, w11, eq
6325 ; -O0: ands w12, w11, #0x1
6326 ; -O0: csel x9, x8, x9, ne
6327 ; -O0: ands w11, w11, #0x1
6328 ; -O0: csel x8, x8, x10, ne
6329 ; -O0: bl __atomic_compare_exchange
6331 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
6332 ; -O1: ldp x0, x1, [x0]
6334 ; -O1: csel x8, x1, x19, lt
6335 ; -O1: csel x9, x0, x21, lt
6336 ; -O1: bl __atomic_compare_exchange
6337 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
6341 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
6342 ; -O0-LABEL: atomicrmw_min_i8_aligned_monotonic:
6344 ; -O0: subs w9, w9, w8, sxtb
6345 ; -O0: csel w12, w10, w8, le
6346 ; -O0: ldaxrb w9, [x11]
6347 ; -O0: cmp w9, w10, uxtb
6348 ; -O0: stlxrb w8, w12, [x11]
6349 ; -O0: and w8, w9, #0xff
6350 ; -O0: subs w8, w8, w10, uxtb
6352 ; -O1-LABEL: atomicrmw_min_i8_aligned_monotonic:
6353 ; -O1: ldxrb w9, [x0]
6355 ; -O1: cmp w8, w1, sxtb
6356 ; -O1: csel w9, w9, w1, le
6357 ; -O1: stxrb w10, w9, [x0]
6358 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
6362 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
6363 ; -O0-LABEL: atomicrmw_min_i8_aligned_acquire:
6365 ; -O0: subs w9, w9, w8, sxtb
6366 ; -O0: csel w12, w10, w8, le
6367 ; -O0: ldaxrb w9, [x11]
6368 ; -O0: cmp w9, w10, uxtb
6369 ; -O0: stlxrb w8, w12, [x11]
6370 ; -O0: and w8, w9, #0xff
6371 ; -O0: subs w8, w8, w10, uxtb
6373 ; -O1-LABEL: atomicrmw_min_i8_aligned_acquire:
6374 ; -O1: ldaxrb w9, [x0]
6376 ; -O1: cmp w8, w1, sxtb
6377 ; -O1: csel w9, w9, w1, le
6378 ; -O1: stxrb w10, w9, [x0]
6379 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
6383 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
6384 ; -O0-LABEL: atomicrmw_min_i8_aligned_release:
6386 ; -O0: subs w9, w9, w8, sxtb
6387 ; -O0: csel w12, w10, w8, le
6388 ; -O0: ldaxrb w9, [x11]
6389 ; -O0: cmp w9, w10, uxtb
6390 ; -O0: stlxrb w8, w12, [x11]
6391 ; -O0: and w8, w9, #0xff
6392 ; -O0: subs w8, w8, w10, uxtb
6394 ; -O1-LABEL: atomicrmw_min_i8_aligned_release:
6395 ; -O1: ldxrb w9, [x0]
6397 ; -O1: cmp w8, w1, sxtb
6398 ; -O1: csel w9, w9, w1, le
6399 ; -O1: stlxrb w10, w9, [x0]
6400 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
6404 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
6405 ; -O0-LABEL: atomicrmw_min_i8_aligned_acq_rel:
6407 ; -O0: subs w9, w9, w8, sxtb
6408 ; -O0: csel w12, w10, w8, le
6409 ; -O0: ldaxrb w9, [x11]
6410 ; -O0: cmp w9, w10, uxtb
6411 ; -O0: stlxrb w8, w12, [x11]
6412 ; -O0: and w8, w9, #0xff
6413 ; -O0: subs w8, w8, w10, uxtb
6415 ; -O1-LABEL: atomicrmw_min_i8_aligned_acq_rel:
6416 ; -O1: ldaxrb w9, [x0]
6418 ; -O1: cmp w8, w1, sxtb
6419 ; -O1: csel w9, w9, w1, le
6420 ; -O1: stlxrb w10, w9, [x0]
6421 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
6425 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
6426 ; -O0-LABEL: atomicrmw_min_i8_aligned_seq_cst:
6428 ; -O0: subs w9, w9, w8, sxtb
6429 ; -O0: csel w12, w10, w8, le
6430 ; -O0: ldaxrb w9, [x11]
6431 ; -O0: cmp w9, w10, uxtb
6432 ; -O0: stlxrb w8, w12, [x11]
6433 ; -O0: and w8, w9, #0xff
6434 ; -O0: subs w8, w8, w10, uxtb
6436 ; -O1-LABEL: atomicrmw_min_i8_aligned_seq_cst:
6437 ; -O1: ldaxrb w9, [x0]
6439 ; -O1: cmp w8, w1, sxtb
6440 ; -O1: csel w9, w9, w1, le
6441 ; -O1: stlxrb w10, w9, [x0]
6442 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
6446 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
6447 ; -O0-LABEL: atomicrmw_min_i16_aligned_monotonic:
6449 ; -O0: subs w10, w10, w9, sxth
6450 ; -O0: csel w12, w8, w9, le
6451 ; -O0: ldaxrh w9, [x11]
6452 ; -O0: cmp w9, w8, uxth
6453 ; -O0: stlxrh w10, w12, [x11]
6454 ; -O0: subs w8, w8, w9, uxth
6456 ; -O1-LABEL: atomicrmw_min_i16_aligned_monotonic:
6457 ; -O1: ldxrh w9, [x0]
6459 ; -O1: cmp w8, w1, sxth
6460 ; -O1: csel w9, w9, w1, le
6461 ; -O1: stxrh w10, w9, [x0]
6462 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
6466 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
6467 ; -O0-LABEL: atomicrmw_min_i16_aligned_acquire:
6469 ; -O0: subs w10, w10, w9, sxth
6470 ; -O0: csel w12, w8, w9, le
6471 ; -O0: ldaxrh w9, [x11]
6472 ; -O0: cmp w9, w8, uxth
6473 ; -O0: stlxrh w10, w12, [x11]
6474 ; -O0: subs w8, w8, w9, uxth
6476 ; -O1-LABEL: atomicrmw_min_i16_aligned_acquire:
6477 ; -O1: ldaxrh w9, [x0]
6479 ; -O1: cmp w8, w1, sxth
6480 ; -O1: csel w9, w9, w1, le
6481 ; -O1: stxrh w10, w9, [x0]
6482 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
6486 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
6487 ; -O0-LABEL: atomicrmw_min_i16_aligned_release:
6489 ; -O0: subs w10, w10, w9, sxth
6490 ; -O0: csel w12, w8, w9, le
6491 ; -O0: ldaxrh w9, [x11]
6492 ; -O0: cmp w9, w8, uxth
6493 ; -O0: stlxrh w10, w12, [x11]
6494 ; -O0: subs w8, w8, w9, uxth
6496 ; -O1-LABEL: atomicrmw_min_i16_aligned_release:
6497 ; -O1: ldxrh w9, [x0]
6499 ; -O1: cmp w8, w1, sxth
6500 ; -O1: csel w9, w9, w1, le
6501 ; -O1: stlxrh w10, w9, [x0]
6502 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
6506 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6507 ; -O0-LABEL: atomicrmw_min_i16_aligned_acq_rel:
6509 ; -O0: subs w10, w10, w9, sxth
6510 ; -O0: csel w12, w8, w9, le
6511 ; -O0: ldaxrh w9, [x11]
6512 ; -O0: cmp w9, w8, uxth
6513 ; -O0: stlxrh w10, w12, [x11]
6514 ; -O0: subs w8, w8, w9, uxth
6516 ; -O1-LABEL: atomicrmw_min_i16_aligned_acq_rel:
6517 ; -O1: ldaxrh w9, [x0]
6519 ; -O1: cmp w8, w1, sxth
6520 ; -O1: csel w9, w9, w1, le
6521 ; -O1: stlxrh w10, w9, [x0]
6522 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
6526 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6527 ; -O0-LABEL: atomicrmw_min_i16_aligned_seq_cst:
6529 ; -O0: subs w10, w10, w9, sxth
6530 ; -O0: csel w12, w8, w9, le
6531 ; -O0: ldaxrh w9, [x11]
6532 ; -O0: cmp w9, w8, uxth
6533 ; -O0: stlxrh w10, w12, [x11]
6534 ; -O0: subs w8, w8, w9, uxth
6536 ; -O1-LABEL: atomicrmw_min_i16_aligned_seq_cst:
6537 ; -O1: ldaxrh w9, [x0]
6539 ; -O1: cmp w8, w1, sxth
6540 ; -O1: csel w9, w9, w1, le
6541 ; -O1: stlxrh w10, w9, [x0]
6542 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
6546 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6547 ; -O0-LABEL: atomicrmw_min_i32_aligned_monotonic:
6548 ; -O0: subs w10, w8, w9
6549 ; -O0: csel w12, w8, w9, le
6550 ; -O0: ldaxr w9, [x11]
6552 ; -O0: stlxr w10, w12, [x11]
6553 ; -O0: subs w8, w9, w8
6555 ; -O1-LABEL: atomicrmw_min_i32_aligned_monotonic:
6556 ; -O1: ldxr w8, [x0]
6558 ; -O1: csel w9, w8, w1, le
6559 ; -O1: stxr w10, w9, [x0]
6560 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
6564 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
6565 ; -O0-LABEL: atomicrmw_min_i32_aligned_acquire:
6566 ; -O0: subs w10, w8, w9
6567 ; -O0: csel w12, w8, w9, le
6568 ; -O0: ldaxr w9, [x11]
6570 ; -O0: stlxr w10, w12, [x11]
6571 ; -O0: subs w8, w9, w8
6573 ; -O1-LABEL: atomicrmw_min_i32_aligned_acquire:
6574 ; -O1: ldaxr w8, [x0]
6576 ; -O1: csel w9, w8, w1, le
6577 ; -O1: stxr w10, w9, [x0]
6578 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
6582 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
6583 ; -O0-LABEL: atomicrmw_min_i32_aligned_release:
6584 ; -O0: subs w10, w8, w9
6585 ; -O0: csel w12, w8, w9, le
6586 ; -O0: ldaxr w9, [x11]
6588 ; -O0: stlxr w10, w12, [x11]
6589 ; -O0: subs w8, w9, w8
6591 ; -O1-LABEL: atomicrmw_min_i32_aligned_release:
6592 ; -O1: ldxr w8, [x0]
6594 ; -O1: csel w9, w8, w1, le
6595 ; -O1: stlxr w10, w9, [x0]
6596 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
6600 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6601 ; -O0-LABEL: atomicrmw_min_i32_aligned_acq_rel:
6602 ; -O0: subs w10, w8, w9
6603 ; -O0: csel w12, w8, w9, le
6604 ; -O0: ldaxr w9, [x11]
6606 ; -O0: stlxr w10, w12, [x11]
6607 ; -O0: subs w8, w9, w8
6609 ; -O1-LABEL: atomicrmw_min_i32_aligned_acq_rel:
6610 ; -O1: ldaxr w8, [x0]
6612 ; -O1: csel w9, w8, w1, le
6613 ; -O1: stlxr w10, w9, [x0]
6614 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
6618 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6619 ; -O0-LABEL: atomicrmw_min_i32_aligned_seq_cst:
6620 ; -O0: subs w10, w8, w9
6621 ; -O0: csel w12, w8, w9, le
6622 ; -O0: ldaxr w9, [x11]
6624 ; -O0: stlxr w10, w12, [x11]
6625 ; -O0: subs w8, w9, w8
6627 ; -O1-LABEL: atomicrmw_min_i32_aligned_seq_cst:
6628 ; -O1: ldaxr w8, [x0]
6630 ; -O1: csel w9, w8, w1, le
6631 ; -O1: stlxr w10, w9, [x0]
6632 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
6636 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6637 ; -O0-LABEL: atomicrmw_min_i64_aligned_monotonic:
6638 ; -O0: subs x10, x8, x9
6639 ; -O0: csel x12, x8, x9, le
6640 ; -O0: ldaxr x9, [x11]
6642 ; -O0: stlxr w10, x12, [x11]
6643 ; -O0: subs x8, x9, x8
6645 ; -O1-LABEL: atomicrmw_min_i64_aligned_monotonic:
6646 ; -O1: ldxr x0, [x8]
6648 ; -O1: csel x9, x0, x1, le
6649 ; -O1: stxr w10, x9, [x8]
6650 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
6654 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
6655 ; -O0-LABEL: atomicrmw_min_i64_aligned_acquire:
6656 ; -O0: subs x10, x8, x9
6657 ; -O0: csel x12, x8, x9, le
6658 ; -O0: ldaxr x9, [x11]
6660 ; -O0: stlxr w10, x12, [x11]
6661 ; -O0: subs x8, x9, x8
6663 ; -O1-LABEL: atomicrmw_min_i64_aligned_acquire:
6664 ; -O1: ldaxr x0, [x8]
6666 ; -O1: csel x9, x0, x1, le
6667 ; -O1: stxr w10, x9, [x8]
6668 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
6672 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
6673 ; -O0-LABEL: atomicrmw_min_i64_aligned_release:
6674 ; -O0: subs x10, x8, x9
6675 ; -O0: csel x12, x8, x9, le
6676 ; -O0: ldaxr x9, [x11]
6678 ; -O0: stlxr w10, x12, [x11]
6679 ; -O0: subs x8, x9, x8
6681 ; -O1-LABEL: atomicrmw_min_i64_aligned_release:
6682 ; -O1: ldxr x0, [x8]
6684 ; -O1: csel x9, x0, x1, le
6685 ; -O1: stlxr w10, x9, [x8]
6686 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
6690 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6691 ; -O0-LABEL: atomicrmw_min_i64_aligned_acq_rel:
6692 ; -O0: subs x10, x8, x9
6693 ; -O0: csel x12, x8, x9, le
6694 ; -O0: ldaxr x9, [x11]
6696 ; -O0: stlxr w10, x12, [x11]
6697 ; -O0: subs x8, x9, x8
6699 ; -O1-LABEL: atomicrmw_min_i64_aligned_acq_rel:
6700 ; -O1: ldaxr x0, [x8]
6702 ; -O1: csel x9, x0, x1, le
6703 ; -O1: stlxr w10, x9, [x8]
6704 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
6708 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6709 ; -O0-LABEL: atomicrmw_min_i64_aligned_seq_cst:
6710 ; -O0: subs x10, x8, x9
6711 ; -O0: csel x12, x8, x9, le
6712 ; -O0: ldaxr x9, [x11]
6714 ; -O0: stlxr w10, x12, [x11]
6715 ; -O0: subs x8, x9, x8
6717 ; -O1-LABEL: atomicrmw_min_i64_aligned_seq_cst:
6718 ; -O1: ldaxr x0, [x8]
6720 ; -O1: csel x9, x0, x1, le
6721 ; -O1: stlxr w10, x9, [x8]
6722 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
6726 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6727 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
6728 ; -O0: subs x8, x8, x9
6729 ; -O0: subs x8, x8, x12
6730 ; -O0: subs x13, x13, x9
6731 ; -O0: csel w10, w8, w10, eq
6732 ; -O0: ands w13, w10, #0x1
6733 ; -O0: csel x14, x8, x12, ne
6734 ; -O0: ands w10, w10, #0x1
6735 ; -O0: csel x15, x8, x9, ne
6736 ; -O0: ldxp x10, x9, [x11]
6739 ; -O0: stxp w8, x14, x15, [x11]
6740 ; -O0: stxp w8, x10, x9, [x11]
6741 ; -O0: eor x8, x10, x8
6742 ; -O0: eor x11, x9, x11
6743 ; -O0: orr x8, x8, x11
6744 ; -O0: subs x8, x8, #0
6746 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
6747 ; -O1: ldxp x0, x1, [x8]
6749 ; -O1: csel x9, x1, x3, ge
6750 ; -O1: csel x10, x0, x2, ge
6751 ; -O1: stxp w11, x10, x9, [x8]
6752 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
6756 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
6757 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
6758 ; -O0: subs x8, x8, x9
6759 ; -O0: subs x8, x8, x12
6760 ; -O0: subs x13, x13, x9
6761 ; -O0: csel w10, w8, w10, eq
6762 ; -O0: ands w13, w10, #0x1
6763 ; -O0: csel x14, x8, x12, ne
6764 ; -O0: ands w10, w10, #0x1
6765 ; -O0: csel x15, x8, x9, ne
6766 ; -O0: ldaxp x10, x9, [x11]
6769 ; -O0: stxp w8, x14, x15, [x11]
6770 ; -O0: stxp w8, x10, x9, [x11]
6771 ; -O0: eor x8, x10, x8
6772 ; -O0: eor x11, x9, x11
6773 ; -O0: orr x8, x8, x11
6774 ; -O0: subs x8, x8, #0
6776 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
6777 ; -O1: ldaxp x0, x1, [x8]
6779 ; -O1: csel x9, x1, x3, ge
6780 ; -O1: csel x10, x0, x2, ge
6781 ; -O1: stxp w11, x10, x9, [x8]
6782 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
6786 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
6787 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
6788 ; -O0: subs x8, x8, x9
6789 ; -O0: subs x8, x8, x12
6790 ; -O0: subs x13, x13, x9
6791 ; -O0: csel w10, w8, w10, eq
6792 ; -O0: ands w13, w10, #0x1
6793 ; -O0: csel x14, x8, x12, ne
6794 ; -O0: ands w10, w10, #0x1
6795 ; -O0: csel x15, x8, x9, ne
6796 ; -O0: ldxp x10, x9, [x11]
6799 ; -O0: stlxp w8, x14, x15, [x11]
6800 ; -O0: stlxp w8, x10, x9, [x11]
6801 ; -O0: eor x8, x10, x8
6802 ; -O0: eor x11, x9, x11
6803 ; -O0: orr x8, x8, x11
6804 ; -O0: subs x8, x8, #0
6806 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
6807 ; -O1: ldxp x0, x1, [x8]
6809 ; -O1: csel x9, x1, x3, ge
6810 ; -O1: csel x10, x0, x2, ge
6811 ; -O1: stlxp w11, x10, x9, [x8]
6812 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
6816 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6817 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
6818 ; -O0: subs x8, x8, x9
6819 ; -O0: subs x8, x8, x12
6820 ; -O0: subs x13, x13, x9
6821 ; -O0: csel w10, w8, w10, eq
6822 ; -O0: ands w13, w10, #0x1
6823 ; -O0: csel x14, x8, x12, ne
6824 ; -O0: ands w10, w10, #0x1
6825 ; -O0: csel x15, x8, x9, ne
6826 ; -O0: ldaxp x10, x9, [x11]
6829 ; -O0: stlxp w8, x14, x15, [x11]
6830 ; -O0: stlxp w8, x10, x9, [x11]
6831 ; -O0: eor x8, x10, x8
6832 ; -O0: eor x11, x9, x11
6833 ; -O0: orr x8, x8, x11
6834 ; -O0: subs x8, x8, #0
6836 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
6837 ; -O1: ldaxp x0, x1, [x8]
6839 ; -O1: csel x9, x1, x3, ge
6840 ; -O1: csel x10, x0, x2, ge
6841 ; -O1: stlxp w11, x10, x9, [x8]
6842 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
6846 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6847 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
6848 ; -O0: subs x8, x8, x9
6849 ; -O0: subs x8, x8, x12
6850 ; -O0: subs x13, x13, x9
6851 ; -O0: csel w10, w8, w10, eq
6852 ; -O0: ands w13, w10, #0x1
6853 ; -O0: csel x14, x8, x12, ne
6854 ; -O0: ands w10, w10, #0x1
6855 ; -O0: csel x15, x8, x9, ne
6856 ; -O0: ldaxp x10, x9, [x11]
6859 ; -O0: stlxp w8, x14, x15, [x11]
6860 ; -O0: stlxp w8, x10, x9, [x11]
6861 ; -O0: eor x8, x10, x8
6862 ; -O0: eor x11, x9, x11
6863 ; -O0: orr x8, x8, x11
6864 ; -O0: subs x8, x8, #0
6866 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
6867 ; -O1: ldaxp x0, x1, [x8]
6869 ; -O1: csel x9, x1, x3, ge
6870 ; -O1: csel x10, x0, x2, ge
6871 ; -O1: stlxp w11, x10, x9, [x8]
6872 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
6876 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6877 ; -O0-LABEL: atomicrmw_min_i8_unaligned_monotonic:
6879 ; -O0: subs w9, w9, w8, sxtb
6880 ; -O0: csel w12, w10, w8, le
6881 ; -O0: ldaxrb w9, [x11]
6882 ; -O0: cmp w9, w10, uxtb
6883 ; -O0: stlxrb w8, w12, [x11]
6884 ; -O0: and w8, w9, #0xff
6885 ; -O0: subs w8, w8, w10, uxtb
6887 ; -O1-LABEL: atomicrmw_min_i8_unaligned_monotonic:
6888 ; -O1: ldxrb w9, [x0]
6890 ; -O1: cmp w8, w1, sxtb
6891 ; -O1: csel w9, w9, w1, le
6892 ; -O1: stxrb w10, w9, [x0]
6893 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
6897 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6898 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acquire:
6900 ; -O0: subs w9, w9, w8, sxtb
6901 ; -O0: csel w12, w10, w8, le
6902 ; -O0: ldaxrb w9, [x11]
6903 ; -O0: cmp w9, w10, uxtb
6904 ; -O0: stlxrb w8, w12, [x11]
6905 ; -O0: and w8, w9, #0xff
6906 ; -O0: subs w8, w8, w10, uxtb
6908 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acquire:
6909 ; -O1: ldaxrb w9, [x0]
6911 ; -O1: cmp w8, w1, sxtb
6912 ; -O1: csel w9, w9, w1, le
6913 ; -O1: stxrb w10, w9, [x0]
6914 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
6918 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
6919 ; -O0-LABEL: atomicrmw_min_i8_unaligned_release:
6921 ; -O0: subs w9, w9, w8, sxtb
6922 ; -O0: csel w12, w10, w8, le
6923 ; -O0: ldaxrb w9, [x11]
6924 ; -O0: cmp w9, w10, uxtb
6925 ; -O0: stlxrb w8, w12, [x11]
6926 ; -O0: and w8, w9, #0xff
6927 ; -O0: subs w8, w8, w10, uxtb
6929 ; -O1-LABEL: atomicrmw_min_i8_unaligned_release:
6930 ; -O1: ldxrb w9, [x0]
6932 ; -O1: cmp w8, w1, sxtb
6933 ; -O1: csel w9, w9, w1, le
6934 ; -O1: stlxrb w10, w9, [x0]
6935 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
6939 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6940 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
6942 ; -O0: subs w9, w9, w8, sxtb
6943 ; -O0: csel w12, w10, w8, le
6944 ; -O0: ldaxrb w9, [x11]
6945 ; -O0: cmp w9, w10, uxtb
6946 ; -O0: stlxrb w8, w12, [x11]
6947 ; -O0: and w8, w9, #0xff
6948 ; -O0: subs w8, w8, w10, uxtb
6950 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
6951 ; -O1: ldaxrb w9, [x0]
6953 ; -O1: cmp w8, w1, sxtb
6954 ; -O1: csel w9, w9, w1, le
6955 ; -O1: stlxrb w10, w9, [x0]
6956 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
6960 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6961 ; -O0-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
6963 ; -O0: subs w9, w9, w8, sxtb
6964 ; -O0: csel w12, w10, w8, le
6965 ; -O0: ldaxrb w9, [x11]
6966 ; -O0: cmp w9, w10, uxtb
6967 ; -O0: stlxrb w8, w12, [x11]
6968 ; -O0: and w8, w9, #0xff
6969 ; -O0: subs w8, w8, w10, uxtb
6971 ; -O1-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
6972 ; -O1: ldaxrb w9, [x0]
6974 ; -O1: cmp w8, w1, sxtb
6975 ; -O1: csel w9, w9, w1, le
6976 ; -O1: stlxrb w10, w9, [x0]
6977 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
6981 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6982 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
6984 ; -O0: subs w10, w10, w8, sxth
6985 ; -O0: csel w8, w9, w8, le
6986 ; -O0: bl __atomic_compare_exchange
6988 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
6990 ; -O1: cmp w8, w20, sxth
6991 ; -O1: csel w8, w0, w20, le
6992 ; -O1: bl __atomic_compare_exchange
6993 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
6997 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6998 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
7000 ; -O0: subs w10, w10, w8, sxth
7001 ; -O0: csel w8, w9, w8, le
7002 ; -O0: bl __atomic_compare_exchange
7004 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
7006 ; -O1: cmp w8, w20, sxth
7007 ; -O1: csel w8, w0, w20, le
7008 ; -O1: bl __atomic_compare_exchange
7009 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
7013 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
7014 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
7016 ; -O0: subs w10, w10, w8, sxth
7017 ; -O0: csel w8, w9, w8, le
7018 ; -O0: bl __atomic_compare_exchange
7020 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
7022 ; -O1: cmp w8, w20, sxth
7023 ; -O1: csel w8, w0, w20, le
7024 ; -O1: bl __atomic_compare_exchange
7025 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
7029 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
7030 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
7032 ; -O0: subs w10, w10, w8, sxth
7033 ; -O0: csel w8, w9, w8, le
7034 ; -O0: bl __atomic_compare_exchange
7036 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
7038 ; -O1: cmp w8, w20, sxth
7039 ; -O1: csel w8, w0, w20, le
7040 ; -O1: bl __atomic_compare_exchange
7041 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
7045 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
7046 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
7048 ; -O0: subs w10, w10, w8, sxth
7049 ; -O0: csel w8, w9, w8, le
7050 ; -O0: bl __atomic_compare_exchange
7052 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
7054 ; -O1: cmp w8, w20, sxth
7055 ; -O1: csel w8, w0, w20, le
7056 ; -O1: bl __atomic_compare_exchange
7057 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
7061 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
7062 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
7063 ; -O0: subs w10, w9, w8
7064 ; -O0: csel w8, w9, w8, le
7065 ; -O0: bl __atomic_compare_exchange
7067 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
7069 ; -O1: csel w8, w0, w20, le
7070 ; -O1: bl __atomic_compare_exchange
7071 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
7075 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
7076 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
7077 ; -O0: subs w10, w9, w8
7078 ; -O0: csel w8, w9, w8, le
7079 ; -O0: bl __atomic_compare_exchange
7081 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
7083 ; -O1: csel w8, w0, w20, le
7084 ; -O1: bl __atomic_compare_exchange
7085 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
7089 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
7090 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
7091 ; -O0: subs w10, w9, w8
7092 ; -O0: csel w8, w9, w8, le
7093 ; -O0: bl __atomic_compare_exchange
7095 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
7097 ; -O1: csel w8, w0, w20, le
7098 ; -O1: bl __atomic_compare_exchange
7099 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
7103 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
7104 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
7105 ; -O0: subs w10, w9, w8
7106 ; -O0: csel w8, w9, w8, le
7107 ; -O0: bl __atomic_compare_exchange
7109 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
7111 ; -O1: csel w8, w0, w20, le
7112 ; -O1: bl __atomic_compare_exchange
7113 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
7117 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
7118 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
7119 ; -O0: subs w10, w9, w8
7120 ; -O0: csel w8, w9, w8, le
7121 ; -O0: bl __atomic_compare_exchange
7123 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
7125 ; -O1: csel w8, w0, w20, le
7126 ; -O1: bl __atomic_compare_exchange
7127 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
7131 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
7132 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
7133 ; -O0: subs x10, x9, x8
7134 ; -O0: csel x8, x9, x8, le
7135 ; -O0: bl __atomic_compare_exchange
7137 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
7139 ; -O1: csel x8, x0, x20, le
7140 ; -O1: bl __atomic_compare_exchange
7141 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
7145 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
7146 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
7147 ; -O0: subs x10, x9, x8
7148 ; -O0: csel x8, x9, x8, le
7149 ; -O0: bl __atomic_compare_exchange
7151 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
7153 ; -O1: csel x8, x0, x20, le
7154 ; -O1: bl __atomic_compare_exchange
7155 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
7159 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
7160 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
7161 ; -O0: subs x10, x9, x8
7162 ; -O0: csel x8, x9, x8, le
7163 ; -O0: bl __atomic_compare_exchange
7165 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
7167 ; -O1: csel x8, x0, x20, le
7168 ; -O1: bl __atomic_compare_exchange
7169 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
7173 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
7174 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
7175 ; -O0: subs x10, x9, x8
7176 ; -O0: csel x8, x9, x8, le
7177 ; -O0: bl __atomic_compare_exchange
7179 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
7181 ; -O1: csel x8, x0, x20, le
7182 ; -O1: bl __atomic_compare_exchange
7183 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
7187 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
7188 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
7189 ; -O0: subs x10, x9, x8
7190 ; -O0: csel x8, x9, x8, le
7191 ; -O0: bl __atomic_compare_exchange
7193 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
7195 ; -O1: csel x8, x0, x20, le
7196 ; -O1: bl __atomic_compare_exchange
7197 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
7201 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
7202 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
7203 ; -O0: subs x8, x8, x10
7204 ; -O0: subs x8, x8, x9
7205 ; -O0: subs x12, x12, x10
7206 ; -O0: csel w11, w8, w11, eq
7207 ; -O0: ands w12, w11, #0x1
7208 ; -O0: csel x9, x8, x9, ne
7209 ; -O0: ands w11, w11, #0x1
7210 ; -O0: csel x8, x8, x10, ne
7211 ; -O0: bl __atomic_compare_exchange
7213 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
7214 ; -O1: ldp x0, x1, [x0]
7216 ; -O1: csel x8, x1, x19, ge
7217 ; -O1: csel x9, x0, x21, ge
7218 ; -O1: bl __atomic_compare_exchange
7219 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
7223 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
7224 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
7225 ; -O0: subs x8, x8, x10
7226 ; -O0: subs x8, x8, x9
7227 ; -O0: subs x12, x12, x10
7228 ; -O0: csel w11, w8, w11, eq
7229 ; -O0: ands w12, w11, #0x1
7230 ; -O0: csel x9, x8, x9, ne
7231 ; -O0: ands w11, w11, #0x1
7232 ; -O0: csel x8, x8, x10, ne
7233 ; -O0: bl __atomic_compare_exchange
7235 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
7236 ; -O1: ldp x0, x1, [x0]
7238 ; -O1: csel x8, x1, x19, ge
7239 ; -O1: csel x9, x0, x21, ge
7240 ; -O1: bl __atomic_compare_exchange
7241 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
7245 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
7246 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
7247 ; -O0: subs x8, x8, x10
7248 ; -O0: subs x8, x8, x9
7249 ; -O0: subs x12, x12, x10
7250 ; -O0: csel w11, w8, w11, eq
7251 ; -O0: ands w12, w11, #0x1
7252 ; -O0: csel x9, x8, x9, ne
7253 ; -O0: ands w11, w11, #0x1
7254 ; -O0: csel x8, x8, x10, ne
7255 ; -O0: bl __atomic_compare_exchange
7257 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
7258 ; -O1: ldp x0, x1, [x0]
7260 ; -O1: csel x8, x1, x19, ge
7261 ; -O1: csel x9, x0, x21, ge
7262 ; -O1: bl __atomic_compare_exchange
7263 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
7267 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
7268 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
7269 ; -O0: subs x8, x8, x10
7270 ; -O0: subs x8, x8, x9
7271 ; -O0: subs x12, x12, x10
7272 ; -O0: csel w11, w8, w11, eq
7273 ; -O0: ands w12, w11, #0x1
7274 ; -O0: csel x9, x8, x9, ne
7275 ; -O0: ands w11, w11, #0x1
7276 ; -O0: csel x8, x8, x10, ne
7277 ; -O0: bl __atomic_compare_exchange
7279 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
7280 ; -O1: ldp x0, x1, [x0]
7282 ; -O1: csel x8, x1, x19, ge
7283 ; -O1: csel x9, x0, x21, ge
7284 ; -O1: bl __atomic_compare_exchange
7285 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
7289 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
7290 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
7291 ; -O0: subs x8, x8, x10
7292 ; -O0: subs x8, x8, x9
7293 ; -O0: subs x12, x12, x10
7294 ; -O0: csel w11, w8, w11, eq
7295 ; -O0: ands w12, w11, #0x1
7296 ; -O0: csel x9, x8, x9, ne
7297 ; -O0: ands w11, w11, #0x1
7298 ; -O0: csel x8, x8, x10, ne
7299 ; -O0: bl __atomic_compare_exchange
7301 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
7302 ; -O1: ldp x0, x1, [x0]
7304 ; -O1: csel x8, x1, x19, ge
7305 ; -O1: csel x9, x0, x21, ge
7306 ; -O1: bl __atomic_compare_exchange
7307 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
7311 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
7312 ; -O0-LABEL: atomicrmw_umax_i8_aligned_monotonic:
7313 ; -O0: and w9, w10, #0xff
7314 ; -O0: subs w9, w9, w8, uxtb
7315 ; -O0: csel w12, w10, w8, hi
7316 ; -O0: ldaxrb w9, [x11]
7317 ; -O0: cmp w9, w10, uxtb
7318 ; -O0: stlxrb w8, w12, [x11]
7319 ; -O0: and w8, w9, #0xff
7320 ; -O0: subs w8, w8, w10, uxtb
7322 ; -O1-LABEL: atomicrmw_umax_i8_aligned_monotonic:
7323 ; -O1: and w9, w1, #0xff
7324 ; -O1: ldxrb w8, [x0]
7326 ; -O1: csel w10, w8, w9, hi
7327 ; -O1: stxrb w11, w10, [x0]
7328 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
7332 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
7333 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acquire:
7334 ; -O0: and w9, w10, #0xff
7335 ; -O0: subs w9, w9, w8, uxtb
7336 ; -O0: csel w12, w10, w8, hi
7337 ; -O0: ldaxrb w9, [x11]
7338 ; -O0: cmp w9, w10, uxtb
7339 ; -O0: stlxrb w8, w12, [x11]
7340 ; -O0: and w8, w9, #0xff
7341 ; -O0: subs w8, w8, w10, uxtb
7343 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acquire:
7344 ; -O1: and w9, w1, #0xff
7345 ; -O1: ldaxrb w8, [x0]
7347 ; -O1: csel w10, w8, w9, hi
7348 ; -O1: stxrb w11, w10, [x0]
7349 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
7353 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
7354 ; -O0-LABEL: atomicrmw_umax_i8_aligned_release:
7355 ; -O0: and w9, w10, #0xff
7356 ; -O0: subs w9, w9, w8, uxtb
7357 ; -O0: csel w12, w10, w8, hi
7358 ; -O0: ldaxrb w9, [x11]
7359 ; -O0: cmp w9, w10, uxtb
7360 ; -O0: stlxrb w8, w12, [x11]
7361 ; -O0: and w8, w9, #0xff
7362 ; -O0: subs w8, w8, w10, uxtb
7364 ; -O1-LABEL: atomicrmw_umax_i8_aligned_release:
7365 ; -O1: and w9, w1, #0xff
7366 ; -O1: ldxrb w8, [x0]
7368 ; -O1: csel w10, w8, w9, hi
7369 ; -O1: stlxrb w11, w10, [x0]
7370 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
7374 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
7375 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
7376 ; -O0: and w9, w10, #0xff
7377 ; -O0: subs w9, w9, w8, uxtb
7378 ; -O0: csel w12, w10, w8, hi
7379 ; -O0: ldaxrb w9, [x11]
7380 ; -O0: cmp w9, w10, uxtb
7381 ; -O0: stlxrb w8, w12, [x11]
7382 ; -O0: and w8, w9, #0xff
7383 ; -O0: subs w8, w8, w10, uxtb
7385 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
7386 ; -O1: and w9, w1, #0xff
7387 ; -O1: ldaxrb w8, [x0]
7389 ; -O1: csel w10, w8, w9, hi
7390 ; -O1: stlxrb w11, w10, [x0]
7391 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
7395 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
7396 ; -O0-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
7397 ; -O0: and w9, w10, #0xff
7398 ; -O0: subs w9, w9, w8, uxtb
7399 ; -O0: csel w12, w10, w8, hi
7400 ; -O0: ldaxrb w9, [x11]
7401 ; -O0: cmp w9, w10, uxtb
7402 ; -O0: stlxrb w8, w12, [x11]
7403 ; -O0: and w8, w9, #0xff
7404 ; -O0: subs w8, w8, w10, uxtb
7406 ; -O1-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
7407 ; -O1: and w9, w1, #0xff
7408 ; -O1: ldaxrb w8, [x0]
7410 ; -O1: csel w10, w8, w9, hi
7411 ; -O1: stlxrb w11, w10, [x0]
7412 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
7416 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
7417 ; -O0-LABEL: atomicrmw_umax_i16_aligned_monotonic:
7418 ; -O0: subs w10, w10, w9, uxth
7419 ; -O0: csel w12, w8, w9, hi
7420 ; -O0: ldaxrh w9, [x11]
7421 ; -O0: cmp w9, w8, uxth
7422 ; -O0: stlxrh w10, w12, [x11]
7423 ; -O0: subs w8, w8, w9, uxth
7425 ; -O1-LABEL: atomicrmw_umax_i16_aligned_monotonic:
7426 ; -O1: and w9, w1, #0xffff
7427 ; -O1: ldxrh w8, [x0]
7429 ; -O1: csel w10, w8, w9, hi
7430 ; -O1: stxrh w11, w10, [x0]
7431 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
7435 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
7436 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acquire:
7437 ; -O0: subs w10, w10, w9, uxth
7438 ; -O0: csel w12, w8, w9, hi
7439 ; -O0: ldaxrh w9, [x11]
7440 ; -O0: cmp w9, w8, uxth
7441 ; -O0: stlxrh w10, w12, [x11]
7442 ; -O0: subs w8, w8, w9, uxth
7444 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acquire:
7445 ; -O1: and w9, w1, #0xffff
7446 ; -O1: ldaxrh w8, [x0]
7448 ; -O1: csel w10, w8, w9, hi
7449 ; -O1: stxrh w11, w10, [x0]
7450 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
7454 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
7455 ; -O0-LABEL: atomicrmw_umax_i16_aligned_release:
7456 ; -O0: subs w10, w10, w9, uxth
7457 ; -O0: csel w12, w8, w9, hi
7458 ; -O0: ldaxrh w9, [x11]
7459 ; -O0: cmp w9, w8, uxth
7460 ; -O0: stlxrh w10, w12, [x11]
7461 ; -O0: subs w8, w8, w9, uxth
7463 ; -O1-LABEL: atomicrmw_umax_i16_aligned_release:
7464 ; -O1: and w9, w1, #0xffff
7465 ; -O1: ldxrh w8, [x0]
7467 ; -O1: csel w10, w8, w9, hi
7468 ; -O1: stlxrh w11, w10, [x0]
7469 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
7473 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
7474 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
7475 ; -O0: subs w10, w10, w9, uxth
7476 ; -O0: csel w12, w8, w9, hi
7477 ; -O0: ldaxrh w9, [x11]
7478 ; -O0: cmp w9, w8, uxth
7479 ; -O0: stlxrh w10, w12, [x11]
7480 ; -O0: subs w8, w8, w9, uxth
7482 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
7483 ; -O1: and w9, w1, #0xffff
7484 ; -O1: ldaxrh w8, [x0]
7486 ; -O1: csel w10, w8, w9, hi
7487 ; -O1: stlxrh w11, w10, [x0]
7488 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
7492 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
7493 ; -O0-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
7494 ; -O0: subs w10, w10, w9, uxth
7495 ; -O0: csel w12, w8, w9, hi
7496 ; -O0: ldaxrh w9, [x11]
7497 ; -O0: cmp w9, w8, uxth
7498 ; -O0: stlxrh w10, w12, [x11]
7499 ; -O0: subs w8, w8, w9, uxth
7501 ; -O1-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
7502 ; -O1: and w9, w1, #0xffff
7503 ; -O1: ldaxrh w8, [x0]
7505 ; -O1: csel w10, w8, w9, hi
7506 ; -O1: stlxrh w11, w10, [x0]
7507 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
7511 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
7512 ; -O0-LABEL: atomicrmw_umax_i32_aligned_monotonic:
7513 ; -O0: subs w10, w8, w9
7514 ; -O0: csel w12, w8, w9, hi
7515 ; -O0: ldaxr w9, [x11]
7517 ; -O0: stlxr w10, w12, [x11]
7518 ; -O0: subs w8, w9, w8
7520 ; -O1-LABEL: atomicrmw_umax_i32_aligned_monotonic:
7521 ; -O1: ldxr w8, [x0]
7523 ; -O1: csel w9, w8, w1, hi
7524 ; -O1: stxr w10, w9, [x0]
7525 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
7529 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
7530 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acquire:
7531 ; -O0: subs w10, w8, w9
7532 ; -O0: csel w12, w8, w9, hi
7533 ; -O0: ldaxr w9, [x11]
7535 ; -O0: stlxr w10, w12, [x11]
7536 ; -O0: subs w8, w9, w8
7538 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acquire:
7539 ; -O1: ldaxr w8, [x0]
7541 ; -O1: csel w9, w8, w1, hi
7542 ; -O1: stxr w10, w9, [x0]
7543 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
7547 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
7548 ; -O0-LABEL: atomicrmw_umax_i32_aligned_release:
7549 ; -O0: subs w10, w8, w9
7550 ; -O0: csel w12, w8, w9, hi
7551 ; -O0: ldaxr w9, [x11]
7553 ; -O0: stlxr w10, w12, [x11]
7554 ; -O0: subs w8, w9, w8
7556 ; -O1-LABEL: atomicrmw_umax_i32_aligned_release:
7557 ; -O1: ldxr w8, [x0]
7559 ; -O1: csel w9, w8, w1, hi
7560 ; -O1: stlxr w10, w9, [x0]
7561 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
7565 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
7566 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
7567 ; -O0: subs w10, w8, w9
7568 ; -O0: csel w12, w8, w9, hi
7569 ; -O0: ldaxr w9, [x11]
7571 ; -O0: stlxr w10, w12, [x11]
7572 ; -O0: subs w8, w9, w8
7574 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
7575 ; -O1: ldaxr w8, [x0]
7577 ; -O1: csel w9, w8, w1, hi
7578 ; -O1: stlxr w10, w9, [x0]
7579 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
7583 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
7584 ; -O0-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
7585 ; -O0: subs w10, w8, w9
7586 ; -O0: csel w12, w8, w9, hi
7587 ; -O0: ldaxr w9, [x11]
7589 ; -O0: stlxr w10, w12, [x11]
7590 ; -O0: subs w8, w9, w8
7592 ; -O1-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
7593 ; -O1: ldaxr w8, [x0]
7595 ; -O1: csel w9, w8, w1, hi
7596 ; -O1: stlxr w10, w9, [x0]
7597 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
7601 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
7602 ; -O0-LABEL: atomicrmw_umax_i64_aligned_monotonic:
7603 ; -O0: subs x10, x8, x9
7604 ; -O0: csel x12, x8, x9, hi
7605 ; -O0: ldaxr x9, [x11]
7607 ; -O0: stlxr w10, x12, [x11]
7608 ; -O0: subs x8, x9, x8
7610 ; -O1-LABEL: atomicrmw_umax_i64_aligned_monotonic:
7611 ; -O1: ldxr x0, [x8]
7613 ; -O1: csel x9, x0, x1, hi
7614 ; -O1: stxr w10, x9, [x8]
7615 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
7619 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
7620 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acquire:
7621 ; -O0: subs x10, x8, x9
7622 ; -O0: csel x12, x8, x9, hi
7623 ; -O0: ldaxr x9, [x11]
7625 ; -O0: stlxr w10, x12, [x11]
7626 ; -O0: subs x8, x9, x8
7628 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acquire:
7629 ; -O1: ldaxr x0, [x8]
7631 ; -O1: csel x9, x0, x1, hi
7632 ; -O1: stxr w10, x9, [x8]
7633 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
7637 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
7638 ; -O0-LABEL: atomicrmw_umax_i64_aligned_release:
7639 ; -O0: subs x10, x8, x9
7640 ; -O0: csel x12, x8, x9, hi
7641 ; -O0: ldaxr x9, [x11]
7643 ; -O0: stlxr w10, x12, [x11]
7644 ; -O0: subs x8, x9, x8
7646 ; -O1-LABEL: atomicrmw_umax_i64_aligned_release:
7647 ; -O1: ldxr x0, [x8]
7649 ; -O1: csel x9, x0, x1, hi
7650 ; -O1: stlxr w10, x9, [x8]
7651 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
7655 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
7656 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
7657 ; -O0: subs x10, x8, x9
7658 ; -O0: csel x12, x8, x9, hi
7659 ; -O0: ldaxr x9, [x11]
7661 ; -O0: stlxr w10, x12, [x11]
7662 ; -O0: subs x8, x9, x8
7664 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
7665 ; -O1: ldaxr x0, [x8]
7667 ; -O1: csel x9, x0, x1, hi
7668 ; -O1: stlxr w10, x9, [x8]
7669 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
7673 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
7674 ; -O0-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
7675 ; -O0: subs x10, x8, x9
7676 ; -O0: csel x12, x8, x9, hi
7677 ; -O0: ldaxr x9, [x11]
7679 ; -O0: stlxr w10, x12, [x11]
7680 ; -O0: subs x8, x9, x8
7682 ; -O1-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
7683 ; -O1: ldaxr x0, [x8]
7685 ; -O1: csel x9, x0, x1, hi
7686 ; -O1: stlxr w10, x9, [x8]
7687 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
7691 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
7692 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
7693 ; -O0: subs x8, x8, x9
7694 ; -O0: subs x8, x8, x12
7695 ; -O0: subs x13, x13, x9
7696 ; -O0: csel w10, w8, w10, eq
7697 ; -O0: ands w13, w10, #0x1
7698 ; -O0: csel x14, x8, x12, ne
7699 ; -O0: ands w10, w10, #0x1
7700 ; -O0: csel x15, x8, x9, ne
7701 ; -O0: ldxp x10, x9, [x11]
7704 ; -O0: stxp w8, x14, x15, [x11]
7705 ; -O0: stxp w8, x10, x9, [x11]
7706 ; -O0: eor x8, x10, x8
7707 ; -O0: eor x11, x9, x11
7708 ; -O0: orr x8, x8, x11
7709 ; -O0: subs x8, x8, #0
7711 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
7712 ; -O1: ldxp x0, x1, [x8]
7714 ; -O1: csel x9, x1, x3, lo
7715 ; -O1: csel x10, x0, x2, lo
7716 ; -O1: stxp w11, x10, x9, [x8]
7717 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
7721 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
7722 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
7723 ; -O0: subs x8, x8, x9
7724 ; -O0: subs x8, x8, x12
7725 ; -O0: subs x13, x13, x9
7726 ; -O0: csel w10, w8, w10, eq
7727 ; -O0: ands w13, w10, #0x1
7728 ; -O0: csel x14, x8, x12, ne
7729 ; -O0: ands w10, w10, #0x1
7730 ; -O0: csel x15, x8, x9, ne
7731 ; -O0: ldaxp x10, x9, [x11]
7734 ; -O0: stxp w8, x14, x15, [x11]
7735 ; -O0: stxp w8, x10, x9, [x11]
7736 ; -O0: eor x8, x10, x8
7737 ; -O0: eor x11, x9, x11
7738 ; -O0: orr x8, x8, x11
7739 ; -O0: subs x8, x8, #0
7741 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
7742 ; -O1: ldaxp x0, x1, [x8]
7744 ; -O1: csel x9, x1, x3, lo
7745 ; -O1: csel x10, x0, x2, lo
7746 ; -O1: stxp w11, x10, x9, [x8]
7747 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
7751 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
7752 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
7753 ; -O0: subs x8, x8, x9
7754 ; -O0: subs x8, x8, x12
7755 ; -O0: subs x13, x13, x9
7756 ; -O0: csel w10, w8, w10, eq
7757 ; -O0: ands w13, w10, #0x1
7758 ; -O0: csel x14, x8, x12, ne
7759 ; -O0: ands w10, w10, #0x1
7760 ; -O0: csel x15, x8, x9, ne
7761 ; -O0: ldxp x10, x9, [x11]
7764 ; -O0: stlxp w8, x14, x15, [x11]
7765 ; -O0: stlxp w8, x10, x9, [x11]
7766 ; -O0: eor x8, x10, x8
7767 ; -O0: eor x11, x9, x11
7768 ; -O0: orr x8, x8, x11
7769 ; -O0: subs x8, x8, #0
7771 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
7772 ; -O1: ldxp x0, x1, [x8]
7774 ; -O1: csel x9, x1, x3, lo
7775 ; -O1: csel x10, x0, x2, lo
7776 ; -O1: stlxp w11, x10, x9, [x8]
7777 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
7781 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
7782 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
7783 ; -O0: subs x8, x8, x9
7784 ; -O0: subs x8, x8, x12
7785 ; -O0: subs x13, x13, x9
7786 ; -O0: csel w10, w8, w10, eq
7787 ; -O0: ands w13, w10, #0x1
7788 ; -O0: csel x14, x8, x12, ne
7789 ; -O0: ands w10, w10, #0x1
7790 ; -O0: csel x15, x8, x9, ne
7791 ; -O0: ldaxp x10, x9, [x11]
7794 ; -O0: stlxp w8, x14, x15, [x11]
7795 ; -O0: stlxp w8, x10, x9, [x11]
7796 ; -O0: eor x8, x10, x8
7797 ; -O0: eor x11, x9, x11
7798 ; -O0: orr x8, x8, x11
7799 ; -O0: subs x8, x8, #0
7801 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
7802 ; -O1: ldaxp x0, x1, [x8]
7804 ; -O1: csel x9, x1, x3, lo
7805 ; -O1: csel x10, x0, x2, lo
7806 ; -O1: stlxp w11, x10, x9, [x8]
7807 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
7811 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
7812 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
7813 ; -O0: subs x8, x8, x9
7814 ; -O0: subs x8, x8, x12
7815 ; -O0: subs x13, x13, x9
7816 ; -O0: csel w10, w8, w10, eq
7817 ; -O0: ands w13, w10, #0x1
7818 ; -O0: csel x14, x8, x12, ne
7819 ; -O0: ands w10, w10, #0x1
7820 ; -O0: csel x15, x8, x9, ne
7821 ; -O0: ldaxp x10, x9, [x11]
7824 ; -O0: stlxp w8, x14, x15, [x11]
7825 ; -O0: stlxp w8, x10, x9, [x11]
7826 ; -O0: eor x8, x10, x8
7827 ; -O0: eor x11, x9, x11
7828 ; -O0: orr x8, x8, x11
7829 ; -O0: subs x8, x8, #0
7831 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
7832 ; -O1: ldaxp x0, x1, [x8]
7834 ; -O1: csel x9, x1, x3, lo
7835 ; -O1: csel x10, x0, x2, lo
7836 ; -O1: stlxp w11, x10, x9, [x8]
7837 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
7841 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
7842 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
7843 ; -O0: and w9, w10, #0xff
7844 ; -O0: subs w9, w9, w8, uxtb
7845 ; -O0: csel w12, w10, w8, hi
7846 ; -O0: ldaxrb w9, [x11]
7847 ; -O0: cmp w9, w10, uxtb
7848 ; -O0: stlxrb w8, w12, [x11]
7849 ; -O0: and w8, w9, #0xff
7850 ; -O0: subs w8, w8, w10, uxtb
7852 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
7853 ; -O1: and w9, w1, #0xff
7854 ; -O1: ldxrb w8, [x0]
7856 ; -O1: csel w10, w8, w9, hi
7857 ; -O1: stxrb w11, w10, [x0]
7858 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
7862 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
7863 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acquire:
7864 ; -O0: and w9, w10, #0xff
7865 ; -O0: subs w9, w9, w8, uxtb
7866 ; -O0: csel w12, w10, w8, hi
7867 ; -O0: ldaxrb w9, [x11]
7868 ; -O0: cmp w9, w10, uxtb
7869 ; -O0: stlxrb w8, w12, [x11]
7870 ; -O0: and w8, w9, #0xff
7871 ; -O0: subs w8, w8, w10, uxtb
7873 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acquire:
7874 ; -O1: and w9, w1, #0xff
7875 ; -O1: ldaxrb w8, [x0]
7877 ; -O1: csel w10, w8, w9, hi
7878 ; -O1: stxrb w11, w10, [x0]
7879 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
7883 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
7884 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_release:
7885 ; -O0: and w9, w10, #0xff
7886 ; -O0: subs w9, w9, w8, uxtb
7887 ; -O0: csel w12, w10, w8, hi
7888 ; -O0: ldaxrb w9, [x11]
7889 ; -O0: cmp w9, w10, uxtb
7890 ; -O0: stlxrb w8, w12, [x11]
7891 ; -O0: and w8, w9, #0xff
7892 ; -O0: subs w8, w8, w10, uxtb
7894 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_release:
7895 ; -O1: and w9, w1, #0xff
7896 ; -O1: ldxrb w8, [x0]
7898 ; -O1: csel w10, w8, w9, hi
7899 ; -O1: stlxrb w11, w10, [x0]
7900 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
7904 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
7905 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
7906 ; -O0: and w9, w10, #0xff
7907 ; -O0: subs w9, w9, w8, uxtb
7908 ; -O0: csel w12, w10, w8, hi
7909 ; -O0: ldaxrb w9, [x11]
7910 ; -O0: cmp w9, w10, uxtb
7911 ; -O0: stlxrb w8, w12, [x11]
7912 ; -O0: and w8, w9, #0xff
7913 ; -O0: subs w8, w8, w10, uxtb
7915 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
7916 ; -O1: and w9, w1, #0xff
7917 ; -O1: ldaxrb w8, [x0]
7919 ; -O1: csel w10, w8, w9, hi
7920 ; -O1: stlxrb w11, w10, [x0]
7921 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
7925 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
7926 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
7927 ; -O0: and w9, w10, #0xff
7928 ; -O0: subs w9, w9, w8, uxtb
7929 ; -O0: csel w12, w10, w8, hi
7930 ; -O0: ldaxrb w9, [x11]
7931 ; -O0: cmp w9, w10, uxtb
7932 ; -O0: stlxrb w8, w12, [x11]
7933 ; -O0: and w8, w9, #0xff
7934 ; -O0: subs w8, w8, w10, uxtb
7936 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
7937 ; -O1: and w9, w1, #0xff
7938 ; -O1: ldaxrb w8, [x0]
7940 ; -O1: csel w10, w8, w9, hi
7941 ; -O1: stlxrb w11, w10, [x0]
7942 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
7946 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
7947 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
7948 ; -O0: subs w10, w10, w8, uxth
7949 ; -O0: csel w8, w9, w8, hi
7950 ; -O0: bl __atomic_compare_exchange
7952 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
7953 ; -O1: and w8, w0, #0xffff
7954 ; -O1: cmp w8, w20, uxth
7955 ; -O1: csel w8, w0, w20, hi
7956 ; -O1: bl __atomic_compare_exchange
7957 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
7961 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
7962 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
7963 ; -O0: subs w10, w10, w8, uxth
7964 ; -O0: csel w8, w9, w8, hi
7965 ; -O0: bl __atomic_compare_exchange
7967 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
7968 ; -O1: and w8, w0, #0xffff
7969 ; -O1: cmp w8, w20, uxth
7970 ; -O1: csel w8, w0, w20, hi
7971 ; -O1: bl __atomic_compare_exchange
7972 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
7976 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
7977 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
7978 ; -O0: subs w10, w10, w8, uxth
7979 ; -O0: csel w8, w9, w8, hi
7980 ; -O0: bl __atomic_compare_exchange
7982 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
7983 ; -O1: and w8, w0, #0xffff
7984 ; -O1: cmp w8, w20, uxth
7985 ; -O1: csel w8, w0, w20, hi
7986 ; -O1: bl __atomic_compare_exchange
7987 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
7991 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
7992 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
7993 ; -O0: subs w10, w10, w8, uxth
7994 ; -O0: csel w8, w9, w8, hi
7995 ; -O0: bl __atomic_compare_exchange
7997 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
7998 ; -O1: and w8, w0, #0xffff
7999 ; -O1: cmp w8, w20, uxth
8000 ; -O1: csel w8, w0, w20, hi
8001 ; -O1: bl __atomic_compare_exchange
8002 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
8006 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
8007 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
8008 ; -O0: subs w10, w10, w8, uxth
8009 ; -O0: csel w8, w9, w8, hi
8010 ; -O0: bl __atomic_compare_exchange
8012 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
8013 ; -O1: and w8, w0, #0xffff
8014 ; -O1: cmp w8, w20, uxth
8015 ; -O1: csel w8, w0, w20, hi
8016 ; -O1: bl __atomic_compare_exchange
8017 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
8021 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
8022 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
8023 ; -O0: subs w10, w9, w8
8024 ; -O0: csel w8, w9, w8, hi
8025 ; -O0: bl __atomic_compare_exchange
8027 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
8029 ; -O1: csel w8, w0, w20, hi
8030 ; -O1: bl __atomic_compare_exchange
8031 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
8035 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
8036 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
8037 ; -O0: subs w10, w9, w8
8038 ; -O0: csel w8, w9, w8, hi
8039 ; -O0: bl __atomic_compare_exchange
8041 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
8043 ; -O1: csel w8, w0, w20, hi
8044 ; -O1: bl __atomic_compare_exchange
8045 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
8049 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
8050 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
8051 ; -O0: subs w10, w9, w8
8052 ; -O0: csel w8, w9, w8, hi
8053 ; -O0: bl __atomic_compare_exchange
8055 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
8057 ; -O1: csel w8, w0, w20, hi
8058 ; -O1: bl __atomic_compare_exchange
8059 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
8063 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
8064 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
8065 ; -O0: subs w10, w9, w8
8066 ; -O0: csel w8, w9, w8, hi
8067 ; -O0: bl __atomic_compare_exchange
8069 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
8071 ; -O1: csel w8, w0, w20, hi
8072 ; -O1: bl __atomic_compare_exchange
8073 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
8077 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
8078 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
8079 ; -O0: subs w10, w9, w8
8080 ; -O0: csel w8, w9, w8, hi
8081 ; -O0: bl __atomic_compare_exchange
8083 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
8085 ; -O1: csel w8, w0, w20, hi
8086 ; -O1: bl __atomic_compare_exchange
8087 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
8091 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
8092 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
8093 ; -O0: subs x10, x9, x8
8094 ; -O0: csel x8, x9, x8, hi
8095 ; -O0: bl __atomic_compare_exchange
8097 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
8099 ; -O1: csel x8, x0, x20, hi
8100 ; -O1: bl __atomic_compare_exchange
8101 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
8105 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
8106 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
8107 ; -O0: subs x10, x9, x8
8108 ; -O0: csel x8, x9, x8, hi
8109 ; -O0: bl __atomic_compare_exchange
8111 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
8113 ; -O1: csel x8, x0, x20, hi
8114 ; -O1: bl __atomic_compare_exchange
8115 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
8119 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
8120 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
8121 ; -O0: subs x10, x9, x8
8122 ; -O0: csel x8, x9, x8, hi
8123 ; -O0: bl __atomic_compare_exchange
8125 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
8127 ; -O1: csel x8, x0, x20, hi
8128 ; -O1: bl __atomic_compare_exchange
8129 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
8133 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
8134 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
8135 ; -O0: subs x10, x9, x8
8136 ; -O0: csel x8, x9, x8, hi
8137 ; -O0: bl __atomic_compare_exchange
8139 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
8141 ; -O1: csel x8, x0, x20, hi
8142 ; -O1: bl __atomic_compare_exchange
8143 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
8147 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
8148 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
8149 ; -O0: subs x10, x9, x8
8150 ; -O0: csel x8, x9, x8, hi
8151 ; -O0: bl __atomic_compare_exchange
8153 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
8155 ; -O1: csel x8, x0, x20, hi
8156 ; -O1: bl __atomic_compare_exchange
8157 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
8161 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
8162 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
8163 ; -O0: subs x8, x8, x10
8164 ; -O0: subs x8, x8, x9
8165 ; -O0: subs x12, x12, x10
8166 ; -O0: csel w11, w8, w11, eq
8167 ; -O0: ands w12, w11, #0x1
8168 ; -O0: csel x9, x8, x9, ne
8169 ; -O0: ands w11, w11, #0x1
8170 ; -O0: csel x8, x8, x10, ne
8171 ; -O0: bl __atomic_compare_exchange
8173 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
8174 ; -O1: ldp x0, x1, [x0]
8176 ; -O1: csel x8, x1, x19, lo
8177 ; -O1: csel x9, x0, x21, lo
8178 ; -O1: bl __atomic_compare_exchange
8179 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
8183 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
8184 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
8185 ; -O0: subs x8, x8, x10
8186 ; -O0: subs x8, x8, x9
8187 ; -O0: subs x12, x12, x10
8188 ; -O0: csel w11, w8, w11, eq
8189 ; -O0: ands w12, w11, #0x1
8190 ; -O0: csel x9, x8, x9, ne
8191 ; -O0: ands w11, w11, #0x1
8192 ; -O0: csel x8, x8, x10, ne
8193 ; -O0: bl __atomic_compare_exchange
8195 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
8196 ; -O1: ldp x0, x1, [x0]
8198 ; -O1: csel x8, x1, x19, lo
8199 ; -O1: csel x9, x0, x21, lo
8200 ; -O1: bl __atomic_compare_exchange
8201 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
8205 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
8206 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
8207 ; -O0: subs x8, x8, x10
8208 ; -O0: subs x8, x8, x9
8209 ; -O0: subs x12, x12, x10
8210 ; -O0: csel w11, w8, w11, eq
8211 ; -O0: ands w12, w11, #0x1
8212 ; -O0: csel x9, x8, x9, ne
8213 ; -O0: ands w11, w11, #0x1
8214 ; -O0: csel x8, x8, x10, ne
8215 ; -O0: bl __atomic_compare_exchange
8217 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
8218 ; -O1: ldp x0, x1, [x0]
8220 ; -O1: csel x8, x1, x19, lo
8221 ; -O1: csel x9, x0, x21, lo
8222 ; -O1: bl __atomic_compare_exchange
8223 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
8227 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
8228 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
8229 ; -O0: subs x8, x8, x10
8230 ; -O0: subs x8, x8, x9
8231 ; -O0: subs x12, x12, x10
8232 ; -O0: csel w11, w8, w11, eq
8233 ; -O0: ands w12, w11, #0x1
8234 ; -O0: csel x9, x8, x9, ne
8235 ; -O0: ands w11, w11, #0x1
8236 ; -O0: csel x8, x8, x10, ne
8237 ; -O0: bl __atomic_compare_exchange
8239 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
8240 ; -O1: ldp x0, x1, [x0]
8242 ; -O1: csel x8, x1, x19, lo
8243 ; -O1: csel x9, x0, x21, lo
8244 ; -O1: bl __atomic_compare_exchange
8245 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
8249 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
8250 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
8251 ; -O0: subs x8, x8, x10
8252 ; -O0: subs x8, x8, x9
8253 ; -O0: subs x12, x12, x10
8254 ; -O0: csel w11, w8, w11, eq
8255 ; -O0: ands w12, w11, #0x1
8256 ; -O0: csel x9, x8, x9, ne
8257 ; -O0: ands w11, w11, #0x1
8258 ; -O0: csel x8, x8, x10, ne
8259 ; -O0: bl __atomic_compare_exchange
8261 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
8262 ; -O1: ldp x0, x1, [x0]
8264 ; -O1: csel x8, x1, x19, lo
8265 ; -O1: csel x9, x0, x21, lo
8266 ; -O1: bl __atomic_compare_exchange
8267 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
8271 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
8272 ; -O0-LABEL: atomicrmw_umin_i8_aligned_monotonic:
8273 ; -O0: and w9, w10, #0xff
8274 ; -O0: subs w9, w9, w8, uxtb
8275 ; -O0: csel w12, w10, w8, ls
8276 ; -O0: ldaxrb w9, [x11]
8277 ; -O0: cmp w9, w10, uxtb
8278 ; -O0: stlxrb w8, w12, [x11]
8279 ; -O0: and w8, w9, #0xff
8280 ; -O0: subs w8, w8, w10, uxtb
8282 ; -O1-LABEL: atomicrmw_umin_i8_aligned_monotonic:
8283 ; -O1: and w9, w1, #0xff
8284 ; -O1: ldxrb w8, [x0]
8286 ; -O1: csel w10, w8, w9, ls
8287 ; -O1: stxrb w11, w10, [x0]
8288 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
8292 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
8293 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acquire:
8294 ; -O0: and w9, w10, #0xff
8295 ; -O0: subs w9, w9, w8, uxtb
8296 ; -O0: csel w12, w10, w8, ls
8297 ; -O0: ldaxrb w9, [x11]
8298 ; -O0: cmp w9, w10, uxtb
8299 ; -O0: stlxrb w8, w12, [x11]
8300 ; -O0: and w8, w9, #0xff
8301 ; -O0: subs w8, w8, w10, uxtb
8303 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acquire:
8304 ; -O1: and w9, w1, #0xff
8305 ; -O1: ldaxrb w8, [x0]
8307 ; -O1: csel w10, w8, w9, ls
8308 ; -O1: stxrb w11, w10, [x0]
8309 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
8313 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
8314 ; -O0-LABEL: atomicrmw_umin_i8_aligned_release:
8315 ; -O0: and w9, w10, #0xff
8316 ; -O0: subs w9, w9, w8, uxtb
8317 ; -O0: csel w12, w10, w8, ls
8318 ; -O0: ldaxrb w9, [x11]
8319 ; -O0: cmp w9, w10, uxtb
8320 ; -O0: stlxrb w8, w12, [x11]
8321 ; -O0: and w8, w9, #0xff
8322 ; -O0: subs w8, w8, w10, uxtb
8324 ; -O1-LABEL: atomicrmw_umin_i8_aligned_release:
8325 ; -O1: and w9, w1, #0xff
8326 ; -O1: ldxrb w8, [x0]
8328 ; -O1: csel w10, w8, w9, ls
8329 ; -O1: stlxrb w11, w10, [x0]
8330 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
8334 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
8335 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
8336 ; -O0: and w9, w10, #0xff
8337 ; -O0: subs w9, w9, w8, uxtb
8338 ; -O0: csel w12, w10, w8, ls
8339 ; -O0: ldaxrb w9, [x11]
8340 ; -O0: cmp w9, w10, uxtb
8341 ; -O0: stlxrb w8, w12, [x11]
8342 ; -O0: and w8, w9, #0xff
8343 ; -O0: subs w8, w8, w10, uxtb
8345 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
8346 ; -O1: and w9, w1, #0xff
8347 ; -O1: ldaxrb w8, [x0]
8349 ; -O1: csel w10, w8, w9, ls
8350 ; -O1: stlxrb w11, w10, [x0]
8351 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
8355 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
8356 ; -O0-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
8357 ; -O0: and w9, w10, #0xff
8358 ; -O0: subs w9, w9, w8, uxtb
8359 ; -O0: csel w12, w10, w8, ls
8360 ; -O0: ldaxrb w9, [x11]
8361 ; -O0: cmp w9, w10, uxtb
8362 ; -O0: stlxrb w8, w12, [x11]
8363 ; -O0: and w8, w9, #0xff
8364 ; -O0: subs w8, w8, w10, uxtb
8366 ; -O1-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
8367 ; -O1: and w9, w1, #0xff
8368 ; -O1: ldaxrb w8, [x0]
8370 ; -O1: csel w10, w8, w9, ls
8371 ; -O1: stlxrb w11, w10, [x0]
8372 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
8376 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
8377 ; -O0-LABEL: atomicrmw_umin_i16_aligned_monotonic:
8378 ; -O0: subs w10, w10, w9, uxth
8379 ; -O0: csel w12, w8, w9, ls
8380 ; -O0: ldaxrh w9, [x11]
8381 ; -O0: cmp w9, w8, uxth
8382 ; -O0: stlxrh w10, w12, [x11]
8383 ; -O0: subs w8, w8, w9, uxth
8385 ; -O1-LABEL: atomicrmw_umin_i16_aligned_monotonic:
8386 ; -O1: and w9, w1, #0xffff
8387 ; -O1: ldxrh w8, [x0]
8389 ; -O1: csel w10, w8, w9, ls
8390 ; -O1: stxrh w11, w10, [x0]
8391 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
8395 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
8396 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acquire:
8397 ; -O0: subs w10, w10, w9, uxth
8398 ; -O0: csel w12, w8, w9, ls
8399 ; -O0: ldaxrh w9, [x11]
8400 ; -O0: cmp w9, w8, uxth
8401 ; -O0: stlxrh w10, w12, [x11]
8402 ; -O0: subs w8, w8, w9, uxth
8404 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acquire:
8405 ; -O1: and w9, w1, #0xffff
8406 ; -O1: ldaxrh w8, [x0]
8408 ; -O1: csel w10, w8, w9, ls
8409 ; -O1: stxrh w11, w10, [x0]
8410 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
8414 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
8415 ; -O0-LABEL: atomicrmw_umin_i16_aligned_release:
8416 ; -O0: subs w10, w10, w9, uxth
8417 ; -O0: csel w12, w8, w9, ls
8418 ; -O0: ldaxrh w9, [x11]
8419 ; -O0: cmp w9, w8, uxth
8420 ; -O0: stlxrh w10, w12, [x11]
8421 ; -O0: subs w8, w8, w9, uxth
8423 ; -O1-LABEL: atomicrmw_umin_i16_aligned_release:
8424 ; -O1: and w9, w1, #0xffff
8425 ; -O1: ldxrh w8, [x0]
8427 ; -O1: csel w10, w8, w9, ls
8428 ; -O1: stlxrh w11, w10, [x0]
8429 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
8433 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
8434 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
8435 ; -O0: subs w10, w10, w9, uxth
8436 ; -O0: csel w12, w8, w9, ls
8437 ; -O0: ldaxrh w9, [x11]
8438 ; -O0: cmp w9, w8, uxth
8439 ; -O0: stlxrh w10, w12, [x11]
8440 ; -O0: subs w8, w8, w9, uxth
8442 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
8443 ; -O1: and w9, w1, #0xffff
8444 ; -O1: ldaxrh w8, [x0]
8446 ; -O1: csel w10, w8, w9, ls
8447 ; -O1: stlxrh w11, w10, [x0]
8448 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
8452 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
8453 ; -O0-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
8454 ; -O0: subs w10, w10, w9, uxth
8455 ; -O0: csel w12, w8, w9, ls
8456 ; -O0: ldaxrh w9, [x11]
8457 ; -O0: cmp w9, w8, uxth
8458 ; -O0: stlxrh w10, w12, [x11]
8459 ; -O0: subs w8, w8, w9, uxth
8461 ; -O1-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
8462 ; -O1: and w9, w1, #0xffff
8463 ; -O1: ldaxrh w8, [x0]
8465 ; -O1: csel w10, w8, w9, ls
8466 ; -O1: stlxrh w11, w10, [x0]
8467 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
8471 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
8472 ; -O0-LABEL: atomicrmw_umin_i32_aligned_monotonic:
8473 ; -O0: subs w10, w8, w9
8474 ; -O0: csel w12, w8, w9, ls
8475 ; -O0: ldaxr w9, [x11]
8477 ; -O0: stlxr w10, w12, [x11]
8478 ; -O0: subs w8, w9, w8
8480 ; -O1-LABEL: atomicrmw_umin_i32_aligned_monotonic:
8481 ; -O1: ldxr w8, [x0]
8483 ; -O1: csel w9, w8, w1, ls
8484 ; -O1: stxr w10, w9, [x0]
8485 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
8489 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
8490 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acquire:
8491 ; -O0: subs w10, w8, w9
8492 ; -O0: csel w12, w8, w9, ls
8493 ; -O0: ldaxr w9, [x11]
8495 ; -O0: stlxr w10, w12, [x11]
8496 ; -O0: subs w8, w9, w8
8498 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acquire:
8499 ; -O1: ldaxr w8, [x0]
8501 ; -O1: csel w9, w8, w1, ls
8502 ; -O1: stxr w10, w9, [x0]
8503 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
8507 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
8508 ; -O0-LABEL: atomicrmw_umin_i32_aligned_release:
8509 ; -O0: subs w10, w8, w9
8510 ; -O0: csel w12, w8, w9, ls
8511 ; -O0: ldaxr w9, [x11]
8513 ; -O0: stlxr w10, w12, [x11]
8514 ; -O0: subs w8, w9, w8
8516 ; -O1-LABEL: atomicrmw_umin_i32_aligned_release:
8517 ; -O1: ldxr w8, [x0]
8519 ; -O1: csel w9, w8, w1, ls
8520 ; -O1: stlxr w10, w9, [x0]
8521 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
8525 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
8526 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
8527 ; -O0: subs w10, w8, w9
8528 ; -O0: csel w12, w8, w9, ls
8529 ; -O0: ldaxr w9, [x11]
8531 ; -O0: stlxr w10, w12, [x11]
8532 ; -O0: subs w8, w9, w8
8534 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
8535 ; -O1: ldaxr w8, [x0]
8537 ; -O1: csel w9, w8, w1, ls
8538 ; -O1: stlxr w10, w9, [x0]
8539 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
8543 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
8544 ; -O0-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
8545 ; -O0: subs w10, w8, w9
8546 ; -O0: csel w12, w8, w9, ls
8547 ; -O0: ldaxr w9, [x11]
8549 ; -O0: stlxr w10, w12, [x11]
8550 ; -O0: subs w8, w9, w8
8552 ; -O1-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
8553 ; -O1: ldaxr w8, [x0]
8555 ; -O1: csel w9, w8, w1, ls
8556 ; -O1: stlxr w10, w9, [x0]
8557 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
8561 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
8562 ; -O0-LABEL: atomicrmw_umin_i64_aligned_monotonic:
8563 ; -O0: subs x10, x8, x9
8564 ; -O0: csel x12, x8, x9, ls
8565 ; -O0: ldaxr x9, [x11]
8567 ; -O0: stlxr w10, x12, [x11]
8568 ; -O0: subs x8, x9, x8
8570 ; -O1-LABEL: atomicrmw_umin_i64_aligned_monotonic:
8571 ; -O1: ldxr x0, [x8]
8573 ; -O1: csel x9, x0, x1, ls
8574 ; -O1: stxr w10, x9, [x8]
8575 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
8579 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
8580 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acquire:
8581 ; -O0: subs x10, x8, x9
8582 ; -O0: csel x12, x8, x9, ls
8583 ; -O0: ldaxr x9, [x11]
8585 ; -O0: stlxr w10, x12, [x11]
8586 ; -O0: subs x8, x9, x8
8588 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acquire:
8589 ; -O1: ldaxr x0, [x8]
8591 ; -O1: csel x9, x0, x1, ls
8592 ; -O1: stxr w10, x9, [x8]
8593 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
8597 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
8598 ; -O0-LABEL: atomicrmw_umin_i64_aligned_release:
8599 ; -O0: subs x10, x8, x9
8600 ; -O0: csel x12, x8, x9, ls
8601 ; -O0: ldaxr x9, [x11]
8603 ; -O0: stlxr w10, x12, [x11]
8604 ; -O0: subs x8, x9, x8
8606 ; -O1-LABEL: atomicrmw_umin_i64_aligned_release:
8607 ; -O1: ldxr x0, [x8]
8609 ; -O1: csel x9, x0, x1, ls
8610 ; -O1: stlxr w10, x9, [x8]
8611 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
8615 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
8616 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
8617 ; -O0: subs x10, x8, x9
8618 ; -O0: csel x12, x8, x9, ls
8619 ; -O0: ldaxr x9, [x11]
8621 ; -O0: stlxr w10, x12, [x11]
8622 ; -O0: subs x8, x9, x8
8624 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
8625 ; -O1: ldaxr x0, [x8]
8627 ; -O1: csel x9, x0, x1, ls
8628 ; -O1: stlxr w10, x9, [x8]
8629 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
8633 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
8634 ; -O0-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
8635 ; -O0: subs x10, x8, x9
8636 ; -O0: csel x12, x8, x9, ls
8637 ; -O0: ldaxr x9, [x11]
8639 ; -O0: stlxr w10, x12, [x11]
8640 ; -O0: subs x8, x9, x8
8642 ; -O1-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
8643 ; -O1: ldaxr x0, [x8]
8645 ; -O1: csel x9, x0, x1, ls
8646 ; -O1: stlxr w10, x9, [x8]
8647 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
8651 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
8652 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
8653 ; -O0: subs x8, x8, x9
8654 ; -O0: subs x8, x8, x12
8655 ; -O0: subs x13, x13, x9
8656 ; -O0: csel w10, w8, w10, eq
8657 ; -O0: ands w13, w10, #0x1
8658 ; -O0: csel x14, x8, x12, ne
8659 ; -O0: ands w10, w10, #0x1
8660 ; -O0: csel x15, x8, x9, ne
8661 ; -O0: ldxp x10, x9, [x11]
8664 ; -O0: stxp w8, x14, x15, [x11]
8665 ; -O0: stxp w8, x10, x9, [x11]
8666 ; -O0: eor x8, x10, x8
8667 ; -O0: eor x11, x9, x11
8668 ; -O0: orr x8, x8, x11
8669 ; -O0: subs x8, x8, #0
8671 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
8672 ; -O1: ldxp x0, x1, [x8]
8674 ; -O1: csel x9, x1, x3, hs
8675 ; -O1: csel x10, x0, x2, hs
8676 ; -O1: stxp w11, x10, x9, [x8]
8677 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
8681 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
8682 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
8683 ; -O0: subs x8, x8, x9
8684 ; -O0: subs x8, x8, x12
8685 ; -O0: subs x13, x13, x9
8686 ; -O0: csel w10, w8, w10, eq
8687 ; -O0: ands w13, w10, #0x1
8688 ; -O0: csel x14, x8, x12, ne
8689 ; -O0: ands w10, w10, #0x1
8690 ; -O0: csel x15, x8, x9, ne
8691 ; -O0: ldaxp x10, x9, [x11]
8694 ; -O0: stxp w8, x14, x15, [x11]
8695 ; -O0: stxp w8, x10, x9, [x11]
8696 ; -O0: eor x8, x10, x8
8697 ; -O0: eor x11, x9, x11
8698 ; -O0: orr x8, x8, x11
8699 ; -O0: subs x8, x8, #0
8701 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
8702 ; -O1: ldaxp x0, x1, [x8]
8704 ; -O1: csel x9, x1, x3, hs
8705 ; -O1: csel x10, x0, x2, hs
8706 ; -O1: stxp w11, x10, x9, [x8]
8707 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
8711 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
8712 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
8713 ; -O0: subs x8, x8, x9
8714 ; -O0: subs x8, x8, x12
8715 ; -O0: subs x13, x13, x9
8716 ; -O0: csel w10, w8, w10, eq
8717 ; -O0: ands w13, w10, #0x1
8718 ; -O0: csel x14, x8, x12, ne
8719 ; -O0: ands w10, w10, #0x1
8720 ; -O0: csel x15, x8, x9, ne
8721 ; -O0: ldxp x10, x9, [x11]
8724 ; -O0: stlxp w8, x14, x15, [x11]
8725 ; -O0: stlxp w8, x10, x9, [x11]
8726 ; -O0: eor x8, x10, x8
8727 ; -O0: eor x11, x9, x11
8728 ; -O0: orr x8, x8, x11
8729 ; -O0: subs x8, x8, #0
8731 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
8732 ; -O1: ldxp x0, x1, [x8]
8734 ; -O1: csel x9, x1, x3, hs
8735 ; -O1: csel x10, x0, x2, hs
8736 ; -O1: stlxp w11, x10, x9, [x8]
8737 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
8741 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
8742 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
8743 ; -O0: subs x8, x8, x9
8744 ; -O0: subs x8, x8, x12
8745 ; -O0: subs x13, x13, x9
8746 ; -O0: csel w10, w8, w10, eq
8747 ; -O0: ands w13, w10, #0x1
8748 ; -O0: csel x14, x8, x12, ne
8749 ; -O0: ands w10, w10, #0x1
8750 ; -O0: csel x15, x8, x9, ne
8751 ; -O0: ldaxp x10, x9, [x11]
8754 ; -O0: stlxp w8, x14, x15, [x11]
8755 ; -O0: stlxp w8, x10, x9, [x11]
8756 ; -O0: eor x8, x10, x8
8757 ; -O0: eor x11, x9, x11
8758 ; -O0: orr x8, x8, x11
8759 ; -O0: subs x8, x8, #0
8761 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
8762 ; -O1: ldaxp x0, x1, [x8]
8764 ; -O1: csel x9, x1, x3, hs
8765 ; -O1: csel x10, x0, x2, hs
8766 ; -O1: stlxp w11, x10, x9, [x8]
8767 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
8771 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
8772 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
8773 ; -O0: subs x8, x8, x9
8774 ; -O0: subs x8, x8, x12
8775 ; -O0: subs x13, x13, x9
8776 ; -O0: csel w10, w8, w10, eq
8777 ; -O0: ands w13, w10, #0x1
8778 ; -O0: csel x14, x8, x12, ne
8779 ; -O0: ands w10, w10, #0x1
8780 ; -O0: csel x15, x8, x9, ne
8781 ; -O0: ldaxp x10, x9, [x11]
8784 ; -O0: stlxp w8, x14, x15, [x11]
8785 ; -O0: stlxp w8, x10, x9, [x11]
8786 ; -O0: eor x8, x10, x8
8787 ; -O0: eor x11, x9, x11
8788 ; -O0: orr x8, x8, x11
8789 ; -O0: subs x8, x8, #0
8791 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
8792 ; -O1: ldaxp x0, x1, [x8]
8794 ; -O1: csel x9, x1, x3, hs
8795 ; -O1: csel x10, x0, x2, hs
8796 ; -O1: stlxp w11, x10, x9, [x8]
8797 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
8801 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
8802 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
8803 ; -O0: and w9, w10, #0xff
8804 ; -O0: subs w9, w9, w8, uxtb
8805 ; -O0: csel w12, w10, w8, ls
8806 ; -O0: ldaxrb w9, [x11]
8807 ; -O0: cmp w9, w10, uxtb
8808 ; -O0: stlxrb w8, w12, [x11]
8809 ; -O0: and w8, w9, #0xff
8810 ; -O0: subs w8, w8, w10, uxtb
8812 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
8813 ; -O1: and w9, w1, #0xff
8814 ; -O1: ldxrb w8, [x0]
8816 ; -O1: csel w10, w8, w9, ls
8817 ; -O1: stxrb w11, w10, [x0]
8818 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
8822 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
8823 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acquire:
8824 ; -O0: and w9, w10, #0xff
8825 ; -O0: subs w9, w9, w8, uxtb
8826 ; -O0: csel w12, w10, w8, ls
8827 ; -O0: ldaxrb w9, [x11]
8828 ; -O0: cmp w9, w10, uxtb
8829 ; -O0: stlxrb w8, w12, [x11]
8830 ; -O0: and w8, w9, #0xff
8831 ; -O0: subs w8, w8, w10, uxtb
8833 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acquire:
8834 ; -O1: and w9, w1, #0xff
8835 ; -O1: ldaxrb w8, [x0]
8837 ; -O1: csel w10, w8, w9, ls
8838 ; -O1: stxrb w11, w10, [x0]
8839 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
8843 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
8844 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_release:
8845 ; -O0: and w9, w10, #0xff
8846 ; -O0: subs w9, w9, w8, uxtb
8847 ; -O0: csel w12, w10, w8, ls
8848 ; -O0: ldaxrb w9, [x11]
8849 ; -O0: cmp w9, w10, uxtb
8850 ; -O0: stlxrb w8, w12, [x11]
8851 ; -O0: and w8, w9, #0xff
8852 ; -O0: subs w8, w8, w10, uxtb
8854 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_release:
8855 ; -O1: and w9, w1, #0xff
8856 ; -O1: ldxrb w8, [x0]
8858 ; -O1: csel w10, w8, w9, ls
8859 ; -O1: stlxrb w11, w10, [x0]
8860 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
8864 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
8865 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
8866 ; -O0: and w9, w10, #0xff
8867 ; -O0: subs w9, w9, w8, uxtb
8868 ; -O0: csel w12, w10, w8, ls
8869 ; -O0: ldaxrb w9, [x11]
8870 ; -O0: cmp w9, w10, uxtb
8871 ; -O0: stlxrb w8, w12, [x11]
8872 ; -O0: and w8, w9, #0xff
8873 ; -O0: subs w8, w8, w10, uxtb
8875 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
8876 ; -O1: and w9, w1, #0xff
8877 ; -O1: ldaxrb w8, [x0]
8879 ; -O1: csel w10, w8, w9, ls
8880 ; -O1: stlxrb w11, w10, [x0]
8881 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
8885 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
8886 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
8887 ; -O0: and w9, w10, #0xff
8888 ; -O0: subs w9, w9, w8, uxtb
8889 ; -O0: csel w12, w10, w8, ls
8890 ; -O0: ldaxrb w9, [x11]
8891 ; -O0: cmp w9, w10, uxtb
8892 ; -O0: stlxrb w8, w12, [x11]
8893 ; -O0: and w8, w9, #0xff
8894 ; -O0: subs w8, w8, w10, uxtb
8896 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
8897 ; -O1: and w9, w1, #0xff
8898 ; -O1: ldaxrb w8, [x0]
8900 ; -O1: csel w10, w8, w9, ls
8901 ; -O1: stlxrb w11, w10, [x0]
8902 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
8906 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
8907 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
8908 ; -O0: subs w10, w10, w8, uxth
8909 ; -O0: csel w8, w9, w8, ls
8910 ; -O0: bl __atomic_compare_exchange
8912 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
8913 ; -O1: and w8, w0, #0xffff
8914 ; -O1: cmp w8, w20, uxth
8915 ; -O1: csel w8, w0, w20, ls
8916 ; -O1: bl __atomic_compare_exchange
8917 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
8921 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
8922 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
8923 ; -O0: subs w10, w10, w8, uxth
8924 ; -O0: csel w8, w9, w8, ls
8925 ; -O0: bl __atomic_compare_exchange
8927 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
8928 ; -O1: and w8, w0, #0xffff
8929 ; -O1: cmp w8, w20, uxth
8930 ; -O1: csel w8, w0, w20, ls
8931 ; -O1: bl __atomic_compare_exchange
8932 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
8936 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
8937 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
8938 ; -O0: subs w10, w10, w8, uxth
8939 ; -O0: csel w8, w9, w8, ls
8940 ; -O0: bl __atomic_compare_exchange
8942 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
8943 ; -O1: and w8, w0, #0xffff
8944 ; -O1: cmp w8, w20, uxth
8945 ; -O1: csel w8, w0, w20, ls
8946 ; -O1: bl __atomic_compare_exchange
8947 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
8951 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
8952 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
8953 ; -O0: subs w10, w10, w8, uxth
8954 ; -O0: csel w8, w9, w8, ls
8955 ; -O0: bl __atomic_compare_exchange
8957 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
8958 ; -O1: and w8, w0, #0xffff
8959 ; -O1: cmp w8, w20, uxth
8960 ; -O1: csel w8, w0, w20, ls
8961 ; -O1: bl __atomic_compare_exchange
8962 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
8966 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
8967 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
8968 ; -O0: subs w10, w10, w8, uxth
8969 ; -O0: csel w8, w9, w8, ls
8970 ; -O0: bl __atomic_compare_exchange
8972 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
8973 ; -O1: and w8, w0, #0xffff
8974 ; -O1: cmp w8, w20, uxth
8975 ; -O1: csel w8, w0, w20, ls
8976 ; -O1: bl __atomic_compare_exchange
8977 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
8981 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
8982 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
8983 ; -O0: subs w10, w9, w8
8984 ; -O0: csel w8, w9, w8, ls
8985 ; -O0: bl __atomic_compare_exchange
8987 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
8989 ; -O1: csel w8, w0, w20, ls
8990 ; -O1: bl __atomic_compare_exchange
8991 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
8995 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
8996 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
8997 ; -O0: subs w10, w9, w8
8998 ; -O0: csel w8, w9, w8, ls
8999 ; -O0: bl __atomic_compare_exchange
9001 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
9003 ; -O1: csel w8, w0, w20, ls
9004 ; -O1: bl __atomic_compare_exchange
9005 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
9009 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
9010 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
9011 ; -O0: subs w10, w9, w8
9012 ; -O0: csel w8, w9, w8, ls
9013 ; -O0: bl __atomic_compare_exchange
9015 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
9017 ; -O1: csel w8, w0, w20, ls
9018 ; -O1: bl __atomic_compare_exchange
9019 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
9023 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
9024 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
9025 ; -O0: subs w10, w9, w8
9026 ; -O0: csel w8, w9, w8, ls
9027 ; -O0: bl __atomic_compare_exchange
9029 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
9031 ; -O1: csel w8, w0, w20, ls
9032 ; -O1: bl __atomic_compare_exchange
9033 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
9037 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
9038 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
9039 ; -O0: subs w10, w9, w8
9040 ; -O0: csel w8, w9, w8, ls
9041 ; -O0: bl __atomic_compare_exchange
9043 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
9045 ; -O1: csel w8, w0, w20, ls
9046 ; -O1: bl __atomic_compare_exchange
9047 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
9051 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
9052 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
9053 ; -O0: subs x10, x9, x8
9054 ; -O0: csel x8, x9, x8, ls
9055 ; -O0: bl __atomic_compare_exchange
9057 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
9059 ; -O1: csel x8, x0, x20, ls
9060 ; -O1: bl __atomic_compare_exchange
9061 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
9065 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
9066 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
9067 ; -O0: subs x10, x9, x8
9068 ; -O0: csel x8, x9, x8, ls
9069 ; -O0: bl __atomic_compare_exchange
9071 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
9073 ; -O1: csel x8, x0, x20, ls
9074 ; -O1: bl __atomic_compare_exchange
9075 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
9079 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
9080 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
9081 ; -O0: subs x10, x9, x8
9082 ; -O0: csel x8, x9, x8, ls
9083 ; -O0: bl __atomic_compare_exchange
9085 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
9087 ; -O1: csel x8, x0, x20, ls
9088 ; -O1: bl __atomic_compare_exchange
9089 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
9093 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
9094 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
9095 ; -O0: subs x10, x9, x8
9096 ; -O0: csel x8, x9, x8, ls
9097 ; -O0: bl __atomic_compare_exchange
9099 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
9101 ; -O1: csel x8, x0, x20, ls
9102 ; -O1: bl __atomic_compare_exchange
9103 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
9107 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
9108 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
9109 ; -O0: subs x10, x9, x8
9110 ; -O0: csel x8, x9, x8, ls
9111 ; -O0: bl __atomic_compare_exchange
9113 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
9115 ; -O1: csel x8, x0, x20, ls
9116 ; -O1: bl __atomic_compare_exchange
9117 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
9121 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
9122 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
9123 ; -O0: subs x8, x8, x10
9124 ; -O0: subs x8, x8, x9
9125 ; -O0: subs x12, x12, x10
9126 ; -O0: csel w11, w8, w11, eq
9127 ; -O0: ands w12, w11, #0x1
9128 ; -O0: csel x9, x8, x9, ne
9129 ; -O0: ands w11, w11, #0x1
9130 ; -O0: csel x8, x8, x10, ne
9131 ; -O0: bl __atomic_compare_exchange
9133 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
9134 ; -O1: ldp x0, x1, [x0]
9136 ; -O1: csel x8, x1, x19, hs
9137 ; -O1: csel x9, x0, x21, hs
9138 ; -O1: bl __atomic_compare_exchange
9139 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
9143 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
9144 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
9145 ; -O0: subs x8, x8, x10
9146 ; -O0: subs x8, x8, x9
9147 ; -O0: subs x12, x12, x10
9148 ; -O0: csel w11, w8, w11, eq
9149 ; -O0: ands w12, w11, #0x1
9150 ; -O0: csel x9, x8, x9, ne
9151 ; -O0: ands w11, w11, #0x1
9152 ; -O0: csel x8, x8, x10, ne
9153 ; -O0: bl __atomic_compare_exchange
9155 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
9156 ; -O1: ldp x0, x1, [x0]
9158 ; -O1: csel x8, x1, x19, hs
9159 ; -O1: csel x9, x0, x21, hs
9160 ; -O1: bl __atomic_compare_exchange
9161 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
9165 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
9166 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
9167 ; -O0: subs x8, x8, x10
9168 ; -O0: subs x8, x8, x9
9169 ; -O0: subs x12, x12, x10
9170 ; -O0: csel w11, w8, w11, eq
9171 ; -O0: ands w12, w11, #0x1
9172 ; -O0: csel x9, x8, x9, ne
9173 ; -O0: ands w11, w11, #0x1
9174 ; -O0: csel x8, x8, x10, ne
9175 ; -O0: bl __atomic_compare_exchange
9177 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
9178 ; -O1: ldp x0, x1, [x0]
9180 ; -O1: csel x8, x1, x19, hs
9181 ; -O1: csel x9, x0, x21, hs
9182 ; -O1: bl __atomic_compare_exchange
9183 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
9187 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
9188 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
9189 ; -O0: subs x8, x8, x10
9190 ; -O0: subs x8, x8, x9
9191 ; -O0: subs x12, x12, x10
9192 ; -O0: csel w11, w8, w11, eq
9193 ; -O0: ands w12, w11, #0x1
9194 ; -O0: csel x9, x8, x9, ne
9195 ; -O0: ands w11, w11, #0x1
9196 ; -O0: csel x8, x8, x10, ne
9197 ; -O0: bl __atomic_compare_exchange
9199 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
9200 ; -O1: ldp x0, x1, [x0]
9202 ; -O1: csel x8, x1, x19, hs
9203 ; -O1: csel x9, x0, x21, hs
9204 ; -O1: bl __atomic_compare_exchange
9205 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
9209 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
9210 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
9211 ; -O0: subs x8, x8, x10
9212 ; -O0: subs x8, x8, x9
9213 ; -O0: subs x12, x12, x10
9214 ; -O0: csel w11, w8, w11, eq
9215 ; -O0: ands w12, w11, #0x1
9216 ; -O0: csel x9, x8, x9, ne
9217 ; -O0: ands w11, w11, #0x1
9218 ; -O0: csel x8, x8, x10, ne
9219 ; -O0: bl __atomic_compare_exchange
9221 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
9222 ; -O1: ldp x0, x1, [x0]
9224 ; -O1: csel x8, x1, x19, hs
9225 ; -O1: csel x9, x0, x21, hs
9226 ; -O1: bl __atomic_compare_exchange
9227 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1