1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+rcpc -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -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 w8, [x11]
9 ; -O0: cmp w8, w9, uxtb
10 ; -O0: stlxrb w10, w12, [x11]
11 ; -O0: subs w9, w8, w9, uxtb
12 ; -O0: subs w9, w9, #1
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 w8, [x11]
24 ; -O0: cmp w8, w9, uxtb
25 ; -O0: stlxrb w10, w12, [x11]
26 ; -O0: subs w9, w8, w9, uxtb
27 ; -O0: subs w9, w9, #1
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 w8, [x11]
39 ; -O0: cmp w8, w9, uxtb
40 ; -O0: stlxrb w10, w12, [x11]
41 ; -O0: subs w9, w8, w9, uxtb
42 ; -O0: subs w9, w9, #1
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 w8, [x11]
54 ; -O0: cmp w8, w9, uxtb
55 ; -O0: stlxrb w10, w12, [x11]
56 ; -O0: subs w9, w8, w9, uxtb
57 ; -O0: subs w9, w9, #1
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 w8, [x11]
69 ; -O0: cmp w8, w9, uxtb
70 ; -O0: stlxrb w10, w12, [x11]
71 ; -O0: subs w9, w8, w9, uxtb
72 ; -O0: subs w9, w9, #1
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 w8, [x11]
84 ; -O0: cmp w8, w9, uxth
85 ; -O0: stlxrh w10, w12, [x11]
86 ; -O0: subs w9, w8, w9, uxth
87 ; -O0: subs w9, w9, #1
89 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_monotonic:
91 ; -O1: stxrh w9, w1, [x0]
92 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 2
96 define dso_local i16 @atomicrmw_xchg_i16_aligned_acquire(ptr %ptr, i16 %value) {
97 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_acquire:
98 ; -O0: ldaxrh w8, [x11]
99 ; -O0: cmp w8, w9, uxth
100 ; -O0: stlxrh w10, w12, [x11]
101 ; -O0: subs w9, w8, w9, uxth
102 ; -O0: subs w9, w9, #1
104 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_acquire:
105 ; -O1: ldaxrh w8, [x0]
106 ; -O1: stxrh w9, w1, [x0]
107 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 2
111 define dso_local i16 @atomicrmw_xchg_i16_aligned_release(ptr %ptr, i16 %value) {
112 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_release:
113 ; -O0: ldaxrh w8, [x11]
114 ; -O0: cmp w8, w9, uxth
115 ; -O0: stlxrh w10, w12, [x11]
116 ; -O0: subs w9, w8, w9, uxth
117 ; -O0: subs w9, w9, #1
119 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_release:
120 ; -O1: ldxrh w8, [x0]
121 ; -O1: stlxrh w9, w1, [x0]
122 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 2
126 define dso_local i16 @atomicrmw_xchg_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
127 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_acq_rel:
128 ; -O0: ldaxrh w8, [x11]
129 ; -O0: cmp w8, w9, uxth
130 ; -O0: stlxrh w10, w12, [x11]
131 ; -O0: subs w9, w8, w9, uxth
132 ; -O0: subs w9, w9, #1
134 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_acq_rel:
135 ; -O1: ldaxrh w8, [x0]
136 ; -O1: stlxrh w9, w1, [x0]
137 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 2
141 define dso_local i16 @atomicrmw_xchg_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
142 ; -O0-LABEL: atomicrmw_xchg_i16_aligned_seq_cst:
143 ; -O0: ldaxrh w8, [x11]
144 ; -O0: cmp w8, w9, uxth
145 ; -O0: stlxrh w10, w12, [x11]
146 ; -O0: subs w9, w8, w9, uxth
147 ; -O0: subs w9, w9, #1
149 ; -O1-LABEL: atomicrmw_xchg_i16_aligned_seq_cst:
150 ; -O1: ldaxrh w8, [x0]
151 ; -O1: stlxrh w9, w1, [x0]
152 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 2
156 define dso_local i32 @atomicrmw_xchg_i32_aligned_monotonic(ptr %ptr, i32 %value) {
157 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_monotonic:
158 ; -O0: ldaxr w8, [x11]
160 ; -O0: stlxr w10, w12, [x11]
161 ; -O0: subs w9, w8, w9
162 ; -O0: subs w9, w9, #1
164 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_monotonic:
166 ; -O1: stxr w9, w1, [x8]
167 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 4
171 define dso_local i32 @atomicrmw_xchg_i32_aligned_acquire(ptr %ptr, i32 %value) {
172 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_acquire:
173 ; -O0: ldaxr w8, [x11]
175 ; -O0: stlxr w10, w12, [x11]
176 ; -O0: subs w9, w8, w9
177 ; -O0: subs w9, w9, #1
179 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_acquire:
180 ; -O1: ldaxr w0, [x8]
181 ; -O1: stxr w9, w1, [x8]
182 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 4
186 define dso_local i32 @atomicrmw_xchg_i32_aligned_release(ptr %ptr, i32 %value) {
187 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_release:
188 ; -O0: ldaxr w8, [x11]
190 ; -O0: stlxr w10, w12, [x11]
191 ; -O0: subs w9, w8, w9
192 ; -O0: subs w9, w9, #1
194 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_release:
196 ; -O1: stlxr w9, w1, [x8]
197 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 4
201 define dso_local i32 @atomicrmw_xchg_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
202 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_acq_rel:
203 ; -O0: ldaxr w8, [x11]
205 ; -O0: stlxr w10, w12, [x11]
206 ; -O0: subs w9, w8, w9
207 ; -O0: subs w9, w9, #1
209 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_acq_rel:
210 ; -O1: ldaxr w0, [x8]
211 ; -O1: stlxr w9, w1, [x8]
212 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 4
216 define dso_local i32 @atomicrmw_xchg_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
217 ; -O0-LABEL: atomicrmw_xchg_i32_aligned_seq_cst:
218 ; -O0: ldaxr w8, [x11]
220 ; -O0: stlxr w10, w12, [x11]
221 ; -O0: subs w9, w8, w9
222 ; -O0: subs w9, w9, #1
224 ; -O1-LABEL: atomicrmw_xchg_i32_aligned_seq_cst:
225 ; -O1: ldaxr w0, [x8]
226 ; -O1: stlxr w9, w1, [x8]
227 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 4
231 define dso_local i64 @atomicrmw_xchg_i64_aligned_monotonic(ptr %ptr, i64 %value) {
232 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_monotonic:
233 ; -O0: ldaxr x8, [x11]
235 ; -O0: stlxr w10, x12, [x11]
236 ; -O0: subs x9, x8, x9
237 ; -O0: subs w9, w9, #1
239 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_monotonic:
241 ; -O1: stxr w9, x1, [x8]
242 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 8
246 define dso_local i64 @atomicrmw_xchg_i64_aligned_acquire(ptr %ptr, i64 %value) {
247 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_acquire:
248 ; -O0: ldaxr x8, [x11]
250 ; -O0: stlxr w10, x12, [x11]
251 ; -O0: subs x9, x8, x9
252 ; -O0: subs w9, w9, #1
254 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_acquire:
255 ; -O1: ldaxr x0, [x8]
256 ; -O1: stxr w9, x1, [x8]
257 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 8
261 define dso_local i64 @atomicrmw_xchg_i64_aligned_release(ptr %ptr, i64 %value) {
262 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_release:
263 ; -O0: ldaxr x8, [x11]
265 ; -O0: stlxr w10, x12, [x11]
266 ; -O0: subs x9, x8, x9
267 ; -O0: subs w9, w9, #1
269 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_release:
271 ; -O1: stlxr w9, x1, [x8]
272 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 8
276 define dso_local i64 @atomicrmw_xchg_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
277 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_acq_rel:
278 ; -O0: ldaxr x8, [x11]
280 ; -O0: stlxr w10, x12, [x11]
281 ; -O0: subs x9, x8, x9
282 ; -O0: subs w9, w9, #1
284 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_acq_rel:
285 ; -O1: ldaxr x0, [x8]
286 ; -O1: stlxr w9, x1, [x8]
287 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 8
291 define dso_local i64 @atomicrmw_xchg_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
292 ; -O0-LABEL: atomicrmw_xchg_i64_aligned_seq_cst:
293 ; -O0: ldaxr x8, [x11]
295 ; -O0: stlxr w10, x12, [x11]
296 ; -O0: subs x9, x8, x9
297 ; -O0: subs w9, w9, #1
299 ; -O1-LABEL: atomicrmw_xchg_i64_aligned_seq_cst:
300 ; -O1: ldaxr x0, [x8]
301 ; -O1: stlxr w9, x1, [x8]
302 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 8
306 define dso_local i128 @atomicrmw_xchg_i128_aligned_monotonic(ptr %ptr, i128 %value) {
307 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
308 ; -O0: ldxp x10, x12, [x9]
311 ; -O0: stxp w8, x14, x15, [x9]
312 ; -O0: stxp w8, x10, x12, [x9]
313 ; -O0: subs x12, x12, x13
314 ; -O0: ccmp x10, x11, #0, eq
316 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_monotonic:
317 ; -O1: ldxp x1, x8, [x0]
318 ; -O1: stxp w9, x3, x2, [x0]
319 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 16
323 define dso_local i128 @atomicrmw_xchg_i128_aligned_acquire(ptr %ptr, i128 %value) {
324 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acquire:
325 ; -O0: ldaxp x10, x12, [x9]
328 ; -O0: stxp w8, x14, x15, [x9]
329 ; -O0: stxp w8, x10, x12, [x9]
330 ; -O0: subs x12, x12, x13
331 ; -O0: ccmp x10, x11, #0, eq
333 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acquire:
334 ; -O1: ldaxp x1, x8, [x0]
335 ; -O1: stxp w9, x3, x2, [x0]
336 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 16
340 define dso_local i128 @atomicrmw_xchg_i128_aligned_release(ptr %ptr, i128 %value) {
341 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_release:
342 ; -O0: ldxp x10, x12, [x9]
345 ; -O0: stlxp w8, x14, x15, [x9]
346 ; -O0: stlxp w8, x10, x12, [x9]
347 ; -O0: subs x12, x12, x13
348 ; -O0: ccmp x10, x11, #0, eq
350 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_release:
351 ; -O1: ldxp x1, x8, [x0]
352 ; -O1: stlxp w9, x3, x2, [x0]
353 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 16
357 define dso_local i128 @atomicrmw_xchg_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
358 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
359 ; -O0: ldaxp x10, x12, [x9]
362 ; -O0: stlxp w8, x14, x15, [x9]
363 ; -O0: stlxp w8, x10, x12, [x9]
364 ; -O0: subs x12, x12, x13
365 ; -O0: ccmp x10, x11, #0, eq
367 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_acq_rel:
368 ; -O1: ldaxp x1, x8, [x0]
369 ; -O1: stlxp w9, x3, x2, [x0]
370 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 16
374 define dso_local i128 @atomicrmw_xchg_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
375 ; -O0-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
376 ; -O0: ldaxp x10, x12, [x9]
379 ; -O0: stlxp w8, x14, x15, [x9]
380 ; -O0: stlxp w8, x10, x12, [x9]
381 ; -O0: subs x12, x12, x13
382 ; -O0: ccmp x10, x11, #0, eq
384 ; -O1-LABEL: atomicrmw_xchg_i128_aligned_seq_cst:
385 ; -O1: ldaxp x1, x8, [x0]
386 ; -O1: stlxp w9, x3, x2, [x0]
387 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 16
391 define dso_local i8 @atomicrmw_xchg_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
392 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
393 ; -O0: ldaxrb w8, [x11]
394 ; -O0: cmp w8, w9, uxtb
395 ; -O0: stlxrb w10, w12, [x11]
396 ; -O0: subs w9, w8, w9, uxtb
397 ; -O0: subs w9, w9, #1
399 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_monotonic:
400 ; -O1: ldxrb w8, [x0]
401 ; -O1: stxrb w9, w1, [x0]
402 %r = atomicrmw xchg ptr %ptr, i8 %value monotonic, align 1
406 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acquire(ptr %ptr, i8 %value) {
407 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
408 ; -O0: ldaxrb w8, [x11]
409 ; -O0: cmp w8, w9, uxtb
410 ; -O0: stlxrb w10, w12, [x11]
411 ; -O0: subs w9, w8, w9, uxtb
412 ; -O0: subs w9, w9, #1
414 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_acquire:
415 ; -O1: ldaxrb w8, [x0]
416 ; -O1: stxrb w9, w1, [x0]
417 %r = atomicrmw xchg ptr %ptr, i8 %value acquire, align 1
421 define dso_local i8 @atomicrmw_xchg_i8_unaligned_release(ptr %ptr, i8 %value) {
422 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_release:
423 ; -O0: ldaxrb w8, [x11]
424 ; -O0: cmp w8, w9, uxtb
425 ; -O0: stlxrb w10, w12, [x11]
426 ; -O0: subs w9, w8, w9, uxtb
427 ; -O0: subs w9, w9, #1
429 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_release:
430 ; -O1: ldxrb w8, [x0]
431 ; -O1: stlxrb w9, w1, [x0]
432 %r = atomicrmw xchg ptr %ptr, i8 %value release, align 1
436 define dso_local i8 @atomicrmw_xchg_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
437 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
438 ; -O0: ldaxrb w8, [x11]
439 ; -O0: cmp w8, w9, uxtb
440 ; -O0: stlxrb w10, w12, [x11]
441 ; -O0: subs w9, w8, w9, uxtb
442 ; -O0: subs w9, w9, #1
444 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_acq_rel:
445 ; -O1: ldaxrb w8, [x0]
446 ; -O1: stlxrb w9, w1, [x0]
447 %r = atomicrmw xchg ptr %ptr, i8 %value acq_rel, align 1
451 define dso_local i8 @atomicrmw_xchg_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
452 ; -O0-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
453 ; -O0: ldaxrb w8, [x11]
454 ; -O0: cmp w8, w9, uxtb
455 ; -O0: stlxrb w10, w12, [x11]
456 ; -O0: subs w9, w8, w9, uxtb
457 ; -O0: subs w9, w9, #1
459 ; -O1-LABEL: atomicrmw_xchg_i8_unaligned_seq_cst:
460 ; -O1: ldaxrb w8, [x0]
461 ; -O1: stlxrb w9, w1, [x0]
462 %r = atomicrmw xchg ptr %ptr, i8 %value seq_cst, align 1
466 define dso_local i16 @atomicrmw_xchg_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
467 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_monotonic:
468 ; CHECK: bl __atomic_exchange
469 %r = atomicrmw xchg ptr %ptr, i16 %value monotonic, align 1
473 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acquire(ptr %ptr, i16 %value) {
474 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acquire:
475 ; CHECK: bl __atomic_exchange
476 %r = atomicrmw xchg ptr %ptr, i16 %value acquire, align 1
480 define dso_local i16 @atomicrmw_xchg_i16_unaligned_release(ptr %ptr, i16 %value) {
481 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_release:
482 ; CHECK: bl __atomic_exchange
483 %r = atomicrmw xchg ptr %ptr, i16 %value release, align 1
487 define dso_local i16 @atomicrmw_xchg_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
488 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_acq_rel:
489 ; CHECK: bl __atomic_exchange
490 %r = atomicrmw xchg ptr %ptr, i16 %value acq_rel, align 1
494 define dso_local i16 @atomicrmw_xchg_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
495 ; CHECK-LABEL: atomicrmw_xchg_i16_unaligned_seq_cst:
496 ; CHECK: bl __atomic_exchange
497 %r = atomicrmw xchg ptr %ptr, i16 %value seq_cst, align 1
501 define dso_local i32 @atomicrmw_xchg_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
502 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_monotonic:
503 ; CHECK: bl __atomic_exchange
504 %r = atomicrmw xchg ptr %ptr, i32 %value monotonic, align 1
508 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acquire(ptr %ptr, i32 %value) {
509 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acquire:
510 ; CHECK: bl __atomic_exchange
511 %r = atomicrmw xchg ptr %ptr, i32 %value acquire, align 1
515 define dso_local i32 @atomicrmw_xchg_i32_unaligned_release(ptr %ptr, i32 %value) {
516 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_release:
517 ; CHECK: bl __atomic_exchange
518 %r = atomicrmw xchg ptr %ptr, i32 %value release, align 1
522 define dso_local i32 @atomicrmw_xchg_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
523 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_acq_rel:
524 ; CHECK: bl __atomic_exchange
525 %r = atomicrmw xchg ptr %ptr, i32 %value acq_rel, align 1
529 define dso_local i32 @atomicrmw_xchg_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
530 ; CHECK-LABEL: atomicrmw_xchg_i32_unaligned_seq_cst:
531 ; CHECK: bl __atomic_exchange
532 %r = atomicrmw xchg ptr %ptr, i32 %value seq_cst, align 1
536 define dso_local i64 @atomicrmw_xchg_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
537 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_monotonic:
538 ; CHECK: bl __atomic_exchange
539 %r = atomicrmw xchg ptr %ptr, i64 %value monotonic, align 1
543 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acquire(ptr %ptr, i64 %value) {
544 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acquire:
545 ; CHECK: bl __atomic_exchange
546 %r = atomicrmw xchg ptr %ptr, i64 %value acquire, align 1
550 define dso_local i64 @atomicrmw_xchg_i64_unaligned_release(ptr %ptr, i64 %value) {
551 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_release:
552 ; CHECK: bl __atomic_exchange
553 %r = atomicrmw xchg ptr %ptr, i64 %value release, align 1
557 define dso_local i64 @atomicrmw_xchg_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
558 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_acq_rel:
559 ; CHECK: bl __atomic_exchange
560 %r = atomicrmw xchg ptr %ptr, i64 %value acq_rel, align 1
564 define dso_local i64 @atomicrmw_xchg_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
565 ; CHECK-LABEL: atomicrmw_xchg_i64_unaligned_seq_cst:
566 ; CHECK: bl __atomic_exchange
567 %r = atomicrmw xchg ptr %ptr, i64 %value seq_cst, align 1
571 define dso_local i128 @atomicrmw_xchg_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
572 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_monotonic:
573 ; CHECK: bl __atomic_exchange
574 %r = atomicrmw xchg ptr %ptr, i128 %value monotonic, align 1
578 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acquire(ptr %ptr, i128 %value) {
579 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acquire:
580 ; CHECK: bl __atomic_exchange
581 %r = atomicrmw xchg ptr %ptr, i128 %value acquire, align 1
585 define dso_local i128 @atomicrmw_xchg_i128_unaligned_release(ptr %ptr, i128 %value) {
586 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_release:
587 ; CHECK: bl __atomic_exchange
588 %r = atomicrmw xchg ptr %ptr, i128 %value release, align 1
592 define dso_local i128 @atomicrmw_xchg_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
593 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_acq_rel:
594 ; CHECK: bl __atomic_exchange
595 %r = atomicrmw xchg ptr %ptr, i128 %value acq_rel, align 1
599 define dso_local i128 @atomicrmw_xchg_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
600 ; CHECK-LABEL: atomicrmw_xchg_i128_unaligned_seq_cst:
601 ; CHECK: bl __atomic_exchange
602 %r = atomicrmw xchg ptr %ptr, i128 %value seq_cst, align 1
606 define dso_local i8 @atomicrmw_add_i8_aligned_monotonic(ptr %ptr, i8 %value) {
607 ; -O0-LABEL: atomicrmw_add_i8_aligned_monotonic:
608 ; -O0: add w12, w9, w8
609 ; -O0: ldaxrb w8, [x11]
610 ; -O0: cmp w8, w9, uxtb
611 ; -O0: stlxrb w10, w12, [x11]
612 ; -O0: subs w9, w8, w9, uxtb
613 ; -O0: subs w9, w9, #1
615 ; -O1-LABEL: atomicrmw_add_i8_aligned_monotonic:
616 ; -O1: ldxrb w8, [x0]
617 ; -O1: add w9, w8, w1
618 ; -O1: stxrb w10, w9, [x0]
619 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
623 define dso_local i8 @atomicrmw_add_i8_aligned_acquire(ptr %ptr, i8 %value) {
624 ; -O0-LABEL: atomicrmw_add_i8_aligned_acquire:
625 ; -O0: add w12, w9, w8
626 ; -O0: ldaxrb w8, [x11]
627 ; -O0: cmp w8, w9, uxtb
628 ; -O0: stlxrb w10, w12, [x11]
629 ; -O0: subs w9, w8, w9, uxtb
630 ; -O0: subs w9, w9, #1
632 ; -O1-LABEL: atomicrmw_add_i8_aligned_acquire:
633 ; -O1: ldaxrb w8, [x0]
634 ; -O1: add w9, w8, w1
635 ; -O1: stxrb w10, w9, [x0]
636 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
640 define dso_local i8 @atomicrmw_add_i8_aligned_release(ptr %ptr, i8 %value) {
641 ; -O0-LABEL: atomicrmw_add_i8_aligned_release:
642 ; -O0: add w12, w9, w8
643 ; -O0: ldaxrb w8, [x11]
644 ; -O0: cmp w8, w9, uxtb
645 ; -O0: stlxrb w10, w12, [x11]
646 ; -O0: subs w9, w8, w9, uxtb
647 ; -O0: subs w9, w9, #1
649 ; -O1-LABEL: atomicrmw_add_i8_aligned_release:
650 ; -O1: ldxrb w8, [x0]
651 ; -O1: add w9, w8, w1
652 ; -O1: stlxrb w10, w9, [x0]
653 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
657 define dso_local i8 @atomicrmw_add_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
658 ; -O0-LABEL: atomicrmw_add_i8_aligned_acq_rel:
659 ; -O0: add w12, w9, w8
660 ; -O0: ldaxrb w8, [x11]
661 ; -O0: cmp w8, w9, uxtb
662 ; -O0: stlxrb w10, w12, [x11]
663 ; -O0: subs w9, w8, w9, uxtb
664 ; -O0: subs w9, w9, #1
666 ; -O1-LABEL: atomicrmw_add_i8_aligned_acq_rel:
667 ; -O1: ldaxrb w8, [x0]
668 ; -O1: add w9, w8, w1
669 ; -O1: stlxrb w10, w9, [x0]
670 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
674 define dso_local i8 @atomicrmw_add_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
675 ; -O0-LABEL: atomicrmw_add_i8_aligned_seq_cst:
676 ; -O0: add w12, w9, w8
677 ; -O0: ldaxrb w8, [x11]
678 ; -O0: cmp w8, w9, uxtb
679 ; -O0: stlxrb w10, w12, [x11]
680 ; -O0: subs w9, w8, w9, uxtb
681 ; -O0: subs w9, w9, #1
683 ; -O1-LABEL: atomicrmw_add_i8_aligned_seq_cst:
684 ; -O1: ldaxrb w8, [x0]
685 ; -O1: add w9, w8, w1
686 ; -O1: stlxrb w10, w9, [x0]
687 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
691 define dso_local i16 @atomicrmw_add_i16_aligned_monotonic(ptr %ptr, i16 %value) {
692 ; -O0-LABEL: atomicrmw_add_i16_aligned_monotonic:
693 ; -O0: add w12, w9, w8
694 ; -O0: ldaxrh w8, [x11]
695 ; -O0: cmp w8, w9, uxth
696 ; -O0: stlxrh w10, w12, [x11]
697 ; -O0: subs w9, w8, w9, uxth
698 ; -O0: subs w9, w9, #1
700 ; -O1-LABEL: atomicrmw_add_i16_aligned_monotonic:
701 ; -O1: ldxrh w8, [x0]
702 ; -O1: add w9, w8, w1
703 ; -O1: stxrh w10, w9, [x0]
704 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 2
708 define dso_local i16 @atomicrmw_add_i16_aligned_acquire(ptr %ptr, i16 %value) {
709 ; -O0-LABEL: atomicrmw_add_i16_aligned_acquire:
710 ; -O0: add w12, w9, w8
711 ; -O0: ldaxrh w8, [x11]
712 ; -O0: cmp w8, w9, uxth
713 ; -O0: stlxrh w10, w12, [x11]
714 ; -O0: subs w9, w8, w9, uxth
715 ; -O0: subs w9, w9, #1
717 ; -O1-LABEL: atomicrmw_add_i16_aligned_acquire:
718 ; -O1: ldaxrh w8, [x0]
719 ; -O1: add w9, w8, w1
720 ; -O1: stxrh w10, w9, [x0]
721 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 2
725 define dso_local i16 @atomicrmw_add_i16_aligned_release(ptr %ptr, i16 %value) {
726 ; -O0-LABEL: atomicrmw_add_i16_aligned_release:
727 ; -O0: add w12, w9, w8
728 ; -O0: ldaxrh w8, [x11]
729 ; -O0: cmp w8, w9, uxth
730 ; -O0: stlxrh w10, w12, [x11]
731 ; -O0: subs w9, w8, w9, uxth
732 ; -O0: subs w9, w9, #1
734 ; -O1-LABEL: atomicrmw_add_i16_aligned_release:
735 ; -O1: ldxrh w8, [x0]
736 ; -O1: add w9, w8, w1
737 ; -O1: stlxrh w10, w9, [x0]
738 %r = atomicrmw add ptr %ptr, i16 %value release, align 2
742 define dso_local i16 @atomicrmw_add_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
743 ; -O0-LABEL: atomicrmw_add_i16_aligned_acq_rel:
744 ; -O0: add w12, w9, w8
745 ; -O0: ldaxrh w8, [x11]
746 ; -O0: cmp w8, w9, uxth
747 ; -O0: stlxrh w10, w12, [x11]
748 ; -O0: subs w9, w8, w9, uxth
749 ; -O0: subs w9, w9, #1
751 ; -O1-LABEL: atomicrmw_add_i16_aligned_acq_rel:
752 ; -O1: ldaxrh w8, [x0]
753 ; -O1: add w9, w8, w1
754 ; -O1: stlxrh w10, w9, [x0]
755 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 2
759 define dso_local i16 @atomicrmw_add_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
760 ; -O0-LABEL: atomicrmw_add_i16_aligned_seq_cst:
761 ; -O0: add w12, w9, w8
762 ; -O0: ldaxrh w8, [x11]
763 ; -O0: cmp w8, w9, uxth
764 ; -O0: stlxrh w10, w12, [x11]
765 ; -O0: subs w9, w8, w9, uxth
766 ; -O0: subs w9, w9, #1
768 ; -O1-LABEL: atomicrmw_add_i16_aligned_seq_cst:
769 ; -O1: ldaxrh w8, [x0]
770 ; -O1: add w9, w8, w1
771 ; -O1: stlxrh w10, w9, [x0]
772 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 2
776 define dso_local i32 @atomicrmw_add_i32_aligned_monotonic(ptr %ptr, i32 %value) {
777 ; -O0-LABEL: atomicrmw_add_i32_aligned_monotonic:
778 ; -O0: add w12, w9, w8
779 ; -O0: ldaxr w8, [x11]
781 ; -O0: stlxr w10, w12, [x11]
782 ; -O0: subs w9, w8, w9
783 ; -O0: subs w9, w9, #1
785 ; -O1-LABEL: atomicrmw_add_i32_aligned_monotonic:
787 ; -O1: add w9, w8, w1
788 ; -O1: stxr w10, w9, [x0]
789 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 4
793 define dso_local i32 @atomicrmw_add_i32_aligned_acquire(ptr %ptr, i32 %value) {
794 ; -O0-LABEL: atomicrmw_add_i32_aligned_acquire:
795 ; -O0: add w12, w9, w8
796 ; -O0: ldaxr w8, [x11]
798 ; -O0: stlxr w10, w12, [x11]
799 ; -O0: subs w9, w8, w9
800 ; -O0: subs w9, w9, #1
802 ; -O1-LABEL: atomicrmw_add_i32_aligned_acquire:
803 ; -O1: ldaxr w8, [x0]
804 ; -O1: add w9, w8, w1
805 ; -O1: stxr w10, w9, [x0]
806 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 4
810 define dso_local i32 @atomicrmw_add_i32_aligned_release(ptr %ptr, i32 %value) {
811 ; -O0-LABEL: atomicrmw_add_i32_aligned_release:
812 ; -O0: add w12, w9, w8
813 ; -O0: ldaxr w8, [x11]
815 ; -O0: stlxr w10, w12, [x11]
816 ; -O0: subs w9, w8, w9
817 ; -O0: subs w9, w9, #1
819 ; -O1-LABEL: atomicrmw_add_i32_aligned_release:
821 ; -O1: add w9, w8, w1
822 ; -O1: stlxr w10, w9, [x0]
823 %r = atomicrmw add ptr %ptr, i32 %value release, align 4
827 define dso_local i32 @atomicrmw_add_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
828 ; -O0-LABEL: atomicrmw_add_i32_aligned_acq_rel:
829 ; -O0: add w12, w9, w8
830 ; -O0: ldaxr w8, [x11]
832 ; -O0: stlxr w10, w12, [x11]
833 ; -O0: subs w9, w8, w9
834 ; -O0: subs w9, w9, #1
836 ; -O1-LABEL: atomicrmw_add_i32_aligned_acq_rel:
837 ; -O1: ldaxr w8, [x0]
838 ; -O1: add w9, w8, w1
839 ; -O1: stlxr w10, w9, [x0]
840 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 4
844 define dso_local i32 @atomicrmw_add_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
845 ; -O0-LABEL: atomicrmw_add_i32_aligned_seq_cst:
846 ; -O0: add w12, w9, w8
847 ; -O0: ldaxr w8, [x11]
849 ; -O0: stlxr w10, w12, [x11]
850 ; -O0: subs w9, w8, w9
851 ; -O0: subs w9, w9, #1
853 ; -O1-LABEL: atomicrmw_add_i32_aligned_seq_cst:
854 ; -O1: ldaxr w8, [x0]
855 ; -O1: add w9, w8, w1
856 ; -O1: stlxr w10, w9, [x0]
857 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 4
861 define dso_local i64 @atomicrmw_add_i64_aligned_monotonic(ptr %ptr, i64 %value) {
862 ; -O0-LABEL: atomicrmw_add_i64_aligned_monotonic:
863 ; -O0: add x12, x9, x8
864 ; -O0: ldaxr x8, [x11]
866 ; -O0: stlxr w10, x12, [x11]
867 ; -O0: subs x9, x8, x9
868 ; -O0: subs w9, w9, #1
870 ; -O1-LABEL: atomicrmw_add_i64_aligned_monotonic:
872 ; -O1: add x9, x0, x1
873 ; -O1: stxr w10, x9, [x8]
874 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 8
878 define dso_local i64 @atomicrmw_add_i64_aligned_acquire(ptr %ptr, i64 %value) {
879 ; -O0-LABEL: atomicrmw_add_i64_aligned_acquire:
880 ; -O0: add x12, x9, x8
881 ; -O0: ldaxr x8, [x11]
883 ; -O0: stlxr w10, x12, [x11]
884 ; -O0: subs x9, x8, x9
885 ; -O0: subs w9, w9, #1
887 ; -O1-LABEL: atomicrmw_add_i64_aligned_acquire:
888 ; -O1: ldaxr x0, [x8]
889 ; -O1: add x9, x0, x1
890 ; -O1: stxr w10, x9, [x8]
891 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 8
895 define dso_local i64 @atomicrmw_add_i64_aligned_release(ptr %ptr, i64 %value) {
896 ; -O0-LABEL: atomicrmw_add_i64_aligned_release:
897 ; -O0: add x12, x9, x8
898 ; -O0: ldaxr x8, [x11]
900 ; -O0: stlxr w10, x12, [x11]
901 ; -O0: subs x9, x8, x9
902 ; -O0: subs w9, w9, #1
904 ; -O1-LABEL: atomicrmw_add_i64_aligned_release:
906 ; -O1: add x9, x0, x1
907 ; -O1: stlxr w10, x9, [x8]
908 %r = atomicrmw add ptr %ptr, i64 %value release, align 8
912 define dso_local i64 @atomicrmw_add_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
913 ; -O0-LABEL: atomicrmw_add_i64_aligned_acq_rel:
914 ; -O0: add x12, x9, x8
915 ; -O0: ldaxr x8, [x11]
917 ; -O0: stlxr w10, x12, [x11]
918 ; -O0: subs x9, x8, x9
919 ; -O0: subs w9, w9, #1
921 ; -O1-LABEL: atomicrmw_add_i64_aligned_acq_rel:
922 ; -O1: ldaxr x0, [x8]
923 ; -O1: add x9, x0, x1
924 ; -O1: stlxr w10, x9, [x8]
925 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 8
929 define dso_local i64 @atomicrmw_add_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
930 ; -O0-LABEL: atomicrmw_add_i64_aligned_seq_cst:
931 ; -O0: add x12, x9, x8
932 ; -O0: ldaxr x8, [x11]
934 ; -O0: stlxr w10, x12, [x11]
935 ; -O0: subs x9, x8, x9
936 ; -O0: subs w9, w9, #1
938 ; -O1-LABEL: atomicrmw_add_i64_aligned_seq_cst:
939 ; -O1: ldaxr x0, [x8]
940 ; -O1: add x9, x0, x1
941 ; -O1: stlxr w10, x9, [x8]
942 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 8
946 define dso_local i128 @atomicrmw_add_i128_aligned_monotonic(ptr %ptr, i128 %value) {
947 ; -O0-LABEL: atomicrmw_add_i128_aligned_monotonic:
948 ; -O0: adds x14, x11, x10
949 ; -O0: ldxp x10, x12, [x9]
952 ; -O0: stxp w8, x14, x15, [x9]
953 ; -O0: stxp w8, x10, x12, [x9]
954 ; -O0: subs x12, x12, x13
955 ; -O0: ccmp x10, x11, #0, eq
957 ; -O1-LABEL: atomicrmw_add_i128_aligned_monotonic:
958 ; -O1: ldxp x1, x0, [x8]
959 ; -O1: adds x9, x1, x3
960 ; -O1: stxp w11, x9, x10, [x8]
961 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 16
965 define dso_local i128 @atomicrmw_add_i128_aligned_acquire(ptr %ptr, i128 %value) {
966 ; -O0-LABEL: atomicrmw_add_i128_aligned_acquire:
967 ; -O0: adds x14, x11, x10
968 ; -O0: ldaxp x10, x12, [x9]
971 ; -O0: stxp w8, x14, x15, [x9]
972 ; -O0: stxp w8, x10, x12, [x9]
973 ; -O0: subs x12, x12, x13
974 ; -O0: ccmp x10, x11, #0, eq
976 ; -O1-LABEL: atomicrmw_add_i128_aligned_acquire:
977 ; -O1: ldaxp x1, x0, [x8]
978 ; -O1: adds x9, x1, x3
979 ; -O1: stxp w11, x9, x10, [x8]
980 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 16
984 define dso_local i128 @atomicrmw_add_i128_aligned_release(ptr %ptr, i128 %value) {
985 ; -O0-LABEL: atomicrmw_add_i128_aligned_release:
986 ; -O0: adds x14, x11, x10
987 ; -O0: ldxp x10, x12, [x9]
990 ; -O0: stlxp w8, x14, x15, [x9]
991 ; -O0: stlxp w8, x10, x12, [x9]
992 ; -O0: subs x12, x12, x13
993 ; -O0: ccmp x10, x11, #0, eq
995 ; -O1-LABEL: atomicrmw_add_i128_aligned_release:
996 ; -O1: ldxp x1, x0, [x8]
997 ; -O1: adds x9, x1, x3
998 ; -O1: stlxp w11, x9, x10, [x8]
999 %r = atomicrmw add ptr %ptr, i128 %value release, align 16
1003 define dso_local i128 @atomicrmw_add_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1004 ; -O0-LABEL: atomicrmw_add_i128_aligned_acq_rel:
1005 ; -O0: adds x14, x11, x10
1006 ; -O0: ldaxp x10, x12, [x9]
1009 ; -O0: stlxp w8, x14, x15, [x9]
1010 ; -O0: stlxp w8, x10, x12, [x9]
1011 ; -O0: subs x12, x12, x13
1012 ; -O0: ccmp x10, x11, #0, eq
1014 ; -O1-LABEL: atomicrmw_add_i128_aligned_acq_rel:
1015 ; -O1: ldaxp x1, x0, [x8]
1016 ; -O1: adds x9, x1, x3
1017 ; -O1: stlxp w11, x9, x10, [x8]
1018 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 16
1022 define dso_local i128 @atomicrmw_add_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1023 ; -O0-LABEL: atomicrmw_add_i128_aligned_seq_cst:
1024 ; -O0: adds x14, x11, x10
1025 ; -O0: ldaxp x10, x12, [x9]
1028 ; -O0: stlxp w8, x14, x15, [x9]
1029 ; -O0: stlxp w8, x10, x12, [x9]
1030 ; -O0: subs x12, x12, x13
1031 ; -O0: ccmp x10, x11, #0, eq
1033 ; -O1-LABEL: atomicrmw_add_i128_aligned_seq_cst:
1034 ; -O1: ldaxp x1, x0, [x8]
1035 ; -O1: adds x9, x1, x3
1036 ; -O1: stlxp w11, x9, x10, [x8]
1037 %r = atomicrmw add ptr %ptr, i128 %value seq_cst, align 16
1041 define dso_local i8 @atomicrmw_add_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1042 ; -O0-LABEL: atomicrmw_add_i8_unaligned_monotonic:
1043 ; -O0: add w12, w9, w8
1044 ; -O0: ldaxrb w8, [x11]
1045 ; -O0: cmp w8, w9, uxtb
1046 ; -O0: stlxrb w10, w12, [x11]
1047 ; -O0: subs w9, w8, w9, uxtb
1048 ; -O0: subs w9, w9, #1
1050 ; -O1-LABEL: atomicrmw_add_i8_unaligned_monotonic:
1051 ; -O1: ldxrb w8, [x0]
1052 ; -O1: add w9, w8, w1
1053 ; -O1: stxrb w10, w9, [x0]
1054 %r = atomicrmw add ptr %ptr, i8 %value monotonic, align 1
1058 define dso_local i8 @atomicrmw_add_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1059 ; -O0-LABEL: atomicrmw_add_i8_unaligned_acquire:
1060 ; -O0: add w12, w9, w8
1061 ; -O0: ldaxrb w8, [x11]
1062 ; -O0: cmp w8, w9, uxtb
1063 ; -O0: stlxrb w10, w12, [x11]
1064 ; -O0: subs w9, w8, w9, uxtb
1065 ; -O0: subs w9, w9, #1
1067 ; -O1-LABEL: atomicrmw_add_i8_unaligned_acquire:
1068 ; -O1: ldaxrb w8, [x0]
1069 ; -O1: add w9, w8, w1
1070 ; -O1: stxrb w10, w9, [x0]
1071 %r = atomicrmw add ptr %ptr, i8 %value acquire, align 1
1075 define dso_local i8 @atomicrmw_add_i8_unaligned_release(ptr %ptr, i8 %value) {
1076 ; -O0-LABEL: atomicrmw_add_i8_unaligned_release:
1077 ; -O0: add w12, w9, w8
1078 ; -O0: ldaxrb w8, [x11]
1079 ; -O0: cmp w8, w9, uxtb
1080 ; -O0: stlxrb w10, w12, [x11]
1081 ; -O0: subs w9, w8, w9, uxtb
1082 ; -O0: subs w9, w9, #1
1084 ; -O1-LABEL: atomicrmw_add_i8_unaligned_release:
1085 ; -O1: ldxrb w8, [x0]
1086 ; -O1: add w9, w8, w1
1087 ; -O1: stlxrb w10, w9, [x0]
1088 %r = atomicrmw add ptr %ptr, i8 %value release, align 1
1092 define dso_local i8 @atomicrmw_add_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1093 ; -O0-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
1094 ; -O0: add w12, w9, w8
1095 ; -O0: ldaxrb w8, [x11]
1096 ; -O0: cmp w8, w9, uxtb
1097 ; -O0: stlxrb w10, w12, [x11]
1098 ; -O0: subs w9, w8, w9, uxtb
1099 ; -O0: subs w9, w9, #1
1101 ; -O1-LABEL: atomicrmw_add_i8_unaligned_acq_rel:
1102 ; -O1: ldaxrb w8, [x0]
1103 ; -O1: add w9, w8, w1
1104 ; -O1: stlxrb w10, w9, [x0]
1105 %r = atomicrmw add ptr %ptr, i8 %value acq_rel, align 1
1109 define dso_local i8 @atomicrmw_add_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1110 ; -O0-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
1111 ; -O0: add w12, w9, w8
1112 ; -O0: ldaxrb w8, [x11]
1113 ; -O0: cmp w8, w9, uxtb
1114 ; -O0: stlxrb w10, w12, [x11]
1115 ; -O0: subs w9, w8, w9, uxtb
1116 ; -O0: subs w9, w9, #1
1118 ; -O1-LABEL: atomicrmw_add_i8_unaligned_seq_cst:
1119 ; -O1: ldaxrb w8, [x0]
1120 ; -O1: add w9, w8, w1
1121 ; -O1: stlxrb w10, w9, [x0]
1122 %r = atomicrmw add ptr %ptr, i8 %value seq_cst, align 1
1126 define dso_local i16 @atomicrmw_add_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1127 ; -O0-LABEL: atomicrmw_add_i16_unaligned_monotonic:
1128 ; -O0: add w8, w9, w8
1129 ; -O0: bl __atomic_compare_exchange
1131 ; -O1-LABEL: atomicrmw_add_i16_unaligned_monotonic:
1132 ; -O1: add w8, w0, w20
1133 ; -O1: bl __atomic_compare_exchange
1134 %r = atomicrmw add ptr %ptr, i16 %value monotonic, align 1
1138 define dso_local i16 @atomicrmw_add_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1139 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acquire:
1140 ; -O0: add w8, w9, w8
1141 ; -O0: bl __atomic_compare_exchange
1143 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acquire:
1144 ; -O1: add w8, w0, w20
1145 ; -O1: bl __atomic_compare_exchange
1146 %r = atomicrmw add ptr %ptr, i16 %value acquire, align 1
1150 define dso_local i16 @atomicrmw_add_i16_unaligned_release(ptr %ptr, i16 %value) {
1151 ; -O0-LABEL: atomicrmw_add_i16_unaligned_release:
1152 ; -O0: add w8, w9, w8
1153 ; -O0: bl __atomic_compare_exchange
1155 ; -O1-LABEL: atomicrmw_add_i16_unaligned_release:
1156 ; -O1: add w8, w0, w20
1157 ; -O1: bl __atomic_compare_exchange
1158 %r = atomicrmw add ptr %ptr, i16 %value release, align 1
1162 define dso_local i16 @atomicrmw_add_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1163 ; -O0-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
1164 ; -O0: add w8, w9, w8
1165 ; -O0: bl __atomic_compare_exchange
1167 ; -O1-LABEL: atomicrmw_add_i16_unaligned_acq_rel:
1168 ; -O1: add w8, w0, w20
1169 ; -O1: bl __atomic_compare_exchange
1170 %r = atomicrmw add ptr %ptr, i16 %value acq_rel, align 1
1174 define dso_local i16 @atomicrmw_add_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1175 ; -O0-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
1176 ; -O0: add w8, w9, w8
1177 ; -O0: bl __atomic_compare_exchange
1179 ; -O1-LABEL: atomicrmw_add_i16_unaligned_seq_cst:
1180 ; -O1: add w8, w0, w20
1181 ; -O1: bl __atomic_compare_exchange
1182 %r = atomicrmw add ptr %ptr, i16 %value seq_cst, align 1
1186 define dso_local i32 @atomicrmw_add_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1187 ; -O0-LABEL: atomicrmw_add_i32_unaligned_monotonic:
1188 ; -O0: add w8, w9, w8
1189 ; -O0: bl __atomic_compare_exchange
1191 ; -O1-LABEL: atomicrmw_add_i32_unaligned_monotonic:
1192 ; -O1: add w8, w0, w20
1193 ; -O1: bl __atomic_compare_exchange
1194 %r = atomicrmw add ptr %ptr, i32 %value monotonic, align 1
1198 define dso_local i32 @atomicrmw_add_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1199 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acquire:
1200 ; -O0: add w8, w9, w8
1201 ; -O0: bl __atomic_compare_exchange
1203 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acquire:
1204 ; -O1: add w8, w0, w20
1205 ; -O1: bl __atomic_compare_exchange
1206 %r = atomicrmw add ptr %ptr, i32 %value acquire, align 1
1210 define dso_local i32 @atomicrmw_add_i32_unaligned_release(ptr %ptr, i32 %value) {
1211 ; -O0-LABEL: atomicrmw_add_i32_unaligned_release:
1212 ; -O0: add w8, w9, w8
1213 ; -O0: bl __atomic_compare_exchange
1215 ; -O1-LABEL: atomicrmw_add_i32_unaligned_release:
1216 ; -O1: add w8, w0, w20
1217 ; -O1: bl __atomic_compare_exchange
1218 %r = atomicrmw add ptr %ptr, i32 %value release, align 1
1222 define dso_local i32 @atomicrmw_add_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1223 ; -O0-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
1224 ; -O0: add w8, w9, w8
1225 ; -O0: bl __atomic_compare_exchange
1227 ; -O1-LABEL: atomicrmw_add_i32_unaligned_acq_rel:
1228 ; -O1: add w8, w0, w20
1229 ; -O1: bl __atomic_compare_exchange
1230 %r = atomicrmw add ptr %ptr, i32 %value acq_rel, align 1
1234 define dso_local i32 @atomicrmw_add_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
1235 ; -O0-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
1236 ; -O0: add w8, w9, w8
1237 ; -O0: bl __atomic_compare_exchange
1239 ; -O1-LABEL: atomicrmw_add_i32_unaligned_seq_cst:
1240 ; -O1: add w8, w0, w20
1241 ; -O1: bl __atomic_compare_exchange
1242 %r = atomicrmw add ptr %ptr, i32 %value seq_cst, align 1
1246 define dso_local i64 @atomicrmw_add_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
1247 ; -O0-LABEL: atomicrmw_add_i64_unaligned_monotonic:
1248 ; -O0: add x8, x9, x8
1249 ; -O0: bl __atomic_compare_exchange
1251 ; -O1-LABEL: atomicrmw_add_i64_unaligned_monotonic:
1252 ; -O1: add x8, x0, x20
1253 ; -O1: bl __atomic_compare_exchange
1254 %r = atomicrmw add ptr %ptr, i64 %value monotonic, align 1
1258 define dso_local i64 @atomicrmw_add_i64_unaligned_acquire(ptr %ptr, i64 %value) {
1259 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acquire:
1260 ; -O0: add x8, x9, x8
1261 ; -O0: bl __atomic_compare_exchange
1263 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acquire:
1264 ; -O1: add x8, x0, x20
1265 ; -O1: bl __atomic_compare_exchange
1266 %r = atomicrmw add ptr %ptr, i64 %value acquire, align 1
1270 define dso_local i64 @atomicrmw_add_i64_unaligned_release(ptr %ptr, i64 %value) {
1271 ; -O0-LABEL: atomicrmw_add_i64_unaligned_release:
1272 ; -O0: add x8, x9, x8
1273 ; -O0: bl __atomic_compare_exchange
1275 ; -O1-LABEL: atomicrmw_add_i64_unaligned_release:
1276 ; -O1: add x8, x0, x20
1277 ; -O1: bl __atomic_compare_exchange
1278 %r = atomicrmw add ptr %ptr, i64 %value release, align 1
1282 define dso_local i64 @atomicrmw_add_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
1283 ; -O0-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
1284 ; -O0: add x8, x9, x8
1285 ; -O0: bl __atomic_compare_exchange
1287 ; -O1-LABEL: atomicrmw_add_i64_unaligned_acq_rel:
1288 ; -O1: add x8, x0, x20
1289 ; -O1: bl __atomic_compare_exchange
1290 %r = atomicrmw add ptr %ptr, i64 %value acq_rel, align 1
1294 define dso_local i64 @atomicrmw_add_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
1295 ; -O0-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
1296 ; -O0: add x8, x9, x8
1297 ; -O0: bl __atomic_compare_exchange
1299 ; -O1-LABEL: atomicrmw_add_i64_unaligned_seq_cst:
1300 ; -O1: add x8, x0, x20
1301 ; -O1: bl __atomic_compare_exchange
1302 %r = atomicrmw add ptr %ptr, i64 %value seq_cst, align 1
1306 define dso_local i128 @atomicrmw_add_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
1307 ; -O0-LABEL: atomicrmw_add_i128_unaligned_monotonic:
1308 ; -O0: adds x9, x10, x9
1309 ; -O0: bl __atomic_compare_exchange
1311 ; -O1-LABEL: atomicrmw_add_i128_unaligned_monotonic:
1312 ; -O1: ldp x0, x1, [x0]
1313 ; -O1: adds x8, x1, x19
1314 ; -O1: bl __atomic_compare_exchange
1315 %r = atomicrmw add ptr %ptr, i128 %value monotonic, align 1
1319 define dso_local i128 @atomicrmw_add_i128_unaligned_acquire(ptr %ptr, i128 %value) {
1320 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acquire:
1321 ; -O0: adds x9, x10, x9
1322 ; -O0: bl __atomic_compare_exchange
1324 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acquire:
1325 ; -O1: ldp x0, x1, [x0]
1326 ; -O1: adds x8, x1, x19
1327 ; -O1: bl __atomic_compare_exchange
1328 %r = atomicrmw add ptr %ptr, i128 %value acquire, align 1
1332 define dso_local i128 @atomicrmw_add_i128_unaligned_release(ptr %ptr, i128 %value) {
1333 ; -O0-LABEL: atomicrmw_add_i128_unaligned_release:
1334 ; -O0: adds x9, x10, x9
1335 ; -O0: bl __atomic_compare_exchange
1337 ; -O1-LABEL: atomicrmw_add_i128_unaligned_release:
1338 ; -O1: ldp x0, x1, [x0]
1339 ; -O1: adds x8, x1, x19
1340 ; -O1: bl __atomic_compare_exchange
1341 %r = atomicrmw add ptr %ptr, i128 %value release, align 1
1345 define dso_local i128 @atomicrmw_add_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
1346 ; -O0-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
1347 ; -O0: adds x9, x10, x9
1348 ; -O0: bl __atomic_compare_exchange
1350 ; -O1-LABEL: atomicrmw_add_i128_unaligned_acq_rel:
1351 ; -O1: ldp x0, x1, [x0]
1352 ; -O1: adds x8, x1, x19
1353 ; -O1: bl __atomic_compare_exchange
1354 %r = atomicrmw add ptr %ptr, i128 %value acq_rel, align 1
1358 define dso_local i128 @atomicrmw_add_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
1359 ; -O0-LABEL: atomicrmw_add_i128_unaligned_seq_cst:
1360 ; -O0: adds x9, x10, x9
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, x1, x19
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, w9, w8
1374 ; -O0: ldaxrb w8, [x11]
1375 ; -O0: cmp w8, w9, uxtb
1376 ; -O0: stlxrb w10, w12, [x11]
1377 ; -O0: subs w9, w8, w9, uxtb
1378 ; -O0: subs w9, w9, #1
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, w9, w8
1391 ; -O0: ldaxrb w8, [x11]
1392 ; -O0: cmp w8, w9, uxtb
1393 ; -O0: stlxrb w10, w12, [x11]
1394 ; -O0: subs w9, w8, w9, uxtb
1395 ; -O0: subs w9, w9, #1
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, w9, w8
1408 ; -O0: ldaxrb w8, [x11]
1409 ; -O0: cmp w8, w9, uxtb
1410 ; -O0: stlxrb w10, w12, [x11]
1411 ; -O0: subs w9, w8, w9, uxtb
1412 ; -O0: subs w9, w9, #1
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, w9, w8
1425 ; -O0: ldaxrb w8, [x11]
1426 ; -O0: cmp w8, w9, uxtb
1427 ; -O0: stlxrb w10, w12, [x11]
1428 ; -O0: subs w9, w8, w9, uxtb
1429 ; -O0: subs w9, w9, #1
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, w9, w8
1442 ; -O0: ldaxrb w8, [x11]
1443 ; -O0: cmp w8, w9, uxtb
1444 ; -O0: stlxrb w10, w12, [x11]
1445 ; -O0: subs w9, w8, w9, uxtb
1446 ; -O0: subs w9, w9, #1
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, w9, w8
1459 ; -O0: ldaxrh w8, [x11]
1460 ; -O0: cmp w8, w9, uxth
1461 ; -O0: stlxrh w10, w12, [x11]
1462 ; -O0: subs w9, w8, w9, uxth
1463 ; -O0: subs w9, w9, #1
1465 ; -O1-LABEL: atomicrmw_sub_i16_aligned_monotonic:
1466 ; -O1: ldxrh w8, [x0]
1467 ; -O1: sub w9, w8, w1
1468 ; -O1: stxrh w10, w9, [x0]
1469 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 2
1473 define dso_local i16 @atomicrmw_sub_i16_aligned_acquire(ptr %ptr, i16 %value) {
1474 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acquire:
1475 ; -O0: subs w12, w9, w8
1476 ; -O0: ldaxrh w8, [x11]
1477 ; -O0: cmp w8, w9, uxth
1478 ; -O0: stlxrh w10, w12, [x11]
1479 ; -O0: subs w9, w8, w9, uxth
1480 ; -O0: subs w9, w9, #1
1482 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acquire:
1483 ; -O1: ldaxrh w8, [x0]
1484 ; -O1: sub w9, w8, w1
1485 ; -O1: stxrh w10, w9, [x0]
1486 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 2
1490 define dso_local i16 @atomicrmw_sub_i16_aligned_release(ptr %ptr, i16 %value) {
1491 ; -O0-LABEL: atomicrmw_sub_i16_aligned_release:
1492 ; -O0: subs w12, w9, w8
1493 ; -O0: ldaxrh w8, [x11]
1494 ; -O0: cmp w8, w9, uxth
1495 ; -O0: stlxrh w10, w12, [x11]
1496 ; -O0: subs w9, w8, w9, uxth
1497 ; -O0: subs w9, w9, #1
1499 ; -O1-LABEL: atomicrmw_sub_i16_aligned_release:
1500 ; -O1: ldxrh w8, [x0]
1501 ; -O1: sub w9, w8, w1
1502 ; -O1: stlxrh w10, w9, [x0]
1503 %r = atomicrmw sub ptr %ptr, i16 %value release, align 2
1507 define dso_local i16 @atomicrmw_sub_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
1508 ; -O0-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1509 ; -O0: subs w12, w9, w8
1510 ; -O0: ldaxrh w8, [x11]
1511 ; -O0: cmp w8, w9, uxth
1512 ; -O0: stlxrh w10, w12, [x11]
1513 ; -O0: subs w9, w8, w9, uxth
1514 ; -O0: subs w9, w9, #1
1516 ; -O1-LABEL: atomicrmw_sub_i16_aligned_acq_rel:
1517 ; -O1: ldaxrh w8, [x0]
1518 ; -O1: sub w9, w8, w1
1519 ; -O1: stlxrh w10, w9, [x0]
1520 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 2
1524 define dso_local i16 @atomicrmw_sub_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
1525 ; -O0-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1526 ; -O0: subs w12, w9, w8
1527 ; -O0: ldaxrh w8, [x11]
1528 ; -O0: cmp w8, w9, uxth
1529 ; -O0: stlxrh w10, w12, [x11]
1530 ; -O0: subs w9, w8, w9, uxth
1531 ; -O0: subs w9, w9, #1
1533 ; -O1-LABEL: atomicrmw_sub_i16_aligned_seq_cst:
1534 ; -O1: ldaxrh w8, [x0]
1535 ; -O1: sub w9, w8, w1
1536 ; -O1: stlxrh w10, w9, [x0]
1537 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 2
1541 define dso_local i32 @atomicrmw_sub_i32_aligned_monotonic(ptr %ptr, i32 %value) {
1542 ; -O0-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1543 ; -O0: subs w12, w9, w8
1544 ; -O0: ldaxr w8, [x11]
1546 ; -O0: stlxr w10, w12, [x11]
1547 ; -O0: subs w9, w8, w9
1548 ; -O0: subs w9, w9, #1
1550 ; -O1-LABEL: atomicrmw_sub_i32_aligned_monotonic:
1551 ; -O1: ldxr w8, [x0]
1552 ; -O1: sub w9, w8, w1
1553 ; -O1: stxr w10, w9, [x0]
1554 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 4
1558 define dso_local i32 @atomicrmw_sub_i32_aligned_acquire(ptr %ptr, i32 %value) {
1559 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acquire:
1560 ; -O0: subs w12, w9, w8
1561 ; -O0: ldaxr w8, [x11]
1563 ; -O0: stlxr w10, w12, [x11]
1564 ; -O0: subs w9, w8, w9
1565 ; -O0: subs w9, w9, #1
1567 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acquire:
1568 ; -O1: ldaxr w8, [x0]
1569 ; -O1: sub w9, w8, w1
1570 ; -O1: stxr w10, w9, [x0]
1571 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 4
1575 define dso_local i32 @atomicrmw_sub_i32_aligned_release(ptr %ptr, i32 %value) {
1576 ; -O0-LABEL: atomicrmw_sub_i32_aligned_release:
1577 ; -O0: subs w12, w9, w8
1578 ; -O0: ldaxr w8, [x11]
1580 ; -O0: stlxr w10, w12, [x11]
1581 ; -O0: subs w9, w8, w9
1582 ; -O0: subs w9, w9, #1
1584 ; -O1-LABEL: atomicrmw_sub_i32_aligned_release:
1585 ; -O1: ldxr w8, [x0]
1586 ; -O1: sub w9, w8, w1
1587 ; -O1: stlxr w10, w9, [x0]
1588 %r = atomicrmw sub ptr %ptr, i32 %value release, align 4
1592 define dso_local i32 @atomicrmw_sub_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
1593 ; -O0-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1594 ; -O0: subs w12, w9, w8
1595 ; -O0: ldaxr w8, [x11]
1597 ; -O0: stlxr w10, w12, [x11]
1598 ; -O0: subs w9, w8, w9
1599 ; -O0: subs w9, w9, #1
1601 ; -O1-LABEL: atomicrmw_sub_i32_aligned_acq_rel:
1602 ; -O1: ldaxr w8, [x0]
1603 ; -O1: sub w9, w8, w1
1604 ; -O1: stlxr w10, w9, [x0]
1605 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 4
1609 define dso_local i32 @atomicrmw_sub_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
1610 ; -O0-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1611 ; -O0: subs w12, w9, w8
1612 ; -O0: ldaxr w8, [x11]
1614 ; -O0: stlxr w10, w12, [x11]
1615 ; -O0: subs w9, w8, w9
1616 ; -O0: subs w9, w9, #1
1618 ; -O1-LABEL: atomicrmw_sub_i32_aligned_seq_cst:
1619 ; -O1: ldaxr w8, [x0]
1620 ; -O1: sub w9, w8, w1
1621 ; -O1: stlxr w10, w9, [x0]
1622 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 4
1626 define dso_local i64 @atomicrmw_sub_i64_aligned_monotonic(ptr %ptr, i64 %value) {
1627 ; -O0-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1628 ; -O0: subs x12, x9, x8
1629 ; -O0: ldaxr x8, [x11]
1631 ; -O0: stlxr w10, x12, [x11]
1632 ; -O0: subs x9, x8, x9
1633 ; -O0: subs w9, w9, #1
1635 ; -O1-LABEL: atomicrmw_sub_i64_aligned_monotonic:
1636 ; -O1: ldxr x0, [x8]
1637 ; -O1: sub x9, x0, x1
1638 ; -O1: stxr w10, x9, [x8]
1639 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 8
1643 define dso_local i64 @atomicrmw_sub_i64_aligned_acquire(ptr %ptr, i64 %value) {
1644 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acquire:
1645 ; -O0: subs x12, x9, x8
1646 ; -O0: ldaxr x8, [x11]
1648 ; -O0: stlxr w10, x12, [x11]
1649 ; -O0: subs x9, x8, x9
1650 ; -O0: subs w9, w9, #1
1652 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acquire:
1653 ; -O1: ldaxr x0, [x8]
1654 ; -O1: sub x9, x0, x1
1655 ; -O1: stxr w10, x9, [x8]
1656 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 8
1660 define dso_local i64 @atomicrmw_sub_i64_aligned_release(ptr %ptr, i64 %value) {
1661 ; -O0-LABEL: atomicrmw_sub_i64_aligned_release:
1662 ; -O0: subs x12, x9, x8
1663 ; -O0: ldaxr x8, [x11]
1665 ; -O0: stlxr w10, x12, [x11]
1666 ; -O0: subs x9, x8, x9
1667 ; -O0: subs w9, w9, #1
1669 ; -O1-LABEL: atomicrmw_sub_i64_aligned_release:
1670 ; -O1: ldxr x0, [x8]
1671 ; -O1: sub x9, x0, x1
1672 ; -O1: stlxr w10, x9, [x8]
1673 %r = atomicrmw sub ptr %ptr, i64 %value release, align 8
1677 define dso_local i64 @atomicrmw_sub_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
1678 ; -O0-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1679 ; -O0: subs x12, x9, x8
1680 ; -O0: ldaxr x8, [x11]
1682 ; -O0: stlxr w10, x12, [x11]
1683 ; -O0: subs x9, x8, x9
1684 ; -O0: subs w9, w9, #1
1686 ; -O1-LABEL: atomicrmw_sub_i64_aligned_acq_rel:
1687 ; -O1: ldaxr x0, [x8]
1688 ; -O1: sub x9, x0, x1
1689 ; -O1: stlxr w10, x9, [x8]
1690 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 8
1694 define dso_local i64 @atomicrmw_sub_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
1695 ; -O0-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1696 ; -O0: subs x12, x9, x8
1697 ; -O0: ldaxr x8, [x11]
1699 ; -O0: stlxr w10, x12, [x11]
1700 ; -O0: subs x9, x8, x9
1701 ; -O0: subs w9, w9, #1
1703 ; -O1-LABEL: atomicrmw_sub_i64_aligned_seq_cst:
1704 ; -O1: ldaxr x0, [x8]
1705 ; -O1: sub x9, x0, x1
1706 ; -O1: stlxr w10, x9, [x8]
1707 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 8
1711 define dso_local i128 @atomicrmw_sub_i128_aligned_monotonic(ptr %ptr, i128 %value) {
1712 ; -O0-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1713 ; -O0: subs x14, x11, x10
1714 ; -O0: ldxp x10, x12, [x9]
1717 ; -O0: stxp w8, x14, x15, [x9]
1718 ; -O0: stxp w8, x10, x12, [x9]
1719 ; -O0: subs x12, x12, x13
1720 ; -O0: ccmp x10, x11, #0, eq
1722 ; -O1-LABEL: atomicrmw_sub_i128_aligned_monotonic:
1723 ; -O1: ldxp x1, x0, [x8]
1724 ; -O1: subs x9, x1, x3
1725 ; -O1: stxp w11, x9, x10, [x8]
1726 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 16
1730 define dso_local i128 @atomicrmw_sub_i128_aligned_acquire(ptr %ptr, i128 %value) {
1731 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acquire:
1732 ; -O0: subs x14, x11, x10
1733 ; -O0: ldaxp x10, x12, [x9]
1736 ; -O0: stxp w8, x14, x15, [x9]
1737 ; -O0: stxp w8, x10, x12, [x9]
1738 ; -O0: subs x12, x12, x13
1739 ; -O0: ccmp x10, x11, #0, eq
1741 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acquire:
1742 ; -O1: ldaxp x1, x0, [x8]
1743 ; -O1: subs x9, x1, x3
1744 ; -O1: stxp w11, x9, x10, [x8]
1745 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 16
1749 define dso_local i128 @atomicrmw_sub_i128_aligned_release(ptr %ptr, i128 %value) {
1750 ; -O0-LABEL: atomicrmw_sub_i128_aligned_release:
1751 ; -O0: subs x14, x11, x10
1752 ; -O0: ldxp x10, x12, [x9]
1755 ; -O0: stlxp w8, x14, x15, [x9]
1756 ; -O0: stlxp w8, x10, x12, [x9]
1757 ; -O0: subs x12, x12, x13
1758 ; -O0: ccmp x10, x11, #0, eq
1760 ; -O1-LABEL: atomicrmw_sub_i128_aligned_release:
1761 ; -O1: ldxp x1, x0, [x8]
1762 ; -O1: subs x9, x1, x3
1763 ; -O1: stlxp w11, x9, x10, [x8]
1764 %r = atomicrmw sub ptr %ptr, i128 %value release, align 16
1768 define dso_local i128 @atomicrmw_sub_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
1769 ; -O0-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1770 ; -O0: subs x14, x11, x10
1771 ; -O0: ldaxp x10, x12, [x9]
1774 ; -O0: stlxp w8, x14, x15, [x9]
1775 ; -O0: stlxp w8, x10, x12, [x9]
1776 ; -O0: subs x12, x12, x13
1777 ; -O0: ccmp x10, x11, #0, eq
1779 ; -O1-LABEL: atomicrmw_sub_i128_aligned_acq_rel:
1780 ; -O1: ldaxp x1, x0, [x8]
1781 ; -O1: subs x9, x1, x3
1782 ; -O1: stlxp w11, x9, x10, [x8]
1783 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 16
1787 define dso_local i128 @atomicrmw_sub_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
1788 ; -O0-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1789 ; -O0: subs x14, x11, x10
1790 ; -O0: ldaxp x10, x12, [x9]
1793 ; -O0: stlxp w8, x14, x15, [x9]
1794 ; -O0: stlxp w8, x10, x12, [x9]
1795 ; -O0: subs x12, x12, x13
1796 ; -O0: ccmp x10, x11, #0, eq
1798 ; -O1-LABEL: atomicrmw_sub_i128_aligned_seq_cst:
1799 ; -O1: ldaxp x1, x0, [x8]
1800 ; -O1: subs x9, x1, x3
1801 ; -O1: stlxp w11, x9, x10, [x8]
1802 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 16
1806 define dso_local i8 @atomicrmw_sub_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
1807 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1808 ; -O0: subs w12, w9, w8
1809 ; -O0: ldaxrb w8, [x11]
1810 ; -O0: cmp w8, w9, uxtb
1811 ; -O0: stlxrb w10, w12, [x11]
1812 ; -O0: subs w9, w8, w9, uxtb
1813 ; -O0: subs w9, w9, #1
1815 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_monotonic:
1816 ; -O1: ldxrb w8, [x0]
1817 ; -O1: sub w9, w8, w1
1818 ; -O1: stxrb w10, w9, [x0]
1819 %r = atomicrmw sub ptr %ptr, i8 %value monotonic, align 1
1823 define dso_local i8 @atomicrmw_sub_i8_unaligned_acquire(ptr %ptr, i8 %value) {
1824 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1825 ; -O0: subs w12, w9, w8
1826 ; -O0: ldaxrb w8, [x11]
1827 ; -O0: cmp w8, w9, uxtb
1828 ; -O0: stlxrb w10, w12, [x11]
1829 ; -O0: subs w9, w8, w9, uxtb
1830 ; -O0: subs w9, w9, #1
1832 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acquire:
1833 ; -O1: ldaxrb w8, [x0]
1834 ; -O1: sub w9, w8, w1
1835 ; -O1: stxrb w10, w9, [x0]
1836 %r = atomicrmw sub ptr %ptr, i8 %value acquire, align 1
1840 define dso_local i8 @atomicrmw_sub_i8_unaligned_release(ptr %ptr, i8 %value) {
1841 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_release:
1842 ; -O0: subs w12, w9, w8
1843 ; -O0: ldaxrb w8, [x11]
1844 ; -O0: cmp w8, w9, uxtb
1845 ; -O0: stlxrb w10, w12, [x11]
1846 ; -O0: subs w9, w8, w9, uxtb
1847 ; -O0: subs w9, w9, #1
1849 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_release:
1850 ; -O1: ldxrb w8, [x0]
1851 ; -O1: sub w9, w8, w1
1852 ; -O1: stlxrb w10, w9, [x0]
1853 %r = atomicrmw sub ptr %ptr, i8 %value release, align 1
1857 define dso_local i8 @atomicrmw_sub_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
1858 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1859 ; -O0: subs w12, w9, w8
1860 ; -O0: ldaxrb w8, [x11]
1861 ; -O0: cmp w8, w9, uxtb
1862 ; -O0: stlxrb w10, w12, [x11]
1863 ; -O0: subs w9, w8, w9, uxtb
1864 ; -O0: subs w9, w9, #1
1866 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_acq_rel:
1867 ; -O1: ldaxrb w8, [x0]
1868 ; -O1: sub w9, w8, w1
1869 ; -O1: stlxrb w10, w9, [x0]
1870 %r = atomicrmw sub ptr %ptr, i8 %value acq_rel, align 1
1874 define dso_local i8 @atomicrmw_sub_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
1875 ; -O0-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1876 ; -O0: subs w12, w9, w8
1877 ; -O0: ldaxrb w8, [x11]
1878 ; -O0: cmp w8, w9, uxtb
1879 ; -O0: stlxrb w10, w12, [x11]
1880 ; -O0: subs w9, w8, w9, uxtb
1881 ; -O0: subs w9, w9, #1
1883 ; -O1-LABEL: atomicrmw_sub_i8_unaligned_seq_cst:
1884 ; -O1: ldaxrb w8, [x0]
1885 ; -O1: sub w9, w8, w1
1886 ; -O1: stlxrb w10, w9, [x0]
1887 %r = atomicrmw sub ptr %ptr, i8 %value seq_cst, align 1
1891 define dso_local i16 @atomicrmw_sub_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
1892 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1893 ; -O0: subs w8, w9, w8
1894 ; -O0: bl __atomic_compare_exchange
1896 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_monotonic:
1897 ; -O1: sub w8, w0, w20
1898 ; -O1: bl __atomic_compare_exchange
1899 %r = atomicrmw sub ptr %ptr, i16 %value monotonic, align 1
1903 define dso_local i16 @atomicrmw_sub_i16_unaligned_acquire(ptr %ptr, i16 %value) {
1904 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1905 ; -O0: subs w8, w9, w8
1906 ; -O0: bl __atomic_compare_exchange
1908 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acquire:
1909 ; -O1: sub w8, w0, w20
1910 ; -O1: bl __atomic_compare_exchange
1911 %r = atomicrmw sub ptr %ptr, i16 %value acquire, align 1
1915 define dso_local i16 @atomicrmw_sub_i16_unaligned_release(ptr %ptr, i16 %value) {
1916 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_release:
1917 ; -O0: subs w8, w9, w8
1918 ; -O0: bl __atomic_compare_exchange
1920 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_release:
1921 ; -O1: sub w8, w0, w20
1922 ; -O1: bl __atomic_compare_exchange
1923 %r = atomicrmw sub ptr %ptr, i16 %value release, align 1
1927 define dso_local i16 @atomicrmw_sub_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
1928 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1929 ; -O0: subs w8, w9, w8
1930 ; -O0: bl __atomic_compare_exchange
1932 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_acq_rel:
1933 ; -O1: sub w8, w0, w20
1934 ; -O1: bl __atomic_compare_exchange
1935 %r = atomicrmw sub ptr %ptr, i16 %value acq_rel, align 1
1939 define dso_local i16 @atomicrmw_sub_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
1940 ; -O0-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1941 ; -O0: subs w8, w9, w8
1942 ; -O0: bl __atomic_compare_exchange
1944 ; -O1-LABEL: atomicrmw_sub_i16_unaligned_seq_cst:
1945 ; -O1: sub w8, w0, w20
1946 ; -O1: bl __atomic_compare_exchange
1947 %r = atomicrmw sub ptr %ptr, i16 %value seq_cst, align 1
1951 define dso_local i32 @atomicrmw_sub_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
1952 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1953 ; -O0: subs w8, w9, w8
1954 ; -O0: bl __atomic_compare_exchange
1956 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_monotonic:
1957 ; -O1: sub w8, w0, w20
1958 ; -O1: bl __atomic_compare_exchange
1959 %r = atomicrmw sub ptr %ptr, i32 %value monotonic, align 1
1963 define dso_local i32 @atomicrmw_sub_i32_unaligned_acquire(ptr %ptr, i32 %value) {
1964 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1965 ; -O0: subs w8, w9, w8
1966 ; -O0: bl __atomic_compare_exchange
1968 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acquire:
1969 ; -O1: sub w8, w0, w20
1970 ; -O1: bl __atomic_compare_exchange
1971 %r = atomicrmw sub ptr %ptr, i32 %value acquire, align 1
1975 define dso_local i32 @atomicrmw_sub_i32_unaligned_release(ptr %ptr, i32 %value) {
1976 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_release:
1977 ; -O0: subs w8, w9, w8
1978 ; -O0: bl __atomic_compare_exchange
1980 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_release:
1981 ; -O1: sub w8, w0, w20
1982 ; -O1: bl __atomic_compare_exchange
1983 %r = atomicrmw sub ptr %ptr, i32 %value release, align 1
1987 define dso_local i32 @atomicrmw_sub_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
1988 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1989 ; -O0: subs w8, w9, w8
1990 ; -O0: bl __atomic_compare_exchange
1992 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_acq_rel:
1993 ; -O1: sub w8, w0, w20
1994 ; -O1: bl __atomic_compare_exchange
1995 %r = atomicrmw sub ptr %ptr, i32 %value acq_rel, align 1
1999 define dso_local i32 @atomicrmw_sub_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2000 ; -O0-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
2001 ; -O0: subs w8, w9, w8
2002 ; -O0: bl __atomic_compare_exchange
2004 ; -O1-LABEL: atomicrmw_sub_i32_unaligned_seq_cst:
2005 ; -O1: sub w8, w0, w20
2006 ; -O1: bl __atomic_compare_exchange
2007 %r = atomicrmw sub ptr %ptr, i32 %value seq_cst, align 1
2011 define dso_local i64 @atomicrmw_sub_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2012 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
2013 ; -O0: subs x8, x9, x8
2014 ; -O0: bl __atomic_compare_exchange
2016 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_monotonic:
2017 ; -O1: sub x8, x0, x20
2018 ; -O1: bl __atomic_compare_exchange
2019 %r = atomicrmw sub ptr %ptr, i64 %value monotonic, align 1
2023 define dso_local i64 @atomicrmw_sub_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2024 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acquire:
2025 ; -O0: subs x8, x9, x8
2026 ; -O0: bl __atomic_compare_exchange
2028 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acquire:
2029 ; -O1: sub x8, x0, x20
2030 ; -O1: bl __atomic_compare_exchange
2031 %r = atomicrmw sub ptr %ptr, i64 %value acquire, align 1
2035 define dso_local i64 @atomicrmw_sub_i64_unaligned_release(ptr %ptr, i64 %value) {
2036 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_release:
2037 ; -O0: subs x8, x9, x8
2038 ; -O0: bl __atomic_compare_exchange
2040 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_release:
2041 ; -O1: sub x8, x0, x20
2042 ; -O1: bl __atomic_compare_exchange
2043 %r = atomicrmw sub ptr %ptr, i64 %value release, align 1
2047 define dso_local i64 @atomicrmw_sub_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2048 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
2049 ; -O0: subs x8, x9, x8
2050 ; -O0: bl __atomic_compare_exchange
2052 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_acq_rel:
2053 ; -O1: sub x8, x0, x20
2054 ; -O1: bl __atomic_compare_exchange
2055 %r = atomicrmw sub ptr %ptr, i64 %value acq_rel, align 1
2059 define dso_local i64 @atomicrmw_sub_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2060 ; -O0-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
2061 ; -O0: subs x8, x9, x8
2062 ; -O0: bl __atomic_compare_exchange
2064 ; -O1-LABEL: atomicrmw_sub_i64_unaligned_seq_cst:
2065 ; -O1: sub x8, x0, x20
2066 ; -O1: bl __atomic_compare_exchange
2067 %r = atomicrmw sub ptr %ptr, i64 %value seq_cst, align 1
2071 define dso_local i128 @atomicrmw_sub_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2072 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
2073 ; -O0: subs x9, x10, x9
2074 ; -O0: bl __atomic_compare_exchange
2076 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_monotonic:
2077 ; -O1: ldp x0, x1, [x0]
2078 ; -O1: subs x8, x1, x19
2079 ; -O1: bl __atomic_compare_exchange
2080 %r = atomicrmw sub ptr %ptr, i128 %value monotonic, align 1
2084 define dso_local i128 @atomicrmw_sub_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2085 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acquire:
2086 ; -O0: subs x9, x10, x9
2087 ; -O0: bl __atomic_compare_exchange
2089 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acquire:
2090 ; -O1: ldp x0, x1, [x0]
2091 ; -O1: subs x8, x1, x19
2092 ; -O1: bl __atomic_compare_exchange
2093 %r = atomicrmw sub ptr %ptr, i128 %value acquire, align 1
2097 define dso_local i128 @atomicrmw_sub_i128_unaligned_release(ptr %ptr, i128 %value) {
2098 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_release:
2099 ; -O0: subs x9, x10, x9
2100 ; -O0: bl __atomic_compare_exchange
2102 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_release:
2103 ; -O1: ldp x0, x1, [x0]
2104 ; -O1: subs x8, x1, x19
2105 ; -O1: bl __atomic_compare_exchange
2106 %r = atomicrmw sub ptr %ptr, i128 %value release, align 1
2110 define dso_local i128 @atomicrmw_sub_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2111 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
2112 ; -O0: subs x9, x10, x9
2113 ; -O0: bl __atomic_compare_exchange
2115 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_acq_rel:
2116 ; -O1: ldp x0, x1, [x0]
2117 ; -O1: subs x8, x1, x19
2118 ; -O1: bl __atomic_compare_exchange
2119 %r = atomicrmw sub ptr %ptr, i128 %value acq_rel, align 1
2123 define dso_local i128 @atomicrmw_sub_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2124 ; -O0-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
2125 ; -O0: subs x9, x10, x9
2126 ; -O0: bl __atomic_compare_exchange
2128 ; -O1-LABEL: atomicrmw_sub_i128_unaligned_seq_cst:
2129 ; -O1: ldp x0, x1, [x0]
2130 ; -O1: subs x8, x1, x19
2131 ; -O1: bl __atomic_compare_exchange
2132 %r = atomicrmw sub ptr %ptr, i128 %value seq_cst, align 1
2136 define dso_local i8 @atomicrmw_and_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2137 ; -O0-LABEL: atomicrmw_and_i8_aligned_monotonic:
2138 ; -O0: and w12, w9, w8
2139 ; -O0: ldaxrb w8, [x11]
2140 ; -O0: cmp w8, w9, uxtb
2141 ; -O0: stlxrb w10, w12, [x11]
2142 ; -O0: subs w9, w8, w9, uxtb
2143 ; -O0: subs w9, w9, #1
2145 ; -O1-LABEL: atomicrmw_and_i8_aligned_monotonic:
2146 ; -O1: ldxrb w8, [x0]
2147 ; -O1: and w9, w8, w1
2148 ; -O1: stxrb w10, w9, [x0]
2149 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
2153 define dso_local i8 @atomicrmw_and_i8_aligned_acquire(ptr %ptr, i8 %value) {
2154 ; -O0-LABEL: atomicrmw_and_i8_aligned_acquire:
2155 ; -O0: and w12, w9, w8
2156 ; -O0: ldaxrb w8, [x11]
2157 ; -O0: cmp w8, w9, uxtb
2158 ; -O0: stlxrb w10, w12, [x11]
2159 ; -O0: subs w9, w8, w9, uxtb
2160 ; -O0: subs w9, w9, #1
2162 ; -O1-LABEL: atomicrmw_and_i8_aligned_acquire:
2163 ; -O1: ldaxrb w8, [x0]
2164 ; -O1: and w9, w8, w1
2165 ; -O1: stxrb w10, w9, [x0]
2166 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
2170 define dso_local i8 @atomicrmw_and_i8_aligned_release(ptr %ptr, i8 %value) {
2171 ; -O0-LABEL: atomicrmw_and_i8_aligned_release:
2172 ; -O0: and w12, w9, w8
2173 ; -O0: ldaxrb w8, [x11]
2174 ; -O0: cmp w8, w9, uxtb
2175 ; -O0: stlxrb w10, w12, [x11]
2176 ; -O0: subs w9, w8, w9, uxtb
2177 ; -O0: subs w9, w9, #1
2179 ; -O1-LABEL: atomicrmw_and_i8_aligned_release:
2180 ; -O1: ldxrb w8, [x0]
2181 ; -O1: and w9, w8, w1
2182 ; -O1: stlxrb w10, w9, [x0]
2183 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
2187 define dso_local i8 @atomicrmw_and_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2188 ; -O0-LABEL: atomicrmw_and_i8_aligned_acq_rel:
2189 ; -O0: and w12, w9, w8
2190 ; -O0: ldaxrb w8, [x11]
2191 ; -O0: cmp w8, w9, uxtb
2192 ; -O0: stlxrb w10, w12, [x11]
2193 ; -O0: subs w9, w8, w9, uxtb
2194 ; -O0: subs w9, w9, #1
2196 ; -O1-LABEL: atomicrmw_and_i8_aligned_acq_rel:
2197 ; -O1: ldaxrb w8, [x0]
2198 ; -O1: and w9, w8, w1
2199 ; -O1: stlxrb w10, w9, [x0]
2200 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
2204 define dso_local i8 @atomicrmw_and_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2205 ; -O0-LABEL: atomicrmw_and_i8_aligned_seq_cst:
2206 ; -O0: and w12, w9, w8
2207 ; -O0: ldaxrb w8, [x11]
2208 ; -O0: cmp w8, w9, uxtb
2209 ; -O0: stlxrb w10, w12, [x11]
2210 ; -O0: subs w9, w8, w9, uxtb
2211 ; -O0: subs w9, w9, #1
2213 ; -O1-LABEL: atomicrmw_and_i8_aligned_seq_cst:
2214 ; -O1: ldaxrb w8, [x0]
2215 ; -O1: and w9, w8, w1
2216 ; -O1: stlxrb w10, w9, [x0]
2217 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
2221 define dso_local i16 @atomicrmw_and_i16_aligned_monotonic(ptr %ptr, i16 %value) {
2222 ; -O0-LABEL: atomicrmw_and_i16_aligned_monotonic:
2223 ; -O0: and w12, w9, w8
2224 ; -O0: ldaxrh w8, [x11]
2225 ; -O0: cmp w8, w9, uxth
2226 ; -O0: stlxrh w10, w12, [x11]
2227 ; -O0: subs w9, w8, w9, uxth
2228 ; -O0: subs w9, w9, #1
2230 ; -O1-LABEL: atomicrmw_and_i16_aligned_monotonic:
2231 ; -O1: ldxrh w8, [x0]
2232 ; -O1: and w9, w8, w1
2233 ; -O1: stxrh w10, w9, [x0]
2234 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 2
2238 define dso_local i16 @atomicrmw_and_i16_aligned_acquire(ptr %ptr, i16 %value) {
2239 ; -O0-LABEL: atomicrmw_and_i16_aligned_acquire:
2240 ; -O0: and w12, w9, w8
2241 ; -O0: ldaxrh w8, [x11]
2242 ; -O0: cmp w8, w9, uxth
2243 ; -O0: stlxrh w10, w12, [x11]
2244 ; -O0: subs w9, w8, w9, uxth
2245 ; -O0: subs w9, w9, #1
2247 ; -O1-LABEL: atomicrmw_and_i16_aligned_acquire:
2248 ; -O1: ldaxrh w8, [x0]
2249 ; -O1: and w9, w8, w1
2250 ; -O1: stxrh w10, w9, [x0]
2251 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 2
2255 define dso_local i16 @atomicrmw_and_i16_aligned_release(ptr %ptr, i16 %value) {
2256 ; -O0-LABEL: atomicrmw_and_i16_aligned_release:
2257 ; -O0: and w12, w9, w8
2258 ; -O0: ldaxrh w8, [x11]
2259 ; -O0: cmp w8, w9, uxth
2260 ; -O0: stlxrh w10, w12, [x11]
2261 ; -O0: subs w9, w8, w9, uxth
2262 ; -O0: subs w9, w9, #1
2264 ; -O1-LABEL: atomicrmw_and_i16_aligned_release:
2265 ; -O1: ldxrh w8, [x0]
2266 ; -O1: and w9, w8, w1
2267 ; -O1: stlxrh w10, w9, [x0]
2268 %r = atomicrmw and ptr %ptr, i16 %value release, align 2
2272 define dso_local i16 @atomicrmw_and_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
2273 ; -O0-LABEL: atomicrmw_and_i16_aligned_acq_rel:
2274 ; -O0: and w12, w9, w8
2275 ; -O0: ldaxrh w8, [x11]
2276 ; -O0: cmp w8, w9, uxth
2277 ; -O0: stlxrh w10, w12, [x11]
2278 ; -O0: subs w9, w8, w9, uxth
2279 ; -O0: subs w9, w9, #1
2281 ; -O1-LABEL: atomicrmw_and_i16_aligned_acq_rel:
2282 ; -O1: ldaxrh w8, [x0]
2283 ; -O1: and w9, w8, w1
2284 ; -O1: stlxrh w10, w9, [x0]
2285 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 2
2289 define dso_local i16 @atomicrmw_and_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
2290 ; -O0-LABEL: atomicrmw_and_i16_aligned_seq_cst:
2291 ; -O0: and w12, w9, w8
2292 ; -O0: ldaxrh w8, [x11]
2293 ; -O0: cmp w8, w9, uxth
2294 ; -O0: stlxrh w10, w12, [x11]
2295 ; -O0: subs w9, w8, w9, uxth
2296 ; -O0: subs w9, w9, #1
2298 ; -O1-LABEL: atomicrmw_and_i16_aligned_seq_cst:
2299 ; -O1: ldaxrh w8, [x0]
2300 ; -O1: and w9, w8, w1
2301 ; -O1: stlxrh w10, w9, [x0]
2302 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 2
2306 define dso_local i32 @atomicrmw_and_i32_aligned_monotonic(ptr %ptr, i32 %value) {
2307 ; -O0-LABEL: atomicrmw_and_i32_aligned_monotonic:
2308 ; -O0: and w12, w9, w8
2309 ; -O0: ldaxr w8, [x11]
2311 ; -O0: stlxr w10, w12, [x11]
2312 ; -O0: subs w9, w8, w9
2313 ; -O0: subs w9, w9, #1
2315 ; -O1-LABEL: atomicrmw_and_i32_aligned_monotonic:
2316 ; -O1: ldxr w8, [x0]
2317 ; -O1: and w9, w8, w1
2318 ; -O1: stxr w10, w9, [x0]
2319 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 4
2323 define dso_local i32 @atomicrmw_and_i32_aligned_acquire(ptr %ptr, i32 %value) {
2324 ; -O0-LABEL: atomicrmw_and_i32_aligned_acquire:
2325 ; -O0: and w12, w9, w8
2326 ; -O0: ldaxr w8, [x11]
2328 ; -O0: stlxr w10, w12, [x11]
2329 ; -O0: subs w9, w8, w9
2330 ; -O0: subs w9, w9, #1
2332 ; -O1-LABEL: atomicrmw_and_i32_aligned_acquire:
2333 ; -O1: ldaxr w8, [x0]
2334 ; -O1: and w9, w8, w1
2335 ; -O1: stxr w10, w9, [x0]
2336 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 4
2340 define dso_local i32 @atomicrmw_and_i32_aligned_release(ptr %ptr, i32 %value) {
2341 ; -O0-LABEL: atomicrmw_and_i32_aligned_release:
2342 ; -O0: and w12, w9, w8
2343 ; -O0: ldaxr w8, [x11]
2345 ; -O0: stlxr w10, w12, [x11]
2346 ; -O0: subs w9, w8, w9
2347 ; -O0: subs w9, w9, #1
2349 ; -O1-LABEL: atomicrmw_and_i32_aligned_release:
2350 ; -O1: ldxr w8, [x0]
2351 ; -O1: and w9, w8, w1
2352 ; -O1: stlxr w10, w9, [x0]
2353 %r = atomicrmw and ptr %ptr, i32 %value release, align 4
2357 define dso_local i32 @atomicrmw_and_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
2358 ; -O0-LABEL: atomicrmw_and_i32_aligned_acq_rel:
2359 ; -O0: and w12, w9, w8
2360 ; -O0: ldaxr w8, [x11]
2362 ; -O0: stlxr w10, w12, [x11]
2363 ; -O0: subs w9, w8, w9
2364 ; -O0: subs w9, w9, #1
2366 ; -O1-LABEL: atomicrmw_and_i32_aligned_acq_rel:
2367 ; -O1: ldaxr w8, [x0]
2368 ; -O1: and w9, w8, w1
2369 ; -O1: stlxr w10, w9, [x0]
2370 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 4
2374 define dso_local i32 @atomicrmw_and_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
2375 ; -O0-LABEL: atomicrmw_and_i32_aligned_seq_cst:
2376 ; -O0: and w12, w9, w8
2377 ; -O0: ldaxr w8, [x11]
2379 ; -O0: stlxr w10, w12, [x11]
2380 ; -O0: subs w9, w8, w9
2381 ; -O0: subs w9, w9, #1
2383 ; -O1-LABEL: atomicrmw_and_i32_aligned_seq_cst:
2384 ; -O1: ldaxr w8, [x0]
2385 ; -O1: and w9, w8, w1
2386 ; -O1: stlxr w10, w9, [x0]
2387 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 4
2391 define dso_local i64 @atomicrmw_and_i64_aligned_monotonic(ptr %ptr, i64 %value) {
2392 ; -O0-LABEL: atomicrmw_and_i64_aligned_monotonic:
2393 ; -O0: and x12, x9, x8
2394 ; -O0: ldaxr x8, [x11]
2396 ; -O0: stlxr w10, x12, [x11]
2397 ; -O0: subs x9, x8, x9
2398 ; -O0: subs w9, w9, #1
2400 ; -O1-LABEL: atomicrmw_and_i64_aligned_monotonic:
2401 ; -O1: ldxr x0, [x8]
2402 ; -O1: and x9, x0, x1
2403 ; -O1: stxr w10, x9, [x8]
2404 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 8
2408 define dso_local i64 @atomicrmw_and_i64_aligned_acquire(ptr %ptr, i64 %value) {
2409 ; -O0-LABEL: atomicrmw_and_i64_aligned_acquire:
2410 ; -O0: and x12, x9, x8
2411 ; -O0: ldaxr x8, [x11]
2413 ; -O0: stlxr w10, x12, [x11]
2414 ; -O0: subs x9, x8, x9
2415 ; -O0: subs w9, w9, #1
2417 ; -O1-LABEL: atomicrmw_and_i64_aligned_acquire:
2418 ; -O1: ldaxr x0, [x8]
2419 ; -O1: and x9, x0, x1
2420 ; -O1: stxr w10, x9, [x8]
2421 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 8
2425 define dso_local i64 @atomicrmw_and_i64_aligned_release(ptr %ptr, i64 %value) {
2426 ; -O0-LABEL: atomicrmw_and_i64_aligned_release:
2427 ; -O0: and x12, x9, x8
2428 ; -O0: ldaxr x8, [x11]
2430 ; -O0: stlxr w10, x12, [x11]
2431 ; -O0: subs x9, x8, x9
2432 ; -O0: subs w9, w9, #1
2434 ; -O1-LABEL: atomicrmw_and_i64_aligned_release:
2435 ; -O1: ldxr x0, [x8]
2436 ; -O1: and x9, x0, x1
2437 ; -O1: stlxr w10, x9, [x8]
2438 %r = atomicrmw and ptr %ptr, i64 %value release, align 8
2442 define dso_local i64 @atomicrmw_and_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
2443 ; -O0-LABEL: atomicrmw_and_i64_aligned_acq_rel:
2444 ; -O0: and x12, x9, x8
2445 ; -O0: ldaxr x8, [x11]
2447 ; -O0: stlxr w10, x12, [x11]
2448 ; -O0: subs x9, x8, x9
2449 ; -O0: subs w9, w9, #1
2451 ; -O1-LABEL: atomicrmw_and_i64_aligned_acq_rel:
2452 ; -O1: ldaxr x0, [x8]
2453 ; -O1: and x9, x0, x1
2454 ; -O1: stlxr w10, x9, [x8]
2455 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 8
2459 define dso_local i64 @atomicrmw_and_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
2460 ; -O0-LABEL: atomicrmw_and_i64_aligned_seq_cst:
2461 ; -O0: and x12, x9, x8
2462 ; -O0: ldaxr x8, [x11]
2464 ; -O0: stlxr w10, x12, [x11]
2465 ; -O0: subs x9, x8, x9
2466 ; -O0: subs w9, w9, #1
2468 ; -O1-LABEL: atomicrmw_and_i64_aligned_seq_cst:
2469 ; -O1: ldaxr x0, [x8]
2470 ; -O1: and x9, x0, x1
2471 ; -O1: stlxr w10, x9, [x8]
2472 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 8
2476 define dso_local i128 @atomicrmw_and_i128_aligned_monotonic(ptr %ptr, i128 %value) {
2477 ; -O0-LABEL: atomicrmw_and_i128_aligned_monotonic:
2478 ; -O0: and x15, x13, x10
2479 ; -O0: and x14, x11, x8
2480 ; -O0: ldxp x10, x12, [x9]
2483 ; -O0: stxp w8, x14, x15, [x9]
2484 ; -O0: stxp w8, x10, x12, [x9]
2485 ; -O0: subs x12, x12, x13
2486 ; -O0: ccmp x10, x11, #0, eq
2488 ; -O1-LABEL: atomicrmw_and_i128_aligned_monotonic:
2489 ; -O1: ldxp x1, x0, [x8]
2490 ; -O1: and x9, x0, x2
2491 ; -O1: and x10, x1, x3
2492 ; -O1: stxp w11, x10, x9, [x8]
2493 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 16
2497 define dso_local i128 @atomicrmw_and_i128_aligned_acquire(ptr %ptr, i128 %value) {
2498 ; -O0-LABEL: atomicrmw_and_i128_aligned_acquire:
2499 ; -O0: and x15, x13, x10
2500 ; -O0: and x14, x11, x8
2501 ; -O0: ldaxp x10, x12, [x9]
2504 ; -O0: stxp w8, x14, x15, [x9]
2505 ; -O0: stxp w8, x10, x12, [x9]
2506 ; -O0: subs x12, x12, x13
2507 ; -O0: ccmp x10, x11, #0, eq
2509 ; -O1-LABEL: atomicrmw_and_i128_aligned_acquire:
2510 ; -O1: ldaxp x1, x0, [x8]
2511 ; -O1: and x9, x0, x2
2512 ; -O1: and x10, x1, x3
2513 ; -O1: stxp w11, x10, x9, [x8]
2514 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 16
2518 define dso_local i128 @atomicrmw_and_i128_aligned_release(ptr %ptr, i128 %value) {
2519 ; -O0-LABEL: atomicrmw_and_i128_aligned_release:
2520 ; -O0: and x15, x13, x10
2521 ; -O0: and x14, x11, x8
2522 ; -O0: ldxp x10, x12, [x9]
2525 ; -O0: stlxp w8, x14, x15, [x9]
2526 ; -O0: stlxp w8, x10, x12, [x9]
2527 ; -O0: subs x12, x12, x13
2528 ; -O0: ccmp x10, x11, #0, eq
2530 ; -O1-LABEL: atomicrmw_and_i128_aligned_release:
2531 ; -O1: ldxp x1, x0, [x8]
2532 ; -O1: and x9, x0, x2
2533 ; -O1: and x10, x1, x3
2534 ; -O1: stlxp w11, x10, x9, [x8]
2535 %r = atomicrmw and ptr %ptr, i128 %value release, align 16
2539 define dso_local i128 @atomicrmw_and_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
2540 ; -O0-LABEL: atomicrmw_and_i128_aligned_acq_rel:
2541 ; -O0: and x15, x13, x10
2542 ; -O0: and x14, x11, x8
2543 ; -O0: ldaxp x10, x12, [x9]
2546 ; -O0: stlxp w8, x14, x15, [x9]
2547 ; -O0: stlxp w8, x10, x12, [x9]
2548 ; -O0: subs x12, x12, x13
2549 ; -O0: ccmp x10, x11, #0, eq
2551 ; -O1-LABEL: atomicrmw_and_i128_aligned_acq_rel:
2552 ; -O1: ldaxp x1, x0, [x8]
2553 ; -O1: and x9, x0, x2
2554 ; -O1: and x10, x1, x3
2555 ; -O1: stlxp w11, x10, x9, [x8]
2556 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 16
2560 define dso_local i128 @atomicrmw_and_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
2561 ; -O0-LABEL: atomicrmw_and_i128_aligned_seq_cst:
2562 ; -O0: and x15, x13, x10
2563 ; -O0: and x14, x11, x8
2564 ; -O0: ldaxp x10, x12, [x9]
2567 ; -O0: stlxp w8, x14, x15, [x9]
2568 ; -O0: stlxp w8, x10, x12, [x9]
2569 ; -O0: subs x12, x12, x13
2570 ; -O0: ccmp x10, x11, #0, eq
2572 ; -O1-LABEL: atomicrmw_and_i128_aligned_seq_cst:
2573 ; -O1: ldaxp x1, x0, [x8]
2574 ; -O1: and x9, x0, x2
2575 ; -O1: and x10, x1, x3
2576 ; -O1: stlxp w11, x10, x9, [x8]
2577 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 16
2581 define dso_local i8 @atomicrmw_and_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
2582 ; -O0-LABEL: atomicrmw_and_i8_unaligned_monotonic:
2583 ; -O0: and w12, w9, w8
2584 ; -O0: ldaxrb w8, [x11]
2585 ; -O0: cmp w8, w9, uxtb
2586 ; -O0: stlxrb w10, w12, [x11]
2587 ; -O0: subs w9, w8, w9, uxtb
2588 ; -O0: subs w9, w9, #1
2590 ; -O1-LABEL: atomicrmw_and_i8_unaligned_monotonic:
2591 ; -O1: ldxrb w8, [x0]
2592 ; -O1: and w9, w8, w1
2593 ; -O1: stxrb w10, w9, [x0]
2594 %r = atomicrmw and ptr %ptr, i8 %value monotonic, align 1
2598 define dso_local i8 @atomicrmw_and_i8_unaligned_acquire(ptr %ptr, i8 %value) {
2599 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acquire:
2600 ; -O0: and w12, w9, w8
2601 ; -O0: ldaxrb w8, [x11]
2602 ; -O0: cmp w8, w9, uxtb
2603 ; -O0: stlxrb w10, w12, [x11]
2604 ; -O0: subs w9, w8, w9, uxtb
2605 ; -O0: subs w9, w9, #1
2607 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acquire:
2608 ; -O1: ldaxrb w8, [x0]
2609 ; -O1: and w9, w8, w1
2610 ; -O1: stxrb w10, w9, [x0]
2611 %r = atomicrmw and ptr %ptr, i8 %value acquire, align 1
2615 define dso_local i8 @atomicrmw_and_i8_unaligned_release(ptr %ptr, i8 %value) {
2616 ; -O0-LABEL: atomicrmw_and_i8_unaligned_release:
2617 ; -O0: and w12, w9, w8
2618 ; -O0: ldaxrb w8, [x11]
2619 ; -O0: cmp w8, w9, uxtb
2620 ; -O0: stlxrb w10, w12, [x11]
2621 ; -O0: subs w9, w8, w9, uxtb
2622 ; -O0: subs w9, w9, #1
2624 ; -O1-LABEL: atomicrmw_and_i8_unaligned_release:
2625 ; -O1: ldxrb w8, [x0]
2626 ; -O1: and w9, w8, w1
2627 ; -O1: stlxrb w10, w9, [x0]
2628 %r = atomicrmw and ptr %ptr, i8 %value release, align 1
2632 define dso_local i8 @atomicrmw_and_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
2633 ; -O0-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
2634 ; -O0: and w12, w9, w8
2635 ; -O0: ldaxrb w8, [x11]
2636 ; -O0: cmp w8, w9, uxtb
2637 ; -O0: stlxrb w10, w12, [x11]
2638 ; -O0: subs w9, w8, w9, uxtb
2639 ; -O0: subs w9, w9, #1
2641 ; -O1-LABEL: atomicrmw_and_i8_unaligned_acq_rel:
2642 ; -O1: ldaxrb w8, [x0]
2643 ; -O1: and w9, w8, w1
2644 ; -O1: stlxrb w10, w9, [x0]
2645 %r = atomicrmw and ptr %ptr, i8 %value acq_rel, align 1
2649 define dso_local i8 @atomicrmw_and_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
2650 ; -O0-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2651 ; -O0: and w12, w9, w8
2652 ; -O0: ldaxrb w8, [x11]
2653 ; -O0: cmp w8, w9, uxtb
2654 ; -O0: stlxrb w10, w12, [x11]
2655 ; -O0: subs w9, w8, w9, uxtb
2656 ; -O0: subs w9, w9, #1
2658 ; -O1-LABEL: atomicrmw_and_i8_unaligned_seq_cst:
2659 ; -O1: ldaxrb w8, [x0]
2660 ; -O1: and w9, w8, w1
2661 ; -O1: stlxrb w10, w9, [x0]
2662 %r = atomicrmw and ptr %ptr, i8 %value seq_cst, align 1
2666 define dso_local i16 @atomicrmw_and_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
2667 ; -O0-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2668 ; -O0: and w8, w9, w8
2669 ; -O0: bl __atomic_compare_exchange
2671 ; -O1-LABEL: atomicrmw_and_i16_unaligned_monotonic:
2672 ; -O1: and w8, w0, w20
2673 ; -O1: bl __atomic_compare_exchange
2674 %r = atomicrmw and ptr %ptr, i16 %value monotonic, align 1
2678 define dso_local i16 @atomicrmw_and_i16_unaligned_acquire(ptr %ptr, i16 %value) {
2679 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acquire:
2680 ; -O0: and w8, w9, w8
2681 ; -O0: bl __atomic_compare_exchange
2683 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acquire:
2684 ; -O1: and w8, w0, w20
2685 ; -O1: bl __atomic_compare_exchange
2686 %r = atomicrmw and ptr %ptr, i16 %value acquire, align 1
2690 define dso_local i16 @atomicrmw_and_i16_unaligned_release(ptr %ptr, i16 %value) {
2691 ; -O0-LABEL: atomicrmw_and_i16_unaligned_release:
2692 ; -O0: and w8, w9, w8
2693 ; -O0: bl __atomic_compare_exchange
2695 ; -O1-LABEL: atomicrmw_and_i16_unaligned_release:
2696 ; -O1: and w8, w0, w20
2697 ; -O1: bl __atomic_compare_exchange
2698 %r = atomicrmw and ptr %ptr, i16 %value release, align 1
2702 define dso_local i16 @atomicrmw_and_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
2703 ; -O0-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2704 ; -O0: and w8, w9, w8
2705 ; -O0: bl __atomic_compare_exchange
2707 ; -O1-LABEL: atomicrmw_and_i16_unaligned_acq_rel:
2708 ; -O1: and w8, w0, w20
2709 ; -O1: bl __atomic_compare_exchange
2710 %r = atomicrmw and ptr %ptr, i16 %value acq_rel, align 1
2714 define dso_local i16 @atomicrmw_and_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
2715 ; -O0-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2716 ; -O0: and w8, w9, w8
2717 ; -O0: bl __atomic_compare_exchange
2719 ; -O1-LABEL: atomicrmw_and_i16_unaligned_seq_cst:
2720 ; -O1: and w8, w0, w20
2721 ; -O1: bl __atomic_compare_exchange
2722 %r = atomicrmw and ptr %ptr, i16 %value seq_cst, align 1
2726 define dso_local i32 @atomicrmw_and_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
2727 ; -O0-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2728 ; -O0: and w8, w9, w8
2729 ; -O0: bl __atomic_compare_exchange
2731 ; -O1-LABEL: atomicrmw_and_i32_unaligned_monotonic:
2732 ; -O1: and w8, w0, w20
2733 ; -O1: bl __atomic_compare_exchange
2734 %r = atomicrmw and ptr %ptr, i32 %value monotonic, align 1
2738 define dso_local i32 @atomicrmw_and_i32_unaligned_acquire(ptr %ptr, i32 %value) {
2739 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acquire:
2740 ; -O0: and w8, w9, w8
2741 ; -O0: bl __atomic_compare_exchange
2743 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acquire:
2744 ; -O1: and w8, w0, w20
2745 ; -O1: bl __atomic_compare_exchange
2746 %r = atomicrmw and ptr %ptr, i32 %value acquire, align 1
2750 define dso_local i32 @atomicrmw_and_i32_unaligned_release(ptr %ptr, i32 %value) {
2751 ; -O0-LABEL: atomicrmw_and_i32_unaligned_release:
2752 ; -O0: and w8, w9, w8
2753 ; -O0: bl __atomic_compare_exchange
2755 ; -O1-LABEL: atomicrmw_and_i32_unaligned_release:
2756 ; -O1: and w8, w0, w20
2757 ; -O1: bl __atomic_compare_exchange
2758 %r = atomicrmw and ptr %ptr, i32 %value release, align 1
2762 define dso_local i32 @atomicrmw_and_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
2763 ; -O0-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2764 ; -O0: and w8, w9, w8
2765 ; -O0: bl __atomic_compare_exchange
2767 ; -O1-LABEL: atomicrmw_and_i32_unaligned_acq_rel:
2768 ; -O1: and w8, w0, w20
2769 ; -O1: bl __atomic_compare_exchange
2770 %r = atomicrmw and ptr %ptr, i32 %value acq_rel, align 1
2774 define dso_local i32 @atomicrmw_and_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
2775 ; -O0-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2776 ; -O0: and w8, w9, w8
2777 ; -O0: bl __atomic_compare_exchange
2779 ; -O1-LABEL: atomicrmw_and_i32_unaligned_seq_cst:
2780 ; -O1: and w8, w0, w20
2781 ; -O1: bl __atomic_compare_exchange
2782 %r = atomicrmw and ptr %ptr, i32 %value seq_cst, align 1
2786 define dso_local i64 @atomicrmw_and_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
2787 ; -O0-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2788 ; -O0: and x8, x9, x8
2789 ; -O0: bl __atomic_compare_exchange
2791 ; -O1-LABEL: atomicrmw_and_i64_unaligned_monotonic:
2792 ; -O1: and x8, x0, x20
2793 ; -O1: bl __atomic_compare_exchange
2794 %r = atomicrmw and ptr %ptr, i64 %value monotonic, align 1
2798 define dso_local i64 @atomicrmw_and_i64_unaligned_acquire(ptr %ptr, i64 %value) {
2799 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acquire:
2800 ; -O0: and x8, x9, x8
2801 ; -O0: bl __atomic_compare_exchange
2803 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acquire:
2804 ; -O1: and x8, x0, x20
2805 ; -O1: bl __atomic_compare_exchange
2806 %r = atomicrmw and ptr %ptr, i64 %value acquire, align 1
2810 define dso_local i64 @atomicrmw_and_i64_unaligned_release(ptr %ptr, i64 %value) {
2811 ; -O0-LABEL: atomicrmw_and_i64_unaligned_release:
2812 ; -O0: and x8, x9, x8
2813 ; -O0: bl __atomic_compare_exchange
2815 ; -O1-LABEL: atomicrmw_and_i64_unaligned_release:
2816 ; -O1: and x8, x0, x20
2817 ; -O1: bl __atomic_compare_exchange
2818 %r = atomicrmw and ptr %ptr, i64 %value release, align 1
2822 define dso_local i64 @atomicrmw_and_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
2823 ; -O0-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2824 ; -O0: and x8, x9, x8
2825 ; -O0: bl __atomic_compare_exchange
2827 ; -O1-LABEL: atomicrmw_and_i64_unaligned_acq_rel:
2828 ; -O1: and x8, x0, x20
2829 ; -O1: bl __atomic_compare_exchange
2830 %r = atomicrmw and ptr %ptr, i64 %value acq_rel, align 1
2834 define dso_local i64 @atomicrmw_and_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
2835 ; -O0-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2836 ; -O0: and x8, x9, x8
2837 ; -O0: bl __atomic_compare_exchange
2839 ; -O1-LABEL: atomicrmw_and_i64_unaligned_seq_cst:
2840 ; -O1: and x8, x0, x20
2841 ; -O1: bl __atomic_compare_exchange
2842 %r = atomicrmw and ptr %ptr, i64 %value seq_cst, align 1
2846 define dso_local i128 @atomicrmw_and_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
2847 ; -O0-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2848 ; -O0: and x8, x11, x8
2849 ; -O0: and x9, x10, x9
2850 ; -O0: bl __atomic_compare_exchange
2852 ; -O1-LABEL: atomicrmw_and_i128_unaligned_monotonic:
2853 ; -O1: ldp x0, x1, [x0]
2854 ; -O1: and x8, x1, x19
2855 ; -O1: and x9, x0, x21
2856 ; -O1: bl __atomic_compare_exchange
2857 %r = atomicrmw and ptr %ptr, i128 %value monotonic, align 1
2861 define dso_local i128 @atomicrmw_and_i128_unaligned_acquire(ptr %ptr, i128 %value) {
2862 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acquire:
2863 ; -O0: and x8, x11, x8
2864 ; -O0: and x9, x10, x9
2865 ; -O0: bl __atomic_compare_exchange
2867 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acquire:
2868 ; -O1: ldp x0, x1, [x0]
2869 ; -O1: and x8, x1, x19
2870 ; -O1: and x9, x0, x21
2871 ; -O1: bl __atomic_compare_exchange
2872 %r = atomicrmw and ptr %ptr, i128 %value acquire, align 1
2876 define dso_local i128 @atomicrmw_and_i128_unaligned_release(ptr %ptr, i128 %value) {
2877 ; -O0-LABEL: atomicrmw_and_i128_unaligned_release:
2878 ; -O0: and x8, x11, x8
2879 ; -O0: and x9, x10, x9
2880 ; -O0: bl __atomic_compare_exchange
2882 ; -O1-LABEL: atomicrmw_and_i128_unaligned_release:
2883 ; -O1: ldp x0, x1, [x0]
2884 ; -O1: and x8, x1, x19
2885 ; -O1: and x9, x0, x21
2886 ; -O1: bl __atomic_compare_exchange
2887 %r = atomicrmw and ptr %ptr, i128 %value release, align 1
2891 define dso_local i128 @atomicrmw_and_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
2892 ; -O0-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2893 ; -O0: and x8, x11, x8
2894 ; -O0: and x9, x10, x9
2895 ; -O0: bl __atomic_compare_exchange
2897 ; -O1-LABEL: atomicrmw_and_i128_unaligned_acq_rel:
2898 ; -O1: ldp x0, x1, [x0]
2899 ; -O1: and x8, x1, x19
2900 ; -O1: and x9, x0, x21
2901 ; -O1: bl __atomic_compare_exchange
2902 %r = atomicrmw and ptr %ptr, i128 %value acq_rel, align 1
2906 define dso_local i128 @atomicrmw_and_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
2907 ; -O0-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2908 ; -O0: and x8, x11, x8
2909 ; -O0: and x9, x10, x9
2910 ; -O0: bl __atomic_compare_exchange
2912 ; -O1-LABEL: atomicrmw_and_i128_unaligned_seq_cst:
2913 ; -O1: ldp x0, x1, [x0]
2914 ; -O1: and x8, x1, x19
2915 ; -O1: and x9, x0, x21
2916 ; -O1: bl __atomic_compare_exchange
2917 %r = atomicrmw and ptr %ptr, i128 %value seq_cst, align 1
2921 define dso_local i8 @atomicrmw_nand_i8_aligned_monotonic(ptr %ptr, i8 %value) {
2922 ; -O0-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2923 ; -O0: and w8, w9, w8
2925 ; -O0: ldaxrb w8, [x11]
2926 ; -O0: cmp w8, w9, uxtb
2927 ; -O0: stlxrb w10, w12, [x11]
2928 ; -O0: subs w9, w8, w9, uxtb
2929 ; -O0: subs w9, w9, #1
2931 ; -O1-LABEL: atomicrmw_nand_i8_aligned_monotonic:
2932 ; -O1: ldxrb w8, [x0]
2933 ; -O1: and w9, w8, w1
2935 ; -O1: stxrb w10, w9, [x0]
2936 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
2940 define dso_local i8 @atomicrmw_nand_i8_aligned_acquire(ptr %ptr, i8 %value) {
2941 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acquire:
2942 ; -O0: and w8, w9, w8
2944 ; -O0: ldaxrb w8, [x11]
2945 ; -O0: cmp w8, w9, uxtb
2946 ; -O0: stlxrb w10, w12, [x11]
2947 ; -O0: subs w9, w8, w9, uxtb
2948 ; -O0: subs w9, w9, #1
2950 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acquire:
2951 ; -O1: ldaxrb w8, [x0]
2952 ; -O1: and w9, w8, w1
2954 ; -O1: stxrb w10, w9, [x0]
2955 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
2959 define dso_local i8 @atomicrmw_nand_i8_aligned_release(ptr %ptr, i8 %value) {
2960 ; -O0-LABEL: atomicrmw_nand_i8_aligned_release:
2961 ; -O0: and w8, w9, w8
2963 ; -O0: ldaxrb w8, [x11]
2964 ; -O0: cmp w8, w9, uxtb
2965 ; -O0: stlxrb w10, w12, [x11]
2966 ; -O0: subs w9, w8, w9, uxtb
2967 ; -O0: subs w9, w9, #1
2969 ; -O1-LABEL: atomicrmw_nand_i8_aligned_release:
2970 ; -O1: ldxrb w8, [x0]
2971 ; -O1: and w9, w8, w1
2973 ; -O1: stlxrb w10, w9, [x0]
2974 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
2978 define dso_local i8 @atomicrmw_nand_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
2979 ; -O0-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2980 ; -O0: and w8, w9, w8
2982 ; -O0: ldaxrb w8, [x11]
2983 ; -O0: cmp w8, w9, uxtb
2984 ; -O0: stlxrb w10, w12, [x11]
2985 ; -O0: subs w9, w8, w9, uxtb
2986 ; -O0: subs w9, w9, #1
2988 ; -O1-LABEL: atomicrmw_nand_i8_aligned_acq_rel:
2989 ; -O1: ldaxrb w8, [x0]
2990 ; -O1: and w9, w8, w1
2992 ; -O1: stlxrb w10, w9, [x0]
2993 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
2997 define dso_local i8 @atomicrmw_nand_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
2998 ; -O0-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
2999 ; -O0: and w8, w9, w8
3001 ; -O0: ldaxrb w8, [x11]
3002 ; -O0: cmp w8, w9, uxtb
3003 ; -O0: stlxrb w10, w12, [x11]
3004 ; -O0: subs w9, w8, w9, uxtb
3005 ; -O0: subs w9, w9, #1
3007 ; -O1-LABEL: atomicrmw_nand_i8_aligned_seq_cst:
3008 ; -O1: ldaxrb w8, [x0]
3009 ; -O1: and w9, w8, w1
3011 ; -O1: stlxrb w10, w9, [x0]
3012 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
3016 define dso_local i16 @atomicrmw_nand_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3017 ; -O0-LABEL: atomicrmw_nand_i16_aligned_monotonic:
3018 ; -O0: and w8, w9, w8
3020 ; -O0: ldaxrh w8, [x11]
3021 ; -O0: cmp w8, w9, uxth
3022 ; -O0: stlxrh w10, w12, [x11]
3023 ; -O0: subs w9, w8, w9, uxth
3024 ; -O0: subs w9, w9, #1
3026 ; -O1-LABEL: atomicrmw_nand_i16_aligned_monotonic:
3027 ; -O1: ldxrh w8, [x0]
3028 ; -O1: and w9, w8, w1
3030 ; -O1: stxrh w10, w9, [x0]
3031 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 2
3035 define dso_local i16 @atomicrmw_nand_i16_aligned_acquire(ptr %ptr, i16 %value) {
3036 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acquire:
3037 ; -O0: and w8, w9, w8
3039 ; -O0: ldaxrh w8, [x11]
3040 ; -O0: cmp w8, w9, uxth
3041 ; -O0: stlxrh w10, w12, [x11]
3042 ; -O0: subs w9, w8, w9, uxth
3043 ; -O0: subs w9, w9, #1
3045 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acquire:
3046 ; -O1: ldaxrh w8, [x0]
3047 ; -O1: and w9, w8, w1
3049 ; -O1: stxrh w10, w9, [x0]
3050 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 2
3054 define dso_local i16 @atomicrmw_nand_i16_aligned_release(ptr %ptr, i16 %value) {
3055 ; -O0-LABEL: atomicrmw_nand_i16_aligned_release:
3056 ; -O0: and w8, w9, w8
3058 ; -O0: ldaxrh w8, [x11]
3059 ; -O0: cmp w8, w9, uxth
3060 ; -O0: stlxrh w10, w12, [x11]
3061 ; -O0: subs w9, w8, w9, uxth
3062 ; -O0: subs w9, w9, #1
3064 ; -O1-LABEL: atomicrmw_nand_i16_aligned_release:
3065 ; -O1: ldxrh w8, [x0]
3066 ; -O1: and w9, w8, w1
3068 ; -O1: stlxrh w10, w9, [x0]
3069 %r = atomicrmw nand ptr %ptr, i16 %value release, align 2
3073 define dso_local i16 @atomicrmw_nand_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3074 ; -O0-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
3075 ; -O0: and w8, w9, w8
3077 ; -O0: ldaxrh w8, [x11]
3078 ; -O0: cmp w8, w9, uxth
3079 ; -O0: stlxrh w10, w12, [x11]
3080 ; -O0: subs w9, w8, w9, uxth
3081 ; -O0: subs w9, w9, #1
3083 ; -O1-LABEL: atomicrmw_nand_i16_aligned_acq_rel:
3084 ; -O1: ldaxrh w8, [x0]
3085 ; -O1: and w9, w8, w1
3087 ; -O1: stlxrh w10, w9, [x0]
3088 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 2
3092 define dso_local i16 @atomicrmw_nand_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3093 ; -O0-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
3094 ; -O0: and w8, w9, w8
3096 ; -O0: ldaxrh w8, [x11]
3097 ; -O0: cmp w8, w9, uxth
3098 ; -O0: stlxrh w10, w12, [x11]
3099 ; -O0: subs w9, w8, w9, uxth
3100 ; -O0: subs w9, w9, #1
3102 ; -O1-LABEL: atomicrmw_nand_i16_aligned_seq_cst:
3103 ; -O1: ldaxrh w8, [x0]
3104 ; -O1: and w9, w8, w1
3106 ; -O1: stlxrh w10, w9, [x0]
3107 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 2
3111 define dso_local i32 @atomicrmw_nand_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3112 ; -O0-LABEL: atomicrmw_nand_i32_aligned_monotonic:
3113 ; -O0: and w8, w9, w8
3115 ; -O0: ldaxr w8, [x11]
3117 ; -O0: stlxr w10, w12, [x11]
3118 ; -O0: subs w9, w8, w9
3119 ; -O0: subs w9, w9, #1
3121 ; -O1-LABEL: atomicrmw_nand_i32_aligned_monotonic:
3122 ; -O1: ldxr w8, [x0]
3123 ; -O1: and w9, w8, w1
3125 ; -O1: stxr w10, w9, [x0]
3126 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 4
3130 define dso_local i32 @atomicrmw_nand_i32_aligned_acquire(ptr %ptr, i32 %value) {
3131 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acquire:
3132 ; -O0: and w8, w9, w8
3134 ; -O0: ldaxr w8, [x11]
3136 ; -O0: stlxr w10, w12, [x11]
3137 ; -O0: subs w9, w8, w9
3138 ; -O0: subs w9, w9, #1
3140 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acquire:
3141 ; -O1: ldaxr w8, [x0]
3142 ; -O1: and w9, w8, w1
3144 ; -O1: stxr w10, w9, [x0]
3145 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 4
3149 define dso_local i32 @atomicrmw_nand_i32_aligned_release(ptr %ptr, i32 %value) {
3150 ; -O0-LABEL: atomicrmw_nand_i32_aligned_release:
3151 ; -O0: and w8, w9, w8
3153 ; -O0: ldaxr w8, [x11]
3155 ; -O0: stlxr w10, w12, [x11]
3156 ; -O0: subs w9, w8, w9
3157 ; -O0: subs w9, w9, #1
3159 ; -O1-LABEL: atomicrmw_nand_i32_aligned_release:
3160 ; -O1: ldxr w8, [x0]
3161 ; -O1: and w9, w8, w1
3163 ; -O1: stlxr w10, w9, [x0]
3164 %r = atomicrmw nand ptr %ptr, i32 %value release, align 4
3168 define dso_local i32 @atomicrmw_nand_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
3169 ; -O0-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
3170 ; -O0: and w8, w9, w8
3172 ; -O0: ldaxr w8, [x11]
3174 ; -O0: stlxr w10, w12, [x11]
3175 ; -O0: subs w9, w8, w9
3176 ; -O0: subs w9, w9, #1
3178 ; -O1-LABEL: atomicrmw_nand_i32_aligned_acq_rel:
3179 ; -O1: ldaxr w8, [x0]
3180 ; -O1: and w9, w8, w1
3182 ; -O1: stlxr w10, w9, [x0]
3183 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 4
3187 define dso_local i32 @atomicrmw_nand_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
3188 ; -O0-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
3189 ; -O0: and w8, w9, w8
3191 ; -O0: ldaxr w8, [x11]
3193 ; -O0: stlxr w10, w12, [x11]
3194 ; -O0: subs w9, w8, w9
3195 ; -O0: subs w9, w9, #1
3197 ; -O1-LABEL: atomicrmw_nand_i32_aligned_seq_cst:
3198 ; -O1: ldaxr w8, [x0]
3199 ; -O1: and w9, w8, w1
3201 ; -O1: stlxr w10, w9, [x0]
3202 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 4
3206 define dso_local i64 @atomicrmw_nand_i64_aligned_monotonic(ptr %ptr, i64 %value) {
3207 ; -O0-LABEL: atomicrmw_nand_i64_aligned_monotonic:
3208 ; -O0: and x8, x9, x8
3210 ; -O0: ldaxr x8, [x11]
3212 ; -O0: stlxr w10, x12, [x11]
3213 ; -O0: subs x9, x8, x9
3214 ; -O0: subs w9, w9, #1
3216 ; -O1-LABEL: atomicrmw_nand_i64_aligned_monotonic:
3217 ; -O1: ldxr x0, [x8]
3218 ; -O1: and x9, x0, x1
3220 ; -O1: stxr w10, x9, [x8]
3221 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 8
3225 define dso_local i64 @atomicrmw_nand_i64_aligned_acquire(ptr %ptr, i64 %value) {
3226 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acquire:
3227 ; -O0: and x8, x9, x8
3229 ; -O0: ldaxr x8, [x11]
3231 ; -O0: stlxr w10, x12, [x11]
3232 ; -O0: subs x9, x8, x9
3233 ; -O0: subs w9, w9, #1
3235 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acquire:
3236 ; -O1: ldaxr x0, [x8]
3237 ; -O1: and x9, x0, x1
3239 ; -O1: stxr w10, x9, [x8]
3240 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 8
3244 define dso_local i64 @atomicrmw_nand_i64_aligned_release(ptr %ptr, i64 %value) {
3245 ; -O0-LABEL: atomicrmw_nand_i64_aligned_release:
3246 ; -O0: and x8, x9, x8
3248 ; -O0: ldaxr x8, [x11]
3250 ; -O0: stlxr w10, x12, [x11]
3251 ; -O0: subs x9, x8, x9
3252 ; -O0: subs w9, w9, #1
3254 ; -O1-LABEL: atomicrmw_nand_i64_aligned_release:
3255 ; -O1: ldxr x0, [x8]
3256 ; -O1: and x9, x0, x1
3258 ; -O1: stlxr w10, x9, [x8]
3259 %r = atomicrmw nand ptr %ptr, i64 %value release, align 8
3263 define dso_local i64 @atomicrmw_nand_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
3264 ; -O0-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
3265 ; -O0: and x8, x9, x8
3267 ; -O0: ldaxr x8, [x11]
3269 ; -O0: stlxr w10, x12, [x11]
3270 ; -O0: subs x9, x8, x9
3271 ; -O0: subs w9, w9, #1
3273 ; -O1-LABEL: atomicrmw_nand_i64_aligned_acq_rel:
3274 ; -O1: ldaxr x0, [x8]
3275 ; -O1: and x9, x0, x1
3277 ; -O1: stlxr w10, x9, [x8]
3278 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 8
3282 define dso_local i64 @atomicrmw_nand_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
3283 ; -O0-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
3284 ; -O0: and x8, x9, x8
3286 ; -O0: ldaxr x8, [x11]
3288 ; -O0: stlxr w10, x12, [x11]
3289 ; -O0: subs x9, x8, x9
3290 ; -O0: subs w9, w9, #1
3292 ; -O1-LABEL: atomicrmw_nand_i64_aligned_seq_cst:
3293 ; -O1: ldaxr x0, [x8]
3294 ; -O1: and x9, x0, x1
3296 ; -O1: stlxr w10, x9, [x8]
3297 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 8
3301 define dso_local i128 @atomicrmw_nand_i128_aligned_monotonic(ptr %ptr, i128 %value) {
3302 ; -O0-LABEL: atomicrmw_nand_i128_aligned_monotonic:
3303 ; -O0: and x8, x11, x8
3304 ; -O0: and x10, x13, x10
3307 ; -O0: ldxp x10, x12, [x9]
3310 ; -O0: stxp w8, x14, x15, [x9]
3311 ; -O0: stxp w8, x10, x12, [x9]
3312 ; -O0: subs x12, x12, x13
3313 ; -O0: ccmp x10, x11, #0, eq
3315 ; -O1-LABEL: atomicrmw_nand_i128_aligned_monotonic:
3316 ; -O1: ldxp x1, x0, [x8]
3317 ; -O1: and x9, x1, x3
3318 ; -O1: and x10, x0, x2
3321 ; -O1: stxp w11, x9, x10, [x8]
3322 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 16
3326 define dso_local i128 @atomicrmw_nand_i128_aligned_acquire(ptr %ptr, i128 %value) {
3327 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acquire:
3328 ; -O0: and x8, x11, x8
3329 ; -O0: and x10, x13, x10
3332 ; -O0: ldaxp x10, x12, [x9]
3335 ; -O0: stxp w8, x14, x15, [x9]
3336 ; -O0: stxp w8, x10, x12, [x9]
3337 ; -O0: subs x12, x12, x13
3338 ; -O0: ccmp x10, x11, #0, eq
3340 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acquire:
3341 ; -O1: ldaxp x1, x0, [x8]
3342 ; -O1: and x9, x1, x3
3343 ; -O1: and x10, x0, x2
3346 ; -O1: stxp w11, x9, x10, [x8]
3347 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 16
3351 define dso_local i128 @atomicrmw_nand_i128_aligned_release(ptr %ptr, i128 %value) {
3352 ; -O0-LABEL: atomicrmw_nand_i128_aligned_release:
3353 ; -O0: and x8, x11, x8
3354 ; -O0: and x10, x13, x10
3357 ; -O0: ldxp x10, x12, [x9]
3360 ; -O0: stlxp w8, x14, x15, [x9]
3361 ; -O0: stlxp w8, x10, x12, [x9]
3362 ; -O0: subs x12, x12, x13
3363 ; -O0: ccmp x10, x11, #0, eq
3365 ; -O1-LABEL: atomicrmw_nand_i128_aligned_release:
3366 ; -O1: ldxp x1, x0, [x8]
3367 ; -O1: and x9, x1, x3
3368 ; -O1: and x10, x0, x2
3371 ; -O1: stlxp w11, x9, x10, [x8]
3372 %r = atomicrmw nand ptr %ptr, i128 %value release, align 16
3376 define dso_local i128 @atomicrmw_nand_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
3377 ; -O0-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
3378 ; -O0: and x8, x11, x8
3379 ; -O0: and x10, x13, x10
3382 ; -O0: ldaxp x10, x12, [x9]
3385 ; -O0: stlxp w8, x14, x15, [x9]
3386 ; -O0: stlxp w8, x10, x12, [x9]
3387 ; -O0: subs x12, x12, x13
3388 ; -O0: ccmp x10, x11, #0, eq
3390 ; -O1-LABEL: atomicrmw_nand_i128_aligned_acq_rel:
3391 ; -O1: ldaxp x1, x0, [x8]
3392 ; -O1: and x9, x1, x3
3393 ; -O1: and x10, x0, x2
3396 ; -O1: stlxp w11, x9, x10, [x8]
3397 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 16
3401 define dso_local i128 @atomicrmw_nand_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
3402 ; -O0-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
3403 ; -O0: and x8, x11, x8
3404 ; -O0: and x10, x13, x10
3407 ; -O0: ldaxp x10, x12, [x9]
3410 ; -O0: stlxp w8, x14, x15, [x9]
3411 ; -O0: stlxp w8, x10, x12, [x9]
3412 ; -O0: subs x12, x12, x13
3413 ; -O0: ccmp x10, x11, #0, eq
3415 ; -O1-LABEL: atomicrmw_nand_i128_aligned_seq_cst:
3416 ; -O1: ldaxp x1, x0, [x8]
3417 ; -O1: and x9, x1, x3
3418 ; -O1: and x10, x0, x2
3421 ; -O1: stlxp w11, x9, x10, [x8]
3422 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 16
3426 define dso_local i8 @atomicrmw_nand_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
3427 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
3428 ; -O0: and w8, w9, w8
3430 ; -O0: ldaxrb w8, [x11]
3431 ; -O0: cmp w8, w9, uxtb
3432 ; -O0: stlxrb w10, w12, [x11]
3433 ; -O0: subs w9, w8, w9, uxtb
3434 ; -O0: subs w9, w9, #1
3436 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_monotonic:
3437 ; -O1: ldxrb w8, [x0]
3438 ; -O1: and w9, w8, w1
3440 ; -O1: stxrb w10, w9, [x0]
3441 %r = atomicrmw nand ptr %ptr, i8 %value monotonic, align 1
3445 define dso_local i8 @atomicrmw_nand_i8_unaligned_acquire(ptr %ptr, i8 %value) {
3446 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acquire:
3447 ; -O0: and w8, w9, w8
3449 ; -O0: ldaxrb w8, [x11]
3450 ; -O0: cmp w8, w9, uxtb
3451 ; -O0: stlxrb w10, w12, [x11]
3452 ; -O0: subs w9, w8, w9, uxtb
3453 ; -O0: subs w9, w9, #1
3455 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acquire:
3456 ; -O1: ldaxrb w8, [x0]
3457 ; -O1: and w9, w8, w1
3459 ; -O1: stxrb w10, w9, [x0]
3460 %r = atomicrmw nand ptr %ptr, i8 %value acquire, align 1
3464 define dso_local i8 @atomicrmw_nand_i8_unaligned_release(ptr %ptr, i8 %value) {
3465 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_release:
3466 ; -O0: and w8, w9, w8
3468 ; -O0: ldaxrb w8, [x11]
3469 ; -O0: cmp w8, w9, uxtb
3470 ; -O0: stlxrb w10, w12, [x11]
3471 ; -O0: subs w9, w8, w9, uxtb
3472 ; -O0: subs w9, w9, #1
3474 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_release:
3475 ; -O1: ldxrb w8, [x0]
3476 ; -O1: and w9, w8, w1
3478 ; -O1: stlxrb w10, w9, [x0]
3479 %r = atomicrmw nand ptr %ptr, i8 %value release, align 1
3483 define dso_local i8 @atomicrmw_nand_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
3484 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
3485 ; -O0: and w8, w9, w8
3487 ; -O0: ldaxrb w8, [x11]
3488 ; -O0: cmp w8, w9, uxtb
3489 ; -O0: stlxrb w10, w12, [x11]
3490 ; -O0: subs w9, w8, w9, uxtb
3491 ; -O0: subs w9, w9, #1
3493 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_acq_rel:
3494 ; -O1: ldaxrb w8, [x0]
3495 ; -O1: and w9, w8, w1
3497 ; -O1: stlxrb w10, w9, [x0]
3498 %r = atomicrmw nand ptr %ptr, i8 %value acq_rel, align 1
3502 define dso_local i8 @atomicrmw_nand_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
3503 ; -O0-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
3504 ; -O0: and w8, w9, w8
3506 ; -O0: ldaxrb w8, [x11]
3507 ; -O0: cmp w8, w9, uxtb
3508 ; -O0: stlxrb w10, w12, [x11]
3509 ; -O0: subs w9, w8, w9, uxtb
3510 ; -O0: subs w9, w9, #1
3512 ; -O1-LABEL: atomicrmw_nand_i8_unaligned_seq_cst:
3513 ; -O1: ldaxrb w8, [x0]
3514 ; -O1: and w9, w8, w1
3516 ; -O1: stlxrb w10, w9, [x0]
3517 %r = atomicrmw nand ptr %ptr, i8 %value seq_cst, align 1
3521 define dso_local i16 @atomicrmw_nand_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
3522 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
3523 ; -O0: and w8, w9, w8
3525 ; -O0: bl __atomic_compare_exchange
3527 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_monotonic:
3528 ; -O1: and w8, w0, w20
3530 ; -O1: bl __atomic_compare_exchange
3531 %r = atomicrmw nand ptr %ptr, i16 %value monotonic, align 1
3535 define dso_local i16 @atomicrmw_nand_i16_unaligned_acquire(ptr %ptr, i16 %value) {
3536 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acquire:
3537 ; -O0: and w8, w9, w8
3539 ; -O0: bl __atomic_compare_exchange
3541 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acquire:
3542 ; -O1: and w8, w0, w20
3544 ; -O1: bl __atomic_compare_exchange
3545 %r = atomicrmw nand ptr %ptr, i16 %value acquire, align 1
3549 define dso_local i16 @atomicrmw_nand_i16_unaligned_release(ptr %ptr, i16 %value) {
3550 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_release:
3551 ; -O0: and w8, w9, w8
3553 ; -O0: bl __atomic_compare_exchange
3555 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_release:
3556 ; -O1: and w8, w0, w20
3558 ; -O1: bl __atomic_compare_exchange
3559 %r = atomicrmw nand ptr %ptr, i16 %value release, align 1
3563 define dso_local i16 @atomicrmw_nand_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
3564 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
3565 ; -O0: and w8, w9, w8
3567 ; -O0: bl __atomic_compare_exchange
3569 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_acq_rel:
3570 ; -O1: and w8, w0, w20
3572 ; -O1: bl __atomic_compare_exchange
3573 %r = atomicrmw nand ptr %ptr, i16 %value acq_rel, align 1
3577 define dso_local i16 @atomicrmw_nand_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
3578 ; -O0-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
3579 ; -O0: and w8, w9, w8
3581 ; -O0: bl __atomic_compare_exchange
3583 ; -O1-LABEL: atomicrmw_nand_i16_unaligned_seq_cst:
3584 ; -O1: and w8, w0, w20
3586 ; -O1: bl __atomic_compare_exchange
3587 %r = atomicrmw nand ptr %ptr, i16 %value seq_cst, align 1
3591 define dso_local i32 @atomicrmw_nand_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
3592 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
3593 ; -O0: and w8, w9, w8
3595 ; -O0: bl __atomic_compare_exchange
3597 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_monotonic:
3598 ; -O1: and w8, w0, w20
3600 ; -O1: bl __atomic_compare_exchange
3601 %r = atomicrmw nand ptr %ptr, i32 %value monotonic, align 1
3605 define dso_local i32 @atomicrmw_nand_i32_unaligned_acquire(ptr %ptr, i32 %value) {
3606 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acquire:
3607 ; -O0: and w8, w9, w8
3609 ; -O0: bl __atomic_compare_exchange
3611 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acquire:
3612 ; -O1: and w8, w0, w20
3614 ; -O1: bl __atomic_compare_exchange
3615 %r = atomicrmw nand ptr %ptr, i32 %value acquire, align 1
3619 define dso_local i32 @atomicrmw_nand_i32_unaligned_release(ptr %ptr, i32 %value) {
3620 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_release:
3621 ; -O0: and w8, w9, w8
3623 ; -O0: bl __atomic_compare_exchange
3625 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_release:
3626 ; -O1: and w8, w0, w20
3628 ; -O1: bl __atomic_compare_exchange
3629 %r = atomicrmw nand ptr %ptr, i32 %value release, align 1
3633 define dso_local i32 @atomicrmw_nand_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
3634 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
3635 ; -O0: and w8, w9, w8
3637 ; -O0: bl __atomic_compare_exchange
3639 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_acq_rel:
3640 ; -O1: and w8, w0, w20
3642 ; -O1: bl __atomic_compare_exchange
3643 %r = atomicrmw nand ptr %ptr, i32 %value acq_rel, align 1
3647 define dso_local i32 @atomicrmw_nand_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
3648 ; -O0-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
3649 ; -O0: and w8, w9, w8
3651 ; -O0: bl __atomic_compare_exchange
3653 ; -O1-LABEL: atomicrmw_nand_i32_unaligned_seq_cst:
3654 ; -O1: and w8, w0, w20
3656 ; -O1: bl __atomic_compare_exchange
3657 %r = atomicrmw nand ptr %ptr, i32 %value seq_cst, align 1
3661 define dso_local i64 @atomicrmw_nand_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
3662 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3663 ; -O0: and x8, x9, x8
3665 ; -O0: bl __atomic_compare_exchange
3667 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_monotonic:
3668 ; -O1: and x8, x0, x20
3670 ; -O1: bl __atomic_compare_exchange
3671 %r = atomicrmw nand ptr %ptr, i64 %value monotonic, align 1
3675 define dso_local i64 @atomicrmw_nand_i64_unaligned_acquire(ptr %ptr, i64 %value) {
3676 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3677 ; -O0: and x8, x9, x8
3679 ; -O0: bl __atomic_compare_exchange
3681 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acquire:
3682 ; -O1: and x8, x0, x20
3684 ; -O1: bl __atomic_compare_exchange
3685 %r = atomicrmw nand ptr %ptr, i64 %value acquire, align 1
3689 define dso_local i64 @atomicrmw_nand_i64_unaligned_release(ptr %ptr, i64 %value) {
3690 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_release:
3691 ; -O0: and x8, x9, x8
3693 ; -O0: bl __atomic_compare_exchange
3695 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_release:
3696 ; -O1: and x8, x0, x20
3698 ; -O1: bl __atomic_compare_exchange
3699 %r = atomicrmw nand ptr %ptr, i64 %value release, align 1
3703 define dso_local i64 @atomicrmw_nand_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
3704 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3705 ; -O0: and x8, x9, x8
3707 ; -O0: bl __atomic_compare_exchange
3709 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_acq_rel:
3710 ; -O1: and x8, x0, x20
3712 ; -O1: bl __atomic_compare_exchange
3713 %r = atomicrmw nand ptr %ptr, i64 %value acq_rel, align 1
3717 define dso_local i64 @atomicrmw_nand_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
3718 ; -O0-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3719 ; -O0: and x8, x9, x8
3721 ; -O0: bl __atomic_compare_exchange
3723 ; -O1-LABEL: atomicrmw_nand_i64_unaligned_seq_cst:
3724 ; -O1: and x8, x0, x20
3726 ; -O1: bl __atomic_compare_exchange
3727 %r = atomicrmw nand ptr %ptr, i64 %value seq_cst, align 1
3731 define dso_local i128 @atomicrmw_nand_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
3732 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3733 ; -O0: and x9, x11, x9
3734 ; -O0: and x8, x10, x8
3737 ; -O0: bl __atomic_compare_exchange
3739 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_monotonic:
3740 ; -O1: ldp x0, x1, [x0]
3741 ; -O1: and x8, x1, x19
3742 ; -O1: and x9, x0, x21
3745 ; -O1: bl __atomic_compare_exchange
3746 %r = atomicrmw nand ptr %ptr, i128 %value monotonic, align 1
3750 define dso_local i128 @atomicrmw_nand_i128_unaligned_acquire(ptr %ptr, i128 %value) {
3751 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3752 ; -O0: and x9, x11, x9
3753 ; -O0: and x8, x10, x8
3756 ; -O0: bl __atomic_compare_exchange
3758 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acquire:
3759 ; -O1: ldp x0, x1, [x0]
3760 ; -O1: and x8, x1, x19
3761 ; -O1: and x9, x0, x21
3764 ; -O1: bl __atomic_compare_exchange
3765 %r = atomicrmw nand ptr %ptr, i128 %value acquire, align 1
3769 define dso_local i128 @atomicrmw_nand_i128_unaligned_release(ptr %ptr, i128 %value) {
3770 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_release:
3771 ; -O0: and x9, x11, x9
3772 ; -O0: and x8, x10, x8
3775 ; -O0: bl __atomic_compare_exchange
3777 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_release:
3778 ; -O1: ldp x0, x1, [x0]
3779 ; -O1: and x8, x1, x19
3780 ; -O1: and x9, x0, x21
3783 ; -O1: bl __atomic_compare_exchange
3784 %r = atomicrmw nand ptr %ptr, i128 %value release, align 1
3788 define dso_local i128 @atomicrmw_nand_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
3789 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3790 ; -O0: and x9, x11, x9
3791 ; -O0: and x8, x10, x8
3794 ; -O0: bl __atomic_compare_exchange
3796 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_acq_rel:
3797 ; -O1: ldp x0, x1, [x0]
3798 ; -O1: and x8, x1, x19
3799 ; -O1: and x9, x0, x21
3802 ; -O1: bl __atomic_compare_exchange
3803 %r = atomicrmw nand ptr %ptr, i128 %value acq_rel, align 1
3807 define dso_local i128 @atomicrmw_nand_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
3808 ; -O0-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3809 ; -O0: and x9, x11, x9
3810 ; -O0: and x8, x10, x8
3813 ; -O0: bl __atomic_compare_exchange
3815 ; -O1-LABEL: atomicrmw_nand_i128_unaligned_seq_cst:
3816 ; -O1: ldp x0, x1, [x0]
3817 ; -O1: and x8, x1, x19
3818 ; -O1: and x9, x0, x21
3821 ; -O1: bl __atomic_compare_exchange
3822 %r = atomicrmw nand ptr %ptr, i128 %value seq_cst, align 1
3826 define dso_local i8 @atomicrmw_or_i8_aligned_monotonic(ptr %ptr, i8 %value) {
3827 ; -O0-LABEL: atomicrmw_or_i8_aligned_monotonic:
3828 ; -O0: orr w12, w9, w8
3829 ; -O0: ldaxrb w8, [x11]
3830 ; -O0: cmp w8, w9, uxtb
3831 ; -O0: stlxrb w10, w12, [x11]
3832 ; -O0: subs w9, w8, w9, uxtb
3833 ; -O0: subs w9, w9, #1
3835 ; -O1-LABEL: atomicrmw_or_i8_aligned_monotonic:
3836 ; -O1: ldxrb w8, [x0]
3837 ; -O1: orr w9, w8, w1
3838 ; -O1: stxrb w10, w9, [x0]
3839 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
3843 define dso_local i8 @atomicrmw_or_i8_aligned_acquire(ptr %ptr, i8 %value) {
3844 ; -O0-LABEL: atomicrmw_or_i8_aligned_acquire:
3845 ; -O0: orr w12, w9, w8
3846 ; -O0: ldaxrb w8, [x11]
3847 ; -O0: cmp w8, w9, uxtb
3848 ; -O0: stlxrb w10, w12, [x11]
3849 ; -O0: subs w9, w8, w9, uxtb
3850 ; -O0: subs w9, w9, #1
3852 ; -O1-LABEL: atomicrmw_or_i8_aligned_acquire:
3853 ; -O1: ldaxrb w8, [x0]
3854 ; -O1: orr w9, w8, w1
3855 ; -O1: stxrb w10, w9, [x0]
3856 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
3860 define dso_local i8 @atomicrmw_or_i8_aligned_release(ptr %ptr, i8 %value) {
3861 ; -O0-LABEL: atomicrmw_or_i8_aligned_release:
3862 ; -O0: orr w12, w9, w8
3863 ; -O0: ldaxrb w8, [x11]
3864 ; -O0: cmp w8, w9, uxtb
3865 ; -O0: stlxrb w10, w12, [x11]
3866 ; -O0: subs w9, w8, w9, uxtb
3867 ; -O0: subs w9, w9, #1
3869 ; -O1-LABEL: atomicrmw_or_i8_aligned_release:
3870 ; -O1: ldxrb w8, [x0]
3871 ; -O1: orr w9, w8, w1
3872 ; -O1: stlxrb w10, w9, [x0]
3873 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
3877 define dso_local i8 @atomicrmw_or_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
3878 ; -O0-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3879 ; -O0: orr w12, w9, w8
3880 ; -O0: ldaxrb w8, [x11]
3881 ; -O0: cmp w8, w9, uxtb
3882 ; -O0: stlxrb w10, w12, [x11]
3883 ; -O0: subs w9, w8, w9, uxtb
3884 ; -O0: subs w9, w9, #1
3886 ; -O1-LABEL: atomicrmw_or_i8_aligned_acq_rel:
3887 ; -O1: ldaxrb w8, [x0]
3888 ; -O1: orr w9, w8, w1
3889 ; -O1: stlxrb w10, w9, [x0]
3890 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
3894 define dso_local i8 @atomicrmw_or_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
3895 ; -O0-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3896 ; -O0: orr w12, w9, w8
3897 ; -O0: ldaxrb w8, [x11]
3898 ; -O0: cmp w8, w9, uxtb
3899 ; -O0: stlxrb w10, w12, [x11]
3900 ; -O0: subs w9, w8, w9, uxtb
3901 ; -O0: subs w9, w9, #1
3903 ; -O1-LABEL: atomicrmw_or_i8_aligned_seq_cst:
3904 ; -O1: ldaxrb w8, [x0]
3905 ; -O1: orr w9, w8, w1
3906 ; -O1: stlxrb w10, w9, [x0]
3907 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
3911 define dso_local i16 @atomicrmw_or_i16_aligned_monotonic(ptr %ptr, i16 %value) {
3912 ; -O0-LABEL: atomicrmw_or_i16_aligned_monotonic:
3913 ; -O0: orr w12, w9, w8
3914 ; -O0: ldaxrh w8, [x11]
3915 ; -O0: cmp w8, w9, uxth
3916 ; -O0: stlxrh w10, w12, [x11]
3917 ; -O0: subs w9, w8, w9, uxth
3918 ; -O0: subs w9, w9, #1
3920 ; -O1-LABEL: atomicrmw_or_i16_aligned_monotonic:
3921 ; -O1: ldxrh w8, [x0]
3922 ; -O1: orr w9, w8, w1
3923 ; -O1: stxrh w10, w9, [x0]
3924 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 2
3928 define dso_local i16 @atomicrmw_or_i16_aligned_acquire(ptr %ptr, i16 %value) {
3929 ; -O0-LABEL: atomicrmw_or_i16_aligned_acquire:
3930 ; -O0: orr w12, w9, w8
3931 ; -O0: ldaxrh w8, [x11]
3932 ; -O0: cmp w8, w9, uxth
3933 ; -O0: stlxrh w10, w12, [x11]
3934 ; -O0: subs w9, w8, w9, uxth
3935 ; -O0: subs w9, w9, #1
3937 ; -O1-LABEL: atomicrmw_or_i16_aligned_acquire:
3938 ; -O1: ldaxrh w8, [x0]
3939 ; -O1: orr w9, w8, w1
3940 ; -O1: stxrh w10, w9, [x0]
3941 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 2
3945 define dso_local i16 @atomicrmw_or_i16_aligned_release(ptr %ptr, i16 %value) {
3946 ; -O0-LABEL: atomicrmw_or_i16_aligned_release:
3947 ; -O0: orr w12, w9, w8
3948 ; -O0: ldaxrh w8, [x11]
3949 ; -O0: cmp w8, w9, uxth
3950 ; -O0: stlxrh w10, w12, [x11]
3951 ; -O0: subs w9, w8, w9, uxth
3952 ; -O0: subs w9, w9, #1
3954 ; -O1-LABEL: atomicrmw_or_i16_aligned_release:
3955 ; -O1: ldxrh w8, [x0]
3956 ; -O1: orr w9, w8, w1
3957 ; -O1: stlxrh w10, w9, [x0]
3958 %r = atomicrmw or ptr %ptr, i16 %value release, align 2
3962 define dso_local i16 @atomicrmw_or_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
3963 ; -O0-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3964 ; -O0: orr w12, w9, w8
3965 ; -O0: ldaxrh w8, [x11]
3966 ; -O0: cmp w8, w9, uxth
3967 ; -O0: stlxrh w10, w12, [x11]
3968 ; -O0: subs w9, w8, w9, uxth
3969 ; -O0: subs w9, w9, #1
3971 ; -O1-LABEL: atomicrmw_or_i16_aligned_acq_rel:
3972 ; -O1: ldaxrh w8, [x0]
3973 ; -O1: orr w9, w8, w1
3974 ; -O1: stlxrh w10, w9, [x0]
3975 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 2
3979 define dso_local i16 @atomicrmw_or_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
3980 ; -O0-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3981 ; -O0: orr w12, w9, w8
3982 ; -O0: ldaxrh w8, [x11]
3983 ; -O0: cmp w8, w9, uxth
3984 ; -O0: stlxrh w10, w12, [x11]
3985 ; -O0: subs w9, w8, w9, uxth
3986 ; -O0: subs w9, w9, #1
3988 ; -O1-LABEL: atomicrmw_or_i16_aligned_seq_cst:
3989 ; -O1: ldaxrh w8, [x0]
3990 ; -O1: orr w9, w8, w1
3991 ; -O1: stlxrh w10, w9, [x0]
3992 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 2
3996 define dso_local i32 @atomicrmw_or_i32_aligned_monotonic(ptr %ptr, i32 %value) {
3997 ; -O0-LABEL: atomicrmw_or_i32_aligned_monotonic:
3998 ; -O0: orr w12, w9, w8
3999 ; -O0: ldaxr w8, [x11]
4001 ; -O0: stlxr w10, w12, [x11]
4002 ; -O0: subs w9, w8, w9
4003 ; -O0: subs w9, w9, #1
4005 ; -O1-LABEL: atomicrmw_or_i32_aligned_monotonic:
4006 ; -O1: ldxr w8, [x0]
4007 ; -O1: orr w9, w8, w1
4008 ; -O1: stxr w10, w9, [x0]
4009 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 4
4013 define dso_local i32 @atomicrmw_or_i32_aligned_acquire(ptr %ptr, i32 %value) {
4014 ; -O0-LABEL: atomicrmw_or_i32_aligned_acquire:
4015 ; -O0: orr w12, w9, w8
4016 ; -O0: ldaxr w8, [x11]
4018 ; -O0: stlxr w10, w12, [x11]
4019 ; -O0: subs w9, w8, w9
4020 ; -O0: subs w9, w9, #1
4022 ; -O1-LABEL: atomicrmw_or_i32_aligned_acquire:
4023 ; -O1: ldaxr w8, [x0]
4024 ; -O1: orr w9, w8, w1
4025 ; -O1: stxr w10, w9, [x0]
4026 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 4
4030 define dso_local i32 @atomicrmw_or_i32_aligned_release(ptr %ptr, i32 %value) {
4031 ; -O0-LABEL: atomicrmw_or_i32_aligned_release:
4032 ; -O0: orr w12, w9, w8
4033 ; -O0: ldaxr w8, [x11]
4035 ; -O0: stlxr w10, w12, [x11]
4036 ; -O0: subs w9, w8, w9
4037 ; -O0: subs w9, w9, #1
4039 ; -O1-LABEL: atomicrmw_or_i32_aligned_release:
4040 ; -O1: ldxr w8, [x0]
4041 ; -O1: orr w9, w8, w1
4042 ; -O1: stlxr w10, w9, [x0]
4043 %r = atomicrmw or ptr %ptr, i32 %value release, align 4
4047 define dso_local i32 @atomicrmw_or_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4048 ; -O0-LABEL: atomicrmw_or_i32_aligned_acq_rel:
4049 ; -O0: orr w12, w9, w8
4050 ; -O0: ldaxr w8, [x11]
4052 ; -O0: stlxr w10, w12, [x11]
4053 ; -O0: subs w9, w8, w9
4054 ; -O0: subs w9, w9, #1
4056 ; -O1-LABEL: atomicrmw_or_i32_aligned_acq_rel:
4057 ; -O1: ldaxr w8, [x0]
4058 ; -O1: orr w9, w8, w1
4059 ; -O1: stlxr w10, w9, [x0]
4060 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 4
4064 define dso_local i32 @atomicrmw_or_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4065 ; -O0-LABEL: atomicrmw_or_i32_aligned_seq_cst:
4066 ; -O0: orr w12, w9, w8
4067 ; -O0: ldaxr w8, [x11]
4069 ; -O0: stlxr w10, w12, [x11]
4070 ; -O0: subs w9, w8, w9
4071 ; -O0: subs w9, w9, #1
4073 ; -O1-LABEL: atomicrmw_or_i32_aligned_seq_cst:
4074 ; -O1: ldaxr w8, [x0]
4075 ; -O1: orr w9, w8, w1
4076 ; -O1: stlxr w10, w9, [x0]
4077 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 4
4081 define dso_local i64 @atomicrmw_or_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4082 ; -O0-LABEL: atomicrmw_or_i64_aligned_monotonic:
4083 ; -O0: orr x12, x9, x8
4084 ; -O0: ldaxr x8, [x11]
4086 ; -O0: stlxr w10, x12, [x11]
4087 ; -O0: subs x9, x8, x9
4088 ; -O0: subs w9, w9, #1
4090 ; -O1-LABEL: atomicrmw_or_i64_aligned_monotonic:
4091 ; -O1: ldxr x0, [x8]
4092 ; -O1: orr x9, x0, x1
4093 ; -O1: stxr w10, x9, [x8]
4094 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 8
4098 define dso_local i64 @atomicrmw_or_i64_aligned_acquire(ptr %ptr, i64 %value) {
4099 ; -O0-LABEL: atomicrmw_or_i64_aligned_acquire:
4100 ; -O0: orr x12, x9, x8
4101 ; -O0: ldaxr x8, [x11]
4103 ; -O0: stlxr w10, x12, [x11]
4104 ; -O0: subs x9, x8, x9
4105 ; -O0: subs w9, w9, #1
4107 ; -O1-LABEL: atomicrmw_or_i64_aligned_acquire:
4108 ; -O1: ldaxr x0, [x8]
4109 ; -O1: orr x9, x0, x1
4110 ; -O1: stxr w10, x9, [x8]
4111 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 8
4115 define dso_local i64 @atomicrmw_or_i64_aligned_release(ptr %ptr, i64 %value) {
4116 ; -O0-LABEL: atomicrmw_or_i64_aligned_release:
4117 ; -O0: orr x12, x9, x8
4118 ; -O0: ldaxr x8, [x11]
4120 ; -O0: stlxr w10, x12, [x11]
4121 ; -O0: subs x9, x8, x9
4122 ; -O0: subs w9, w9, #1
4124 ; -O1-LABEL: atomicrmw_or_i64_aligned_release:
4125 ; -O1: ldxr x0, [x8]
4126 ; -O1: orr x9, x0, x1
4127 ; -O1: stlxr w10, x9, [x8]
4128 %r = atomicrmw or ptr %ptr, i64 %value release, align 8
4132 define dso_local i64 @atomicrmw_or_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4133 ; -O0-LABEL: atomicrmw_or_i64_aligned_acq_rel:
4134 ; -O0: orr x12, x9, x8
4135 ; -O0: ldaxr x8, [x11]
4137 ; -O0: stlxr w10, x12, [x11]
4138 ; -O0: subs x9, x8, x9
4139 ; -O0: subs w9, w9, #1
4141 ; -O1-LABEL: atomicrmw_or_i64_aligned_acq_rel:
4142 ; -O1: ldaxr x0, [x8]
4143 ; -O1: orr x9, x0, x1
4144 ; -O1: stlxr w10, x9, [x8]
4145 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 8
4149 define dso_local i64 @atomicrmw_or_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4150 ; -O0-LABEL: atomicrmw_or_i64_aligned_seq_cst:
4151 ; -O0: orr x12, x9, x8
4152 ; -O0: ldaxr x8, [x11]
4154 ; -O0: stlxr w10, x12, [x11]
4155 ; -O0: subs x9, x8, x9
4156 ; -O0: subs w9, w9, #1
4158 ; -O1-LABEL: atomicrmw_or_i64_aligned_seq_cst:
4159 ; -O1: ldaxr x0, [x8]
4160 ; -O1: orr x9, x0, x1
4161 ; -O1: stlxr w10, x9, [x8]
4162 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 8
4166 define dso_local i128 @atomicrmw_or_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4167 ; -O0-LABEL: atomicrmw_or_i128_aligned_monotonic:
4168 ; -O0: orr x15, x13, x10
4169 ; -O0: orr x14, x11, x8
4170 ; -O0: ldxp x10, x12, [x9]
4173 ; -O0: stxp w8, x14, x15, [x9]
4174 ; -O0: stxp w8, x10, x12, [x9]
4175 ; -O0: subs x12, x12, x13
4176 ; -O0: ccmp x10, x11, #0, eq
4178 ; -O1-LABEL: atomicrmw_or_i128_aligned_monotonic:
4179 ; -O1: ldxp x1, x0, [x8]
4180 ; -O1: orr x9, x0, x2
4181 ; -O1: orr x10, x1, x3
4182 ; -O1: stxp w11, x10, x9, [x8]
4183 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 16
4187 define dso_local i128 @atomicrmw_or_i128_aligned_acquire(ptr %ptr, i128 %value) {
4188 ; -O0-LABEL: atomicrmw_or_i128_aligned_acquire:
4189 ; -O0: orr x15, x13, x10
4190 ; -O0: orr x14, x11, x8
4191 ; -O0: ldaxp x10, x12, [x9]
4194 ; -O0: stxp w8, x14, x15, [x9]
4195 ; -O0: stxp w8, x10, x12, [x9]
4196 ; -O0: subs x12, x12, x13
4197 ; -O0: ccmp x10, x11, #0, eq
4199 ; -O1-LABEL: atomicrmw_or_i128_aligned_acquire:
4200 ; -O1: ldaxp x1, x0, [x8]
4201 ; -O1: orr x9, x0, x2
4202 ; -O1: orr x10, x1, x3
4203 ; -O1: stxp w11, x10, x9, [x8]
4204 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 16
4208 define dso_local i128 @atomicrmw_or_i128_aligned_release(ptr %ptr, i128 %value) {
4209 ; -O0-LABEL: atomicrmw_or_i128_aligned_release:
4210 ; -O0: orr x15, x13, x10
4211 ; -O0: orr x14, x11, x8
4212 ; -O0: ldxp x10, x12, [x9]
4215 ; -O0: stlxp w8, x14, x15, [x9]
4216 ; -O0: stlxp w8, x10, x12, [x9]
4217 ; -O0: subs x12, x12, x13
4218 ; -O0: ccmp x10, x11, #0, eq
4220 ; -O1-LABEL: atomicrmw_or_i128_aligned_release:
4221 ; -O1: ldxp x1, x0, [x8]
4222 ; -O1: orr x9, x0, x2
4223 ; -O1: orr x10, x1, x3
4224 ; -O1: stlxp w11, x10, x9, [x8]
4225 %r = atomicrmw or ptr %ptr, i128 %value release, align 16
4229 define dso_local i128 @atomicrmw_or_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
4230 ; -O0-LABEL: atomicrmw_or_i128_aligned_acq_rel:
4231 ; -O0: orr x15, x13, x10
4232 ; -O0: orr x14, x11, x8
4233 ; -O0: ldaxp x10, x12, [x9]
4236 ; -O0: stlxp w8, x14, x15, [x9]
4237 ; -O0: stlxp w8, x10, x12, [x9]
4238 ; -O0: subs x12, x12, x13
4239 ; -O0: ccmp x10, x11, #0, eq
4241 ; -O1-LABEL: atomicrmw_or_i128_aligned_acq_rel:
4242 ; -O1: ldaxp x1, x0, [x8]
4243 ; -O1: orr x9, x0, x2
4244 ; -O1: orr x10, x1, x3
4245 ; -O1: stlxp w11, x10, x9, [x8]
4246 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 16
4250 define dso_local i128 @atomicrmw_or_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
4251 ; -O0-LABEL: atomicrmw_or_i128_aligned_seq_cst:
4252 ; -O0: orr x15, x13, x10
4253 ; -O0: orr x14, x11, x8
4254 ; -O0: ldaxp x10, x12, [x9]
4257 ; -O0: stlxp w8, x14, x15, [x9]
4258 ; -O0: stlxp w8, x10, x12, [x9]
4259 ; -O0: subs x12, x12, x13
4260 ; -O0: ccmp x10, x11, #0, eq
4262 ; -O1-LABEL: atomicrmw_or_i128_aligned_seq_cst:
4263 ; -O1: ldaxp x1, x0, [x8]
4264 ; -O1: orr x9, x0, x2
4265 ; -O1: orr x10, x1, x3
4266 ; -O1: stlxp w11, x10, x9, [x8]
4267 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 16
4271 define dso_local i8 @atomicrmw_or_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
4272 ; -O0-LABEL: atomicrmw_or_i8_unaligned_monotonic:
4273 ; -O0: orr w12, w9, w8
4274 ; -O0: ldaxrb w8, [x11]
4275 ; -O0: cmp w8, w9, uxtb
4276 ; -O0: stlxrb w10, w12, [x11]
4277 ; -O0: subs w9, w8, w9, uxtb
4278 ; -O0: subs w9, w9, #1
4280 ; -O1-LABEL: atomicrmw_or_i8_unaligned_monotonic:
4281 ; -O1: ldxrb w8, [x0]
4282 ; -O1: orr w9, w8, w1
4283 ; -O1: stxrb w10, w9, [x0]
4284 %r = atomicrmw or ptr %ptr, i8 %value monotonic, align 1
4288 define dso_local i8 @atomicrmw_or_i8_unaligned_acquire(ptr %ptr, i8 %value) {
4289 ; -O0-LABEL: atomicrmw_or_i8_unaligned_acquire:
4290 ; -O0: orr w12, w9, w8
4291 ; -O0: ldaxrb w8, [x11]
4292 ; -O0: cmp w8, w9, uxtb
4293 ; -O0: stlxrb w10, w12, [x11]
4294 ; -O0: subs w9, w8, w9, uxtb
4295 ; -O0: subs w9, w9, #1
4297 ; -O1-LABEL: atomicrmw_or_i8_unaligned_acquire:
4298 ; -O1: ldaxrb w8, [x0]
4299 ; -O1: orr w9, w8, w1
4300 ; -O1: stxrb w10, w9, [x0]
4301 %r = atomicrmw or ptr %ptr, i8 %value acquire, align 1
4305 define dso_local i8 @atomicrmw_or_i8_unaligned_release(ptr %ptr, i8 %value) {
4306 ; -O0-LABEL: atomicrmw_or_i8_unaligned_release:
4307 ; -O0: orr w12, w9, w8
4308 ; -O0: ldaxrb w8, [x11]
4309 ; -O0: cmp w8, w9, uxtb
4310 ; -O0: stlxrb w10, w12, [x11]
4311 ; -O0: subs w9, w8, w9, uxtb
4312 ; -O0: subs w9, w9, #1
4314 ; -O1-LABEL: atomicrmw_or_i8_unaligned_release:
4315 ; -O1: ldxrb w8, [x0]
4316 ; -O1: orr w9, w8, w1
4317 ; -O1: stlxrb w10, w9, [x0]
4318 %r = atomicrmw or ptr %ptr, i8 %value release, align 1
4322 define dso_local i8 @atomicrmw_or_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
4323 ; -O0-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
4324 ; -O0: orr w12, w9, w8
4325 ; -O0: ldaxrb w8, [x11]
4326 ; -O0: cmp w8, w9, uxtb
4327 ; -O0: stlxrb w10, w12, [x11]
4328 ; -O0: subs w9, w8, w9, uxtb
4329 ; -O0: subs w9, w9, #1
4331 ; -O1-LABEL: atomicrmw_or_i8_unaligned_acq_rel:
4332 ; -O1: ldaxrb w8, [x0]
4333 ; -O1: orr w9, w8, w1
4334 ; -O1: stlxrb w10, w9, [x0]
4335 %r = atomicrmw or ptr %ptr, i8 %value acq_rel, align 1
4339 define dso_local i8 @atomicrmw_or_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
4340 ; -O0-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
4341 ; -O0: orr w12, w9, w8
4342 ; -O0: ldaxrb w8, [x11]
4343 ; -O0: cmp w8, w9, uxtb
4344 ; -O0: stlxrb w10, w12, [x11]
4345 ; -O0: subs w9, w8, w9, uxtb
4346 ; -O0: subs w9, w9, #1
4348 ; -O1-LABEL: atomicrmw_or_i8_unaligned_seq_cst:
4349 ; -O1: ldaxrb w8, [x0]
4350 ; -O1: orr w9, w8, w1
4351 ; -O1: stlxrb w10, w9, [x0]
4352 %r = atomicrmw or ptr %ptr, i8 %value seq_cst, align 1
4356 define dso_local i16 @atomicrmw_or_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
4357 ; -O0-LABEL: atomicrmw_or_i16_unaligned_monotonic:
4358 ; -O0: orr w8, w9, w8
4359 ; -O0: bl __atomic_compare_exchange
4361 ; -O1-LABEL: atomicrmw_or_i16_unaligned_monotonic:
4362 ; -O1: orr w8, w0, w20
4363 ; -O1: bl __atomic_compare_exchange
4364 %r = atomicrmw or ptr %ptr, i16 %value monotonic, align 1
4368 define dso_local i16 @atomicrmw_or_i16_unaligned_acquire(ptr %ptr, i16 %value) {
4369 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acquire:
4370 ; -O0: orr w8, w9, w8
4371 ; -O0: bl __atomic_compare_exchange
4373 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acquire:
4374 ; -O1: orr w8, w0, w20
4375 ; -O1: bl __atomic_compare_exchange
4376 %r = atomicrmw or ptr %ptr, i16 %value acquire, align 1
4380 define dso_local i16 @atomicrmw_or_i16_unaligned_release(ptr %ptr, i16 %value) {
4381 ; -O0-LABEL: atomicrmw_or_i16_unaligned_release:
4382 ; -O0: orr w8, w9, w8
4383 ; -O0: bl __atomic_compare_exchange
4385 ; -O1-LABEL: atomicrmw_or_i16_unaligned_release:
4386 ; -O1: orr w8, w0, w20
4387 ; -O1: bl __atomic_compare_exchange
4388 %r = atomicrmw or ptr %ptr, i16 %value release, align 1
4392 define dso_local i16 @atomicrmw_or_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
4393 ; -O0-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
4394 ; -O0: orr w8, w9, w8
4395 ; -O0: bl __atomic_compare_exchange
4397 ; -O1-LABEL: atomicrmw_or_i16_unaligned_acq_rel:
4398 ; -O1: orr w8, w0, w20
4399 ; -O1: bl __atomic_compare_exchange
4400 %r = atomicrmw or ptr %ptr, i16 %value acq_rel, align 1
4404 define dso_local i16 @atomicrmw_or_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
4405 ; -O0-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
4406 ; -O0: orr w8, w9, w8
4407 ; -O0: bl __atomic_compare_exchange
4409 ; -O1-LABEL: atomicrmw_or_i16_unaligned_seq_cst:
4410 ; -O1: orr w8, w0, w20
4411 ; -O1: bl __atomic_compare_exchange
4412 %r = atomicrmw or ptr %ptr, i16 %value seq_cst, align 1
4416 define dso_local i32 @atomicrmw_or_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
4417 ; -O0-LABEL: atomicrmw_or_i32_unaligned_monotonic:
4418 ; -O0: orr w8, w9, w8
4419 ; -O0: bl __atomic_compare_exchange
4421 ; -O1-LABEL: atomicrmw_or_i32_unaligned_monotonic:
4422 ; -O1: orr w8, w0, w20
4423 ; -O1: bl __atomic_compare_exchange
4424 %r = atomicrmw or ptr %ptr, i32 %value monotonic, align 1
4428 define dso_local i32 @atomicrmw_or_i32_unaligned_acquire(ptr %ptr, i32 %value) {
4429 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acquire:
4430 ; -O0: orr w8, w9, w8
4431 ; -O0: bl __atomic_compare_exchange
4433 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acquire:
4434 ; -O1: orr w8, w0, w20
4435 ; -O1: bl __atomic_compare_exchange
4436 %r = atomicrmw or ptr %ptr, i32 %value acquire, align 1
4440 define dso_local i32 @atomicrmw_or_i32_unaligned_release(ptr %ptr, i32 %value) {
4441 ; -O0-LABEL: atomicrmw_or_i32_unaligned_release:
4442 ; -O0: orr w8, w9, w8
4443 ; -O0: bl __atomic_compare_exchange
4445 ; -O1-LABEL: atomicrmw_or_i32_unaligned_release:
4446 ; -O1: orr w8, w0, w20
4447 ; -O1: bl __atomic_compare_exchange
4448 %r = atomicrmw or ptr %ptr, i32 %value release, align 1
4452 define dso_local i32 @atomicrmw_or_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
4453 ; -O0-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
4454 ; -O0: orr w8, w9, w8
4455 ; -O0: bl __atomic_compare_exchange
4457 ; -O1-LABEL: atomicrmw_or_i32_unaligned_acq_rel:
4458 ; -O1: orr w8, w0, w20
4459 ; -O1: bl __atomic_compare_exchange
4460 %r = atomicrmw or ptr %ptr, i32 %value acq_rel, align 1
4464 define dso_local i32 @atomicrmw_or_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
4465 ; -O0-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
4466 ; -O0: orr w8, w9, w8
4467 ; -O0: bl __atomic_compare_exchange
4469 ; -O1-LABEL: atomicrmw_or_i32_unaligned_seq_cst:
4470 ; -O1: orr w8, w0, w20
4471 ; -O1: bl __atomic_compare_exchange
4472 %r = atomicrmw or ptr %ptr, i32 %value seq_cst, align 1
4476 define dso_local i64 @atomicrmw_or_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
4477 ; -O0-LABEL: atomicrmw_or_i64_unaligned_monotonic:
4478 ; -O0: orr x8, x9, x8
4479 ; -O0: bl __atomic_compare_exchange
4481 ; -O1-LABEL: atomicrmw_or_i64_unaligned_monotonic:
4482 ; -O1: orr x8, x0, x20
4483 ; -O1: bl __atomic_compare_exchange
4484 %r = atomicrmw or ptr %ptr, i64 %value monotonic, align 1
4488 define dso_local i64 @atomicrmw_or_i64_unaligned_acquire(ptr %ptr, i64 %value) {
4489 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acquire:
4490 ; -O0: orr x8, x9, x8
4491 ; -O0: bl __atomic_compare_exchange
4493 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acquire:
4494 ; -O1: orr x8, x0, x20
4495 ; -O1: bl __atomic_compare_exchange
4496 %r = atomicrmw or ptr %ptr, i64 %value acquire, align 1
4500 define dso_local i64 @atomicrmw_or_i64_unaligned_release(ptr %ptr, i64 %value) {
4501 ; -O0-LABEL: atomicrmw_or_i64_unaligned_release:
4502 ; -O0: orr x8, x9, x8
4503 ; -O0: bl __atomic_compare_exchange
4505 ; -O1-LABEL: atomicrmw_or_i64_unaligned_release:
4506 ; -O1: orr x8, x0, x20
4507 ; -O1: bl __atomic_compare_exchange
4508 %r = atomicrmw or ptr %ptr, i64 %value release, align 1
4512 define dso_local i64 @atomicrmw_or_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
4513 ; -O0-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
4514 ; -O0: orr x8, x9, x8
4515 ; -O0: bl __atomic_compare_exchange
4517 ; -O1-LABEL: atomicrmw_or_i64_unaligned_acq_rel:
4518 ; -O1: orr x8, x0, x20
4519 ; -O1: bl __atomic_compare_exchange
4520 %r = atomicrmw or ptr %ptr, i64 %value acq_rel, align 1
4524 define dso_local i64 @atomicrmw_or_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
4525 ; -O0-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
4526 ; -O0: orr x8, x9, x8
4527 ; -O0: bl __atomic_compare_exchange
4529 ; -O1-LABEL: atomicrmw_or_i64_unaligned_seq_cst:
4530 ; -O1: orr x8, x0, x20
4531 ; -O1: bl __atomic_compare_exchange
4532 %r = atomicrmw or ptr %ptr, i64 %value seq_cst, align 1
4536 define dso_local i128 @atomicrmw_or_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
4537 ; -O0-LABEL: atomicrmw_or_i128_unaligned_monotonic:
4538 ; -O0: orr x8, x11, x8
4539 ; -O0: orr x9, x10, x9
4540 ; -O0: bl __atomic_compare_exchange
4542 ; -O1-LABEL: atomicrmw_or_i128_unaligned_monotonic:
4543 ; -O1: ldp x0, x1, [x0]
4544 ; -O1: orr x8, x1, x19
4545 ; -O1: orr x9, x0, x21
4546 ; -O1: bl __atomic_compare_exchange
4547 %r = atomicrmw or ptr %ptr, i128 %value monotonic, align 1
4551 define dso_local i128 @atomicrmw_or_i128_unaligned_acquire(ptr %ptr, i128 %value) {
4552 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acquire:
4553 ; -O0: orr x8, x11, x8
4554 ; -O0: orr x9, x10, x9
4555 ; -O0: bl __atomic_compare_exchange
4557 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acquire:
4558 ; -O1: ldp x0, x1, [x0]
4559 ; -O1: orr x8, x1, x19
4560 ; -O1: orr x9, x0, x21
4561 ; -O1: bl __atomic_compare_exchange
4562 %r = atomicrmw or ptr %ptr, i128 %value acquire, align 1
4566 define dso_local i128 @atomicrmw_or_i128_unaligned_release(ptr %ptr, i128 %value) {
4567 ; -O0-LABEL: atomicrmw_or_i128_unaligned_release:
4568 ; -O0: orr x8, x11, x8
4569 ; -O0: orr x9, x10, x9
4570 ; -O0: bl __atomic_compare_exchange
4572 ; -O1-LABEL: atomicrmw_or_i128_unaligned_release:
4573 ; -O1: ldp x0, x1, [x0]
4574 ; -O1: orr x8, x1, x19
4575 ; -O1: orr x9, x0, x21
4576 ; -O1: bl __atomic_compare_exchange
4577 %r = atomicrmw or ptr %ptr, i128 %value release, align 1
4581 define dso_local i128 @atomicrmw_or_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
4582 ; -O0-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
4583 ; -O0: orr x8, x11, x8
4584 ; -O0: orr x9, x10, x9
4585 ; -O0: bl __atomic_compare_exchange
4587 ; -O1-LABEL: atomicrmw_or_i128_unaligned_acq_rel:
4588 ; -O1: ldp x0, x1, [x0]
4589 ; -O1: orr x8, x1, x19
4590 ; -O1: orr x9, x0, x21
4591 ; -O1: bl __atomic_compare_exchange
4592 %r = atomicrmw or ptr %ptr, i128 %value acq_rel, align 1
4596 define dso_local i128 @atomicrmw_or_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
4597 ; -O0-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
4598 ; -O0: orr x8, x11, x8
4599 ; -O0: orr x9, x10, x9
4600 ; -O0: bl __atomic_compare_exchange
4602 ; -O1-LABEL: atomicrmw_or_i128_unaligned_seq_cst:
4603 ; -O1: ldp x0, x1, [x0]
4604 ; -O1: orr x8, x1, x19
4605 ; -O1: orr x9, x0, x21
4606 ; -O1: bl __atomic_compare_exchange
4607 %r = atomicrmw or ptr %ptr, i128 %value seq_cst, align 1
4611 define dso_local i8 @atomicrmw_xor_i8_aligned_monotonic(ptr %ptr, i8 %value) {
4612 ; -O0-LABEL: atomicrmw_xor_i8_aligned_monotonic:
4613 ; -O0: eor w12, w9, w8
4614 ; -O0: ldaxrb w8, [x11]
4615 ; -O0: cmp w8, w9, uxtb
4616 ; -O0: stlxrb w10, w12, [x11]
4617 ; -O0: subs w9, w8, w9, uxtb
4618 ; -O0: subs w9, w9, #1
4620 ; -O1-LABEL: atomicrmw_xor_i8_aligned_monotonic:
4621 ; -O1: ldxrb w8, [x0]
4622 ; -O1: eor w9, w8, w1
4623 ; -O1: stxrb w10, w9, [x0]
4624 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
4628 define dso_local i8 @atomicrmw_xor_i8_aligned_acquire(ptr %ptr, i8 %value) {
4629 ; -O0-LABEL: atomicrmw_xor_i8_aligned_acquire:
4630 ; -O0: eor w12, w9, w8
4631 ; -O0: ldaxrb w8, [x11]
4632 ; -O0: cmp w8, w9, uxtb
4633 ; -O0: stlxrb w10, w12, [x11]
4634 ; -O0: subs w9, w8, w9, uxtb
4635 ; -O0: subs w9, w9, #1
4637 ; -O1-LABEL: atomicrmw_xor_i8_aligned_acquire:
4638 ; -O1: ldaxrb w8, [x0]
4639 ; -O1: eor w9, w8, w1
4640 ; -O1: stxrb w10, w9, [x0]
4641 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
4645 define dso_local i8 @atomicrmw_xor_i8_aligned_release(ptr %ptr, i8 %value) {
4646 ; -O0-LABEL: atomicrmw_xor_i8_aligned_release:
4647 ; -O0: eor w12, w9, w8
4648 ; -O0: ldaxrb w8, [x11]
4649 ; -O0: cmp w8, w9, uxtb
4650 ; -O0: stlxrb w10, w12, [x11]
4651 ; -O0: subs w9, w8, w9, uxtb
4652 ; -O0: subs w9, w9, #1
4654 ; -O1-LABEL: atomicrmw_xor_i8_aligned_release:
4655 ; -O1: ldxrb w8, [x0]
4656 ; -O1: eor w9, w8, w1
4657 ; -O1: stlxrb w10, w9, [x0]
4658 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
4662 define dso_local i8 @atomicrmw_xor_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
4663 ; -O0-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
4664 ; -O0: eor w12, w9, w8
4665 ; -O0: ldaxrb w8, [x11]
4666 ; -O0: cmp w8, w9, uxtb
4667 ; -O0: stlxrb w10, w12, [x11]
4668 ; -O0: subs w9, w8, w9, uxtb
4669 ; -O0: subs w9, w9, #1
4671 ; -O1-LABEL: atomicrmw_xor_i8_aligned_acq_rel:
4672 ; -O1: ldaxrb w8, [x0]
4673 ; -O1: eor w9, w8, w1
4674 ; -O1: stlxrb w10, w9, [x0]
4675 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
4679 define dso_local i8 @atomicrmw_xor_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
4680 ; -O0-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
4681 ; -O0: eor w12, w9, w8
4682 ; -O0: ldaxrb w8, [x11]
4683 ; -O0: cmp w8, w9, uxtb
4684 ; -O0: stlxrb w10, w12, [x11]
4685 ; -O0: subs w9, w8, w9, uxtb
4686 ; -O0: subs w9, w9, #1
4688 ; -O1-LABEL: atomicrmw_xor_i8_aligned_seq_cst:
4689 ; -O1: ldaxrb w8, [x0]
4690 ; -O1: eor w9, w8, w1
4691 ; -O1: stlxrb w10, w9, [x0]
4692 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
4696 define dso_local i16 @atomicrmw_xor_i16_aligned_monotonic(ptr %ptr, i16 %value) {
4697 ; -O0-LABEL: atomicrmw_xor_i16_aligned_monotonic:
4698 ; -O0: eor w12, w9, w8
4699 ; -O0: ldaxrh w8, [x11]
4700 ; -O0: cmp w8, w9, uxth
4701 ; -O0: stlxrh w10, w12, [x11]
4702 ; -O0: subs w9, w8, w9, uxth
4703 ; -O0: subs w9, w9, #1
4705 ; -O1-LABEL: atomicrmw_xor_i16_aligned_monotonic:
4706 ; -O1: ldxrh w8, [x0]
4707 ; -O1: eor w9, w8, w1
4708 ; -O1: stxrh w10, w9, [x0]
4709 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 2
4713 define dso_local i16 @atomicrmw_xor_i16_aligned_acquire(ptr %ptr, i16 %value) {
4714 ; -O0-LABEL: atomicrmw_xor_i16_aligned_acquire:
4715 ; -O0: eor w12, w9, w8
4716 ; -O0: ldaxrh w8, [x11]
4717 ; -O0: cmp w8, w9, uxth
4718 ; -O0: stlxrh w10, w12, [x11]
4719 ; -O0: subs w9, w8, w9, uxth
4720 ; -O0: subs w9, w9, #1
4722 ; -O1-LABEL: atomicrmw_xor_i16_aligned_acquire:
4723 ; -O1: ldaxrh w8, [x0]
4724 ; -O1: eor w9, w8, w1
4725 ; -O1: stxrh w10, w9, [x0]
4726 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 2
4730 define dso_local i16 @atomicrmw_xor_i16_aligned_release(ptr %ptr, i16 %value) {
4731 ; -O0-LABEL: atomicrmw_xor_i16_aligned_release:
4732 ; -O0: eor w12, w9, w8
4733 ; -O0: ldaxrh w8, [x11]
4734 ; -O0: cmp w8, w9, uxth
4735 ; -O0: stlxrh w10, w12, [x11]
4736 ; -O0: subs w9, w8, w9, uxth
4737 ; -O0: subs w9, w9, #1
4739 ; -O1-LABEL: atomicrmw_xor_i16_aligned_release:
4740 ; -O1: ldxrh w8, [x0]
4741 ; -O1: eor w9, w8, w1
4742 ; -O1: stlxrh w10, w9, [x0]
4743 %r = atomicrmw xor ptr %ptr, i16 %value release, align 2
4747 define dso_local i16 @atomicrmw_xor_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
4748 ; -O0-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
4749 ; -O0: eor w12, w9, w8
4750 ; -O0: ldaxrh w8, [x11]
4751 ; -O0: cmp w8, w9, uxth
4752 ; -O0: stlxrh w10, w12, [x11]
4753 ; -O0: subs w9, w8, w9, uxth
4754 ; -O0: subs w9, w9, #1
4756 ; -O1-LABEL: atomicrmw_xor_i16_aligned_acq_rel:
4757 ; -O1: ldaxrh w8, [x0]
4758 ; -O1: eor w9, w8, w1
4759 ; -O1: stlxrh w10, w9, [x0]
4760 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 2
4764 define dso_local i16 @atomicrmw_xor_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
4765 ; -O0-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
4766 ; -O0: eor w12, w9, w8
4767 ; -O0: ldaxrh w8, [x11]
4768 ; -O0: cmp w8, w9, uxth
4769 ; -O0: stlxrh w10, w12, [x11]
4770 ; -O0: subs w9, w8, w9, uxth
4771 ; -O0: subs w9, w9, #1
4773 ; -O1-LABEL: atomicrmw_xor_i16_aligned_seq_cst:
4774 ; -O1: ldaxrh w8, [x0]
4775 ; -O1: eor w9, w8, w1
4776 ; -O1: stlxrh w10, w9, [x0]
4777 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 2
4781 define dso_local i32 @atomicrmw_xor_i32_aligned_monotonic(ptr %ptr, i32 %value) {
4782 ; -O0-LABEL: atomicrmw_xor_i32_aligned_monotonic:
4783 ; -O0: eor w12, w9, w8
4784 ; -O0: ldaxr w8, [x11]
4786 ; -O0: stlxr w10, w12, [x11]
4787 ; -O0: subs w9, w8, w9
4788 ; -O0: subs w9, w9, #1
4790 ; -O1-LABEL: atomicrmw_xor_i32_aligned_monotonic:
4791 ; -O1: ldxr w8, [x0]
4792 ; -O1: eor w9, w8, w1
4793 ; -O1: stxr w10, w9, [x0]
4794 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 4
4798 define dso_local i32 @atomicrmw_xor_i32_aligned_acquire(ptr %ptr, i32 %value) {
4799 ; -O0-LABEL: atomicrmw_xor_i32_aligned_acquire:
4800 ; -O0: eor w12, w9, w8
4801 ; -O0: ldaxr w8, [x11]
4803 ; -O0: stlxr w10, w12, [x11]
4804 ; -O0: subs w9, w8, w9
4805 ; -O0: subs w9, w9, #1
4807 ; -O1-LABEL: atomicrmw_xor_i32_aligned_acquire:
4808 ; -O1: ldaxr w8, [x0]
4809 ; -O1: eor w9, w8, w1
4810 ; -O1: stxr w10, w9, [x0]
4811 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 4
4815 define dso_local i32 @atomicrmw_xor_i32_aligned_release(ptr %ptr, i32 %value) {
4816 ; -O0-LABEL: atomicrmw_xor_i32_aligned_release:
4817 ; -O0: eor w12, w9, w8
4818 ; -O0: ldaxr w8, [x11]
4820 ; -O0: stlxr w10, w12, [x11]
4821 ; -O0: subs w9, w8, w9
4822 ; -O0: subs w9, w9, #1
4824 ; -O1-LABEL: atomicrmw_xor_i32_aligned_release:
4825 ; -O1: ldxr w8, [x0]
4826 ; -O1: eor w9, w8, w1
4827 ; -O1: stlxr w10, w9, [x0]
4828 %r = atomicrmw xor ptr %ptr, i32 %value release, align 4
4832 define dso_local i32 @atomicrmw_xor_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
4833 ; -O0-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
4834 ; -O0: eor w12, w9, w8
4835 ; -O0: ldaxr w8, [x11]
4837 ; -O0: stlxr w10, w12, [x11]
4838 ; -O0: subs w9, w8, w9
4839 ; -O0: subs w9, w9, #1
4841 ; -O1-LABEL: atomicrmw_xor_i32_aligned_acq_rel:
4842 ; -O1: ldaxr w8, [x0]
4843 ; -O1: eor w9, w8, w1
4844 ; -O1: stlxr w10, w9, [x0]
4845 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 4
4849 define dso_local i32 @atomicrmw_xor_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
4850 ; -O0-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
4851 ; -O0: eor w12, w9, w8
4852 ; -O0: ldaxr w8, [x11]
4854 ; -O0: stlxr w10, w12, [x11]
4855 ; -O0: subs w9, w8, w9
4856 ; -O0: subs w9, w9, #1
4858 ; -O1-LABEL: atomicrmw_xor_i32_aligned_seq_cst:
4859 ; -O1: ldaxr w8, [x0]
4860 ; -O1: eor w9, w8, w1
4861 ; -O1: stlxr w10, w9, [x0]
4862 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 4
4866 define dso_local i64 @atomicrmw_xor_i64_aligned_monotonic(ptr %ptr, i64 %value) {
4867 ; -O0-LABEL: atomicrmw_xor_i64_aligned_monotonic:
4868 ; -O0: eor x12, x9, x8
4869 ; -O0: ldaxr x8, [x11]
4871 ; -O0: stlxr w10, x12, [x11]
4872 ; -O0: subs x9, x8, x9
4873 ; -O0: subs w9, w9, #1
4875 ; -O1-LABEL: atomicrmw_xor_i64_aligned_monotonic:
4876 ; -O1: ldxr x0, [x8]
4877 ; -O1: eor x9, x0, x1
4878 ; -O1: stxr w10, x9, [x8]
4879 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 8
4883 define dso_local i64 @atomicrmw_xor_i64_aligned_acquire(ptr %ptr, i64 %value) {
4884 ; -O0-LABEL: atomicrmw_xor_i64_aligned_acquire:
4885 ; -O0: eor x12, x9, x8
4886 ; -O0: ldaxr x8, [x11]
4888 ; -O0: stlxr w10, x12, [x11]
4889 ; -O0: subs x9, x8, x9
4890 ; -O0: subs w9, w9, #1
4892 ; -O1-LABEL: atomicrmw_xor_i64_aligned_acquire:
4893 ; -O1: ldaxr x0, [x8]
4894 ; -O1: eor x9, x0, x1
4895 ; -O1: stxr w10, x9, [x8]
4896 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 8
4900 define dso_local i64 @atomicrmw_xor_i64_aligned_release(ptr %ptr, i64 %value) {
4901 ; -O0-LABEL: atomicrmw_xor_i64_aligned_release:
4902 ; -O0: eor x12, x9, x8
4903 ; -O0: ldaxr x8, [x11]
4905 ; -O0: stlxr w10, x12, [x11]
4906 ; -O0: subs x9, x8, x9
4907 ; -O0: subs w9, w9, #1
4909 ; -O1-LABEL: atomicrmw_xor_i64_aligned_release:
4910 ; -O1: ldxr x0, [x8]
4911 ; -O1: eor x9, x0, x1
4912 ; -O1: stlxr w10, x9, [x8]
4913 %r = atomicrmw xor ptr %ptr, i64 %value release, align 8
4917 define dso_local i64 @atomicrmw_xor_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
4918 ; -O0-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
4919 ; -O0: eor x12, x9, x8
4920 ; -O0: ldaxr x8, [x11]
4922 ; -O0: stlxr w10, x12, [x11]
4923 ; -O0: subs x9, x8, x9
4924 ; -O0: subs w9, w9, #1
4926 ; -O1-LABEL: atomicrmw_xor_i64_aligned_acq_rel:
4927 ; -O1: ldaxr x0, [x8]
4928 ; -O1: eor x9, x0, x1
4929 ; -O1: stlxr w10, x9, [x8]
4930 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 8
4934 define dso_local i64 @atomicrmw_xor_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
4935 ; -O0-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
4936 ; -O0: eor x12, x9, x8
4937 ; -O0: ldaxr x8, [x11]
4939 ; -O0: stlxr w10, x12, [x11]
4940 ; -O0: subs x9, x8, x9
4941 ; -O0: subs w9, w9, #1
4943 ; -O1-LABEL: atomicrmw_xor_i64_aligned_seq_cst:
4944 ; -O1: ldaxr x0, [x8]
4945 ; -O1: eor x9, x0, x1
4946 ; -O1: stlxr w10, x9, [x8]
4947 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 8
4951 define dso_local i128 @atomicrmw_xor_i128_aligned_monotonic(ptr %ptr, i128 %value) {
4952 ; -O0-LABEL: atomicrmw_xor_i128_aligned_monotonic:
4953 ; -O0: eor x15, x13, x10
4954 ; -O0: eor x14, x11, x8
4955 ; -O0: ldxp x10, x12, [x9]
4958 ; -O0: stxp w8, x14, x15, [x9]
4959 ; -O0: stxp w8, x10, x12, [x9]
4960 ; -O0: subs x12, x12, x13
4961 ; -O0: ccmp x10, x11, #0, eq
4963 ; -O1-LABEL: atomicrmw_xor_i128_aligned_monotonic:
4964 ; -O1: ldxp x1, x0, [x8]
4965 ; -O1: eor x9, x0, x2
4966 ; -O1: eor x10, x1, x3
4967 ; -O1: stxp w11, x10, x9, [x8]
4968 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 16
4972 define dso_local i128 @atomicrmw_xor_i128_aligned_acquire(ptr %ptr, i128 %value) {
4973 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acquire:
4974 ; -O0: eor x15, x13, x10
4975 ; -O0: eor x14, x11, x8
4976 ; -O0: ldaxp x10, x12, [x9]
4979 ; -O0: stxp w8, x14, x15, [x9]
4980 ; -O0: stxp w8, x10, x12, [x9]
4981 ; -O0: subs x12, x12, x13
4982 ; -O0: ccmp x10, x11, #0, eq
4984 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acquire:
4985 ; -O1: ldaxp x1, x0, [x8]
4986 ; -O1: eor x9, x0, x2
4987 ; -O1: eor x10, x1, x3
4988 ; -O1: stxp w11, x10, x9, [x8]
4989 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 16
4993 define dso_local i128 @atomicrmw_xor_i128_aligned_release(ptr %ptr, i128 %value) {
4994 ; -O0-LABEL: atomicrmw_xor_i128_aligned_release:
4995 ; -O0: eor x15, x13, x10
4996 ; -O0: eor x14, x11, x8
4997 ; -O0: ldxp x10, x12, [x9]
5000 ; -O0: stlxp w8, x14, x15, [x9]
5001 ; -O0: stlxp w8, x10, x12, [x9]
5002 ; -O0: subs x12, x12, x13
5003 ; -O0: ccmp x10, x11, #0, eq
5005 ; -O1-LABEL: atomicrmw_xor_i128_aligned_release:
5006 ; -O1: ldxp x1, x0, [x8]
5007 ; -O1: eor x9, x0, x2
5008 ; -O1: eor x10, x1, x3
5009 ; -O1: stlxp w11, x10, x9, [x8]
5010 %r = atomicrmw xor ptr %ptr, i128 %value release, align 16
5014 define dso_local i128 @atomicrmw_xor_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5015 ; -O0-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
5016 ; -O0: eor x15, x13, x10
5017 ; -O0: eor x14, x11, x8
5018 ; -O0: ldaxp x10, x12, [x9]
5021 ; -O0: stlxp w8, x14, x15, [x9]
5022 ; -O0: stlxp w8, x10, x12, [x9]
5023 ; -O0: subs x12, x12, x13
5024 ; -O0: ccmp x10, x11, #0, eq
5026 ; -O1-LABEL: atomicrmw_xor_i128_aligned_acq_rel:
5027 ; -O1: ldaxp x1, x0, [x8]
5028 ; -O1: eor x9, x0, x2
5029 ; -O1: eor x10, x1, x3
5030 ; -O1: stlxp w11, x10, x9, [x8]
5031 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 16
5035 define dso_local i128 @atomicrmw_xor_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5036 ; -O0-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
5037 ; -O0: eor x15, x13, x10
5038 ; -O0: eor x14, x11, x8
5039 ; -O0: ldaxp x10, x12, [x9]
5042 ; -O0: stlxp w8, x14, x15, [x9]
5043 ; -O0: stlxp w8, x10, x12, [x9]
5044 ; -O0: subs x12, x12, x13
5045 ; -O0: ccmp x10, x11, #0, eq
5047 ; -O1-LABEL: atomicrmw_xor_i128_aligned_seq_cst:
5048 ; -O1: ldaxp x1, x0, [x8]
5049 ; -O1: eor x9, x0, x2
5050 ; -O1: eor x10, x1, x3
5051 ; -O1: stlxp w11, x10, x9, [x8]
5052 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 16
5056 define dso_local i8 @atomicrmw_xor_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5057 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
5058 ; -O0: eor w12, w9, w8
5059 ; -O0: ldaxrb w8, [x11]
5060 ; -O0: cmp w8, w9, uxtb
5061 ; -O0: stlxrb w10, w12, [x11]
5062 ; -O0: subs w9, w8, w9, uxtb
5063 ; -O0: subs w9, w9, #1
5065 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_monotonic:
5066 ; -O1: ldxrb w8, [x0]
5067 ; -O1: eor w9, w8, w1
5068 ; -O1: stxrb w10, w9, [x0]
5069 %r = atomicrmw xor ptr %ptr, i8 %value monotonic, align 1
5073 define dso_local i8 @atomicrmw_xor_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5074 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_acquire:
5075 ; -O0: eor w12, w9, w8
5076 ; -O0: ldaxrb w8, [x11]
5077 ; -O0: cmp w8, w9, uxtb
5078 ; -O0: stlxrb w10, w12, [x11]
5079 ; -O0: subs w9, w8, w9, uxtb
5080 ; -O0: subs w9, w9, #1
5082 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_acquire:
5083 ; -O1: ldaxrb w8, [x0]
5084 ; -O1: eor w9, w8, w1
5085 ; -O1: stxrb w10, w9, [x0]
5086 %r = atomicrmw xor ptr %ptr, i8 %value acquire, align 1
5090 define dso_local i8 @atomicrmw_xor_i8_unaligned_release(ptr %ptr, i8 %value) {
5091 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_release:
5092 ; -O0: eor w12, w9, w8
5093 ; -O0: ldaxrb w8, [x11]
5094 ; -O0: cmp w8, w9, uxtb
5095 ; -O0: stlxrb w10, w12, [x11]
5096 ; -O0: subs w9, w8, w9, uxtb
5097 ; -O0: subs w9, w9, #1
5099 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_release:
5100 ; -O1: ldxrb w8, [x0]
5101 ; -O1: eor w9, w8, w1
5102 ; -O1: stlxrb w10, w9, [x0]
5103 %r = atomicrmw xor ptr %ptr, i8 %value release, align 1
5107 define dso_local i8 @atomicrmw_xor_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5108 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
5109 ; -O0: eor w12, w9, w8
5110 ; -O0: ldaxrb w8, [x11]
5111 ; -O0: cmp w8, w9, uxtb
5112 ; -O0: stlxrb w10, w12, [x11]
5113 ; -O0: subs w9, w8, w9, uxtb
5114 ; -O0: subs w9, w9, #1
5116 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_acq_rel:
5117 ; -O1: ldaxrb w8, [x0]
5118 ; -O1: eor w9, w8, w1
5119 ; -O1: stlxrb w10, w9, [x0]
5120 %r = atomicrmw xor ptr %ptr, i8 %value acq_rel, align 1
5124 define dso_local i8 @atomicrmw_xor_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5125 ; -O0-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
5126 ; -O0: eor w12, w9, w8
5127 ; -O0: ldaxrb w8, [x11]
5128 ; -O0: cmp w8, w9, uxtb
5129 ; -O0: stlxrb w10, w12, [x11]
5130 ; -O0: subs w9, w8, w9, uxtb
5131 ; -O0: subs w9, w9, #1
5133 ; -O1-LABEL: atomicrmw_xor_i8_unaligned_seq_cst:
5134 ; -O1: ldaxrb w8, [x0]
5135 ; -O1: eor w9, w8, w1
5136 ; -O1: stlxrb w10, w9, [x0]
5137 %r = atomicrmw xor ptr %ptr, i8 %value seq_cst, align 1
5141 define dso_local i16 @atomicrmw_xor_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
5142 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
5143 ; -O0: eor w8, w9, w8
5144 ; -O0: bl __atomic_compare_exchange
5146 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_monotonic:
5147 ; -O1: eor w8, w0, w20
5148 ; -O1: bl __atomic_compare_exchange
5149 %r = atomicrmw xor ptr %ptr, i16 %value monotonic, align 1
5153 define dso_local i16 @atomicrmw_xor_i16_unaligned_acquire(ptr %ptr, i16 %value) {
5154 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acquire:
5155 ; -O0: eor w8, w9, w8
5156 ; -O0: bl __atomic_compare_exchange
5158 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acquire:
5159 ; -O1: eor w8, w0, w20
5160 ; -O1: bl __atomic_compare_exchange
5161 %r = atomicrmw xor ptr %ptr, i16 %value acquire, align 1
5165 define dso_local i16 @atomicrmw_xor_i16_unaligned_release(ptr %ptr, i16 %value) {
5166 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_release:
5167 ; -O0: eor w8, w9, w8
5168 ; -O0: bl __atomic_compare_exchange
5170 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_release:
5171 ; -O1: eor w8, w0, w20
5172 ; -O1: bl __atomic_compare_exchange
5173 %r = atomicrmw xor ptr %ptr, i16 %value release, align 1
5177 define dso_local i16 @atomicrmw_xor_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
5178 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
5179 ; -O0: eor w8, w9, w8
5180 ; -O0: bl __atomic_compare_exchange
5182 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_acq_rel:
5183 ; -O1: eor w8, w0, w20
5184 ; -O1: bl __atomic_compare_exchange
5185 %r = atomicrmw xor ptr %ptr, i16 %value acq_rel, align 1
5189 define dso_local i16 @atomicrmw_xor_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
5190 ; -O0-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
5191 ; -O0: eor w8, w9, w8
5192 ; -O0: bl __atomic_compare_exchange
5194 ; -O1-LABEL: atomicrmw_xor_i16_unaligned_seq_cst:
5195 ; -O1: eor w8, w0, w20
5196 ; -O1: bl __atomic_compare_exchange
5197 %r = atomicrmw xor ptr %ptr, i16 %value seq_cst, align 1
5201 define dso_local i32 @atomicrmw_xor_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
5202 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
5203 ; -O0: eor w8, w9, w8
5204 ; -O0: bl __atomic_compare_exchange
5206 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_monotonic:
5207 ; -O1: eor w8, w0, w20
5208 ; -O1: bl __atomic_compare_exchange
5209 %r = atomicrmw xor ptr %ptr, i32 %value monotonic, align 1
5213 define dso_local i32 @atomicrmw_xor_i32_unaligned_acquire(ptr %ptr, i32 %value) {
5214 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acquire:
5215 ; -O0: eor w8, w9, w8
5216 ; -O0: bl __atomic_compare_exchange
5218 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acquire:
5219 ; -O1: eor w8, w0, w20
5220 ; -O1: bl __atomic_compare_exchange
5221 %r = atomicrmw xor ptr %ptr, i32 %value acquire, align 1
5225 define dso_local i32 @atomicrmw_xor_i32_unaligned_release(ptr %ptr, i32 %value) {
5226 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_release:
5227 ; -O0: eor w8, w9, w8
5228 ; -O0: bl __atomic_compare_exchange
5230 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_release:
5231 ; -O1: eor w8, w0, w20
5232 ; -O1: bl __atomic_compare_exchange
5233 %r = atomicrmw xor ptr %ptr, i32 %value release, align 1
5237 define dso_local i32 @atomicrmw_xor_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
5238 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
5239 ; -O0: eor w8, w9, w8
5240 ; -O0: bl __atomic_compare_exchange
5242 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_acq_rel:
5243 ; -O1: eor w8, w0, w20
5244 ; -O1: bl __atomic_compare_exchange
5245 %r = atomicrmw xor ptr %ptr, i32 %value acq_rel, align 1
5249 define dso_local i32 @atomicrmw_xor_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
5250 ; -O0-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
5251 ; -O0: eor w8, w9, w8
5252 ; -O0: bl __atomic_compare_exchange
5254 ; -O1-LABEL: atomicrmw_xor_i32_unaligned_seq_cst:
5255 ; -O1: eor w8, w0, w20
5256 ; -O1: bl __atomic_compare_exchange
5257 %r = atomicrmw xor ptr %ptr, i32 %value seq_cst, align 1
5261 define dso_local i64 @atomicrmw_xor_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
5262 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
5263 ; -O0: eor x8, x9, x8
5264 ; -O0: bl __atomic_compare_exchange
5266 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_monotonic:
5267 ; -O1: eor x8, x0, x20
5268 ; -O1: bl __atomic_compare_exchange
5269 %r = atomicrmw xor ptr %ptr, i64 %value monotonic, align 1
5273 define dso_local i64 @atomicrmw_xor_i64_unaligned_acquire(ptr %ptr, i64 %value) {
5274 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acquire:
5275 ; -O0: eor x8, x9, x8
5276 ; -O0: bl __atomic_compare_exchange
5278 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acquire:
5279 ; -O1: eor x8, x0, x20
5280 ; -O1: bl __atomic_compare_exchange
5281 %r = atomicrmw xor ptr %ptr, i64 %value acquire, align 1
5285 define dso_local i64 @atomicrmw_xor_i64_unaligned_release(ptr %ptr, i64 %value) {
5286 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_release:
5287 ; -O0: eor x8, x9, x8
5288 ; -O0: bl __atomic_compare_exchange
5290 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_release:
5291 ; -O1: eor x8, x0, x20
5292 ; -O1: bl __atomic_compare_exchange
5293 %r = atomicrmw xor ptr %ptr, i64 %value release, align 1
5297 define dso_local i64 @atomicrmw_xor_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
5298 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
5299 ; -O0: eor x8, x9, x8
5300 ; -O0: bl __atomic_compare_exchange
5302 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_acq_rel:
5303 ; -O1: eor x8, x0, x20
5304 ; -O1: bl __atomic_compare_exchange
5305 %r = atomicrmw xor ptr %ptr, i64 %value acq_rel, align 1
5309 define dso_local i64 @atomicrmw_xor_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
5310 ; -O0-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
5311 ; -O0: eor x8, x9, x8
5312 ; -O0: bl __atomic_compare_exchange
5314 ; -O1-LABEL: atomicrmw_xor_i64_unaligned_seq_cst:
5315 ; -O1: eor x8, x0, x20
5316 ; -O1: bl __atomic_compare_exchange
5317 %r = atomicrmw xor ptr %ptr, i64 %value seq_cst, align 1
5321 define dso_local i128 @atomicrmw_xor_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
5322 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
5323 ; -O0: eor x8, x11, x8
5324 ; -O0: eor x9, x10, x9
5325 ; -O0: bl __atomic_compare_exchange
5327 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_monotonic:
5328 ; -O1: ldp x0, x1, [x0]
5329 ; -O1: eor x8, x1, x19
5330 ; -O1: eor x9, x0, x21
5331 ; -O1: bl __atomic_compare_exchange
5332 %r = atomicrmw xor ptr %ptr, i128 %value monotonic, align 1
5336 define dso_local i128 @atomicrmw_xor_i128_unaligned_acquire(ptr %ptr, i128 %value) {
5337 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acquire:
5338 ; -O0: eor x8, x11, x8
5339 ; -O0: eor x9, x10, x9
5340 ; -O0: bl __atomic_compare_exchange
5342 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acquire:
5343 ; -O1: ldp x0, x1, [x0]
5344 ; -O1: eor x8, x1, x19
5345 ; -O1: eor x9, x0, x21
5346 ; -O1: bl __atomic_compare_exchange
5347 %r = atomicrmw xor ptr %ptr, i128 %value acquire, align 1
5351 define dso_local i128 @atomicrmw_xor_i128_unaligned_release(ptr %ptr, i128 %value) {
5352 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_release:
5353 ; -O0: eor x8, x11, x8
5354 ; -O0: eor x9, x10, x9
5355 ; -O0: bl __atomic_compare_exchange
5357 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_release:
5358 ; -O1: ldp x0, x1, [x0]
5359 ; -O1: eor x8, x1, x19
5360 ; -O1: eor x9, x0, x21
5361 ; -O1: bl __atomic_compare_exchange
5362 %r = atomicrmw xor ptr %ptr, i128 %value release, align 1
5366 define dso_local i128 @atomicrmw_xor_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
5367 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
5368 ; -O0: eor x8, x11, x8
5369 ; -O0: eor x9, x10, x9
5370 ; -O0: bl __atomic_compare_exchange
5372 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_acq_rel:
5373 ; -O1: ldp x0, x1, [x0]
5374 ; -O1: eor x8, x1, x19
5375 ; -O1: eor x9, x0, x21
5376 ; -O1: bl __atomic_compare_exchange
5377 %r = atomicrmw xor ptr %ptr, i128 %value acq_rel, align 1
5381 define dso_local i128 @atomicrmw_xor_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
5382 ; -O0-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
5383 ; -O0: eor x8, x11, x8
5384 ; -O0: eor x9, x10, x9
5385 ; -O0: bl __atomic_compare_exchange
5387 ; -O1-LABEL: atomicrmw_xor_i128_unaligned_seq_cst:
5388 ; -O1: ldp x0, x1, [x0]
5389 ; -O1: eor x8, x1, x19
5390 ; -O1: eor x9, x0, x21
5391 ; -O1: bl __atomic_compare_exchange
5392 %r = atomicrmw xor ptr %ptr, i128 %value seq_cst, align 1
5396 define dso_local i8 @atomicrmw_max_i8_aligned_monotonic(ptr %ptr, i8 %value) {
5397 ; -O0-LABEL: atomicrmw_max_i8_aligned_monotonic:
5399 ; -O0: subs w10, w10, w8, sxtb
5400 ; -O0: csel w12, w9, w8, gt
5401 ; -O0: ldaxrb w8, [x11]
5402 ; -O0: cmp w8, w9, uxtb
5403 ; -O0: stlxrb w10, w12, [x11]
5404 ; -O0: subs w9, w8, w9, uxtb
5405 ; -O0: subs w9, w9, #1
5407 ; -O1-LABEL: atomicrmw_max_i8_aligned_monotonic:
5408 ; -O1: ldxrb w9, [x0]
5410 ; -O1: cmp w8, w1, sxtb
5411 ; -O1: csel w9, w9, w1, gt
5412 ; -O1: stxrb w10, w9, [x0]
5413 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
5417 define dso_local i8 @atomicrmw_max_i8_aligned_acquire(ptr %ptr, i8 %value) {
5418 ; -O0-LABEL: atomicrmw_max_i8_aligned_acquire:
5420 ; -O0: subs w10, w10, w8, sxtb
5421 ; -O0: csel w12, w9, w8, gt
5422 ; -O0: ldaxrb w8, [x11]
5423 ; -O0: cmp w8, w9, uxtb
5424 ; -O0: stlxrb w10, w12, [x11]
5425 ; -O0: subs w9, w8, w9, uxtb
5426 ; -O0: subs w9, w9, #1
5428 ; -O1-LABEL: atomicrmw_max_i8_aligned_acquire:
5429 ; -O1: ldaxrb w9, [x0]
5431 ; -O1: cmp w8, w1, sxtb
5432 ; -O1: csel w9, w9, w1, gt
5433 ; -O1: stxrb w10, w9, [x0]
5434 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
5438 define dso_local i8 @atomicrmw_max_i8_aligned_release(ptr %ptr, i8 %value) {
5439 ; -O0-LABEL: atomicrmw_max_i8_aligned_release:
5441 ; -O0: subs w10, w10, w8, sxtb
5442 ; -O0: csel w12, w9, w8, gt
5443 ; -O0: ldaxrb w8, [x11]
5444 ; -O0: cmp w8, w9, uxtb
5445 ; -O0: stlxrb w10, w12, [x11]
5446 ; -O0: subs w9, w8, w9, uxtb
5447 ; -O0: subs w9, w9, #1
5449 ; -O1-LABEL: atomicrmw_max_i8_aligned_release:
5450 ; -O1: ldxrb w9, [x0]
5452 ; -O1: cmp w8, w1, sxtb
5453 ; -O1: csel w9, w9, w1, gt
5454 ; -O1: stlxrb w10, w9, [x0]
5455 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
5459 define dso_local i8 @atomicrmw_max_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
5460 ; -O0-LABEL: atomicrmw_max_i8_aligned_acq_rel:
5462 ; -O0: subs w10, w10, w8, sxtb
5463 ; -O0: csel w12, w9, w8, gt
5464 ; -O0: ldaxrb w8, [x11]
5465 ; -O0: cmp w8, w9, uxtb
5466 ; -O0: stlxrb w10, w12, [x11]
5467 ; -O0: subs w9, w8, w9, uxtb
5468 ; -O0: subs w9, w9, #1
5470 ; -O1-LABEL: atomicrmw_max_i8_aligned_acq_rel:
5471 ; -O1: ldaxrb w9, [x0]
5473 ; -O1: cmp w8, w1, sxtb
5474 ; -O1: csel w9, w9, w1, gt
5475 ; -O1: stlxrb w10, w9, [x0]
5476 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
5480 define dso_local i8 @atomicrmw_max_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
5481 ; -O0-LABEL: atomicrmw_max_i8_aligned_seq_cst:
5483 ; -O0: subs w10, w10, w8, sxtb
5484 ; -O0: csel w12, w9, w8, gt
5485 ; -O0: ldaxrb w8, [x11]
5486 ; -O0: cmp w8, w9, uxtb
5487 ; -O0: stlxrb w10, w12, [x11]
5488 ; -O0: subs w9, w8, w9, uxtb
5489 ; -O0: subs w9, w9, #1
5491 ; -O1-LABEL: atomicrmw_max_i8_aligned_seq_cst:
5492 ; -O1: ldaxrb w9, [x0]
5494 ; -O1: cmp w8, w1, sxtb
5495 ; -O1: csel w9, w9, w1, gt
5496 ; -O1: stlxrb w10, w9, [x0]
5497 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
5501 define dso_local i16 @atomicrmw_max_i16_aligned_monotonic(ptr %ptr, i16 %value) {
5502 ; -O0-LABEL: atomicrmw_max_i16_aligned_monotonic:
5504 ; -O0: subs w10, w10, w8, sxth
5505 ; -O0: csel w12, w9, w8, gt
5506 ; -O0: ldaxrh w8, [x11]
5507 ; -O0: cmp w8, w9, uxth
5508 ; -O0: stlxrh w10, w12, [x11]
5509 ; -O0: subs w9, w8, w9, uxth
5510 ; -O0: subs w9, w9, #1
5512 ; -O1-LABEL: atomicrmw_max_i16_aligned_monotonic:
5513 ; -O1: ldxrh w9, [x0]
5515 ; -O1: cmp w8, w1, sxth
5516 ; -O1: csel w9, w9, w1, gt
5517 ; -O1: stxrh w10, w9, [x0]
5518 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 2
5522 define dso_local i16 @atomicrmw_max_i16_aligned_acquire(ptr %ptr, i16 %value) {
5523 ; -O0-LABEL: atomicrmw_max_i16_aligned_acquire:
5525 ; -O0: subs w10, w10, w8, sxth
5526 ; -O0: csel w12, w9, w8, gt
5527 ; -O0: ldaxrh w8, [x11]
5528 ; -O0: cmp w8, w9, uxth
5529 ; -O0: stlxrh w10, w12, [x11]
5530 ; -O0: subs w9, w8, w9, uxth
5531 ; -O0: subs w9, w9, #1
5533 ; -O1-LABEL: atomicrmw_max_i16_aligned_acquire:
5534 ; -O1: ldaxrh w9, [x0]
5536 ; -O1: cmp w8, w1, sxth
5537 ; -O1: csel w9, w9, w1, gt
5538 ; -O1: stxrh w10, w9, [x0]
5539 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 2
5543 define dso_local i16 @atomicrmw_max_i16_aligned_release(ptr %ptr, i16 %value) {
5544 ; -O0-LABEL: atomicrmw_max_i16_aligned_release:
5546 ; -O0: subs w10, w10, w8, sxth
5547 ; -O0: csel w12, w9, w8, gt
5548 ; -O0: ldaxrh w8, [x11]
5549 ; -O0: cmp w8, w9, uxth
5550 ; -O0: stlxrh w10, w12, [x11]
5551 ; -O0: subs w9, w8, w9, uxth
5552 ; -O0: subs w9, w9, #1
5554 ; -O1-LABEL: atomicrmw_max_i16_aligned_release:
5555 ; -O1: ldxrh w9, [x0]
5557 ; -O1: cmp w8, w1, sxth
5558 ; -O1: csel w9, w9, w1, gt
5559 ; -O1: stlxrh w10, w9, [x0]
5560 %r = atomicrmw max ptr %ptr, i16 %value release, align 2
5564 define dso_local i16 @atomicrmw_max_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
5565 ; -O0-LABEL: atomicrmw_max_i16_aligned_acq_rel:
5567 ; -O0: subs w10, w10, w8, sxth
5568 ; -O0: csel w12, w9, w8, gt
5569 ; -O0: ldaxrh w8, [x11]
5570 ; -O0: cmp w8, w9, uxth
5571 ; -O0: stlxrh w10, w12, [x11]
5572 ; -O0: subs w9, w8, w9, uxth
5573 ; -O0: subs w9, w9, #1
5575 ; -O1-LABEL: atomicrmw_max_i16_aligned_acq_rel:
5576 ; -O1: ldaxrh w9, [x0]
5578 ; -O1: cmp w8, w1, sxth
5579 ; -O1: csel w9, w9, w1, gt
5580 ; -O1: stlxrh w10, w9, [x0]
5581 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 2
5585 define dso_local i16 @atomicrmw_max_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
5586 ; -O0-LABEL: atomicrmw_max_i16_aligned_seq_cst:
5588 ; -O0: subs w10, w10, w8, sxth
5589 ; -O0: csel w12, w9, w8, gt
5590 ; -O0: ldaxrh w8, [x11]
5591 ; -O0: cmp w8, w9, uxth
5592 ; -O0: stlxrh w10, w12, [x11]
5593 ; -O0: subs w9, w8, w9, uxth
5594 ; -O0: subs w9, w9, #1
5596 ; -O1-LABEL: atomicrmw_max_i16_aligned_seq_cst:
5597 ; -O1: ldaxrh w9, [x0]
5599 ; -O1: cmp w8, w1, sxth
5600 ; -O1: csel w9, w9, w1, gt
5601 ; -O1: stlxrh w10, w9, [x0]
5602 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 2
5606 define dso_local i32 @atomicrmw_max_i32_aligned_monotonic(ptr %ptr, i32 %value) {
5607 ; -O0-LABEL: atomicrmw_max_i32_aligned_monotonic:
5608 ; -O0: subs w10, w9, w8
5609 ; -O0: csel w12, w9, w8, gt
5610 ; -O0: ldaxr w8, [x11]
5612 ; -O0: stlxr w10, w12, [x11]
5613 ; -O0: subs w9, w8, w9
5614 ; -O0: subs w9, w9, #1
5616 ; -O1-LABEL: atomicrmw_max_i32_aligned_monotonic:
5617 ; -O1: ldxr w8, [x0]
5619 ; -O1: csel w9, w8, w1, gt
5620 ; -O1: stxr w10, w9, [x0]
5621 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 4
5625 define dso_local i32 @atomicrmw_max_i32_aligned_acquire(ptr %ptr, i32 %value) {
5626 ; -O0-LABEL: atomicrmw_max_i32_aligned_acquire:
5627 ; -O0: subs w10, w9, w8
5628 ; -O0: csel w12, w9, w8, gt
5629 ; -O0: ldaxr w8, [x11]
5631 ; -O0: stlxr w10, w12, [x11]
5632 ; -O0: subs w9, w8, w9
5633 ; -O0: subs w9, w9, #1
5635 ; -O1-LABEL: atomicrmw_max_i32_aligned_acquire:
5636 ; -O1: ldaxr w8, [x0]
5638 ; -O1: csel w9, w8, w1, gt
5639 ; -O1: stxr w10, w9, [x0]
5640 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 4
5644 define dso_local i32 @atomicrmw_max_i32_aligned_release(ptr %ptr, i32 %value) {
5645 ; -O0-LABEL: atomicrmw_max_i32_aligned_release:
5646 ; -O0: subs w10, w9, w8
5647 ; -O0: csel w12, w9, w8, gt
5648 ; -O0: ldaxr w8, [x11]
5650 ; -O0: stlxr w10, w12, [x11]
5651 ; -O0: subs w9, w8, w9
5652 ; -O0: subs w9, w9, #1
5654 ; -O1-LABEL: atomicrmw_max_i32_aligned_release:
5655 ; -O1: ldxr w8, [x0]
5657 ; -O1: csel w9, w8, w1, gt
5658 ; -O1: stlxr w10, w9, [x0]
5659 %r = atomicrmw max ptr %ptr, i32 %value release, align 4
5663 define dso_local i32 @atomicrmw_max_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
5664 ; -O0-LABEL: atomicrmw_max_i32_aligned_acq_rel:
5665 ; -O0: subs w10, w9, w8
5666 ; -O0: csel w12, w9, w8, gt
5667 ; -O0: ldaxr w8, [x11]
5669 ; -O0: stlxr w10, w12, [x11]
5670 ; -O0: subs w9, w8, w9
5671 ; -O0: subs w9, w9, #1
5673 ; -O1-LABEL: atomicrmw_max_i32_aligned_acq_rel:
5674 ; -O1: ldaxr w8, [x0]
5676 ; -O1: csel w9, w8, w1, gt
5677 ; -O1: stlxr w10, w9, [x0]
5678 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 4
5682 define dso_local i32 @atomicrmw_max_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
5683 ; -O0-LABEL: atomicrmw_max_i32_aligned_seq_cst:
5684 ; -O0: subs w10, w9, w8
5685 ; -O0: csel w12, w9, w8, gt
5686 ; -O0: ldaxr w8, [x11]
5688 ; -O0: stlxr w10, w12, [x11]
5689 ; -O0: subs w9, w8, w9
5690 ; -O0: subs w9, w9, #1
5692 ; -O1-LABEL: atomicrmw_max_i32_aligned_seq_cst:
5693 ; -O1: ldaxr w8, [x0]
5695 ; -O1: csel w9, w8, w1, gt
5696 ; -O1: stlxr w10, w9, [x0]
5697 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 4
5701 define dso_local i64 @atomicrmw_max_i64_aligned_monotonic(ptr %ptr, i64 %value) {
5702 ; -O0-LABEL: atomicrmw_max_i64_aligned_monotonic:
5703 ; -O0: subs x10, x9, x8
5704 ; -O0: csel x12, x9, x8, gt
5705 ; -O0: ldaxr x8, [x11]
5707 ; -O0: stlxr w10, x12, [x11]
5708 ; -O0: subs x9, x8, x9
5709 ; -O0: subs w9, w9, #1
5711 ; -O1-LABEL: atomicrmw_max_i64_aligned_monotonic:
5712 ; -O1: ldxr x0, [x8]
5714 ; -O1: csel x9, x0, x1, gt
5715 ; -O1: stxr w10, x9, [x8]
5716 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 8
5720 define dso_local i64 @atomicrmw_max_i64_aligned_acquire(ptr %ptr, i64 %value) {
5721 ; -O0-LABEL: atomicrmw_max_i64_aligned_acquire:
5722 ; -O0: subs x10, x9, x8
5723 ; -O0: csel x12, x9, x8, gt
5724 ; -O0: ldaxr x8, [x11]
5726 ; -O0: stlxr w10, x12, [x11]
5727 ; -O0: subs x9, x8, x9
5728 ; -O0: subs w9, w9, #1
5730 ; -O1-LABEL: atomicrmw_max_i64_aligned_acquire:
5731 ; -O1: ldaxr x0, [x8]
5733 ; -O1: csel x9, x0, x1, gt
5734 ; -O1: stxr w10, x9, [x8]
5735 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 8
5739 define dso_local i64 @atomicrmw_max_i64_aligned_release(ptr %ptr, i64 %value) {
5740 ; -O0-LABEL: atomicrmw_max_i64_aligned_release:
5741 ; -O0: subs x10, x9, x8
5742 ; -O0: csel x12, x9, x8, gt
5743 ; -O0: ldaxr x8, [x11]
5745 ; -O0: stlxr w10, x12, [x11]
5746 ; -O0: subs x9, x8, x9
5747 ; -O0: subs w9, w9, #1
5749 ; -O1-LABEL: atomicrmw_max_i64_aligned_release:
5750 ; -O1: ldxr x0, [x8]
5752 ; -O1: csel x9, x0, x1, gt
5753 ; -O1: stlxr w10, x9, [x8]
5754 %r = atomicrmw max ptr %ptr, i64 %value release, align 8
5758 define dso_local i64 @atomicrmw_max_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
5759 ; -O0-LABEL: atomicrmw_max_i64_aligned_acq_rel:
5760 ; -O0: subs x10, x9, x8
5761 ; -O0: csel x12, x9, x8, gt
5762 ; -O0: ldaxr x8, [x11]
5764 ; -O0: stlxr w10, x12, [x11]
5765 ; -O0: subs x9, x8, x9
5766 ; -O0: subs w9, w9, #1
5768 ; -O1-LABEL: atomicrmw_max_i64_aligned_acq_rel:
5769 ; -O1: ldaxr x0, [x8]
5771 ; -O1: csel x9, x0, x1, gt
5772 ; -O1: stlxr w10, x9, [x8]
5773 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 8
5777 define dso_local i64 @atomicrmw_max_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
5778 ; -O0-LABEL: atomicrmw_max_i64_aligned_seq_cst:
5779 ; -O0: subs x10, x9, x8
5780 ; -O0: csel x12, x9, x8, gt
5781 ; -O0: ldaxr x8, [x11]
5783 ; -O0: stlxr w10, x12, [x11]
5784 ; -O0: subs x9, x8, x9
5785 ; -O0: subs w9, w9, #1
5787 ; -O1-LABEL: atomicrmw_max_i64_aligned_seq_cst:
5788 ; -O1: ldaxr x0, [x8]
5790 ; -O1: csel x9, x0, x1, gt
5791 ; -O1: stlxr w10, x9, [x8]
5792 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 8
5796 define dso_local i128 @atomicrmw_max_i128_aligned_monotonic(ptr %ptr, i128 %value) {
5797 ; -O0-LABEL: atomicrmw_max_i128_aligned_monotonic:
5798 ; -O0: subs x12, x8, x11
5799 ; -O0: csel x15, x13, x10, lt
5800 ; -O0: csel x14, x11, x8, lt
5801 ; -O0: ldxp x10, x12, [x9]
5804 ; -O0: stxp w8, x14, x15, [x9]
5805 ; -O0: stxp w8, x10, x12, [x9]
5806 ; -O0: subs x12, x12, x13
5807 ; -O0: ccmp x10, x11, #0, eq
5809 ; -O1-LABEL: atomicrmw_max_i128_aligned_monotonic:
5810 ; -O1: ldxp x1, x0, [x8]
5812 ; -O1: csel x9, x0, x2, lt
5813 ; -O1: csel x10, x1, x3, lt
5814 ; -O1: stxp w11, x10, x9, [x8]
5815 %r = atomicrmw max ptr %ptr, i128 %value monotonic, align 16
5819 define dso_local i128 @atomicrmw_max_i128_aligned_acquire(ptr %ptr, i128 %value) {
5820 ; -O0-LABEL: atomicrmw_max_i128_aligned_acquire:
5821 ; -O0: subs x12, x8, x11
5822 ; -O0: csel x15, x13, x10, lt
5823 ; -O0: csel x14, x11, x8, lt
5824 ; -O0: ldaxp x10, x12, [x9]
5827 ; -O0: stxp w8, x14, x15, [x9]
5828 ; -O0: stxp w8, x10, x12, [x9]
5829 ; -O0: subs x12, x12, x13
5830 ; -O0: ccmp x10, x11, #0, eq
5832 ; -O1-LABEL: atomicrmw_max_i128_aligned_acquire:
5833 ; -O1: ldaxp x1, x0, [x8]
5835 ; -O1: csel x9, x0, x2, lt
5836 ; -O1: csel x10, x1, x3, lt
5837 ; -O1: stxp w11, x10, x9, [x8]
5838 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 16
5842 define dso_local i128 @atomicrmw_max_i128_aligned_release(ptr %ptr, i128 %value) {
5843 ; -O0-LABEL: atomicrmw_max_i128_aligned_release:
5844 ; -O0: subs x12, x8, x11
5845 ; -O0: csel x15, x13, x10, lt
5846 ; -O0: csel x14, x11, x8, lt
5847 ; -O0: ldxp x10, x12, [x9]
5850 ; -O0: stlxp w8, x14, x15, [x9]
5851 ; -O0: stlxp w8, x10, x12, [x9]
5852 ; -O0: subs x12, x12, x13
5853 ; -O0: ccmp x10, x11, #0, eq
5855 ; -O1-LABEL: atomicrmw_max_i128_aligned_release:
5856 ; -O1: ldxp x1, x0, [x8]
5858 ; -O1: csel x9, x0, x2, lt
5859 ; -O1: csel x10, x1, x3, lt
5860 ; -O1: stlxp w11, x10, x9, [x8]
5861 %r = atomicrmw max ptr %ptr, i128 %value release, align 16
5865 define dso_local i128 @atomicrmw_max_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
5866 ; -O0-LABEL: atomicrmw_max_i128_aligned_acq_rel:
5867 ; -O0: subs x12, x8, x11
5868 ; -O0: csel x15, x13, x10, lt
5869 ; -O0: csel x14, x11, x8, lt
5870 ; -O0: ldaxp x10, x12, [x9]
5873 ; -O0: stlxp w8, x14, x15, [x9]
5874 ; -O0: stlxp w8, x10, x12, [x9]
5875 ; -O0: subs x12, x12, x13
5876 ; -O0: ccmp x10, x11, #0, eq
5878 ; -O1-LABEL: atomicrmw_max_i128_aligned_acq_rel:
5879 ; -O1: ldaxp x1, x0, [x8]
5881 ; -O1: csel x9, x0, x2, lt
5882 ; -O1: csel x10, x1, x3, lt
5883 ; -O1: stlxp w11, x10, x9, [x8]
5884 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 16
5888 define dso_local i128 @atomicrmw_max_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
5889 ; -O0-LABEL: atomicrmw_max_i128_aligned_seq_cst:
5890 ; -O0: subs x12, x8, x11
5891 ; -O0: csel x15, x13, x10, lt
5892 ; -O0: csel x14, x11, x8, lt
5893 ; -O0: ldaxp x10, x12, [x9]
5896 ; -O0: stlxp w8, x14, x15, [x9]
5897 ; -O0: stlxp w8, x10, x12, [x9]
5898 ; -O0: subs x12, x12, x13
5899 ; -O0: ccmp x10, x11, #0, eq
5901 ; -O1-LABEL: atomicrmw_max_i128_aligned_seq_cst:
5902 ; -O1: ldaxp x1, x0, [x8]
5904 ; -O1: csel x9, x0, x2, lt
5905 ; -O1: csel x10, x1, x3, lt
5906 ; -O1: stlxp w11, x10, x9, [x8]
5907 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 16
5911 define dso_local i8 @atomicrmw_max_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
5912 ; -O0-LABEL: atomicrmw_max_i8_unaligned_monotonic:
5914 ; -O0: subs w10, w10, w8, sxtb
5915 ; -O0: csel w12, w9, w8, gt
5916 ; -O0: ldaxrb w8, [x11]
5917 ; -O0: cmp w8, w9, uxtb
5918 ; -O0: stlxrb w10, w12, [x11]
5919 ; -O0: subs w9, w8, w9, uxtb
5920 ; -O0: subs w9, w9, #1
5922 ; -O1-LABEL: atomicrmw_max_i8_unaligned_monotonic:
5923 ; -O1: ldxrb w9, [x0]
5925 ; -O1: cmp w8, w1, sxtb
5926 ; -O1: csel w9, w9, w1, gt
5927 ; -O1: stxrb w10, w9, [x0]
5928 %r = atomicrmw max ptr %ptr, i8 %value monotonic, align 1
5932 define dso_local i8 @atomicrmw_max_i8_unaligned_acquire(ptr %ptr, i8 %value) {
5933 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acquire:
5935 ; -O0: subs w10, w10, w8, sxtb
5936 ; -O0: csel w12, w9, w8, gt
5937 ; -O0: ldaxrb w8, [x11]
5938 ; -O0: cmp w8, w9, uxtb
5939 ; -O0: stlxrb w10, w12, [x11]
5940 ; -O0: subs w9, w8, w9, uxtb
5941 ; -O0: subs w9, w9, #1
5943 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acquire:
5944 ; -O1: ldaxrb w9, [x0]
5946 ; -O1: cmp w8, w1, sxtb
5947 ; -O1: csel w9, w9, w1, gt
5948 ; -O1: stxrb w10, w9, [x0]
5949 %r = atomicrmw max ptr %ptr, i8 %value acquire, align 1
5953 define dso_local i8 @atomicrmw_max_i8_unaligned_release(ptr %ptr, i8 %value) {
5954 ; -O0-LABEL: atomicrmw_max_i8_unaligned_release:
5956 ; -O0: subs w10, w10, w8, sxtb
5957 ; -O0: csel w12, w9, w8, gt
5958 ; -O0: ldaxrb w8, [x11]
5959 ; -O0: cmp w8, w9, uxtb
5960 ; -O0: stlxrb w10, w12, [x11]
5961 ; -O0: subs w9, w8, w9, uxtb
5962 ; -O0: subs w9, w9, #1
5964 ; -O1-LABEL: atomicrmw_max_i8_unaligned_release:
5965 ; -O1: ldxrb w9, [x0]
5967 ; -O1: cmp w8, w1, sxtb
5968 ; -O1: csel w9, w9, w1, gt
5969 ; -O1: stlxrb w10, w9, [x0]
5970 %r = atomicrmw max ptr %ptr, i8 %value release, align 1
5974 define dso_local i8 @atomicrmw_max_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
5975 ; -O0-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
5977 ; -O0: subs w10, w10, w8, sxtb
5978 ; -O0: csel w12, w9, w8, gt
5979 ; -O0: ldaxrb w8, [x11]
5980 ; -O0: cmp w8, w9, uxtb
5981 ; -O0: stlxrb w10, w12, [x11]
5982 ; -O0: subs w9, w8, w9, uxtb
5983 ; -O0: subs w9, w9, #1
5985 ; -O1-LABEL: atomicrmw_max_i8_unaligned_acq_rel:
5986 ; -O1: ldaxrb w9, [x0]
5988 ; -O1: cmp w8, w1, sxtb
5989 ; -O1: csel w9, w9, w1, gt
5990 ; -O1: stlxrb w10, w9, [x0]
5991 %r = atomicrmw max ptr %ptr, i8 %value acq_rel, align 1
5995 define dso_local i8 @atomicrmw_max_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
5996 ; -O0-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
5998 ; -O0: subs w10, w10, w8, sxtb
5999 ; -O0: csel w12, w9, w8, gt
6000 ; -O0: ldaxrb w8, [x11]
6001 ; -O0: cmp w8, w9, uxtb
6002 ; -O0: stlxrb w10, w12, [x11]
6003 ; -O0: subs w9, w8, w9, uxtb
6004 ; -O0: subs w9, w9, #1
6006 ; -O1-LABEL: atomicrmw_max_i8_unaligned_seq_cst:
6007 ; -O1: ldaxrb w9, [x0]
6009 ; -O1: cmp w8, w1, sxtb
6010 ; -O1: csel w9, w9, w1, gt
6011 ; -O1: stlxrb w10, w9, [x0]
6012 %r = atomicrmw max ptr %ptr, i8 %value seq_cst, align 1
6016 define dso_local i16 @atomicrmw_max_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6017 ; -O0-LABEL: atomicrmw_max_i16_unaligned_monotonic:
6019 ; -O0: subs w10, w10, w8, sxth
6020 ; -O0: csel w8, w9, w8, gt
6021 ; -O0: bl __atomic_compare_exchange
6023 ; -O1-LABEL: atomicrmw_max_i16_unaligned_monotonic:
6025 ; -O1: cmp w8, w20, sxth
6026 ; -O1: csel w8, w0, w20, gt
6027 ; -O1: bl __atomic_compare_exchange
6028 %r = atomicrmw max ptr %ptr, i16 %value monotonic, align 1
6032 define dso_local i16 @atomicrmw_max_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6033 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acquire:
6035 ; -O0: subs w10, w10, w8, sxth
6036 ; -O0: csel w8, w9, w8, gt
6037 ; -O0: bl __atomic_compare_exchange
6039 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acquire:
6041 ; -O1: cmp w8, w20, sxth
6042 ; -O1: csel w8, w0, w20, gt
6043 ; -O1: bl __atomic_compare_exchange
6044 %r = atomicrmw max ptr %ptr, i16 %value acquire, align 1
6048 define dso_local i16 @atomicrmw_max_i16_unaligned_release(ptr %ptr, i16 %value) {
6049 ; -O0-LABEL: atomicrmw_max_i16_unaligned_release:
6051 ; -O0: subs w10, w10, w8, sxth
6052 ; -O0: csel w8, w9, w8, gt
6053 ; -O0: bl __atomic_compare_exchange
6055 ; -O1-LABEL: atomicrmw_max_i16_unaligned_release:
6057 ; -O1: cmp w8, w20, sxth
6058 ; -O1: csel w8, w0, w20, gt
6059 ; -O1: bl __atomic_compare_exchange
6060 %r = atomicrmw max ptr %ptr, i16 %value release, align 1
6064 define dso_local i16 @atomicrmw_max_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6065 ; -O0-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
6067 ; -O0: subs w10, w10, w8, sxth
6068 ; -O0: csel w8, w9, w8, gt
6069 ; -O0: bl __atomic_compare_exchange
6071 ; -O1-LABEL: atomicrmw_max_i16_unaligned_acq_rel:
6073 ; -O1: cmp w8, w20, sxth
6074 ; -O1: csel w8, w0, w20, gt
6075 ; -O1: bl __atomic_compare_exchange
6076 %r = atomicrmw max ptr %ptr, i16 %value acq_rel, align 1
6080 define dso_local i16 @atomicrmw_max_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
6081 ; -O0-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
6083 ; -O0: subs w10, w10, w8, sxth
6084 ; -O0: csel w8, w9, w8, gt
6085 ; -O0: bl __atomic_compare_exchange
6087 ; -O1-LABEL: atomicrmw_max_i16_unaligned_seq_cst:
6089 ; -O1: cmp w8, w20, sxth
6090 ; -O1: csel w8, w0, w20, gt
6091 ; -O1: bl __atomic_compare_exchange
6092 %r = atomicrmw max ptr %ptr, i16 %value seq_cst, align 1
6096 define dso_local i32 @atomicrmw_max_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
6097 ; -O0-LABEL: atomicrmw_max_i32_unaligned_monotonic:
6098 ; -O0: subs w10, w9, w8
6099 ; -O0: csel w8, w9, w8, gt
6100 ; -O0: bl __atomic_compare_exchange
6102 ; -O1-LABEL: atomicrmw_max_i32_unaligned_monotonic:
6104 ; -O1: csel w8, w0, w20, gt
6105 ; -O1: bl __atomic_compare_exchange
6106 %r = atomicrmw max ptr %ptr, i32 %value monotonic, align 1
6110 define dso_local i32 @atomicrmw_max_i32_unaligned_acquire(ptr %ptr, i32 %value) {
6111 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acquire:
6112 ; -O0: subs w10, w9, w8
6113 ; -O0: csel w8, w9, w8, gt
6114 ; -O0: bl __atomic_compare_exchange
6116 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acquire:
6118 ; -O1: csel w8, w0, w20, gt
6119 ; -O1: bl __atomic_compare_exchange
6120 %r = atomicrmw max ptr %ptr, i32 %value acquire, align 1
6124 define dso_local i32 @atomicrmw_max_i32_unaligned_release(ptr %ptr, i32 %value) {
6125 ; -O0-LABEL: atomicrmw_max_i32_unaligned_release:
6126 ; -O0: subs w10, w9, w8
6127 ; -O0: csel w8, w9, w8, gt
6128 ; -O0: bl __atomic_compare_exchange
6130 ; -O1-LABEL: atomicrmw_max_i32_unaligned_release:
6132 ; -O1: csel w8, w0, w20, gt
6133 ; -O1: bl __atomic_compare_exchange
6134 %r = atomicrmw max ptr %ptr, i32 %value release, align 1
6138 define dso_local i32 @atomicrmw_max_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
6139 ; -O0-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
6140 ; -O0: subs w10, w9, w8
6141 ; -O0: csel w8, w9, w8, gt
6142 ; -O0: bl __atomic_compare_exchange
6144 ; -O1-LABEL: atomicrmw_max_i32_unaligned_acq_rel:
6146 ; -O1: csel w8, w0, w20, gt
6147 ; -O1: bl __atomic_compare_exchange
6148 %r = atomicrmw max ptr %ptr, i32 %value acq_rel, align 1
6152 define dso_local i32 @atomicrmw_max_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
6153 ; -O0-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
6154 ; -O0: subs w10, w9, w8
6155 ; -O0: csel w8, w9, w8, gt
6156 ; -O0: bl __atomic_compare_exchange
6158 ; -O1-LABEL: atomicrmw_max_i32_unaligned_seq_cst:
6160 ; -O1: csel w8, w0, w20, gt
6161 ; -O1: bl __atomic_compare_exchange
6162 %r = atomicrmw max ptr %ptr, i32 %value seq_cst, align 1
6166 define dso_local i64 @atomicrmw_max_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
6167 ; -O0-LABEL: atomicrmw_max_i64_unaligned_monotonic:
6168 ; -O0: subs x10, x9, x8
6169 ; -O0: csel x8, x9, x8, gt
6170 ; -O0: bl __atomic_compare_exchange
6172 ; -O1-LABEL: atomicrmw_max_i64_unaligned_monotonic:
6174 ; -O1: csel x8, x0, x20, gt
6175 ; -O1: bl __atomic_compare_exchange
6176 %r = atomicrmw max ptr %ptr, i64 %value monotonic, align 1
6180 define dso_local i64 @atomicrmw_max_i64_unaligned_acquire(ptr %ptr, i64 %value) {
6181 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acquire:
6182 ; -O0: subs x10, x9, x8
6183 ; -O0: csel x8, x9, x8, gt
6184 ; -O0: bl __atomic_compare_exchange
6186 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acquire:
6188 ; -O1: csel x8, x0, x20, gt
6189 ; -O1: bl __atomic_compare_exchange
6190 %r = atomicrmw max ptr %ptr, i64 %value acquire, align 1
6194 define dso_local i64 @atomicrmw_max_i64_unaligned_release(ptr %ptr, i64 %value) {
6195 ; -O0-LABEL: atomicrmw_max_i64_unaligned_release:
6196 ; -O0: subs x10, x9, x8
6197 ; -O0: csel x8, x9, x8, gt
6198 ; -O0: bl __atomic_compare_exchange
6200 ; -O1-LABEL: atomicrmw_max_i64_unaligned_release:
6202 ; -O1: csel x8, x0, x20, gt
6203 ; -O1: bl __atomic_compare_exchange
6204 %r = atomicrmw max ptr %ptr, i64 %value release, align 1
6208 define dso_local i64 @atomicrmw_max_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
6209 ; -O0-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
6210 ; -O0: subs x10, x9, x8
6211 ; -O0: csel x8, x9, x8, gt
6212 ; -O0: bl __atomic_compare_exchange
6214 ; -O1-LABEL: atomicrmw_max_i64_unaligned_acq_rel:
6216 ; -O1: csel x8, x0, x20, gt
6217 ; -O1: bl __atomic_compare_exchange
6218 %r = atomicrmw max ptr %ptr, i64 %value acq_rel, align 1
6222 define dso_local i64 @atomicrmw_max_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
6223 ; -O0-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
6224 ; -O0: subs x10, x9, x8
6225 ; -O0: csel x8, x9, x8, gt
6226 ; -O0: bl __atomic_compare_exchange
6228 ; -O1-LABEL: atomicrmw_max_i64_unaligned_seq_cst:
6230 ; -O1: csel x8, x0, x20, gt
6231 ; -O1: bl __atomic_compare_exchange
6232 %r = atomicrmw max ptr %ptr, i64 %value seq_cst, align 1
6236 define dso_local i128 @atomicrmw_max_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
6237 ; -O0-LABEL: atomicrmw_max_i128_unaligned_monotonic:
6238 ; -O0: subs x12, x9, x10
6239 ; -O0: csel x8, x11, x8, lt
6240 ; -O0: csel x9, x10, x9, lt
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 x12, x9, x10
6256 ; -O0: csel x8, x11, x8, lt
6257 ; -O0: csel x9, x10, x9, lt
6258 ; -O0: bl __atomic_compare_exchange
6260 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acquire:
6261 ; -O1: ldp x0, x1, [x0]
6263 ; -O1: csel x8, x1, x19, lt
6264 ; -O1: csel x9, x0, x21, lt
6265 ; -O1: bl __atomic_compare_exchange
6266 %r = atomicrmw max ptr %ptr, i128 %value acquire, align 1
6270 define dso_local i128 @atomicrmw_max_i128_unaligned_release(ptr %ptr, i128 %value) {
6271 ; -O0-LABEL: atomicrmw_max_i128_unaligned_release:
6272 ; -O0: subs x12, x9, x10
6273 ; -O0: csel x8, x11, x8, lt
6274 ; -O0: csel x9, x10, x9, lt
6275 ; -O0: bl __atomic_compare_exchange
6277 ; -O1-LABEL: atomicrmw_max_i128_unaligned_release:
6278 ; -O1: ldp x0, x1, [x0]
6280 ; -O1: csel x8, x1, x19, lt
6281 ; -O1: csel x9, x0, x21, lt
6282 ; -O1: bl __atomic_compare_exchange
6283 %r = atomicrmw max ptr %ptr, i128 %value release, align 1
6287 define dso_local i128 @atomicrmw_max_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
6288 ; -O0-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
6289 ; -O0: subs x12, x9, x10
6290 ; -O0: csel x8, x11, x8, lt
6291 ; -O0: csel x9, x10, x9, lt
6292 ; -O0: bl __atomic_compare_exchange
6294 ; -O1-LABEL: atomicrmw_max_i128_unaligned_acq_rel:
6295 ; -O1: ldp x0, x1, [x0]
6297 ; -O1: csel x8, x1, x19, lt
6298 ; -O1: csel x9, x0, x21, lt
6299 ; -O1: bl __atomic_compare_exchange
6300 %r = atomicrmw max ptr %ptr, i128 %value acq_rel, align 1
6304 define dso_local i128 @atomicrmw_max_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
6305 ; -O0-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
6306 ; -O0: subs x12, x9, x10
6307 ; -O0: csel x8, x11, x8, lt
6308 ; -O0: csel x9, x10, x9, lt
6309 ; -O0: bl __atomic_compare_exchange
6311 ; -O1-LABEL: atomicrmw_max_i128_unaligned_seq_cst:
6312 ; -O1: ldp x0, x1, [x0]
6314 ; -O1: csel x8, x1, x19, lt
6315 ; -O1: csel x9, x0, x21, lt
6316 ; -O1: bl __atomic_compare_exchange
6317 %r = atomicrmw max ptr %ptr, i128 %value seq_cst, align 1
6321 define dso_local i8 @atomicrmw_min_i8_aligned_monotonic(ptr %ptr, i8 %value) {
6322 ; -O0-LABEL: atomicrmw_min_i8_aligned_monotonic:
6324 ; -O0: subs w10, w10, w8, sxtb
6325 ; -O0: csel w12, w9, w8, le
6326 ; -O0: ldaxrb w8, [x11]
6327 ; -O0: cmp w8, w9, uxtb
6328 ; -O0: stlxrb w10, w12, [x11]
6329 ; -O0: subs w9, w8, w9, uxtb
6330 ; -O0: subs w9, w9, #1
6332 ; -O1-LABEL: atomicrmw_min_i8_aligned_monotonic:
6333 ; -O1: ldxrb w9, [x0]
6335 ; -O1: cmp w8, w1, sxtb
6336 ; -O1: csel w9, w9, w1, le
6337 ; -O1: stxrb w10, w9, [x0]
6338 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
6342 define dso_local i8 @atomicrmw_min_i8_aligned_acquire(ptr %ptr, i8 %value) {
6343 ; -O0-LABEL: atomicrmw_min_i8_aligned_acquire:
6345 ; -O0: subs w10, w10, w8, sxtb
6346 ; -O0: csel w12, w9, w8, le
6347 ; -O0: ldaxrb w8, [x11]
6348 ; -O0: cmp w8, w9, uxtb
6349 ; -O0: stlxrb w10, w12, [x11]
6350 ; -O0: subs w9, w8, w9, uxtb
6351 ; -O0: subs w9, w9, #1
6353 ; -O1-LABEL: atomicrmw_min_i8_aligned_acquire:
6354 ; -O1: ldaxrb w9, [x0]
6356 ; -O1: cmp w8, w1, sxtb
6357 ; -O1: csel w9, w9, w1, le
6358 ; -O1: stxrb w10, w9, [x0]
6359 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
6363 define dso_local i8 @atomicrmw_min_i8_aligned_release(ptr %ptr, i8 %value) {
6364 ; -O0-LABEL: atomicrmw_min_i8_aligned_release:
6366 ; -O0: subs w10, w10, w8, sxtb
6367 ; -O0: csel w12, w9, w8, le
6368 ; -O0: ldaxrb w8, [x11]
6369 ; -O0: cmp w8, w9, uxtb
6370 ; -O0: stlxrb w10, w12, [x11]
6371 ; -O0: subs w9, w8, w9, uxtb
6372 ; -O0: subs w9, w9, #1
6374 ; -O1-LABEL: atomicrmw_min_i8_aligned_release:
6375 ; -O1: ldxrb w9, [x0]
6377 ; -O1: cmp w8, w1, sxtb
6378 ; -O1: csel w9, w9, w1, le
6379 ; -O1: stlxrb w10, w9, [x0]
6380 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
6384 define dso_local i8 @atomicrmw_min_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
6385 ; -O0-LABEL: atomicrmw_min_i8_aligned_acq_rel:
6387 ; -O0: subs w10, w10, w8, sxtb
6388 ; -O0: csel w12, w9, w8, le
6389 ; -O0: ldaxrb w8, [x11]
6390 ; -O0: cmp w8, w9, uxtb
6391 ; -O0: stlxrb w10, w12, [x11]
6392 ; -O0: subs w9, w8, w9, uxtb
6393 ; -O0: subs w9, w9, #1
6395 ; -O1-LABEL: atomicrmw_min_i8_aligned_acq_rel:
6396 ; -O1: ldaxrb w9, [x0]
6398 ; -O1: cmp w8, w1, sxtb
6399 ; -O1: csel w9, w9, w1, le
6400 ; -O1: stlxrb w10, w9, [x0]
6401 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
6405 define dso_local i8 @atomicrmw_min_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
6406 ; -O0-LABEL: atomicrmw_min_i8_aligned_seq_cst:
6408 ; -O0: subs w10, w10, w8, sxtb
6409 ; -O0: csel w12, w9, w8, le
6410 ; -O0: ldaxrb w8, [x11]
6411 ; -O0: cmp w8, w9, uxtb
6412 ; -O0: stlxrb w10, w12, [x11]
6413 ; -O0: subs w9, w8, w9, uxtb
6414 ; -O0: subs w9, w9, #1
6416 ; -O1-LABEL: atomicrmw_min_i8_aligned_seq_cst:
6417 ; -O1: ldaxrb w9, [x0]
6419 ; -O1: cmp w8, w1, sxtb
6420 ; -O1: csel w9, w9, w1, le
6421 ; -O1: stlxrb w10, w9, [x0]
6422 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
6426 define dso_local i16 @atomicrmw_min_i16_aligned_monotonic(ptr %ptr, i16 %value) {
6427 ; -O0-LABEL: atomicrmw_min_i16_aligned_monotonic:
6429 ; -O0: subs w10, w10, w8, sxth
6430 ; -O0: csel w12, w9, w8, le
6431 ; -O0: ldaxrh w8, [x11]
6432 ; -O0: cmp w8, w9, uxth
6433 ; -O0: stlxrh w10, w12, [x11]
6434 ; -O0: subs w9, w8, w9, uxth
6435 ; -O0: subs w9, w9, #1
6437 ; -O1-LABEL: atomicrmw_min_i16_aligned_monotonic:
6438 ; -O1: ldxrh w9, [x0]
6440 ; -O1: cmp w8, w1, sxth
6441 ; -O1: csel w9, w9, w1, le
6442 ; -O1: stxrh w10, w9, [x0]
6443 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 2
6447 define dso_local i16 @atomicrmw_min_i16_aligned_acquire(ptr %ptr, i16 %value) {
6448 ; -O0-LABEL: atomicrmw_min_i16_aligned_acquire:
6450 ; -O0: subs w10, w10, w8, sxth
6451 ; -O0: csel w12, w9, w8, le
6452 ; -O0: ldaxrh w8, [x11]
6453 ; -O0: cmp w8, w9, uxth
6454 ; -O0: stlxrh w10, w12, [x11]
6455 ; -O0: subs w9, w8, w9, uxth
6456 ; -O0: subs w9, w9, #1
6458 ; -O1-LABEL: atomicrmw_min_i16_aligned_acquire:
6459 ; -O1: ldaxrh w9, [x0]
6461 ; -O1: cmp w8, w1, sxth
6462 ; -O1: csel w9, w9, w1, le
6463 ; -O1: stxrh w10, w9, [x0]
6464 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 2
6468 define dso_local i16 @atomicrmw_min_i16_aligned_release(ptr %ptr, i16 %value) {
6469 ; -O0-LABEL: atomicrmw_min_i16_aligned_release:
6471 ; -O0: subs w10, w10, w8, sxth
6472 ; -O0: csel w12, w9, w8, le
6473 ; -O0: ldaxrh w8, [x11]
6474 ; -O0: cmp w8, w9, uxth
6475 ; -O0: stlxrh w10, w12, [x11]
6476 ; -O0: subs w9, w8, w9, uxth
6477 ; -O0: subs w9, w9, #1
6479 ; -O1-LABEL: atomicrmw_min_i16_aligned_release:
6480 ; -O1: ldxrh w9, [x0]
6482 ; -O1: cmp w8, w1, sxth
6483 ; -O1: csel w9, w9, w1, le
6484 ; -O1: stlxrh w10, w9, [x0]
6485 %r = atomicrmw min ptr %ptr, i16 %value release, align 2
6489 define dso_local i16 @atomicrmw_min_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
6490 ; -O0-LABEL: atomicrmw_min_i16_aligned_acq_rel:
6492 ; -O0: subs w10, w10, w8, sxth
6493 ; -O0: csel w12, w9, w8, le
6494 ; -O0: ldaxrh w8, [x11]
6495 ; -O0: cmp w8, w9, uxth
6496 ; -O0: stlxrh w10, w12, [x11]
6497 ; -O0: subs w9, w8, w9, uxth
6498 ; -O0: subs w9, w9, #1
6500 ; -O1-LABEL: atomicrmw_min_i16_aligned_acq_rel:
6501 ; -O1: ldaxrh w9, [x0]
6503 ; -O1: cmp w8, w1, sxth
6504 ; -O1: csel w9, w9, w1, le
6505 ; -O1: stlxrh w10, w9, [x0]
6506 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 2
6510 define dso_local i16 @atomicrmw_min_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
6511 ; -O0-LABEL: atomicrmw_min_i16_aligned_seq_cst:
6513 ; -O0: subs w10, w10, w8, sxth
6514 ; -O0: csel w12, w9, w8, le
6515 ; -O0: ldaxrh w8, [x11]
6516 ; -O0: cmp w8, w9, uxth
6517 ; -O0: stlxrh w10, w12, [x11]
6518 ; -O0: subs w9, w8, w9, uxth
6519 ; -O0: subs w9, w9, #1
6521 ; -O1-LABEL: atomicrmw_min_i16_aligned_seq_cst:
6522 ; -O1: ldaxrh w9, [x0]
6524 ; -O1: cmp w8, w1, sxth
6525 ; -O1: csel w9, w9, w1, le
6526 ; -O1: stlxrh w10, w9, [x0]
6527 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 2
6531 define dso_local i32 @atomicrmw_min_i32_aligned_monotonic(ptr %ptr, i32 %value) {
6532 ; -O0-LABEL: atomicrmw_min_i32_aligned_monotonic:
6533 ; -O0: subs w10, w9, w8
6534 ; -O0: csel w12, w9, w8, le
6535 ; -O0: ldaxr w8, [x11]
6537 ; -O0: stlxr w10, w12, [x11]
6538 ; -O0: subs w9, w8, w9
6539 ; -O0: subs w9, w9, #1
6541 ; -O1-LABEL: atomicrmw_min_i32_aligned_monotonic:
6542 ; -O1: ldxr w8, [x0]
6544 ; -O1: csel w9, w8, w1, le
6545 ; -O1: stxr w10, w9, [x0]
6546 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 4
6550 define dso_local i32 @atomicrmw_min_i32_aligned_acquire(ptr %ptr, i32 %value) {
6551 ; -O0-LABEL: atomicrmw_min_i32_aligned_acquire:
6552 ; -O0: subs w10, w9, w8
6553 ; -O0: csel w12, w9, w8, le
6554 ; -O0: ldaxr w8, [x11]
6556 ; -O0: stlxr w10, w12, [x11]
6557 ; -O0: subs w9, w8, w9
6558 ; -O0: subs w9, w9, #1
6560 ; -O1-LABEL: atomicrmw_min_i32_aligned_acquire:
6561 ; -O1: ldaxr w8, [x0]
6563 ; -O1: csel w9, w8, w1, le
6564 ; -O1: stxr w10, w9, [x0]
6565 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 4
6569 define dso_local i32 @atomicrmw_min_i32_aligned_release(ptr %ptr, i32 %value) {
6570 ; -O0-LABEL: atomicrmw_min_i32_aligned_release:
6571 ; -O0: subs w10, w9, w8
6572 ; -O0: csel w12, w9, w8, le
6573 ; -O0: ldaxr w8, [x11]
6575 ; -O0: stlxr w10, w12, [x11]
6576 ; -O0: subs w9, w8, w9
6577 ; -O0: subs w9, w9, #1
6579 ; -O1-LABEL: atomicrmw_min_i32_aligned_release:
6580 ; -O1: ldxr w8, [x0]
6582 ; -O1: csel w9, w8, w1, le
6583 ; -O1: stlxr w10, w9, [x0]
6584 %r = atomicrmw min ptr %ptr, i32 %value release, align 4
6588 define dso_local i32 @atomicrmw_min_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
6589 ; -O0-LABEL: atomicrmw_min_i32_aligned_acq_rel:
6590 ; -O0: subs w10, w9, w8
6591 ; -O0: csel w12, w9, w8, le
6592 ; -O0: ldaxr w8, [x11]
6594 ; -O0: stlxr w10, w12, [x11]
6595 ; -O0: subs w9, w8, w9
6596 ; -O0: subs w9, w9, #1
6598 ; -O1-LABEL: atomicrmw_min_i32_aligned_acq_rel:
6599 ; -O1: ldaxr w8, [x0]
6601 ; -O1: csel w9, w8, w1, le
6602 ; -O1: stlxr w10, w9, [x0]
6603 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 4
6607 define dso_local i32 @atomicrmw_min_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
6608 ; -O0-LABEL: atomicrmw_min_i32_aligned_seq_cst:
6609 ; -O0: subs w10, w9, w8
6610 ; -O0: csel w12, w9, w8, le
6611 ; -O0: ldaxr w8, [x11]
6613 ; -O0: stlxr w10, w12, [x11]
6614 ; -O0: subs w9, w8, w9
6615 ; -O0: subs w9, w9, #1
6617 ; -O1-LABEL: atomicrmw_min_i32_aligned_seq_cst:
6618 ; -O1: ldaxr w8, [x0]
6620 ; -O1: csel w9, w8, w1, le
6621 ; -O1: stlxr w10, w9, [x0]
6622 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 4
6626 define dso_local i64 @atomicrmw_min_i64_aligned_monotonic(ptr %ptr, i64 %value) {
6627 ; -O0-LABEL: atomicrmw_min_i64_aligned_monotonic:
6628 ; -O0: subs x10, x9, x8
6629 ; -O0: csel x12, x9, x8, le
6630 ; -O0: ldaxr x8, [x11]
6632 ; -O0: stlxr w10, x12, [x11]
6633 ; -O0: subs x9, x8, x9
6634 ; -O0: subs w9, w9, #1
6636 ; -O1-LABEL: atomicrmw_min_i64_aligned_monotonic:
6637 ; -O1: ldxr x0, [x8]
6639 ; -O1: csel x9, x0, x1, le
6640 ; -O1: stxr w10, x9, [x8]
6641 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 8
6645 define dso_local i64 @atomicrmw_min_i64_aligned_acquire(ptr %ptr, i64 %value) {
6646 ; -O0-LABEL: atomicrmw_min_i64_aligned_acquire:
6647 ; -O0: subs x10, x9, x8
6648 ; -O0: csel x12, x9, x8, le
6649 ; -O0: ldaxr x8, [x11]
6651 ; -O0: stlxr w10, x12, [x11]
6652 ; -O0: subs x9, x8, x9
6653 ; -O0: subs w9, w9, #1
6655 ; -O1-LABEL: atomicrmw_min_i64_aligned_acquire:
6656 ; -O1: ldaxr x0, [x8]
6658 ; -O1: csel x9, x0, x1, le
6659 ; -O1: stxr w10, x9, [x8]
6660 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 8
6664 define dso_local i64 @atomicrmw_min_i64_aligned_release(ptr %ptr, i64 %value) {
6665 ; -O0-LABEL: atomicrmw_min_i64_aligned_release:
6666 ; -O0: subs x10, x9, x8
6667 ; -O0: csel x12, x9, x8, le
6668 ; -O0: ldaxr x8, [x11]
6670 ; -O0: stlxr w10, x12, [x11]
6671 ; -O0: subs x9, x8, x9
6672 ; -O0: subs w9, w9, #1
6674 ; -O1-LABEL: atomicrmw_min_i64_aligned_release:
6675 ; -O1: ldxr x0, [x8]
6677 ; -O1: csel x9, x0, x1, le
6678 ; -O1: stlxr w10, x9, [x8]
6679 %r = atomicrmw min ptr %ptr, i64 %value release, align 8
6683 define dso_local i64 @atomicrmw_min_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
6684 ; -O0-LABEL: atomicrmw_min_i64_aligned_acq_rel:
6685 ; -O0: subs x10, x9, x8
6686 ; -O0: csel x12, x9, x8, le
6687 ; -O0: ldaxr x8, [x11]
6689 ; -O0: stlxr w10, x12, [x11]
6690 ; -O0: subs x9, x8, x9
6691 ; -O0: subs w9, w9, #1
6693 ; -O1-LABEL: atomicrmw_min_i64_aligned_acq_rel:
6694 ; -O1: ldaxr x0, [x8]
6696 ; -O1: csel x9, x0, x1, le
6697 ; -O1: stlxr w10, x9, [x8]
6698 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 8
6702 define dso_local i64 @atomicrmw_min_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
6703 ; -O0-LABEL: atomicrmw_min_i64_aligned_seq_cst:
6704 ; -O0: subs x10, x9, x8
6705 ; -O0: csel x12, x9, x8, le
6706 ; -O0: ldaxr x8, [x11]
6708 ; -O0: stlxr w10, x12, [x11]
6709 ; -O0: subs x9, x8, x9
6710 ; -O0: subs w9, w9, #1
6712 ; -O1-LABEL: atomicrmw_min_i64_aligned_seq_cst:
6713 ; -O1: ldaxr x0, [x8]
6715 ; -O1: csel x9, x0, x1, le
6716 ; -O1: stlxr w10, x9, [x8]
6717 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 8
6721 define dso_local i128 @atomicrmw_min_i128_aligned_monotonic(ptr %ptr, i128 %value) {
6722 ; -O0-LABEL: atomicrmw_min_i128_aligned_monotonic:
6723 ; -O0: subs x12, x8, x11
6724 ; -O0: csel x15, x13, x10, ge
6725 ; -O0: csel x14, x11, x8, ge
6726 ; -O0: ldxp x10, x12, [x9]
6729 ; -O0: stxp w8, x14, x15, [x9]
6730 ; -O0: stxp w8, x10, x12, [x9]
6731 ; -O0: subs x12, x12, x13
6732 ; -O0: ccmp x10, x11, #0, eq
6734 ; -O1-LABEL: atomicrmw_min_i128_aligned_monotonic:
6735 ; -O1: ldxp x1, x0, [x8]
6737 ; -O1: csel x9, x0, x2, ge
6738 ; -O1: csel x10, x1, x3, ge
6739 ; -O1: stxp w11, x10, x9, [x8]
6740 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 16
6744 define dso_local i128 @atomicrmw_min_i128_aligned_acquire(ptr %ptr, i128 %value) {
6745 ; -O0-LABEL: atomicrmw_min_i128_aligned_acquire:
6746 ; -O0: subs x12, x8, x11
6747 ; -O0: csel x15, x13, x10, ge
6748 ; -O0: csel x14, x11, x8, ge
6749 ; -O0: ldaxp x10, x12, [x9]
6752 ; -O0: stxp w8, x14, x15, [x9]
6753 ; -O0: stxp w8, x10, x12, [x9]
6754 ; -O0: subs x12, x12, x13
6755 ; -O0: ccmp x10, x11, #0, eq
6757 ; -O1-LABEL: atomicrmw_min_i128_aligned_acquire:
6758 ; -O1: ldaxp x1, x0, [x8]
6760 ; -O1: csel x9, x0, x2, ge
6761 ; -O1: csel x10, x1, x3, ge
6762 ; -O1: stxp w11, x10, x9, [x8]
6763 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 16
6767 define dso_local i128 @atomicrmw_min_i128_aligned_release(ptr %ptr, i128 %value) {
6768 ; -O0-LABEL: atomicrmw_min_i128_aligned_release:
6769 ; -O0: subs x12, x8, x11
6770 ; -O0: csel x15, x13, x10, ge
6771 ; -O0: csel x14, x11, x8, ge
6772 ; -O0: ldxp x10, x12, [x9]
6775 ; -O0: stlxp w8, x14, x15, [x9]
6776 ; -O0: stlxp w8, x10, x12, [x9]
6777 ; -O0: subs x12, x12, x13
6778 ; -O0: ccmp x10, x11, #0, eq
6780 ; -O1-LABEL: atomicrmw_min_i128_aligned_release:
6781 ; -O1: ldxp x1, x0, [x8]
6783 ; -O1: csel x9, x0, x2, ge
6784 ; -O1: csel x10, x1, x3, ge
6785 ; -O1: stlxp w11, x10, x9, [x8]
6786 %r = atomicrmw min ptr %ptr, i128 %value release, align 16
6790 define dso_local i128 @atomicrmw_min_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
6791 ; -O0-LABEL: atomicrmw_min_i128_aligned_acq_rel:
6792 ; -O0: subs x12, x8, x11
6793 ; -O0: csel x15, x13, x10, ge
6794 ; -O0: csel x14, x11, x8, ge
6795 ; -O0: ldaxp x10, x12, [x9]
6798 ; -O0: stlxp w8, x14, x15, [x9]
6799 ; -O0: stlxp w8, x10, x12, [x9]
6800 ; -O0: subs x12, x12, x13
6801 ; -O0: ccmp x10, x11, #0, eq
6803 ; -O1-LABEL: atomicrmw_min_i128_aligned_acq_rel:
6804 ; -O1: ldaxp x1, x0, [x8]
6806 ; -O1: csel x9, x0, x2, ge
6807 ; -O1: csel x10, x1, x3, ge
6808 ; -O1: stlxp w11, x10, x9, [x8]
6809 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 16
6813 define dso_local i128 @atomicrmw_min_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
6814 ; -O0-LABEL: atomicrmw_min_i128_aligned_seq_cst:
6815 ; -O0: subs x12, x8, x11
6816 ; -O0: csel x15, x13, x10, ge
6817 ; -O0: csel x14, x11, x8, ge
6818 ; -O0: ldaxp x10, x12, [x9]
6821 ; -O0: stlxp w8, x14, x15, [x9]
6822 ; -O0: stlxp w8, x10, x12, [x9]
6823 ; -O0: subs x12, x12, x13
6824 ; -O0: ccmp x10, x11, #0, eq
6826 ; -O1-LABEL: atomicrmw_min_i128_aligned_seq_cst:
6827 ; -O1: ldaxp x1, x0, [x8]
6829 ; -O1: csel x9, x0, x2, ge
6830 ; -O1: csel x10, x1, x3, ge
6831 ; -O1: stlxp w11, x10, x9, [x8]
6832 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 16
6836 define dso_local i8 @atomicrmw_min_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
6837 ; -O0-LABEL: atomicrmw_min_i8_unaligned_monotonic:
6839 ; -O0: subs w10, w10, w8, sxtb
6840 ; -O0: csel w12, w9, w8, le
6841 ; -O0: ldaxrb w8, [x11]
6842 ; -O0: cmp w8, w9, uxtb
6843 ; -O0: stlxrb w10, w12, [x11]
6844 ; -O0: subs w9, w8, w9, uxtb
6845 ; -O0: subs w9, w9, #1
6847 ; -O1-LABEL: atomicrmw_min_i8_unaligned_monotonic:
6848 ; -O1: ldxrb w9, [x0]
6850 ; -O1: cmp w8, w1, sxtb
6851 ; -O1: csel w9, w9, w1, le
6852 ; -O1: stxrb w10, w9, [x0]
6853 %r = atomicrmw min ptr %ptr, i8 %value monotonic, align 1
6857 define dso_local i8 @atomicrmw_min_i8_unaligned_acquire(ptr %ptr, i8 %value) {
6858 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acquire:
6860 ; -O0: subs w10, w10, w8, sxtb
6861 ; -O0: csel w12, w9, w8, le
6862 ; -O0: ldaxrb w8, [x11]
6863 ; -O0: cmp w8, w9, uxtb
6864 ; -O0: stlxrb w10, w12, [x11]
6865 ; -O0: subs w9, w8, w9, uxtb
6866 ; -O0: subs w9, w9, #1
6868 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acquire:
6869 ; -O1: ldaxrb w9, [x0]
6871 ; -O1: cmp w8, w1, sxtb
6872 ; -O1: csel w9, w9, w1, le
6873 ; -O1: stxrb w10, w9, [x0]
6874 %r = atomicrmw min ptr %ptr, i8 %value acquire, align 1
6878 define dso_local i8 @atomicrmw_min_i8_unaligned_release(ptr %ptr, i8 %value) {
6879 ; -O0-LABEL: atomicrmw_min_i8_unaligned_release:
6881 ; -O0: subs w10, w10, w8, sxtb
6882 ; -O0: csel w12, w9, w8, le
6883 ; -O0: ldaxrb w8, [x11]
6884 ; -O0: cmp w8, w9, uxtb
6885 ; -O0: stlxrb w10, w12, [x11]
6886 ; -O0: subs w9, w8, w9, uxtb
6887 ; -O0: subs w9, w9, #1
6889 ; -O1-LABEL: atomicrmw_min_i8_unaligned_release:
6890 ; -O1: ldxrb w9, [x0]
6892 ; -O1: cmp w8, w1, sxtb
6893 ; -O1: csel w9, w9, w1, le
6894 ; -O1: stlxrb w10, w9, [x0]
6895 %r = atomicrmw min ptr %ptr, i8 %value release, align 1
6899 define dso_local i8 @atomicrmw_min_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
6900 ; -O0-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
6902 ; -O0: subs w10, w10, w8, sxtb
6903 ; -O0: csel w12, w9, w8, le
6904 ; -O0: ldaxrb w8, [x11]
6905 ; -O0: cmp w8, w9, uxtb
6906 ; -O0: stlxrb w10, w12, [x11]
6907 ; -O0: subs w9, w8, w9, uxtb
6908 ; -O0: subs w9, w9, #1
6910 ; -O1-LABEL: atomicrmw_min_i8_unaligned_acq_rel:
6911 ; -O1: ldaxrb w9, [x0]
6913 ; -O1: cmp w8, w1, sxtb
6914 ; -O1: csel w9, w9, w1, le
6915 ; -O1: stlxrb w10, w9, [x0]
6916 %r = atomicrmw min ptr %ptr, i8 %value acq_rel, align 1
6920 define dso_local i8 @atomicrmw_min_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
6921 ; -O0-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
6923 ; -O0: subs w10, w10, w8, sxtb
6924 ; -O0: csel w12, w9, w8, le
6925 ; -O0: ldaxrb w8, [x11]
6926 ; -O0: cmp w8, w9, uxtb
6927 ; -O0: stlxrb w10, w12, [x11]
6928 ; -O0: subs w9, w8, w9, uxtb
6929 ; -O0: subs w9, w9, #1
6931 ; -O1-LABEL: atomicrmw_min_i8_unaligned_seq_cst:
6932 ; -O1: ldaxrb w9, [x0]
6934 ; -O1: cmp w8, w1, sxtb
6935 ; -O1: csel w9, w9, w1, le
6936 ; -O1: stlxrb w10, w9, [x0]
6937 %r = atomicrmw min ptr %ptr, i8 %value seq_cst, align 1
6941 define dso_local i16 @atomicrmw_min_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
6942 ; -O0-LABEL: atomicrmw_min_i16_unaligned_monotonic:
6944 ; -O0: subs w10, w10, w8, sxth
6945 ; -O0: csel w8, w9, w8, le
6946 ; -O0: bl __atomic_compare_exchange
6948 ; -O1-LABEL: atomicrmw_min_i16_unaligned_monotonic:
6950 ; -O1: cmp w8, w20, sxth
6951 ; -O1: csel w8, w0, w20, le
6952 ; -O1: bl __atomic_compare_exchange
6953 %r = atomicrmw min ptr %ptr, i16 %value monotonic, align 1
6957 define dso_local i16 @atomicrmw_min_i16_unaligned_acquire(ptr %ptr, i16 %value) {
6958 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acquire:
6960 ; -O0: subs w10, w10, w8, sxth
6961 ; -O0: csel w8, w9, w8, le
6962 ; -O0: bl __atomic_compare_exchange
6964 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acquire:
6966 ; -O1: cmp w8, w20, sxth
6967 ; -O1: csel w8, w0, w20, le
6968 ; -O1: bl __atomic_compare_exchange
6969 %r = atomicrmw min ptr %ptr, i16 %value acquire, align 1
6973 define dso_local i16 @atomicrmw_min_i16_unaligned_release(ptr %ptr, i16 %value) {
6974 ; -O0-LABEL: atomicrmw_min_i16_unaligned_release:
6976 ; -O0: subs w10, w10, w8, sxth
6977 ; -O0: csel w8, w9, w8, le
6978 ; -O0: bl __atomic_compare_exchange
6980 ; -O1-LABEL: atomicrmw_min_i16_unaligned_release:
6982 ; -O1: cmp w8, w20, sxth
6983 ; -O1: csel w8, w0, w20, le
6984 ; -O1: bl __atomic_compare_exchange
6985 %r = atomicrmw min ptr %ptr, i16 %value release, align 1
6989 define dso_local i16 @atomicrmw_min_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
6990 ; -O0-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
6992 ; -O0: subs w10, w10, w8, sxth
6993 ; -O0: csel w8, w9, w8, le
6994 ; -O0: bl __atomic_compare_exchange
6996 ; -O1-LABEL: atomicrmw_min_i16_unaligned_acq_rel:
6998 ; -O1: cmp w8, w20, sxth
6999 ; -O1: csel w8, w0, w20, le
7000 ; -O1: bl __atomic_compare_exchange
7001 %r = atomicrmw min ptr %ptr, i16 %value acq_rel, align 1
7005 define dso_local i16 @atomicrmw_min_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
7006 ; -O0-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
7008 ; -O0: subs w10, w10, w8, sxth
7009 ; -O0: csel w8, w9, w8, le
7010 ; -O0: bl __atomic_compare_exchange
7012 ; -O1-LABEL: atomicrmw_min_i16_unaligned_seq_cst:
7014 ; -O1: cmp w8, w20, sxth
7015 ; -O1: csel w8, w0, w20, le
7016 ; -O1: bl __atomic_compare_exchange
7017 %r = atomicrmw min ptr %ptr, i16 %value seq_cst, align 1
7021 define dso_local i32 @atomicrmw_min_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
7022 ; -O0-LABEL: atomicrmw_min_i32_unaligned_monotonic:
7023 ; -O0: subs w10, w9, w8
7024 ; -O0: csel w8, w9, w8, le
7025 ; -O0: bl __atomic_compare_exchange
7027 ; -O1-LABEL: atomicrmw_min_i32_unaligned_monotonic:
7029 ; -O1: csel w8, w0, w20, le
7030 ; -O1: bl __atomic_compare_exchange
7031 %r = atomicrmw min ptr %ptr, i32 %value monotonic, align 1
7035 define dso_local i32 @atomicrmw_min_i32_unaligned_acquire(ptr %ptr, i32 %value) {
7036 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acquire:
7037 ; -O0: subs w10, w9, w8
7038 ; -O0: csel w8, w9, w8, le
7039 ; -O0: bl __atomic_compare_exchange
7041 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acquire:
7043 ; -O1: csel w8, w0, w20, le
7044 ; -O1: bl __atomic_compare_exchange
7045 %r = atomicrmw min ptr %ptr, i32 %value acquire, align 1
7049 define dso_local i32 @atomicrmw_min_i32_unaligned_release(ptr %ptr, i32 %value) {
7050 ; -O0-LABEL: atomicrmw_min_i32_unaligned_release:
7051 ; -O0: subs w10, w9, w8
7052 ; -O0: csel w8, w9, w8, le
7053 ; -O0: bl __atomic_compare_exchange
7055 ; -O1-LABEL: atomicrmw_min_i32_unaligned_release:
7057 ; -O1: csel w8, w0, w20, le
7058 ; -O1: bl __atomic_compare_exchange
7059 %r = atomicrmw min ptr %ptr, i32 %value release, align 1
7063 define dso_local i32 @atomicrmw_min_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
7064 ; -O0-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
7065 ; -O0: subs w10, w9, w8
7066 ; -O0: csel w8, w9, w8, le
7067 ; -O0: bl __atomic_compare_exchange
7069 ; -O1-LABEL: atomicrmw_min_i32_unaligned_acq_rel:
7071 ; -O1: csel w8, w0, w20, le
7072 ; -O1: bl __atomic_compare_exchange
7073 %r = atomicrmw min ptr %ptr, i32 %value acq_rel, align 1
7077 define dso_local i32 @atomicrmw_min_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
7078 ; -O0-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
7079 ; -O0: subs w10, w9, w8
7080 ; -O0: csel w8, w9, w8, le
7081 ; -O0: bl __atomic_compare_exchange
7083 ; -O1-LABEL: atomicrmw_min_i32_unaligned_seq_cst:
7085 ; -O1: csel w8, w0, w20, le
7086 ; -O1: bl __atomic_compare_exchange
7087 %r = atomicrmw min ptr %ptr, i32 %value seq_cst, align 1
7091 define dso_local i64 @atomicrmw_min_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
7092 ; -O0-LABEL: atomicrmw_min_i64_unaligned_monotonic:
7093 ; -O0: subs x10, x9, x8
7094 ; -O0: csel x8, x9, x8, le
7095 ; -O0: bl __atomic_compare_exchange
7097 ; -O1-LABEL: atomicrmw_min_i64_unaligned_monotonic:
7099 ; -O1: csel x8, x0, x20, le
7100 ; -O1: bl __atomic_compare_exchange
7101 %r = atomicrmw min ptr %ptr, i64 %value monotonic, align 1
7105 define dso_local i64 @atomicrmw_min_i64_unaligned_acquire(ptr %ptr, i64 %value) {
7106 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acquire:
7107 ; -O0: subs x10, x9, x8
7108 ; -O0: csel x8, x9, x8, le
7109 ; -O0: bl __atomic_compare_exchange
7111 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acquire:
7113 ; -O1: csel x8, x0, x20, le
7114 ; -O1: bl __atomic_compare_exchange
7115 %r = atomicrmw min ptr %ptr, i64 %value acquire, align 1
7119 define dso_local i64 @atomicrmw_min_i64_unaligned_release(ptr %ptr, i64 %value) {
7120 ; -O0-LABEL: atomicrmw_min_i64_unaligned_release:
7121 ; -O0: subs x10, x9, x8
7122 ; -O0: csel x8, x9, x8, le
7123 ; -O0: bl __atomic_compare_exchange
7125 ; -O1-LABEL: atomicrmw_min_i64_unaligned_release:
7127 ; -O1: csel x8, x0, x20, le
7128 ; -O1: bl __atomic_compare_exchange
7129 %r = atomicrmw min ptr %ptr, i64 %value release, align 1
7133 define dso_local i64 @atomicrmw_min_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
7134 ; -O0-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
7135 ; -O0: subs x10, x9, x8
7136 ; -O0: csel x8, x9, x8, le
7137 ; -O0: bl __atomic_compare_exchange
7139 ; -O1-LABEL: atomicrmw_min_i64_unaligned_acq_rel:
7141 ; -O1: csel x8, x0, x20, le
7142 ; -O1: bl __atomic_compare_exchange
7143 %r = atomicrmw min ptr %ptr, i64 %value acq_rel, align 1
7147 define dso_local i64 @atomicrmw_min_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
7148 ; -O0-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
7149 ; -O0: subs x10, x9, x8
7150 ; -O0: csel x8, x9, x8, le
7151 ; -O0: bl __atomic_compare_exchange
7153 ; -O1-LABEL: atomicrmw_min_i64_unaligned_seq_cst:
7155 ; -O1: csel x8, x0, x20, le
7156 ; -O1: bl __atomic_compare_exchange
7157 %r = atomicrmw min ptr %ptr, i64 %value seq_cst, align 1
7161 define dso_local i128 @atomicrmw_min_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
7162 ; -O0-LABEL: atomicrmw_min_i128_unaligned_monotonic:
7163 ; -O0: subs x12, x9, x10
7164 ; -O0: csel x8, x11, x8, ge
7165 ; -O0: csel x9, x10, x9, ge
7166 ; -O0: bl __atomic_compare_exchange
7168 ; -O1-LABEL: atomicrmw_min_i128_unaligned_monotonic:
7169 ; -O1: ldp x0, x1, [x0]
7171 ; -O1: csel x8, x1, x19, ge
7172 ; -O1: csel x9, x0, x21, ge
7173 ; -O1: bl __atomic_compare_exchange
7174 %r = atomicrmw min ptr %ptr, i128 %value monotonic, align 1
7178 define dso_local i128 @atomicrmw_min_i128_unaligned_acquire(ptr %ptr, i128 %value) {
7179 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acquire:
7180 ; -O0: subs x12, x9, x10
7181 ; -O0: csel x8, x11, x8, ge
7182 ; -O0: csel x9, x10, x9, ge
7183 ; -O0: bl __atomic_compare_exchange
7185 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acquire:
7186 ; -O1: ldp x0, x1, [x0]
7188 ; -O1: csel x8, x1, x19, ge
7189 ; -O1: csel x9, x0, x21, ge
7190 ; -O1: bl __atomic_compare_exchange
7191 %r = atomicrmw min ptr %ptr, i128 %value acquire, align 1
7195 define dso_local i128 @atomicrmw_min_i128_unaligned_release(ptr %ptr, i128 %value) {
7196 ; -O0-LABEL: atomicrmw_min_i128_unaligned_release:
7197 ; -O0: subs x12, x9, x10
7198 ; -O0: csel x8, x11, x8, ge
7199 ; -O0: csel x9, x10, x9, ge
7200 ; -O0: bl __atomic_compare_exchange
7202 ; -O1-LABEL: atomicrmw_min_i128_unaligned_release:
7203 ; -O1: ldp x0, x1, [x0]
7205 ; -O1: csel x8, x1, x19, ge
7206 ; -O1: csel x9, x0, x21, ge
7207 ; -O1: bl __atomic_compare_exchange
7208 %r = atomicrmw min ptr %ptr, i128 %value release, align 1
7212 define dso_local i128 @atomicrmw_min_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
7213 ; -O0-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
7214 ; -O0: subs x12, x9, x10
7215 ; -O0: csel x8, x11, x8, ge
7216 ; -O0: csel x9, x10, x9, ge
7217 ; -O0: bl __atomic_compare_exchange
7219 ; -O1-LABEL: atomicrmw_min_i128_unaligned_acq_rel:
7220 ; -O1: ldp x0, x1, [x0]
7222 ; -O1: csel x8, x1, x19, ge
7223 ; -O1: csel x9, x0, x21, ge
7224 ; -O1: bl __atomic_compare_exchange
7225 %r = atomicrmw min ptr %ptr, i128 %value acq_rel, align 1
7229 define dso_local i128 @atomicrmw_min_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
7230 ; -O0-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
7231 ; -O0: subs x12, x9, x10
7232 ; -O0: csel x8, x11, x8, ge
7233 ; -O0: csel x9, x10, x9, ge
7234 ; -O0: bl __atomic_compare_exchange
7236 ; -O1-LABEL: atomicrmw_min_i128_unaligned_seq_cst:
7237 ; -O1: ldp x0, x1, [x0]
7239 ; -O1: csel x8, x1, x19, ge
7240 ; -O1: csel x9, x0, x21, ge
7241 ; -O1: bl __atomic_compare_exchange
7242 %r = atomicrmw min ptr %ptr, i128 %value seq_cst, align 1
7246 define dso_local i8 @atomicrmw_umax_i8_aligned_monotonic(ptr %ptr, i8 %value) {
7247 ; -O0-LABEL: atomicrmw_umax_i8_aligned_monotonic:
7248 ; -O0: and w9, w12, #0xff
7249 ; -O0: subs w10, w9, w8, uxtb
7250 ; -O0: csel w13, w12, w8, hi
7251 ; -O0: ldaxrb w8, [x11]
7252 ; -O0: cmp w8, w12, uxtb
7253 ; -O0: stlxrb w10, w13, [x11]
7254 ; -O0: subs w9, w8, w9
7255 ; -O0: subs w9, w9, #1
7257 ; -O1-LABEL: atomicrmw_umax_i8_aligned_monotonic:
7258 ; -O1: and w9, w1, #0xff
7259 ; -O1: ldxrb w8, [x0]
7261 ; -O1: csel w10, w8, w9, hi
7262 ; -O1: stxrb w11, w10, [x0]
7263 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
7267 define dso_local i8 @atomicrmw_umax_i8_aligned_acquire(ptr %ptr, i8 %value) {
7268 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acquire:
7269 ; -O0: and w9, w12, #0xff
7270 ; -O0: subs w10, w9, w8, uxtb
7271 ; -O0: csel w13, w12, w8, hi
7272 ; -O0: ldaxrb w8, [x11]
7273 ; -O0: cmp w8, w12, uxtb
7274 ; -O0: stlxrb w10, w13, [x11]
7275 ; -O0: subs w9, w8, w9
7276 ; -O0: subs w9, w9, #1
7278 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acquire:
7279 ; -O1: and w9, w1, #0xff
7280 ; -O1: ldaxrb w8, [x0]
7282 ; -O1: csel w10, w8, w9, hi
7283 ; -O1: stxrb w11, w10, [x0]
7284 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
7288 define dso_local i8 @atomicrmw_umax_i8_aligned_release(ptr %ptr, i8 %value) {
7289 ; -O0-LABEL: atomicrmw_umax_i8_aligned_release:
7290 ; -O0: and w9, w12, #0xff
7291 ; -O0: subs w10, w9, w8, uxtb
7292 ; -O0: csel w13, w12, w8, hi
7293 ; -O0: ldaxrb w8, [x11]
7294 ; -O0: cmp w8, w12, uxtb
7295 ; -O0: stlxrb w10, w13, [x11]
7296 ; -O0: subs w9, w8, w9
7297 ; -O0: subs w9, w9, #1
7299 ; -O1-LABEL: atomicrmw_umax_i8_aligned_release:
7300 ; -O1: and w9, w1, #0xff
7301 ; -O1: ldxrb w8, [x0]
7303 ; -O1: csel w10, w8, w9, hi
7304 ; -O1: stlxrb w11, w10, [x0]
7305 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
7309 define dso_local i8 @atomicrmw_umax_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
7310 ; -O0-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
7311 ; -O0: and w9, w12, #0xff
7312 ; -O0: subs w10, w9, w8, uxtb
7313 ; -O0: csel w13, w12, w8, hi
7314 ; -O0: ldaxrb w8, [x11]
7315 ; -O0: cmp w8, w12, uxtb
7316 ; -O0: stlxrb w10, w13, [x11]
7317 ; -O0: subs w9, w8, w9
7318 ; -O0: subs w9, w9, #1
7320 ; -O1-LABEL: atomicrmw_umax_i8_aligned_acq_rel:
7321 ; -O1: and w9, w1, #0xff
7322 ; -O1: ldaxrb w8, [x0]
7324 ; -O1: csel w10, w8, w9, hi
7325 ; -O1: stlxrb w11, w10, [x0]
7326 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
7330 define dso_local i8 @atomicrmw_umax_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
7331 ; -O0-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
7332 ; -O0: and w9, w12, #0xff
7333 ; -O0: subs w10, w9, w8, uxtb
7334 ; -O0: csel w13, w12, w8, hi
7335 ; -O0: ldaxrb w8, [x11]
7336 ; -O0: cmp w8, w12, uxtb
7337 ; -O0: stlxrb w10, w13, [x11]
7338 ; -O0: subs w9, w8, w9
7339 ; -O0: subs w9, w9, #1
7341 ; -O1-LABEL: atomicrmw_umax_i8_aligned_seq_cst:
7342 ; -O1: and w9, w1, #0xff
7343 ; -O1: ldaxrb w8, [x0]
7345 ; -O1: csel w10, w8, w9, hi
7346 ; -O1: stlxrb w11, w10, [x0]
7347 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
7351 define dso_local i16 @atomicrmw_umax_i16_aligned_monotonic(ptr %ptr, i16 %value) {
7352 ; -O0-LABEL: atomicrmw_umax_i16_aligned_monotonic:
7353 ; -O0: and w9, w12, #0xffff
7354 ; -O0: subs w10, w9, w8, uxth
7355 ; -O0: csel w13, w12, w8, hi
7356 ; -O0: ldaxrh w8, [x11]
7357 ; -O0: cmp w8, w12, uxth
7358 ; -O0: stlxrh w10, w13, [x11]
7359 ; -O0: subs w9, w8, w9
7360 ; -O0: subs w9, w9, #1
7362 ; -O1-LABEL: atomicrmw_umax_i16_aligned_monotonic:
7363 ; -O1: and w9, w1, #0xffff
7364 ; -O1: ldxrh w8, [x0]
7366 ; -O1: csel w10, w8, w9, hi
7367 ; -O1: stxrh w11, w10, [x0]
7368 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 2
7372 define dso_local i16 @atomicrmw_umax_i16_aligned_acquire(ptr %ptr, i16 %value) {
7373 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acquire:
7374 ; -O0: and w9, w12, #0xffff
7375 ; -O0: subs w10, w9, w8, uxth
7376 ; -O0: csel w13, w12, w8, hi
7377 ; -O0: ldaxrh w8, [x11]
7378 ; -O0: cmp w8, w12, uxth
7379 ; -O0: stlxrh w10, w13, [x11]
7380 ; -O0: subs w9, w8, w9
7381 ; -O0: subs w9, w9, #1
7383 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acquire:
7384 ; -O1: and w9, w1, #0xffff
7385 ; -O1: ldaxrh w8, [x0]
7387 ; -O1: csel w10, w8, w9, hi
7388 ; -O1: stxrh w11, w10, [x0]
7389 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 2
7393 define dso_local i16 @atomicrmw_umax_i16_aligned_release(ptr %ptr, i16 %value) {
7394 ; -O0-LABEL: atomicrmw_umax_i16_aligned_release:
7395 ; -O0: and w9, w12, #0xffff
7396 ; -O0: subs w10, w9, w8, uxth
7397 ; -O0: csel w13, w12, w8, hi
7398 ; -O0: ldaxrh w8, [x11]
7399 ; -O0: cmp w8, w12, uxth
7400 ; -O0: stlxrh w10, w13, [x11]
7401 ; -O0: subs w9, w8, w9
7402 ; -O0: subs w9, w9, #1
7404 ; -O1-LABEL: atomicrmw_umax_i16_aligned_release:
7405 ; -O1: and w9, w1, #0xffff
7406 ; -O1: ldxrh w8, [x0]
7408 ; -O1: csel w10, w8, w9, hi
7409 ; -O1: stlxrh w11, w10, [x0]
7410 %r = atomicrmw umax ptr %ptr, i16 %value release, align 2
7414 define dso_local i16 @atomicrmw_umax_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
7415 ; -O0-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
7416 ; -O0: and w9, w12, #0xffff
7417 ; -O0: subs w10, w9, w8, uxth
7418 ; -O0: csel w13, w12, w8, hi
7419 ; -O0: ldaxrh w8, [x11]
7420 ; -O0: cmp w8, w12, uxth
7421 ; -O0: stlxrh w10, w13, [x11]
7422 ; -O0: subs w9, w8, w9
7423 ; -O0: subs w9, w9, #1
7425 ; -O1-LABEL: atomicrmw_umax_i16_aligned_acq_rel:
7426 ; -O1: and w9, w1, #0xffff
7427 ; -O1: ldaxrh w8, [x0]
7429 ; -O1: csel w10, w8, w9, hi
7430 ; -O1: stlxrh w11, w10, [x0]
7431 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 2
7435 define dso_local i16 @atomicrmw_umax_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
7436 ; -O0-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
7437 ; -O0: and w9, w12, #0xffff
7438 ; -O0: subs w10, w9, w8, uxth
7439 ; -O0: csel w13, w12, w8, hi
7440 ; -O0: ldaxrh w8, [x11]
7441 ; -O0: cmp w8, w12, uxth
7442 ; -O0: stlxrh w10, w13, [x11]
7443 ; -O0: subs w9, w8, w9
7444 ; -O0: subs w9, w9, #1
7446 ; -O1-LABEL: atomicrmw_umax_i16_aligned_seq_cst:
7447 ; -O1: and w9, w1, #0xffff
7448 ; -O1: ldaxrh w8, [x0]
7450 ; -O1: csel w10, w8, w9, hi
7451 ; -O1: stlxrh w11, w10, [x0]
7452 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 2
7456 define dso_local i32 @atomicrmw_umax_i32_aligned_monotonic(ptr %ptr, i32 %value) {
7457 ; -O0-LABEL: atomicrmw_umax_i32_aligned_monotonic:
7458 ; -O0: subs w10, w9, w8
7459 ; -O0: csel w12, w9, w8, hi
7460 ; -O0: ldaxr w8, [x11]
7462 ; -O0: stlxr w10, w12, [x11]
7463 ; -O0: subs w9, w8, w9
7464 ; -O0: subs w9, w9, #1
7466 ; -O1-LABEL: atomicrmw_umax_i32_aligned_monotonic:
7467 ; -O1: ldxr w8, [x0]
7469 ; -O1: csel w9, w8, w1, hi
7470 ; -O1: stxr w10, w9, [x0]
7471 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 4
7475 define dso_local i32 @atomicrmw_umax_i32_aligned_acquire(ptr %ptr, i32 %value) {
7476 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acquire:
7477 ; -O0: subs w10, w9, w8
7478 ; -O0: csel w12, w9, w8, hi
7479 ; -O0: ldaxr w8, [x11]
7481 ; -O0: stlxr w10, w12, [x11]
7482 ; -O0: subs w9, w8, w9
7483 ; -O0: subs w9, w9, #1
7485 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acquire:
7486 ; -O1: ldaxr w8, [x0]
7488 ; -O1: csel w9, w8, w1, hi
7489 ; -O1: stxr w10, w9, [x0]
7490 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 4
7494 define dso_local i32 @atomicrmw_umax_i32_aligned_release(ptr %ptr, i32 %value) {
7495 ; -O0-LABEL: atomicrmw_umax_i32_aligned_release:
7496 ; -O0: subs w10, w9, w8
7497 ; -O0: csel w12, w9, w8, hi
7498 ; -O0: ldaxr w8, [x11]
7500 ; -O0: stlxr w10, w12, [x11]
7501 ; -O0: subs w9, w8, w9
7502 ; -O0: subs w9, w9, #1
7504 ; -O1-LABEL: atomicrmw_umax_i32_aligned_release:
7505 ; -O1: ldxr w8, [x0]
7507 ; -O1: csel w9, w8, w1, hi
7508 ; -O1: stlxr w10, w9, [x0]
7509 %r = atomicrmw umax ptr %ptr, i32 %value release, align 4
7513 define dso_local i32 @atomicrmw_umax_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
7514 ; -O0-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
7515 ; -O0: subs w10, w9, w8
7516 ; -O0: csel w12, w9, w8, hi
7517 ; -O0: ldaxr w8, [x11]
7519 ; -O0: stlxr w10, w12, [x11]
7520 ; -O0: subs w9, w8, w9
7521 ; -O0: subs w9, w9, #1
7523 ; -O1-LABEL: atomicrmw_umax_i32_aligned_acq_rel:
7524 ; -O1: ldaxr w8, [x0]
7526 ; -O1: csel w9, w8, w1, hi
7527 ; -O1: stlxr w10, w9, [x0]
7528 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 4
7532 define dso_local i32 @atomicrmw_umax_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
7533 ; -O0-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
7534 ; -O0: subs w10, w9, w8
7535 ; -O0: csel w12, w9, w8, hi
7536 ; -O0: ldaxr w8, [x11]
7538 ; -O0: stlxr w10, w12, [x11]
7539 ; -O0: subs w9, w8, w9
7540 ; -O0: subs w9, w9, #1
7542 ; -O1-LABEL: atomicrmw_umax_i32_aligned_seq_cst:
7543 ; -O1: ldaxr w8, [x0]
7545 ; -O1: csel w9, w8, w1, hi
7546 ; -O1: stlxr w10, w9, [x0]
7547 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 4
7551 define dso_local i64 @atomicrmw_umax_i64_aligned_monotonic(ptr %ptr, i64 %value) {
7552 ; -O0-LABEL: atomicrmw_umax_i64_aligned_monotonic:
7553 ; -O0: subs x10, x9, x8
7554 ; -O0: csel x12, x9, x8, hi
7555 ; -O0: ldaxr x8, [x11]
7557 ; -O0: stlxr w10, x12, [x11]
7558 ; -O0: subs x9, x8, x9
7559 ; -O0: subs w9, w9, #1
7561 ; -O1-LABEL: atomicrmw_umax_i64_aligned_monotonic:
7562 ; -O1: ldxr x0, [x8]
7564 ; -O1: csel x9, x0, x1, hi
7565 ; -O1: stxr w10, x9, [x8]
7566 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 8
7570 define dso_local i64 @atomicrmw_umax_i64_aligned_acquire(ptr %ptr, i64 %value) {
7571 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acquire:
7572 ; -O0: subs x10, x9, x8
7573 ; -O0: csel x12, x9, x8, hi
7574 ; -O0: ldaxr x8, [x11]
7576 ; -O0: stlxr w10, x12, [x11]
7577 ; -O0: subs x9, x8, x9
7578 ; -O0: subs w9, w9, #1
7580 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acquire:
7581 ; -O1: ldaxr x0, [x8]
7583 ; -O1: csel x9, x0, x1, hi
7584 ; -O1: stxr w10, x9, [x8]
7585 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 8
7589 define dso_local i64 @atomicrmw_umax_i64_aligned_release(ptr %ptr, i64 %value) {
7590 ; -O0-LABEL: atomicrmw_umax_i64_aligned_release:
7591 ; -O0: subs x10, x9, x8
7592 ; -O0: csel x12, x9, x8, hi
7593 ; -O0: ldaxr x8, [x11]
7595 ; -O0: stlxr w10, x12, [x11]
7596 ; -O0: subs x9, x8, x9
7597 ; -O0: subs w9, w9, #1
7599 ; -O1-LABEL: atomicrmw_umax_i64_aligned_release:
7600 ; -O1: ldxr x0, [x8]
7602 ; -O1: csel x9, x0, x1, hi
7603 ; -O1: stlxr w10, x9, [x8]
7604 %r = atomicrmw umax ptr %ptr, i64 %value release, align 8
7608 define dso_local i64 @atomicrmw_umax_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
7609 ; -O0-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
7610 ; -O0: subs x10, x9, x8
7611 ; -O0: csel x12, x9, x8, hi
7612 ; -O0: ldaxr x8, [x11]
7614 ; -O0: stlxr w10, x12, [x11]
7615 ; -O0: subs x9, x8, x9
7616 ; -O0: subs w9, w9, #1
7618 ; -O1-LABEL: atomicrmw_umax_i64_aligned_acq_rel:
7619 ; -O1: ldaxr x0, [x8]
7621 ; -O1: csel x9, x0, x1, hi
7622 ; -O1: stlxr w10, x9, [x8]
7623 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 8
7627 define dso_local i64 @atomicrmw_umax_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
7628 ; -O0-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
7629 ; -O0: subs x10, x9, x8
7630 ; -O0: csel x12, x9, x8, hi
7631 ; -O0: ldaxr x8, [x11]
7633 ; -O0: stlxr w10, x12, [x11]
7634 ; -O0: subs x9, x8, x9
7635 ; -O0: subs w9, w9, #1
7637 ; -O1-LABEL: atomicrmw_umax_i64_aligned_seq_cst:
7638 ; -O1: ldaxr x0, [x8]
7640 ; -O1: csel x9, x0, x1, hi
7641 ; -O1: stlxr w10, x9, [x8]
7642 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 8
7646 define dso_local i128 @atomicrmw_umax_i128_aligned_monotonic(ptr %ptr, i128 %value) {
7647 ; -O0-LABEL: atomicrmw_umax_i128_aligned_monotonic:
7648 ; -O0: subs x12, x8, x11
7649 ; -O0: csel x15, x13, x10, lo
7650 ; -O0: csel x14, x11, x8, lo
7651 ; -O0: ldxp x10, x12, [x9]
7654 ; -O0: stxp w8, x14, x15, [x9]
7655 ; -O0: stxp w8, x10, x12, [x9]
7656 ; -O0: subs x12, x12, x13
7657 ; -O0: ccmp x10, x11, #0, eq
7659 ; -O1-LABEL: atomicrmw_umax_i128_aligned_monotonic:
7660 ; -O1: ldxp x1, x0, [x8]
7662 ; -O1: csel x9, x0, x2, lo
7663 ; -O1: csel x10, x1, x3, lo
7664 ; -O1: stxp w11, x10, x9, [x8]
7665 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 16
7669 define dso_local i128 @atomicrmw_umax_i128_aligned_acquire(ptr %ptr, i128 %value) {
7670 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acquire:
7671 ; -O0: subs x12, x8, x11
7672 ; -O0: csel x15, x13, x10, lo
7673 ; -O0: csel x14, x11, x8, lo
7674 ; -O0: ldaxp x10, x12, [x9]
7677 ; -O0: stxp w8, x14, x15, [x9]
7678 ; -O0: stxp w8, x10, x12, [x9]
7679 ; -O0: subs x12, x12, x13
7680 ; -O0: ccmp x10, x11, #0, eq
7682 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acquire:
7683 ; -O1: ldaxp x1, x0, [x8]
7685 ; -O1: csel x9, x0, x2, lo
7686 ; -O1: csel x10, x1, x3, lo
7687 ; -O1: stxp w11, x10, x9, [x8]
7688 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 16
7692 define dso_local i128 @atomicrmw_umax_i128_aligned_release(ptr %ptr, i128 %value) {
7693 ; -O0-LABEL: atomicrmw_umax_i128_aligned_release:
7694 ; -O0: subs x12, x8, x11
7695 ; -O0: csel x15, x13, x10, lo
7696 ; -O0: csel x14, x11, x8, lo
7697 ; -O0: ldxp x10, x12, [x9]
7700 ; -O0: stlxp w8, x14, x15, [x9]
7701 ; -O0: stlxp w8, x10, x12, [x9]
7702 ; -O0: subs x12, x12, x13
7703 ; -O0: ccmp x10, x11, #0, eq
7705 ; -O1-LABEL: atomicrmw_umax_i128_aligned_release:
7706 ; -O1: ldxp x1, x0, [x8]
7708 ; -O1: csel x9, x0, x2, lo
7709 ; -O1: csel x10, x1, x3, lo
7710 ; -O1: stlxp w11, x10, x9, [x8]
7711 %r = atomicrmw umax ptr %ptr, i128 %value release, align 16
7715 define dso_local i128 @atomicrmw_umax_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
7716 ; -O0-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
7717 ; -O0: subs x12, x8, x11
7718 ; -O0: csel x15, x13, x10, lo
7719 ; -O0: csel x14, x11, x8, lo
7720 ; -O0: ldaxp x10, x12, [x9]
7723 ; -O0: stlxp w8, x14, x15, [x9]
7724 ; -O0: stlxp w8, x10, x12, [x9]
7725 ; -O0: subs x12, x12, x13
7726 ; -O0: ccmp x10, x11, #0, eq
7728 ; -O1-LABEL: atomicrmw_umax_i128_aligned_acq_rel:
7729 ; -O1: ldaxp x1, x0, [x8]
7731 ; -O1: csel x9, x0, x2, lo
7732 ; -O1: csel x10, x1, x3, lo
7733 ; -O1: stlxp w11, x10, x9, [x8]
7734 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 16
7738 define dso_local i128 @atomicrmw_umax_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
7739 ; -O0-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
7740 ; -O0: subs x12, x8, x11
7741 ; -O0: csel x15, x13, x10, lo
7742 ; -O0: csel x14, x11, x8, lo
7743 ; -O0: ldaxp x10, x12, [x9]
7746 ; -O0: stlxp w8, x14, x15, [x9]
7747 ; -O0: stlxp w8, x10, x12, [x9]
7748 ; -O0: subs x12, x12, x13
7749 ; -O0: ccmp x10, x11, #0, eq
7751 ; -O1-LABEL: atomicrmw_umax_i128_aligned_seq_cst:
7752 ; -O1: ldaxp x1, x0, [x8]
7754 ; -O1: csel x9, x0, x2, lo
7755 ; -O1: csel x10, x1, x3, lo
7756 ; -O1: stlxp w11, x10, x9, [x8]
7757 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 16
7761 define dso_local i8 @atomicrmw_umax_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
7762 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
7763 ; -O0: and w9, w12, #0xff
7764 ; -O0: subs w10, w9, w8, uxtb
7765 ; -O0: csel w13, w12, w8, hi
7766 ; -O0: ldaxrb w8, [x11]
7767 ; -O0: cmp w8, w12, uxtb
7768 ; -O0: stlxrb w10, w13, [x11]
7769 ; -O0: subs w9, w8, w9
7770 ; -O0: subs w9, w9, #1
7772 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_monotonic:
7773 ; -O1: and w9, w1, #0xff
7774 ; -O1: ldxrb w8, [x0]
7776 ; -O1: csel w10, w8, w9, hi
7777 ; -O1: stxrb w11, w10, [x0]
7778 %r = atomicrmw umax ptr %ptr, i8 %value monotonic, align 1
7782 define dso_local i8 @atomicrmw_umax_i8_unaligned_acquire(ptr %ptr, i8 %value) {
7783 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acquire:
7784 ; -O0: and w9, w12, #0xff
7785 ; -O0: subs w10, w9, w8, uxtb
7786 ; -O0: csel w13, w12, w8, hi
7787 ; -O0: ldaxrb w8, [x11]
7788 ; -O0: cmp w8, w12, uxtb
7789 ; -O0: stlxrb w10, w13, [x11]
7790 ; -O0: subs w9, w8, w9
7791 ; -O0: subs w9, w9, #1
7793 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acquire:
7794 ; -O1: and w9, w1, #0xff
7795 ; -O1: ldaxrb w8, [x0]
7797 ; -O1: csel w10, w8, w9, hi
7798 ; -O1: stxrb w11, w10, [x0]
7799 %r = atomicrmw umax ptr %ptr, i8 %value acquire, align 1
7803 define dso_local i8 @atomicrmw_umax_i8_unaligned_release(ptr %ptr, i8 %value) {
7804 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_release:
7805 ; -O0: and w9, w12, #0xff
7806 ; -O0: subs w10, w9, w8, uxtb
7807 ; -O0: csel w13, w12, w8, hi
7808 ; -O0: ldaxrb w8, [x11]
7809 ; -O0: cmp w8, w12, uxtb
7810 ; -O0: stlxrb w10, w13, [x11]
7811 ; -O0: subs w9, w8, w9
7812 ; -O0: subs w9, w9, #1
7814 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_release:
7815 ; -O1: and w9, w1, #0xff
7816 ; -O1: ldxrb w8, [x0]
7818 ; -O1: csel w10, w8, w9, hi
7819 ; -O1: stlxrb w11, w10, [x0]
7820 %r = atomicrmw umax ptr %ptr, i8 %value release, align 1
7824 define dso_local i8 @atomicrmw_umax_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
7825 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
7826 ; -O0: and w9, w12, #0xff
7827 ; -O0: subs w10, w9, w8, uxtb
7828 ; -O0: csel w13, w12, w8, hi
7829 ; -O0: ldaxrb w8, [x11]
7830 ; -O0: cmp w8, w12, uxtb
7831 ; -O0: stlxrb w10, w13, [x11]
7832 ; -O0: subs w9, w8, w9
7833 ; -O0: subs w9, w9, #1
7835 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_acq_rel:
7836 ; -O1: and w9, w1, #0xff
7837 ; -O1: ldaxrb w8, [x0]
7839 ; -O1: csel w10, w8, w9, hi
7840 ; -O1: stlxrb w11, w10, [x0]
7841 %r = atomicrmw umax ptr %ptr, i8 %value acq_rel, align 1
7845 define dso_local i8 @atomicrmw_umax_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
7846 ; -O0-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
7847 ; -O0: and w9, w12, #0xff
7848 ; -O0: subs w10, w9, w8, uxtb
7849 ; -O0: csel w13, w12, w8, hi
7850 ; -O0: ldaxrb w8, [x11]
7851 ; -O0: cmp w8, w12, uxtb
7852 ; -O0: stlxrb w10, w13, [x11]
7853 ; -O0: subs w9, w8, w9
7854 ; -O0: subs w9, w9, #1
7856 ; -O1-LABEL: atomicrmw_umax_i8_unaligned_seq_cst:
7857 ; -O1: and w9, w1, #0xff
7858 ; -O1: ldaxrb w8, [x0]
7860 ; -O1: csel w10, w8, w9, hi
7861 ; -O1: stlxrb w11, w10, [x0]
7862 %r = atomicrmw umax ptr %ptr, i8 %value seq_cst, align 1
7866 define dso_local i16 @atomicrmw_umax_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
7867 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
7868 ; -O0: and w10, w9, #0xffff
7869 ; -O0: subs w10, w10, w8, uxth
7870 ; -O0: csel w8, w9, w8, hi
7871 ; -O0: bl __atomic_compare_exchange
7873 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_monotonic:
7874 ; -O1: and w8, w0, #0xffff
7875 ; -O1: cmp w8, w20, uxth
7876 ; -O1: csel w8, w0, w20, hi
7877 ; -O1: bl __atomic_compare_exchange
7878 %r = atomicrmw umax ptr %ptr, i16 %value monotonic, align 1
7882 define dso_local i16 @atomicrmw_umax_i16_unaligned_acquire(ptr %ptr, i16 %value) {
7883 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acquire:
7884 ; -O0: and w10, w9, #0xffff
7885 ; -O0: subs w10, w10, w8, uxth
7886 ; -O0: csel w8, w9, w8, hi
7887 ; -O0: bl __atomic_compare_exchange
7889 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acquire:
7890 ; -O1: and w8, w0, #0xffff
7891 ; -O1: cmp w8, w20, uxth
7892 ; -O1: csel w8, w0, w20, hi
7893 ; -O1: bl __atomic_compare_exchange
7894 %r = atomicrmw umax ptr %ptr, i16 %value acquire, align 1
7898 define dso_local i16 @atomicrmw_umax_i16_unaligned_release(ptr %ptr, i16 %value) {
7899 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_release:
7900 ; -O0: and w10, w9, #0xffff
7901 ; -O0: subs w10, w10, w8, uxth
7902 ; -O0: csel w8, w9, w8, hi
7903 ; -O0: bl __atomic_compare_exchange
7905 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_release:
7906 ; -O1: and w8, w0, #0xffff
7907 ; -O1: cmp w8, w20, uxth
7908 ; -O1: csel w8, w0, w20, hi
7909 ; -O1: bl __atomic_compare_exchange
7910 %r = atomicrmw umax ptr %ptr, i16 %value release, align 1
7914 define dso_local i16 @atomicrmw_umax_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
7915 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
7916 ; -O0: and w10, w9, #0xffff
7917 ; -O0: subs w10, w10, w8, uxth
7918 ; -O0: csel w8, w9, w8, hi
7919 ; -O0: bl __atomic_compare_exchange
7921 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_acq_rel:
7922 ; -O1: and w8, w0, #0xffff
7923 ; -O1: cmp w8, w20, uxth
7924 ; -O1: csel w8, w0, w20, hi
7925 ; -O1: bl __atomic_compare_exchange
7926 %r = atomicrmw umax ptr %ptr, i16 %value acq_rel, align 1
7930 define dso_local i16 @atomicrmw_umax_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
7931 ; -O0-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
7932 ; -O0: and w10, w9, #0xffff
7933 ; -O0: subs w10, w10, w8, uxth
7934 ; -O0: csel w8, w9, w8, hi
7935 ; -O0: bl __atomic_compare_exchange
7937 ; -O1-LABEL: atomicrmw_umax_i16_unaligned_seq_cst:
7938 ; -O1: and w8, w0, #0xffff
7939 ; -O1: cmp w8, w20, uxth
7940 ; -O1: csel w8, w0, w20, hi
7941 ; -O1: bl __atomic_compare_exchange
7942 %r = atomicrmw umax ptr %ptr, i16 %value seq_cst, align 1
7946 define dso_local i32 @atomicrmw_umax_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
7947 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
7948 ; -O0: subs w10, w9, w8
7949 ; -O0: csel w8, w9, w8, hi
7950 ; -O0: bl __atomic_compare_exchange
7952 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_monotonic:
7954 ; -O1: csel w8, w0, w20, hi
7955 ; -O1: bl __atomic_compare_exchange
7956 %r = atomicrmw umax ptr %ptr, i32 %value monotonic, align 1
7960 define dso_local i32 @atomicrmw_umax_i32_unaligned_acquire(ptr %ptr, i32 %value) {
7961 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acquire:
7962 ; -O0: subs w10, w9, w8
7963 ; -O0: csel w8, w9, w8, hi
7964 ; -O0: bl __atomic_compare_exchange
7966 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acquire:
7968 ; -O1: csel w8, w0, w20, hi
7969 ; -O1: bl __atomic_compare_exchange
7970 %r = atomicrmw umax ptr %ptr, i32 %value acquire, align 1
7974 define dso_local i32 @atomicrmw_umax_i32_unaligned_release(ptr %ptr, i32 %value) {
7975 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_release:
7976 ; -O0: subs w10, w9, w8
7977 ; -O0: csel w8, w9, w8, hi
7978 ; -O0: bl __atomic_compare_exchange
7980 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_release:
7982 ; -O1: csel w8, w0, w20, hi
7983 ; -O1: bl __atomic_compare_exchange
7984 %r = atomicrmw umax ptr %ptr, i32 %value release, align 1
7988 define dso_local i32 @atomicrmw_umax_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
7989 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
7990 ; -O0: subs w10, w9, w8
7991 ; -O0: csel w8, w9, w8, hi
7992 ; -O0: bl __atomic_compare_exchange
7994 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_acq_rel:
7996 ; -O1: csel w8, w0, w20, hi
7997 ; -O1: bl __atomic_compare_exchange
7998 %r = atomicrmw umax ptr %ptr, i32 %value acq_rel, align 1
8002 define dso_local i32 @atomicrmw_umax_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
8003 ; -O0-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
8004 ; -O0: subs w10, w9, w8
8005 ; -O0: csel w8, w9, w8, hi
8006 ; -O0: bl __atomic_compare_exchange
8008 ; -O1-LABEL: atomicrmw_umax_i32_unaligned_seq_cst:
8010 ; -O1: csel w8, w0, w20, hi
8011 ; -O1: bl __atomic_compare_exchange
8012 %r = atomicrmw umax ptr %ptr, i32 %value seq_cst, align 1
8016 define dso_local i64 @atomicrmw_umax_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
8017 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
8018 ; -O0: subs x10, x9, x8
8019 ; -O0: csel x8, x9, x8, hi
8020 ; -O0: bl __atomic_compare_exchange
8022 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_monotonic:
8024 ; -O1: csel x8, x0, x20, hi
8025 ; -O1: bl __atomic_compare_exchange
8026 %r = atomicrmw umax ptr %ptr, i64 %value monotonic, align 1
8030 define dso_local i64 @atomicrmw_umax_i64_unaligned_acquire(ptr %ptr, i64 %value) {
8031 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acquire:
8032 ; -O0: subs x10, x9, x8
8033 ; -O0: csel x8, x9, x8, hi
8034 ; -O0: bl __atomic_compare_exchange
8036 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acquire:
8038 ; -O1: csel x8, x0, x20, hi
8039 ; -O1: bl __atomic_compare_exchange
8040 %r = atomicrmw umax ptr %ptr, i64 %value acquire, align 1
8044 define dso_local i64 @atomicrmw_umax_i64_unaligned_release(ptr %ptr, i64 %value) {
8045 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_release:
8046 ; -O0: subs x10, x9, x8
8047 ; -O0: csel x8, x9, x8, hi
8048 ; -O0: bl __atomic_compare_exchange
8050 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_release:
8052 ; -O1: csel x8, x0, x20, hi
8053 ; -O1: bl __atomic_compare_exchange
8054 %r = atomicrmw umax ptr %ptr, i64 %value release, align 1
8058 define dso_local i64 @atomicrmw_umax_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
8059 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
8060 ; -O0: subs x10, x9, x8
8061 ; -O0: csel x8, x9, x8, hi
8062 ; -O0: bl __atomic_compare_exchange
8064 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_acq_rel:
8066 ; -O1: csel x8, x0, x20, hi
8067 ; -O1: bl __atomic_compare_exchange
8068 %r = atomicrmw umax ptr %ptr, i64 %value acq_rel, align 1
8072 define dso_local i64 @atomicrmw_umax_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
8073 ; -O0-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
8074 ; -O0: subs x10, x9, x8
8075 ; -O0: csel x8, x9, x8, hi
8076 ; -O0: bl __atomic_compare_exchange
8078 ; -O1-LABEL: atomicrmw_umax_i64_unaligned_seq_cst:
8080 ; -O1: csel x8, x0, x20, hi
8081 ; -O1: bl __atomic_compare_exchange
8082 %r = atomicrmw umax ptr %ptr, i64 %value seq_cst, align 1
8086 define dso_local i128 @atomicrmw_umax_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
8087 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
8088 ; -O0: subs x12, x9, x10
8089 ; -O0: csel x8, x11, x8, lo
8090 ; -O0: csel x9, x10, x9, lo
8091 ; -O0: bl __atomic_compare_exchange
8093 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_monotonic:
8094 ; -O1: ldp x0, x1, [x0]
8096 ; -O1: csel x8, x1, x19, lo
8097 ; -O1: csel x9, x0, x21, lo
8098 ; -O1: bl __atomic_compare_exchange
8099 %r = atomicrmw umax ptr %ptr, i128 %value monotonic, align 1
8103 define dso_local i128 @atomicrmw_umax_i128_unaligned_acquire(ptr %ptr, i128 %value) {
8104 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acquire:
8105 ; -O0: subs x12, x9, x10
8106 ; -O0: csel x8, x11, x8, lo
8107 ; -O0: csel x9, x10, x9, lo
8108 ; -O0: bl __atomic_compare_exchange
8110 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acquire:
8111 ; -O1: ldp x0, x1, [x0]
8113 ; -O1: csel x8, x1, x19, lo
8114 ; -O1: csel x9, x0, x21, lo
8115 ; -O1: bl __atomic_compare_exchange
8116 %r = atomicrmw umax ptr %ptr, i128 %value acquire, align 1
8120 define dso_local i128 @atomicrmw_umax_i128_unaligned_release(ptr %ptr, i128 %value) {
8121 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_release:
8122 ; -O0: subs x12, x9, x10
8123 ; -O0: csel x8, x11, x8, lo
8124 ; -O0: csel x9, x10, x9, lo
8125 ; -O0: bl __atomic_compare_exchange
8127 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_release:
8128 ; -O1: ldp x0, x1, [x0]
8130 ; -O1: csel x8, x1, x19, lo
8131 ; -O1: csel x9, x0, x21, lo
8132 ; -O1: bl __atomic_compare_exchange
8133 %r = atomicrmw umax ptr %ptr, i128 %value release, align 1
8137 define dso_local i128 @atomicrmw_umax_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
8138 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
8139 ; -O0: subs x12, x9, x10
8140 ; -O0: csel x8, x11, x8, lo
8141 ; -O0: csel x9, x10, x9, lo
8142 ; -O0: bl __atomic_compare_exchange
8144 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_acq_rel:
8145 ; -O1: ldp x0, x1, [x0]
8147 ; -O1: csel x8, x1, x19, lo
8148 ; -O1: csel x9, x0, x21, lo
8149 ; -O1: bl __atomic_compare_exchange
8150 %r = atomicrmw umax ptr %ptr, i128 %value acq_rel, align 1
8154 define dso_local i128 @atomicrmw_umax_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
8155 ; -O0-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
8156 ; -O0: subs x12, x9, x10
8157 ; -O0: csel x8, x11, x8, lo
8158 ; -O0: csel x9, x10, x9, lo
8159 ; -O0: bl __atomic_compare_exchange
8161 ; -O1-LABEL: atomicrmw_umax_i128_unaligned_seq_cst:
8162 ; -O1: ldp x0, x1, [x0]
8164 ; -O1: csel x8, x1, x19, lo
8165 ; -O1: csel x9, x0, x21, lo
8166 ; -O1: bl __atomic_compare_exchange
8167 %r = atomicrmw umax ptr %ptr, i128 %value seq_cst, align 1
8171 define dso_local i8 @atomicrmw_umin_i8_aligned_monotonic(ptr %ptr, i8 %value) {
8172 ; -O0-LABEL: atomicrmw_umin_i8_aligned_monotonic:
8173 ; -O0: and w9, w12, #0xff
8174 ; -O0: subs w10, w9, w8, uxtb
8175 ; -O0: csel w13, w12, w8, ls
8176 ; -O0: ldaxrb w8, [x11]
8177 ; -O0: cmp w8, w12, uxtb
8178 ; -O0: stlxrb w10, w13, [x11]
8179 ; -O0: subs w9, w8, w9
8180 ; -O0: subs w9, w9, #1
8182 ; -O1-LABEL: atomicrmw_umin_i8_aligned_monotonic:
8183 ; -O1: and w9, w1, #0xff
8184 ; -O1: ldxrb w8, [x0]
8186 ; -O1: csel w10, w8, w9, ls
8187 ; -O1: stxrb w11, w10, [x0]
8188 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
8192 define dso_local i8 @atomicrmw_umin_i8_aligned_acquire(ptr %ptr, i8 %value) {
8193 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acquire:
8194 ; -O0: and w9, w12, #0xff
8195 ; -O0: subs w10, w9, w8, uxtb
8196 ; -O0: csel w13, w12, w8, ls
8197 ; -O0: ldaxrb w8, [x11]
8198 ; -O0: cmp w8, w12, uxtb
8199 ; -O0: stlxrb w10, w13, [x11]
8200 ; -O0: subs w9, w8, w9
8201 ; -O0: subs w9, w9, #1
8203 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acquire:
8204 ; -O1: and w9, w1, #0xff
8205 ; -O1: ldaxrb w8, [x0]
8207 ; -O1: csel w10, w8, w9, ls
8208 ; -O1: stxrb w11, w10, [x0]
8209 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
8213 define dso_local i8 @atomicrmw_umin_i8_aligned_release(ptr %ptr, i8 %value) {
8214 ; -O0-LABEL: atomicrmw_umin_i8_aligned_release:
8215 ; -O0: and w9, w12, #0xff
8216 ; -O0: subs w10, w9, w8, uxtb
8217 ; -O0: csel w13, w12, w8, ls
8218 ; -O0: ldaxrb w8, [x11]
8219 ; -O0: cmp w8, w12, uxtb
8220 ; -O0: stlxrb w10, w13, [x11]
8221 ; -O0: subs w9, w8, w9
8222 ; -O0: subs w9, w9, #1
8224 ; -O1-LABEL: atomicrmw_umin_i8_aligned_release:
8225 ; -O1: and w9, w1, #0xff
8226 ; -O1: ldxrb w8, [x0]
8228 ; -O1: csel w10, w8, w9, ls
8229 ; -O1: stlxrb w11, w10, [x0]
8230 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
8234 define dso_local i8 @atomicrmw_umin_i8_aligned_acq_rel(ptr %ptr, i8 %value) {
8235 ; -O0-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
8236 ; -O0: and w9, w12, #0xff
8237 ; -O0: subs w10, w9, w8, uxtb
8238 ; -O0: csel w13, w12, w8, ls
8239 ; -O0: ldaxrb w8, [x11]
8240 ; -O0: cmp w8, w12, uxtb
8241 ; -O0: stlxrb w10, w13, [x11]
8242 ; -O0: subs w9, w8, w9
8243 ; -O0: subs w9, w9, #1
8245 ; -O1-LABEL: atomicrmw_umin_i8_aligned_acq_rel:
8246 ; -O1: and w9, w1, #0xff
8247 ; -O1: ldaxrb w8, [x0]
8249 ; -O1: csel w10, w8, w9, ls
8250 ; -O1: stlxrb w11, w10, [x0]
8251 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
8255 define dso_local i8 @atomicrmw_umin_i8_aligned_seq_cst(ptr %ptr, i8 %value) {
8256 ; -O0-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
8257 ; -O0: and w9, w12, #0xff
8258 ; -O0: subs w10, w9, w8, uxtb
8259 ; -O0: csel w13, w12, w8, ls
8260 ; -O0: ldaxrb w8, [x11]
8261 ; -O0: cmp w8, w12, uxtb
8262 ; -O0: stlxrb w10, w13, [x11]
8263 ; -O0: subs w9, w8, w9
8264 ; -O0: subs w9, w9, #1
8266 ; -O1-LABEL: atomicrmw_umin_i8_aligned_seq_cst:
8267 ; -O1: and w9, w1, #0xff
8268 ; -O1: ldaxrb w8, [x0]
8270 ; -O1: csel w10, w8, w9, ls
8271 ; -O1: stlxrb w11, w10, [x0]
8272 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
8276 define dso_local i16 @atomicrmw_umin_i16_aligned_monotonic(ptr %ptr, i16 %value) {
8277 ; -O0-LABEL: atomicrmw_umin_i16_aligned_monotonic:
8278 ; -O0: and w9, w12, #0xffff
8279 ; -O0: subs w10, w9, w8, uxth
8280 ; -O0: csel w13, w12, w8, ls
8281 ; -O0: ldaxrh w8, [x11]
8282 ; -O0: cmp w8, w12, uxth
8283 ; -O0: stlxrh w10, w13, [x11]
8284 ; -O0: subs w9, w8, w9
8285 ; -O0: subs w9, w9, #1
8287 ; -O1-LABEL: atomicrmw_umin_i16_aligned_monotonic:
8288 ; -O1: and w9, w1, #0xffff
8289 ; -O1: ldxrh w8, [x0]
8291 ; -O1: csel w10, w8, w9, ls
8292 ; -O1: stxrh w11, w10, [x0]
8293 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 2
8297 define dso_local i16 @atomicrmw_umin_i16_aligned_acquire(ptr %ptr, i16 %value) {
8298 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acquire:
8299 ; -O0: and w9, w12, #0xffff
8300 ; -O0: subs w10, w9, w8, uxth
8301 ; -O0: csel w13, w12, w8, ls
8302 ; -O0: ldaxrh w8, [x11]
8303 ; -O0: cmp w8, w12, uxth
8304 ; -O0: stlxrh w10, w13, [x11]
8305 ; -O0: subs w9, w8, w9
8306 ; -O0: subs w9, w9, #1
8308 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acquire:
8309 ; -O1: and w9, w1, #0xffff
8310 ; -O1: ldaxrh w8, [x0]
8312 ; -O1: csel w10, w8, w9, ls
8313 ; -O1: stxrh w11, w10, [x0]
8314 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 2
8318 define dso_local i16 @atomicrmw_umin_i16_aligned_release(ptr %ptr, i16 %value) {
8319 ; -O0-LABEL: atomicrmw_umin_i16_aligned_release:
8320 ; -O0: and w9, w12, #0xffff
8321 ; -O0: subs w10, w9, w8, uxth
8322 ; -O0: csel w13, w12, w8, ls
8323 ; -O0: ldaxrh w8, [x11]
8324 ; -O0: cmp w8, w12, uxth
8325 ; -O0: stlxrh w10, w13, [x11]
8326 ; -O0: subs w9, w8, w9
8327 ; -O0: subs w9, w9, #1
8329 ; -O1-LABEL: atomicrmw_umin_i16_aligned_release:
8330 ; -O1: and w9, w1, #0xffff
8331 ; -O1: ldxrh w8, [x0]
8333 ; -O1: csel w10, w8, w9, ls
8334 ; -O1: stlxrh w11, w10, [x0]
8335 %r = atomicrmw umin ptr %ptr, i16 %value release, align 2
8339 define dso_local i16 @atomicrmw_umin_i16_aligned_acq_rel(ptr %ptr, i16 %value) {
8340 ; -O0-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
8341 ; -O0: and w9, w12, #0xffff
8342 ; -O0: subs w10, w9, w8, uxth
8343 ; -O0: csel w13, w12, w8, ls
8344 ; -O0: ldaxrh w8, [x11]
8345 ; -O0: cmp w8, w12, uxth
8346 ; -O0: stlxrh w10, w13, [x11]
8347 ; -O0: subs w9, w8, w9
8348 ; -O0: subs w9, w9, #1
8350 ; -O1-LABEL: atomicrmw_umin_i16_aligned_acq_rel:
8351 ; -O1: and w9, w1, #0xffff
8352 ; -O1: ldaxrh w8, [x0]
8354 ; -O1: csel w10, w8, w9, ls
8355 ; -O1: stlxrh w11, w10, [x0]
8356 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 2
8360 define dso_local i16 @atomicrmw_umin_i16_aligned_seq_cst(ptr %ptr, i16 %value) {
8361 ; -O0-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
8362 ; -O0: and w9, w12, #0xffff
8363 ; -O0: subs w10, w9, w8, uxth
8364 ; -O0: csel w13, w12, w8, ls
8365 ; -O0: ldaxrh w8, [x11]
8366 ; -O0: cmp w8, w12, uxth
8367 ; -O0: stlxrh w10, w13, [x11]
8368 ; -O0: subs w9, w8, w9
8369 ; -O0: subs w9, w9, #1
8371 ; -O1-LABEL: atomicrmw_umin_i16_aligned_seq_cst:
8372 ; -O1: and w9, w1, #0xffff
8373 ; -O1: ldaxrh w8, [x0]
8375 ; -O1: csel w10, w8, w9, ls
8376 ; -O1: stlxrh w11, w10, [x0]
8377 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 2
8381 define dso_local i32 @atomicrmw_umin_i32_aligned_monotonic(ptr %ptr, i32 %value) {
8382 ; -O0-LABEL: atomicrmw_umin_i32_aligned_monotonic:
8383 ; -O0: subs w10, w9, w8
8384 ; -O0: csel w12, w9, w8, ls
8385 ; -O0: ldaxr w8, [x11]
8387 ; -O0: stlxr w10, w12, [x11]
8388 ; -O0: subs w9, w8, w9
8389 ; -O0: subs w9, w9, #1
8391 ; -O1-LABEL: atomicrmw_umin_i32_aligned_monotonic:
8392 ; -O1: ldxr w8, [x0]
8394 ; -O1: csel w9, w8, w1, ls
8395 ; -O1: stxr w10, w9, [x0]
8396 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 4
8400 define dso_local i32 @atomicrmw_umin_i32_aligned_acquire(ptr %ptr, i32 %value) {
8401 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acquire:
8402 ; -O0: subs w10, w9, w8
8403 ; -O0: csel w12, w9, w8, ls
8404 ; -O0: ldaxr w8, [x11]
8406 ; -O0: stlxr w10, w12, [x11]
8407 ; -O0: subs w9, w8, w9
8408 ; -O0: subs w9, w9, #1
8410 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acquire:
8411 ; -O1: ldaxr w8, [x0]
8413 ; -O1: csel w9, w8, w1, ls
8414 ; -O1: stxr w10, w9, [x0]
8415 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 4
8419 define dso_local i32 @atomicrmw_umin_i32_aligned_release(ptr %ptr, i32 %value) {
8420 ; -O0-LABEL: atomicrmw_umin_i32_aligned_release:
8421 ; -O0: subs w10, w9, w8
8422 ; -O0: csel w12, w9, w8, ls
8423 ; -O0: ldaxr w8, [x11]
8425 ; -O0: stlxr w10, w12, [x11]
8426 ; -O0: subs w9, w8, w9
8427 ; -O0: subs w9, w9, #1
8429 ; -O1-LABEL: atomicrmw_umin_i32_aligned_release:
8430 ; -O1: ldxr w8, [x0]
8432 ; -O1: csel w9, w8, w1, ls
8433 ; -O1: stlxr w10, w9, [x0]
8434 %r = atomicrmw umin ptr %ptr, i32 %value release, align 4
8438 define dso_local i32 @atomicrmw_umin_i32_aligned_acq_rel(ptr %ptr, i32 %value) {
8439 ; -O0-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
8440 ; -O0: subs w10, w9, w8
8441 ; -O0: csel w12, w9, w8, ls
8442 ; -O0: ldaxr w8, [x11]
8444 ; -O0: stlxr w10, w12, [x11]
8445 ; -O0: subs w9, w8, w9
8446 ; -O0: subs w9, w9, #1
8448 ; -O1-LABEL: atomicrmw_umin_i32_aligned_acq_rel:
8449 ; -O1: ldaxr w8, [x0]
8451 ; -O1: csel w9, w8, w1, ls
8452 ; -O1: stlxr w10, w9, [x0]
8453 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 4
8457 define dso_local i32 @atomicrmw_umin_i32_aligned_seq_cst(ptr %ptr, i32 %value) {
8458 ; -O0-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
8459 ; -O0: subs w10, w9, w8
8460 ; -O0: csel w12, w9, w8, ls
8461 ; -O0: ldaxr w8, [x11]
8463 ; -O0: stlxr w10, w12, [x11]
8464 ; -O0: subs w9, w8, w9
8465 ; -O0: subs w9, w9, #1
8467 ; -O1-LABEL: atomicrmw_umin_i32_aligned_seq_cst:
8468 ; -O1: ldaxr w8, [x0]
8470 ; -O1: csel w9, w8, w1, ls
8471 ; -O1: stlxr w10, w9, [x0]
8472 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 4
8476 define dso_local i64 @atomicrmw_umin_i64_aligned_monotonic(ptr %ptr, i64 %value) {
8477 ; -O0-LABEL: atomicrmw_umin_i64_aligned_monotonic:
8478 ; -O0: subs x10, x9, x8
8479 ; -O0: csel x12, x9, x8, ls
8480 ; -O0: ldaxr x8, [x11]
8482 ; -O0: stlxr w10, x12, [x11]
8483 ; -O0: subs x9, x8, x9
8484 ; -O0: subs w9, w9, #1
8486 ; -O1-LABEL: atomicrmw_umin_i64_aligned_monotonic:
8487 ; -O1: ldxr x0, [x8]
8489 ; -O1: csel x9, x0, x1, ls
8490 ; -O1: stxr w10, x9, [x8]
8491 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 8
8495 define dso_local i64 @atomicrmw_umin_i64_aligned_acquire(ptr %ptr, i64 %value) {
8496 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acquire:
8497 ; -O0: subs x10, x9, x8
8498 ; -O0: csel x12, x9, x8, ls
8499 ; -O0: ldaxr x8, [x11]
8501 ; -O0: stlxr w10, x12, [x11]
8502 ; -O0: subs x9, x8, x9
8503 ; -O0: subs w9, w9, #1
8505 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acquire:
8506 ; -O1: ldaxr x0, [x8]
8508 ; -O1: csel x9, x0, x1, ls
8509 ; -O1: stxr w10, x9, [x8]
8510 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 8
8514 define dso_local i64 @atomicrmw_umin_i64_aligned_release(ptr %ptr, i64 %value) {
8515 ; -O0-LABEL: atomicrmw_umin_i64_aligned_release:
8516 ; -O0: subs x10, x9, x8
8517 ; -O0: csel x12, x9, x8, ls
8518 ; -O0: ldaxr x8, [x11]
8520 ; -O0: stlxr w10, x12, [x11]
8521 ; -O0: subs x9, x8, x9
8522 ; -O0: subs w9, w9, #1
8524 ; -O1-LABEL: atomicrmw_umin_i64_aligned_release:
8525 ; -O1: ldxr x0, [x8]
8527 ; -O1: csel x9, x0, x1, ls
8528 ; -O1: stlxr w10, x9, [x8]
8529 %r = atomicrmw umin ptr %ptr, i64 %value release, align 8
8533 define dso_local i64 @atomicrmw_umin_i64_aligned_acq_rel(ptr %ptr, i64 %value) {
8534 ; -O0-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
8535 ; -O0: subs x10, x9, x8
8536 ; -O0: csel x12, x9, x8, ls
8537 ; -O0: ldaxr x8, [x11]
8539 ; -O0: stlxr w10, x12, [x11]
8540 ; -O0: subs x9, x8, x9
8541 ; -O0: subs w9, w9, #1
8543 ; -O1-LABEL: atomicrmw_umin_i64_aligned_acq_rel:
8544 ; -O1: ldaxr x0, [x8]
8546 ; -O1: csel x9, x0, x1, ls
8547 ; -O1: stlxr w10, x9, [x8]
8548 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 8
8552 define dso_local i64 @atomicrmw_umin_i64_aligned_seq_cst(ptr %ptr, i64 %value) {
8553 ; -O0-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
8554 ; -O0: subs x10, x9, x8
8555 ; -O0: csel x12, x9, x8, ls
8556 ; -O0: ldaxr x8, [x11]
8558 ; -O0: stlxr w10, x12, [x11]
8559 ; -O0: subs x9, x8, x9
8560 ; -O0: subs w9, w9, #1
8562 ; -O1-LABEL: atomicrmw_umin_i64_aligned_seq_cst:
8563 ; -O1: ldaxr x0, [x8]
8565 ; -O1: csel x9, x0, x1, ls
8566 ; -O1: stlxr w10, x9, [x8]
8567 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 8
8571 define dso_local i128 @atomicrmw_umin_i128_aligned_monotonic(ptr %ptr, i128 %value) {
8572 ; -O0-LABEL: atomicrmw_umin_i128_aligned_monotonic:
8573 ; -O0: subs x12, x8, x11
8574 ; -O0: csel x15, x13, x10, hs
8575 ; -O0: csel x14, x11, x8, hs
8576 ; -O0: ldxp x10, x12, [x9]
8579 ; -O0: stxp w8, x14, x15, [x9]
8580 ; -O0: stxp w8, x10, x12, [x9]
8581 ; -O0: subs x12, x12, x13
8582 ; -O0: ccmp x10, x11, #0, eq
8584 ; -O1-LABEL: atomicrmw_umin_i128_aligned_monotonic:
8585 ; -O1: ldxp x1, x0, [x8]
8587 ; -O1: csel x9, x0, x2, hs
8588 ; -O1: csel x10, x1, x3, hs
8589 ; -O1: stxp w11, x10, x9, [x8]
8590 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 16
8594 define dso_local i128 @atomicrmw_umin_i128_aligned_acquire(ptr %ptr, i128 %value) {
8595 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acquire:
8596 ; -O0: subs x12, x8, x11
8597 ; -O0: csel x15, x13, x10, hs
8598 ; -O0: csel x14, x11, x8, hs
8599 ; -O0: ldaxp x10, x12, [x9]
8602 ; -O0: stxp w8, x14, x15, [x9]
8603 ; -O0: stxp w8, x10, x12, [x9]
8604 ; -O0: subs x12, x12, x13
8605 ; -O0: ccmp x10, x11, #0, eq
8607 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acquire:
8608 ; -O1: ldaxp x1, x0, [x8]
8610 ; -O1: csel x9, x0, x2, hs
8611 ; -O1: csel x10, x1, x3, hs
8612 ; -O1: stxp w11, x10, x9, [x8]
8613 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 16
8617 define dso_local i128 @atomicrmw_umin_i128_aligned_release(ptr %ptr, i128 %value) {
8618 ; -O0-LABEL: atomicrmw_umin_i128_aligned_release:
8619 ; -O0: subs x12, x8, x11
8620 ; -O0: csel x15, x13, x10, hs
8621 ; -O0: csel x14, x11, x8, hs
8622 ; -O0: ldxp x10, x12, [x9]
8625 ; -O0: stlxp w8, x14, x15, [x9]
8626 ; -O0: stlxp w8, x10, x12, [x9]
8627 ; -O0: subs x12, x12, x13
8628 ; -O0: ccmp x10, x11, #0, eq
8630 ; -O1-LABEL: atomicrmw_umin_i128_aligned_release:
8631 ; -O1: ldxp x1, x0, [x8]
8633 ; -O1: csel x9, x0, x2, hs
8634 ; -O1: csel x10, x1, x3, hs
8635 ; -O1: stlxp w11, x10, x9, [x8]
8636 %r = atomicrmw umin ptr %ptr, i128 %value release, align 16
8640 define dso_local i128 @atomicrmw_umin_i128_aligned_acq_rel(ptr %ptr, i128 %value) {
8641 ; -O0-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
8642 ; -O0: subs x12, x8, x11
8643 ; -O0: csel x15, x13, x10, hs
8644 ; -O0: csel x14, x11, x8, hs
8645 ; -O0: ldaxp x10, x12, [x9]
8648 ; -O0: stlxp w8, x14, x15, [x9]
8649 ; -O0: stlxp w8, x10, x12, [x9]
8650 ; -O0: subs x12, x12, x13
8651 ; -O0: ccmp x10, x11, #0, eq
8653 ; -O1-LABEL: atomicrmw_umin_i128_aligned_acq_rel:
8654 ; -O1: ldaxp x1, x0, [x8]
8656 ; -O1: csel x9, x0, x2, hs
8657 ; -O1: csel x10, x1, x3, hs
8658 ; -O1: stlxp w11, x10, x9, [x8]
8659 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 16
8663 define dso_local i128 @atomicrmw_umin_i128_aligned_seq_cst(ptr %ptr, i128 %value) {
8664 ; -O0-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
8665 ; -O0: subs x12, x8, x11
8666 ; -O0: csel x15, x13, x10, hs
8667 ; -O0: csel x14, x11, x8, hs
8668 ; -O0: ldaxp x10, x12, [x9]
8671 ; -O0: stlxp w8, x14, x15, [x9]
8672 ; -O0: stlxp w8, x10, x12, [x9]
8673 ; -O0: subs x12, x12, x13
8674 ; -O0: ccmp x10, x11, #0, eq
8676 ; -O1-LABEL: atomicrmw_umin_i128_aligned_seq_cst:
8677 ; -O1: ldaxp x1, x0, [x8]
8679 ; -O1: csel x9, x0, x2, hs
8680 ; -O1: csel x10, x1, x3, hs
8681 ; -O1: stlxp w11, x10, x9, [x8]
8682 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 16
8686 define dso_local i8 @atomicrmw_umin_i8_unaligned_monotonic(ptr %ptr, i8 %value) {
8687 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
8688 ; -O0: and w9, w12, #0xff
8689 ; -O0: subs w10, w9, w8, uxtb
8690 ; -O0: csel w13, w12, w8, ls
8691 ; -O0: ldaxrb w8, [x11]
8692 ; -O0: cmp w8, w12, uxtb
8693 ; -O0: stlxrb w10, w13, [x11]
8694 ; -O0: subs w9, w8, w9
8695 ; -O0: subs w9, w9, #1
8697 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_monotonic:
8698 ; -O1: and w9, w1, #0xff
8699 ; -O1: ldxrb w8, [x0]
8701 ; -O1: csel w10, w8, w9, ls
8702 ; -O1: stxrb w11, w10, [x0]
8703 %r = atomicrmw umin ptr %ptr, i8 %value monotonic, align 1
8707 define dso_local i8 @atomicrmw_umin_i8_unaligned_acquire(ptr %ptr, i8 %value) {
8708 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acquire:
8709 ; -O0: and w9, w12, #0xff
8710 ; -O0: subs w10, w9, w8, uxtb
8711 ; -O0: csel w13, w12, w8, ls
8712 ; -O0: ldaxrb w8, [x11]
8713 ; -O0: cmp w8, w12, uxtb
8714 ; -O0: stlxrb w10, w13, [x11]
8715 ; -O0: subs w9, w8, w9
8716 ; -O0: subs w9, w9, #1
8718 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acquire:
8719 ; -O1: and w9, w1, #0xff
8720 ; -O1: ldaxrb w8, [x0]
8722 ; -O1: csel w10, w8, w9, ls
8723 ; -O1: stxrb w11, w10, [x0]
8724 %r = atomicrmw umin ptr %ptr, i8 %value acquire, align 1
8728 define dso_local i8 @atomicrmw_umin_i8_unaligned_release(ptr %ptr, i8 %value) {
8729 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_release:
8730 ; -O0: and w9, w12, #0xff
8731 ; -O0: subs w10, w9, w8, uxtb
8732 ; -O0: csel w13, w12, w8, ls
8733 ; -O0: ldaxrb w8, [x11]
8734 ; -O0: cmp w8, w12, uxtb
8735 ; -O0: stlxrb w10, w13, [x11]
8736 ; -O0: subs w9, w8, w9
8737 ; -O0: subs w9, w9, #1
8739 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_release:
8740 ; -O1: and w9, w1, #0xff
8741 ; -O1: ldxrb w8, [x0]
8743 ; -O1: csel w10, w8, w9, ls
8744 ; -O1: stlxrb w11, w10, [x0]
8745 %r = atomicrmw umin ptr %ptr, i8 %value release, align 1
8749 define dso_local i8 @atomicrmw_umin_i8_unaligned_acq_rel(ptr %ptr, i8 %value) {
8750 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
8751 ; -O0: and w9, w12, #0xff
8752 ; -O0: subs w10, w9, w8, uxtb
8753 ; -O0: csel w13, w12, w8, ls
8754 ; -O0: ldaxrb w8, [x11]
8755 ; -O0: cmp w8, w12, uxtb
8756 ; -O0: stlxrb w10, w13, [x11]
8757 ; -O0: subs w9, w8, w9
8758 ; -O0: subs w9, w9, #1
8760 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_acq_rel:
8761 ; -O1: and w9, w1, #0xff
8762 ; -O1: ldaxrb w8, [x0]
8764 ; -O1: csel w10, w8, w9, ls
8765 ; -O1: stlxrb w11, w10, [x0]
8766 %r = atomicrmw umin ptr %ptr, i8 %value acq_rel, align 1
8770 define dso_local i8 @atomicrmw_umin_i8_unaligned_seq_cst(ptr %ptr, i8 %value) {
8771 ; -O0-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
8772 ; -O0: and w9, w12, #0xff
8773 ; -O0: subs w10, w9, w8, uxtb
8774 ; -O0: csel w13, w12, w8, ls
8775 ; -O0: ldaxrb w8, [x11]
8776 ; -O0: cmp w8, w12, uxtb
8777 ; -O0: stlxrb w10, w13, [x11]
8778 ; -O0: subs w9, w8, w9
8779 ; -O0: subs w9, w9, #1
8781 ; -O1-LABEL: atomicrmw_umin_i8_unaligned_seq_cst:
8782 ; -O1: and w9, w1, #0xff
8783 ; -O1: ldaxrb w8, [x0]
8785 ; -O1: csel w10, w8, w9, ls
8786 ; -O1: stlxrb w11, w10, [x0]
8787 %r = atomicrmw umin ptr %ptr, i8 %value seq_cst, align 1
8791 define dso_local i16 @atomicrmw_umin_i16_unaligned_monotonic(ptr %ptr, i16 %value) {
8792 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
8793 ; -O0: and w10, w9, #0xffff
8794 ; -O0: subs w10, w10, w8, uxth
8795 ; -O0: csel w8, w9, w8, ls
8796 ; -O0: bl __atomic_compare_exchange
8798 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_monotonic:
8799 ; -O1: and w8, w0, #0xffff
8800 ; -O1: cmp w8, w20, uxth
8801 ; -O1: csel w8, w0, w20, ls
8802 ; -O1: bl __atomic_compare_exchange
8803 %r = atomicrmw umin ptr %ptr, i16 %value monotonic, align 1
8807 define dso_local i16 @atomicrmw_umin_i16_unaligned_acquire(ptr %ptr, i16 %value) {
8808 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acquire:
8809 ; -O0: and w10, w9, #0xffff
8810 ; -O0: subs w10, w10, w8, uxth
8811 ; -O0: csel w8, w9, w8, ls
8812 ; -O0: bl __atomic_compare_exchange
8814 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acquire:
8815 ; -O1: and w8, w0, #0xffff
8816 ; -O1: cmp w8, w20, uxth
8817 ; -O1: csel w8, w0, w20, ls
8818 ; -O1: bl __atomic_compare_exchange
8819 %r = atomicrmw umin ptr %ptr, i16 %value acquire, align 1
8823 define dso_local i16 @atomicrmw_umin_i16_unaligned_release(ptr %ptr, i16 %value) {
8824 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_release:
8825 ; -O0: and w10, w9, #0xffff
8826 ; -O0: subs w10, w10, w8, uxth
8827 ; -O0: csel w8, w9, w8, ls
8828 ; -O0: bl __atomic_compare_exchange
8830 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_release:
8831 ; -O1: and w8, w0, #0xffff
8832 ; -O1: cmp w8, w20, uxth
8833 ; -O1: csel w8, w0, w20, ls
8834 ; -O1: bl __atomic_compare_exchange
8835 %r = atomicrmw umin ptr %ptr, i16 %value release, align 1
8839 define dso_local i16 @atomicrmw_umin_i16_unaligned_acq_rel(ptr %ptr, i16 %value) {
8840 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
8841 ; -O0: and w10, w9, #0xffff
8842 ; -O0: subs w10, w10, w8, uxth
8843 ; -O0: csel w8, w9, w8, ls
8844 ; -O0: bl __atomic_compare_exchange
8846 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_acq_rel:
8847 ; -O1: and w8, w0, #0xffff
8848 ; -O1: cmp w8, w20, uxth
8849 ; -O1: csel w8, w0, w20, ls
8850 ; -O1: bl __atomic_compare_exchange
8851 %r = atomicrmw umin ptr %ptr, i16 %value acq_rel, align 1
8855 define dso_local i16 @atomicrmw_umin_i16_unaligned_seq_cst(ptr %ptr, i16 %value) {
8856 ; -O0-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
8857 ; -O0: and w10, w9, #0xffff
8858 ; -O0: subs w10, w10, w8, uxth
8859 ; -O0: csel w8, w9, w8, ls
8860 ; -O0: bl __atomic_compare_exchange
8862 ; -O1-LABEL: atomicrmw_umin_i16_unaligned_seq_cst:
8863 ; -O1: and w8, w0, #0xffff
8864 ; -O1: cmp w8, w20, uxth
8865 ; -O1: csel w8, w0, w20, ls
8866 ; -O1: bl __atomic_compare_exchange
8867 %r = atomicrmw umin ptr %ptr, i16 %value seq_cst, align 1
8871 define dso_local i32 @atomicrmw_umin_i32_unaligned_monotonic(ptr %ptr, i32 %value) {
8872 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
8873 ; -O0: subs w10, w9, w8
8874 ; -O0: csel w8, w9, w8, ls
8875 ; -O0: bl __atomic_compare_exchange
8877 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_monotonic:
8879 ; -O1: csel w8, w0, w20, ls
8880 ; -O1: bl __atomic_compare_exchange
8881 %r = atomicrmw umin ptr %ptr, i32 %value monotonic, align 1
8885 define dso_local i32 @atomicrmw_umin_i32_unaligned_acquire(ptr %ptr, i32 %value) {
8886 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acquire:
8887 ; -O0: subs w10, w9, w8
8888 ; -O0: csel w8, w9, w8, ls
8889 ; -O0: bl __atomic_compare_exchange
8891 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acquire:
8893 ; -O1: csel w8, w0, w20, ls
8894 ; -O1: bl __atomic_compare_exchange
8895 %r = atomicrmw umin ptr %ptr, i32 %value acquire, align 1
8899 define dso_local i32 @atomicrmw_umin_i32_unaligned_release(ptr %ptr, i32 %value) {
8900 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_release:
8901 ; -O0: subs w10, w9, w8
8902 ; -O0: csel w8, w9, w8, ls
8903 ; -O0: bl __atomic_compare_exchange
8905 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_release:
8907 ; -O1: csel w8, w0, w20, ls
8908 ; -O1: bl __atomic_compare_exchange
8909 %r = atomicrmw umin ptr %ptr, i32 %value release, align 1
8913 define dso_local i32 @atomicrmw_umin_i32_unaligned_acq_rel(ptr %ptr, i32 %value) {
8914 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
8915 ; -O0: subs w10, w9, w8
8916 ; -O0: csel w8, w9, w8, ls
8917 ; -O0: bl __atomic_compare_exchange
8919 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_acq_rel:
8921 ; -O1: csel w8, w0, w20, ls
8922 ; -O1: bl __atomic_compare_exchange
8923 %r = atomicrmw umin ptr %ptr, i32 %value acq_rel, align 1
8927 define dso_local i32 @atomicrmw_umin_i32_unaligned_seq_cst(ptr %ptr, i32 %value) {
8928 ; -O0-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
8929 ; -O0: subs w10, w9, w8
8930 ; -O0: csel w8, w9, w8, ls
8931 ; -O0: bl __atomic_compare_exchange
8933 ; -O1-LABEL: atomicrmw_umin_i32_unaligned_seq_cst:
8935 ; -O1: csel w8, w0, w20, ls
8936 ; -O1: bl __atomic_compare_exchange
8937 %r = atomicrmw umin ptr %ptr, i32 %value seq_cst, align 1
8941 define dso_local i64 @atomicrmw_umin_i64_unaligned_monotonic(ptr %ptr, i64 %value) {
8942 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
8943 ; -O0: subs x10, x9, x8
8944 ; -O0: csel x8, x9, x8, ls
8945 ; -O0: bl __atomic_compare_exchange
8947 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_monotonic:
8949 ; -O1: csel x8, x0, x20, ls
8950 ; -O1: bl __atomic_compare_exchange
8951 %r = atomicrmw umin ptr %ptr, i64 %value monotonic, align 1
8955 define dso_local i64 @atomicrmw_umin_i64_unaligned_acquire(ptr %ptr, i64 %value) {
8956 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acquire:
8957 ; -O0: subs x10, x9, x8
8958 ; -O0: csel x8, x9, x8, ls
8959 ; -O0: bl __atomic_compare_exchange
8961 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acquire:
8963 ; -O1: csel x8, x0, x20, ls
8964 ; -O1: bl __atomic_compare_exchange
8965 %r = atomicrmw umin ptr %ptr, i64 %value acquire, align 1
8969 define dso_local i64 @atomicrmw_umin_i64_unaligned_release(ptr %ptr, i64 %value) {
8970 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_release:
8971 ; -O0: subs x10, x9, x8
8972 ; -O0: csel x8, x9, x8, ls
8973 ; -O0: bl __atomic_compare_exchange
8975 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_release:
8977 ; -O1: csel x8, x0, x20, ls
8978 ; -O1: bl __atomic_compare_exchange
8979 %r = atomicrmw umin ptr %ptr, i64 %value release, align 1
8983 define dso_local i64 @atomicrmw_umin_i64_unaligned_acq_rel(ptr %ptr, i64 %value) {
8984 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
8985 ; -O0: subs x10, x9, x8
8986 ; -O0: csel x8, x9, x8, ls
8987 ; -O0: bl __atomic_compare_exchange
8989 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_acq_rel:
8991 ; -O1: csel x8, x0, x20, ls
8992 ; -O1: bl __atomic_compare_exchange
8993 %r = atomicrmw umin ptr %ptr, i64 %value acq_rel, align 1
8997 define dso_local i64 @atomicrmw_umin_i64_unaligned_seq_cst(ptr %ptr, i64 %value) {
8998 ; -O0-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
8999 ; -O0: subs x10, x9, x8
9000 ; -O0: csel x8, x9, x8, ls
9001 ; -O0: bl __atomic_compare_exchange
9003 ; -O1-LABEL: atomicrmw_umin_i64_unaligned_seq_cst:
9005 ; -O1: csel x8, x0, x20, ls
9006 ; -O1: bl __atomic_compare_exchange
9007 %r = atomicrmw umin ptr %ptr, i64 %value seq_cst, align 1
9011 define dso_local i128 @atomicrmw_umin_i128_unaligned_monotonic(ptr %ptr, i128 %value) {
9012 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
9013 ; -O0: subs x12, x9, x10
9014 ; -O0: csel x8, x11, x8, hs
9015 ; -O0: csel x9, x10, x9, hs
9016 ; -O0: bl __atomic_compare_exchange
9018 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_monotonic:
9019 ; -O1: ldp x0, x1, [x0]
9021 ; -O1: csel x8, x1, x19, hs
9022 ; -O1: csel x9, x0, x21, hs
9023 ; -O1: bl __atomic_compare_exchange
9024 %r = atomicrmw umin ptr %ptr, i128 %value monotonic, align 1
9028 define dso_local i128 @atomicrmw_umin_i128_unaligned_acquire(ptr %ptr, i128 %value) {
9029 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acquire:
9030 ; -O0: subs x12, x9, x10
9031 ; -O0: csel x8, x11, x8, hs
9032 ; -O0: csel x9, x10, x9, hs
9033 ; -O0: bl __atomic_compare_exchange
9035 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acquire:
9036 ; -O1: ldp x0, x1, [x0]
9038 ; -O1: csel x8, x1, x19, hs
9039 ; -O1: csel x9, x0, x21, hs
9040 ; -O1: bl __atomic_compare_exchange
9041 %r = atomicrmw umin ptr %ptr, i128 %value acquire, align 1
9045 define dso_local i128 @atomicrmw_umin_i128_unaligned_release(ptr %ptr, i128 %value) {
9046 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_release:
9047 ; -O0: subs x12, x9, x10
9048 ; -O0: csel x8, x11, x8, hs
9049 ; -O0: csel x9, x10, x9, hs
9050 ; -O0: bl __atomic_compare_exchange
9052 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_release:
9053 ; -O1: ldp x0, x1, [x0]
9055 ; -O1: csel x8, x1, x19, hs
9056 ; -O1: csel x9, x0, x21, hs
9057 ; -O1: bl __atomic_compare_exchange
9058 %r = atomicrmw umin ptr %ptr, i128 %value release, align 1
9062 define dso_local i128 @atomicrmw_umin_i128_unaligned_acq_rel(ptr %ptr, i128 %value) {
9063 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
9064 ; -O0: subs x12, x9, x10
9065 ; -O0: csel x8, x11, x8, hs
9066 ; -O0: csel x9, x10, x9, hs
9067 ; -O0: bl __atomic_compare_exchange
9069 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_acq_rel:
9070 ; -O1: ldp x0, x1, [x0]
9072 ; -O1: csel x8, x1, x19, hs
9073 ; -O1: csel x9, x0, x21, hs
9074 ; -O1: bl __atomic_compare_exchange
9075 %r = atomicrmw umin ptr %ptr, i128 %value acq_rel, align 1
9079 define dso_local i128 @atomicrmw_umin_i128_unaligned_seq_cst(ptr %ptr, i128 %value) {
9080 ; -O0-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
9081 ; -O0: subs x12, x9, x10
9082 ; -O0: csel x8, x11, x8, hs
9083 ; -O0: csel x9, x10, x9, hs
9084 ; -O0: bl __atomic_compare_exchange
9086 ; -O1-LABEL: atomicrmw_umin_i128_unaligned_seq_cst:
9087 ; -O1: ldp x0, x1, [x0]
9089 ; -O1: csel x8, x1, x19, hs
9090 ; -O1: csel x9, x0, x21, hs
9091 ; -O1: bl __atomic_compare_exchange
9092 %r = atomicrmw umin ptr %ptr, i128 %value seq_cst, align 1