1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --filter-out "\b(sp)\b" --filter "^\s*(ld[^r]|st[^r]|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+outline-atomics -O1 | FileCheck %s --check-prefixes=CHECK,-O1
6 define dso_local i8 @cmpxchg_i8_aligned_monotonic_monotonic(i8 %expected, i8 %new, ptr %ptr) {
7 ; -O0-LABEL: cmpxchg_i8_aligned_monotonic_monotonic:
9 ; -O0: cmp w0, w9, uxtb
10 ; -O0: stlxrb w8, w1, [x2]
12 ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic:
13 ; -O1: bl __aarch64_cas1_relax
14 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1
15 %r = extractvalue { i8, i1 } %pair, 0
19 define dso_local i8 @cmpxchg_i8_aligned_monotonic_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
20 ; -O0-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak:
21 ; -O0: ldaxrb w0, [x2]
22 ; -O0: cmp w0, w9, uxtb
23 ; -O0: stlxrb w8, w1, [x2]
25 ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_monotonic_weak:
26 ; -O1: bl __aarch64_cas1_relax
27 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1
28 %r = extractvalue { i8, i1 } %pair, 0
32 define dso_local i8 @cmpxchg_i8_aligned_monotonic_acquire(i8 %expected, i8 %new, ptr %ptr) {
33 ; -O0-LABEL: cmpxchg_i8_aligned_monotonic_acquire:
34 ; -O0: ldaxrb w0, [x2]
35 ; -O0: cmp w0, w9, uxtb
36 ; -O0: stlxrb w8, w1, [x2]
38 ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire:
39 ; -O1: bl __aarch64_cas1_acq
40 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1
41 %r = extractvalue { i8, i1 } %pair, 0
45 define dso_local i8 @cmpxchg_i8_aligned_monotonic_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
46 ; -O0-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak:
47 ; -O0: ldaxrb w0, [x2]
48 ; -O0: cmp w0, w9, uxtb
49 ; -O0: stlxrb w8, w1, [x2]
51 ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_acquire_weak:
52 ; -O1: bl __aarch64_cas1_acq
53 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1
54 %r = extractvalue { i8, i1 } %pair, 0
58 define dso_local i8 @cmpxchg_i8_aligned_monotonic_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
59 ; -O0-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst:
60 ; -O0: ldaxrb w0, [x2]
61 ; -O0: cmp w0, w9, uxtb
62 ; -O0: stlxrb w8, w1, [x2]
64 ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst:
65 ; -O1: bl __aarch64_cas1_acq_rel
66 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1
67 %r = extractvalue { i8, i1 } %pair, 0
71 define dso_local i8 @cmpxchg_i8_aligned_monotonic_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
72 ; -O0-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak:
73 ; -O0: ldaxrb w0, [x2]
74 ; -O0: cmp w0, w9, uxtb
75 ; -O0: stlxrb w8, w1, [x2]
77 ; -O1-LABEL: cmpxchg_i8_aligned_monotonic_seq_cst_weak:
78 ; -O1: bl __aarch64_cas1_acq_rel
79 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1
80 %r = extractvalue { i8, i1 } %pair, 0
84 define dso_local i8 @cmpxchg_i8_aligned_acquire_monotonic(i8 %expected, i8 %new, ptr %ptr) {
85 ; -O0-LABEL: cmpxchg_i8_aligned_acquire_monotonic:
86 ; -O0: ldaxrb w0, [x2]
87 ; -O0: cmp w0, w9, uxtb
88 ; -O0: stlxrb w8, w1, [x2]
90 ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic:
91 ; -O1: bl __aarch64_cas1_acq
92 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1
93 %r = extractvalue { i8, i1 } %pair, 0
97 define dso_local i8 @cmpxchg_i8_aligned_acquire_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
98 ; -O0-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak:
99 ; -O0: ldaxrb w0, [x2]
100 ; -O0: cmp w0, w9, uxtb
101 ; -O0: stlxrb w8, w1, [x2]
103 ; -O1-LABEL: cmpxchg_i8_aligned_acquire_monotonic_weak:
104 ; -O1: bl __aarch64_cas1_acq
105 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1
106 %r = extractvalue { i8, i1 } %pair, 0
110 define dso_local i8 @cmpxchg_i8_aligned_acquire_acquire(i8 %expected, i8 %new, ptr %ptr) {
111 ; -O0-LABEL: cmpxchg_i8_aligned_acquire_acquire:
112 ; -O0: ldaxrb w0, [x2]
113 ; -O0: cmp w0, w9, uxtb
114 ; -O0: stlxrb w8, w1, [x2]
116 ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire:
117 ; -O1: bl __aarch64_cas1_acq
118 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1
119 %r = extractvalue { i8, i1 } %pair, 0
123 define dso_local i8 @cmpxchg_i8_aligned_acquire_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
124 ; -O0-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak:
125 ; -O0: ldaxrb w0, [x2]
126 ; -O0: cmp w0, w9, uxtb
127 ; -O0: stlxrb w8, w1, [x2]
129 ; -O1-LABEL: cmpxchg_i8_aligned_acquire_acquire_weak:
130 ; -O1: bl __aarch64_cas1_acq
131 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1
132 %r = extractvalue { i8, i1 } %pair, 0
136 define dso_local i8 @cmpxchg_i8_aligned_acquire_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
137 ; -O0-LABEL: cmpxchg_i8_aligned_acquire_seq_cst:
138 ; -O0: ldaxrb w0, [x2]
139 ; -O0: cmp w0, w9, uxtb
140 ; -O0: stlxrb w8, w1, [x2]
142 ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst:
143 ; -O1: bl __aarch64_cas1_acq_rel
144 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1
145 %r = extractvalue { i8, i1 } %pair, 0
149 define dso_local i8 @cmpxchg_i8_aligned_acquire_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
150 ; -O0-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak:
151 ; -O0: ldaxrb w0, [x2]
152 ; -O0: cmp w0, w9, uxtb
153 ; -O0: stlxrb w8, w1, [x2]
155 ; -O1-LABEL: cmpxchg_i8_aligned_acquire_seq_cst_weak:
156 ; -O1: bl __aarch64_cas1_acq_rel
157 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1
158 %r = extractvalue { i8, i1 } %pair, 0
162 define dso_local i8 @cmpxchg_i8_aligned_release_monotonic(i8 %expected, i8 %new, ptr %ptr) {
163 ; -O0-LABEL: cmpxchg_i8_aligned_release_monotonic:
164 ; -O0: ldaxrb w0, [x2]
165 ; -O0: cmp w0, w9, uxtb
166 ; -O0: stlxrb w8, w1, [x2]
168 ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic:
169 ; -O1: bl __aarch64_cas1_rel
170 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new release monotonic, align 1
171 %r = extractvalue { i8, i1 } %pair, 0
175 define dso_local i8 @cmpxchg_i8_aligned_release_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
176 ; -O0-LABEL: cmpxchg_i8_aligned_release_monotonic_weak:
177 ; -O0: ldaxrb w0, [x2]
178 ; -O0: cmp w0, w9, uxtb
179 ; -O0: stlxrb w8, w1, [x2]
181 ; -O1-LABEL: cmpxchg_i8_aligned_release_monotonic_weak:
182 ; -O1: bl __aarch64_cas1_rel
183 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1
184 %r = extractvalue { i8, i1 } %pair, 0
188 define dso_local i8 @cmpxchg_i8_aligned_release_acquire(i8 %expected, i8 %new, ptr %ptr) {
189 ; -O0-LABEL: cmpxchg_i8_aligned_release_acquire:
190 ; -O0: ldaxrb w0, [x2]
191 ; -O0: cmp w0, w9, uxtb
192 ; -O0: stlxrb w8, w1, [x2]
194 ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire:
195 ; -O1: bl __aarch64_cas1_acq_rel
196 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new release acquire, align 1
197 %r = extractvalue { i8, i1 } %pair, 0
201 define dso_local i8 @cmpxchg_i8_aligned_release_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
202 ; -O0-LABEL: cmpxchg_i8_aligned_release_acquire_weak:
203 ; -O0: ldaxrb w0, [x2]
204 ; -O0: cmp w0, w9, uxtb
205 ; -O0: stlxrb w8, w1, [x2]
207 ; -O1-LABEL: cmpxchg_i8_aligned_release_acquire_weak:
208 ; -O1: bl __aarch64_cas1_acq_rel
209 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1
210 %r = extractvalue { i8, i1 } %pair, 0
214 define dso_local i8 @cmpxchg_i8_aligned_release_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
215 ; -O0-LABEL: cmpxchg_i8_aligned_release_seq_cst:
216 ; -O0: ldaxrb w0, [x2]
217 ; -O0: cmp w0, w9, uxtb
218 ; -O0: stlxrb w8, w1, [x2]
220 ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst:
221 ; -O1: bl __aarch64_cas1_acq_rel
222 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1
223 %r = extractvalue { i8, i1 } %pair, 0
227 define dso_local i8 @cmpxchg_i8_aligned_release_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
228 ; -O0-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak:
229 ; -O0: ldaxrb w0, [x2]
230 ; -O0: cmp w0, w9, uxtb
231 ; -O0: stlxrb w8, w1, [x2]
233 ; -O1-LABEL: cmpxchg_i8_aligned_release_seq_cst_weak:
234 ; -O1: bl __aarch64_cas1_acq_rel
235 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1
236 %r = extractvalue { i8, i1 } %pair, 0
240 define dso_local i8 @cmpxchg_i8_aligned_acq_rel_monotonic(i8 %expected, i8 %new, ptr %ptr) {
241 ; -O0-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic:
242 ; -O0: ldaxrb w0, [x2]
243 ; -O0: cmp w0, w9, uxtb
244 ; -O0: stlxrb w8, w1, [x2]
246 ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic:
247 ; -O1: bl __aarch64_cas1_acq_rel
248 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1
249 %r = extractvalue { i8, i1 } %pair, 0
253 define dso_local i8 @cmpxchg_i8_aligned_acq_rel_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
254 ; -O0-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak:
255 ; -O0: ldaxrb w0, [x2]
256 ; -O0: cmp w0, w9, uxtb
257 ; -O0: stlxrb w8, w1, [x2]
259 ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_monotonic_weak:
260 ; -O1: bl __aarch64_cas1_acq_rel
261 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1
262 %r = extractvalue { i8, i1 } %pair, 0
266 define dso_local i8 @cmpxchg_i8_aligned_acq_rel_acquire(i8 %expected, i8 %new, ptr %ptr) {
267 ; -O0-LABEL: cmpxchg_i8_aligned_acq_rel_acquire:
268 ; -O0: ldaxrb w0, [x2]
269 ; -O0: cmp w0, w9, uxtb
270 ; -O0: stlxrb w8, w1, [x2]
272 ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire:
273 ; -O1: bl __aarch64_cas1_acq_rel
274 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1
275 %r = extractvalue { i8, i1 } %pair, 0
279 define dso_local i8 @cmpxchg_i8_aligned_acq_rel_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
280 ; -O0-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak:
281 ; -O0: ldaxrb w0, [x2]
282 ; -O0: cmp w0, w9, uxtb
283 ; -O0: stlxrb w8, w1, [x2]
285 ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_acquire_weak:
286 ; -O1: bl __aarch64_cas1_acq_rel
287 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1
288 %r = extractvalue { i8, i1 } %pair, 0
292 define dso_local i8 @cmpxchg_i8_aligned_acq_rel_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
293 ; -O0-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst:
294 ; -O0: ldaxrb w0, [x2]
295 ; -O0: cmp w0, w9, uxtb
296 ; -O0: stlxrb w8, w1, [x2]
298 ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst:
299 ; -O1: bl __aarch64_cas1_acq_rel
300 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1
301 %r = extractvalue { i8, i1 } %pair, 0
305 define dso_local i8 @cmpxchg_i8_aligned_acq_rel_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
306 ; -O0-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak:
307 ; -O0: ldaxrb w0, [x2]
308 ; -O0: cmp w0, w9, uxtb
309 ; -O0: stlxrb w8, w1, [x2]
311 ; -O1-LABEL: cmpxchg_i8_aligned_acq_rel_seq_cst_weak:
312 ; -O1: bl __aarch64_cas1_acq_rel
313 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1
314 %r = extractvalue { i8, i1 } %pair, 0
318 define dso_local i8 @cmpxchg_i8_aligned_seq_cst_monotonic(i8 %expected, i8 %new, ptr %ptr) {
319 ; -O0-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic:
320 ; -O0: ldaxrb w0, [x2]
321 ; -O0: cmp w0, w9, uxtb
322 ; -O0: stlxrb w8, w1, [x2]
324 ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic:
325 ; -O1: bl __aarch64_cas1_acq_rel
326 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1
327 %r = extractvalue { i8, i1 } %pair, 0
331 define dso_local i8 @cmpxchg_i8_aligned_seq_cst_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
332 ; -O0-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak:
333 ; -O0: ldaxrb w0, [x2]
334 ; -O0: cmp w0, w9, uxtb
335 ; -O0: stlxrb w8, w1, [x2]
337 ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_monotonic_weak:
338 ; -O1: bl __aarch64_cas1_acq_rel
339 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1
340 %r = extractvalue { i8, i1 } %pair, 0
344 define dso_local i8 @cmpxchg_i8_aligned_seq_cst_acquire(i8 %expected, i8 %new, ptr %ptr) {
345 ; -O0-LABEL: cmpxchg_i8_aligned_seq_cst_acquire:
346 ; -O0: ldaxrb w0, [x2]
347 ; -O0: cmp w0, w9, uxtb
348 ; -O0: stlxrb w8, w1, [x2]
350 ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire:
351 ; -O1: bl __aarch64_cas1_acq_rel
352 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1
353 %r = extractvalue { i8, i1 } %pair, 0
357 define dso_local i8 @cmpxchg_i8_aligned_seq_cst_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
358 ; -O0-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak:
359 ; -O0: ldaxrb w0, [x2]
360 ; -O0: cmp w0, w9, uxtb
361 ; -O0: stlxrb w8, w1, [x2]
363 ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_acquire_weak:
364 ; -O1: bl __aarch64_cas1_acq_rel
365 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1
366 %r = extractvalue { i8, i1 } %pair, 0
370 define dso_local i8 @cmpxchg_i8_aligned_seq_cst_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
371 ; -O0-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst:
372 ; -O0: ldaxrb w0, [x2]
373 ; -O0: cmp w0, w9, uxtb
374 ; -O0: stlxrb w8, w1, [x2]
376 ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst:
377 ; -O1: bl __aarch64_cas1_acq_rel
378 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1
379 %r = extractvalue { i8, i1 } %pair, 0
383 define dso_local i8 @cmpxchg_i8_aligned_seq_cst_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
384 ; -O0-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak:
385 ; -O0: ldaxrb w0, [x2]
386 ; -O0: cmp w0, w9, uxtb
387 ; -O0: stlxrb w8, w1, [x2]
389 ; -O1-LABEL: cmpxchg_i8_aligned_seq_cst_seq_cst_weak:
390 ; -O1: bl __aarch64_cas1_acq_rel
391 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1
392 %r = extractvalue { i8, i1 } %pair, 0
396 define dso_local i16 @cmpxchg_i16_aligned_monotonic_monotonic(i16 %expected, i16 %new, ptr %ptr) {
397 ; -O0-LABEL: cmpxchg_i16_aligned_monotonic_monotonic:
398 ; -O0: ldaxrh w0, [x2]
399 ; -O0: cmp w0, w9, uxth
400 ; -O0: stlxrh w8, w1, [x2]
402 ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic:
403 ; -O1: bl __aarch64_cas2_relax
404 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2
405 %r = extractvalue { i16, i1 } %pair, 0
409 define dso_local i16 @cmpxchg_i16_aligned_monotonic_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
410 ; -O0-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak:
411 ; -O0: ldaxrh w0, [x2]
412 ; -O0: cmp w0, w9, uxth
413 ; -O0: stlxrh w8, w1, [x2]
415 ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_monotonic_weak:
416 ; -O1: bl __aarch64_cas2_relax
417 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 2
418 %r = extractvalue { i16, i1 } %pair, 0
422 define dso_local i16 @cmpxchg_i16_aligned_monotonic_acquire(i16 %expected, i16 %new, ptr %ptr) {
423 ; -O0-LABEL: cmpxchg_i16_aligned_monotonic_acquire:
424 ; -O0: ldaxrh w0, [x2]
425 ; -O0: cmp w0, w9, uxth
426 ; -O0: stlxrh w8, w1, [x2]
428 ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire:
429 ; -O1: bl __aarch64_cas2_acq
430 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2
431 %r = extractvalue { i16, i1 } %pair, 0
435 define dso_local i16 @cmpxchg_i16_aligned_monotonic_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
436 ; -O0-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak:
437 ; -O0: ldaxrh w0, [x2]
438 ; -O0: cmp w0, w9, uxth
439 ; -O0: stlxrh w8, w1, [x2]
441 ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_acquire_weak:
442 ; -O1: bl __aarch64_cas2_acq
443 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 2
444 %r = extractvalue { i16, i1 } %pair, 0
448 define dso_local i16 @cmpxchg_i16_aligned_monotonic_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
449 ; -O0-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst:
450 ; -O0: ldaxrh w0, [x2]
451 ; -O0: cmp w0, w9, uxth
452 ; -O0: stlxrh w8, w1, [x2]
454 ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst:
455 ; -O1: bl __aarch64_cas2_acq_rel
456 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2
457 %r = extractvalue { i16, i1 } %pair, 0
461 define dso_local i16 @cmpxchg_i16_aligned_monotonic_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
462 ; -O0-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak:
463 ; -O0: ldaxrh w0, [x2]
464 ; -O0: cmp w0, w9, uxth
465 ; -O0: stlxrh w8, w1, [x2]
467 ; -O1-LABEL: cmpxchg_i16_aligned_monotonic_seq_cst_weak:
468 ; -O1: bl __aarch64_cas2_acq_rel
469 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 2
470 %r = extractvalue { i16, i1 } %pair, 0
474 define dso_local i16 @cmpxchg_i16_aligned_acquire_monotonic(i16 %expected, i16 %new, ptr %ptr) {
475 ; -O0-LABEL: cmpxchg_i16_aligned_acquire_monotonic:
476 ; -O0: ldaxrh w0, [x2]
477 ; -O0: cmp w0, w9, uxth
478 ; -O0: stlxrh w8, w1, [x2]
480 ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic:
481 ; -O1: bl __aarch64_cas2_acq
482 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2
483 %r = extractvalue { i16, i1 } %pair, 0
487 define dso_local i16 @cmpxchg_i16_aligned_acquire_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
488 ; -O0-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak:
489 ; -O0: ldaxrh w0, [x2]
490 ; -O0: cmp w0, w9, uxth
491 ; -O0: stlxrh w8, w1, [x2]
493 ; -O1-LABEL: cmpxchg_i16_aligned_acquire_monotonic_weak:
494 ; -O1: bl __aarch64_cas2_acq
495 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 2
496 %r = extractvalue { i16, i1 } %pair, 0
500 define dso_local i16 @cmpxchg_i16_aligned_acquire_acquire(i16 %expected, i16 %new, ptr %ptr) {
501 ; -O0-LABEL: cmpxchg_i16_aligned_acquire_acquire:
502 ; -O0: ldaxrh w0, [x2]
503 ; -O0: cmp w0, w9, uxth
504 ; -O0: stlxrh w8, w1, [x2]
506 ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire:
507 ; -O1: bl __aarch64_cas2_acq
508 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2
509 %r = extractvalue { i16, i1 } %pair, 0
513 define dso_local i16 @cmpxchg_i16_aligned_acquire_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
514 ; -O0-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak:
515 ; -O0: ldaxrh w0, [x2]
516 ; -O0: cmp w0, w9, uxth
517 ; -O0: stlxrh w8, w1, [x2]
519 ; -O1-LABEL: cmpxchg_i16_aligned_acquire_acquire_weak:
520 ; -O1: bl __aarch64_cas2_acq
521 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 2
522 %r = extractvalue { i16, i1 } %pair, 0
526 define dso_local i16 @cmpxchg_i16_aligned_acquire_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
527 ; -O0-LABEL: cmpxchg_i16_aligned_acquire_seq_cst:
528 ; -O0: ldaxrh w0, [x2]
529 ; -O0: cmp w0, w9, uxth
530 ; -O0: stlxrh w8, w1, [x2]
532 ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst:
533 ; -O1: bl __aarch64_cas2_acq_rel
534 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2
535 %r = extractvalue { i16, i1 } %pair, 0
539 define dso_local i16 @cmpxchg_i16_aligned_acquire_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
540 ; -O0-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak:
541 ; -O0: ldaxrh w0, [x2]
542 ; -O0: cmp w0, w9, uxth
543 ; -O0: stlxrh w8, w1, [x2]
545 ; -O1-LABEL: cmpxchg_i16_aligned_acquire_seq_cst_weak:
546 ; -O1: bl __aarch64_cas2_acq_rel
547 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 2
548 %r = extractvalue { i16, i1 } %pair, 0
552 define dso_local i16 @cmpxchg_i16_aligned_release_monotonic(i16 %expected, i16 %new, ptr %ptr) {
553 ; -O0-LABEL: cmpxchg_i16_aligned_release_monotonic:
554 ; -O0: ldaxrh w0, [x2]
555 ; -O0: cmp w0, w9, uxth
556 ; -O0: stlxrh w8, w1, [x2]
558 ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic:
559 ; -O1: bl __aarch64_cas2_rel
560 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new release monotonic, align 2
561 %r = extractvalue { i16, i1 } %pair, 0
565 define dso_local i16 @cmpxchg_i16_aligned_release_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
566 ; -O0-LABEL: cmpxchg_i16_aligned_release_monotonic_weak:
567 ; -O0: ldaxrh w0, [x2]
568 ; -O0: cmp w0, w9, uxth
569 ; -O0: stlxrh w8, w1, [x2]
571 ; -O1-LABEL: cmpxchg_i16_aligned_release_monotonic_weak:
572 ; -O1: bl __aarch64_cas2_rel
573 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 2
574 %r = extractvalue { i16, i1 } %pair, 0
578 define dso_local i16 @cmpxchg_i16_aligned_release_acquire(i16 %expected, i16 %new, ptr %ptr) {
579 ; -O0-LABEL: cmpxchg_i16_aligned_release_acquire:
580 ; -O0: ldaxrh w0, [x2]
581 ; -O0: cmp w0, w9, uxth
582 ; -O0: stlxrh w8, w1, [x2]
584 ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire:
585 ; -O1: bl __aarch64_cas2_acq_rel
586 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new release acquire, align 2
587 %r = extractvalue { i16, i1 } %pair, 0
591 define dso_local i16 @cmpxchg_i16_aligned_release_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
592 ; -O0-LABEL: cmpxchg_i16_aligned_release_acquire_weak:
593 ; -O0: ldaxrh w0, [x2]
594 ; -O0: cmp w0, w9, uxth
595 ; -O0: stlxrh w8, w1, [x2]
597 ; -O1-LABEL: cmpxchg_i16_aligned_release_acquire_weak:
598 ; -O1: bl __aarch64_cas2_acq_rel
599 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 2
600 %r = extractvalue { i16, i1 } %pair, 0
604 define dso_local i16 @cmpxchg_i16_aligned_release_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
605 ; -O0-LABEL: cmpxchg_i16_aligned_release_seq_cst:
606 ; -O0: ldaxrh w0, [x2]
607 ; -O0: cmp w0, w9, uxth
608 ; -O0: stlxrh w8, w1, [x2]
610 ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst:
611 ; -O1: bl __aarch64_cas2_acq_rel
612 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2
613 %r = extractvalue { i16, i1 } %pair, 0
617 define dso_local i16 @cmpxchg_i16_aligned_release_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
618 ; -O0-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak:
619 ; -O0: ldaxrh w0, [x2]
620 ; -O0: cmp w0, w9, uxth
621 ; -O0: stlxrh w8, w1, [x2]
623 ; -O1-LABEL: cmpxchg_i16_aligned_release_seq_cst_weak:
624 ; -O1: bl __aarch64_cas2_acq_rel
625 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 2
626 %r = extractvalue { i16, i1 } %pair, 0
630 define dso_local i16 @cmpxchg_i16_aligned_acq_rel_monotonic(i16 %expected, i16 %new, ptr %ptr) {
631 ; -O0-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic:
632 ; -O0: ldaxrh w0, [x2]
633 ; -O0: cmp w0, w9, uxth
634 ; -O0: stlxrh w8, w1, [x2]
636 ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic:
637 ; -O1: bl __aarch64_cas2_acq_rel
638 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2
639 %r = extractvalue { i16, i1 } %pair, 0
643 define dso_local i16 @cmpxchg_i16_aligned_acq_rel_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
644 ; -O0-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak:
645 ; -O0: ldaxrh w0, [x2]
646 ; -O0: cmp w0, w9, uxth
647 ; -O0: stlxrh w8, w1, [x2]
649 ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_monotonic_weak:
650 ; -O1: bl __aarch64_cas2_acq_rel
651 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 2
652 %r = extractvalue { i16, i1 } %pair, 0
656 define dso_local i16 @cmpxchg_i16_aligned_acq_rel_acquire(i16 %expected, i16 %new, ptr %ptr) {
657 ; -O0-LABEL: cmpxchg_i16_aligned_acq_rel_acquire:
658 ; -O0: ldaxrh w0, [x2]
659 ; -O0: cmp w0, w9, uxth
660 ; -O0: stlxrh w8, w1, [x2]
662 ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire:
663 ; -O1: bl __aarch64_cas2_acq_rel
664 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2
665 %r = extractvalue { i16, i1 } %pair, 0
669 define dso_local i16 @cmpxchg_i16_aligned_acq_rel_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
670 ; -O0-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak:
671 ; -O0: ldaxrh w0, [x2]
672 ; -O0: cmp w0, w9, uxth
673 ; -O0: stlxrh w8, w1, [x2]
675 ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_acquire_weak:
676 ; -O1: bl __aarch64_cas2_acq_rel
677 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 2
678 %r = extractvalue { i16, i1 } %pair, 0
682 define dso_local i16 @cmpxchg_i16_aligned_acq_rel_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
683 ; -O0-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst:
684 ; -O0: ldaxrh w0, [x2]
685 ; -O0: cmp w0, w9, uxth
686 ; -O0: stlxrh w8, w1, [x2]
688 ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst:
689 ; -O1: bl __aarch64_cas2_acq_rel
690 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2
691 %r = extractvalue { i16, i1 } %pair, 0
695 define dso_local i16 @cmpxchg_i16_aligned_acq_rel_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
696 ; -O0-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak:
697 ; -O0: ldaxrh w0, [x2]
698 ; -O0: cmp w0, w9, uxth
699 ; -O0: stlxrh w8, w1, [x2]
701 ; -O1-LABEL: cmpxchg_i16_aligned_acq_rel_seq_cst_weak:
702 ; -O1: bl __aarch64_cas2_acq_rel
703 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 2
704 %r = extractvalue { i16, i1 } %pair, 0
708 define dso_local i16 @cmpxchg_i16_aligned_seq_cst_monotonic(i16 %expected, i16 %new, ptr %ptr) {
709 ; -O0-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic:
710 ; -O0: ldaxrh w0, [x2]
711 ; -O0: cmp w0, w9, uxth
712 ; -O0: stlxrh w8, w1, [x2]
714 ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic:
715 ; -O1: bl __aarch64_cas2_acq_rel
716 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2
717 %r = extractvalue { i16, i1 } %pair, 0
721 define dso_local i16 @cmpxchg_i16_aligned_seq_cst_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
722 ; -O0-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak:
723 ; -O0: ldaxrh w0, [x2]
724 ; -O0: cmp w0, w9, uxth
725 ; -O0: stlxrh w8, w1, [x2]
727 ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_monotonic_weak:
728 ; -O1: bl __aarch64_cas2_acq_rel
729 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 2
730 %r = extractvalue { i16, i1 } %pair, 0
734 define dso_local i16 @cmpxchg_i16_aligned_seq_cst_acquire(i16 %expected, i16 %new, ptr %ptr) {
735 ; -O0-LABEL: cmpxchg_i16_aligned_seq_cst_acquire:
736 ; -O0: ldaxrh w0, [x2]
737 ; -O0: cmp w0, w9, uxth
738 ; -O0: stlxrh w8, w1, [x2]
740 ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire:
741 ; -O1: bl __aarch64_cas2_acq_rel
742 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2
743 %r = extractvalue { i16, i1 } %pair, 0
747 define dso_local i16 @cmpxchg_i16_aligned_seq_cst_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
748 ; -O0-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak:
749 ; -O0: ldaxrh w0, [x2]
750 ; -O0: cmp w0, w9, uxth
751 ; -O0: stlxrh w8, w1, [x2]
753 ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_acquire_weak:
754 ; -O1: bl __aarch64_cas2_acq_rel
755 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 2
756 %r = extractvalue { i16, i1 } %pair, 0
760 define dso_local i16 @cmpxchg_i16_aligned_seq_cst_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
761 ; -O0-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst:
762 ; -O0: ldaxrh w0, [x2]
763 ; -O0: cmp w0, w9, uxth
764 ; -O0: stlxrh w8, w1, [x2]
766 ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst:
767 ; -O1: bl __aarch64_cas2_acq_rel
768 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2
769 %r = extractvalue { i16, i1 } %pair, 0
773 define dso_local i16 @cmpxchg_i16_aligned_seq_cst_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
774 ; -O0-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak:
775 ; -O0: ldaxrh w0, [x2]
776 ; -O0: cmp w0, w9, uxth
777 ; -O0: stlxrh w8, w1, [x2]
779 ; -O1-LABEL: cmpxchg_i16_aligned_seq_cst_seq_cst_weak:
780 ; -O1: bl __aarch64_cas2_acq_rel
781 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 2
782 %r = extractvalue { i16, i1 } %pair, 0
786 define dso_local i32 @cmpxchg_i32_aligned_monotonic_monotonic(i32 %expected, i32 %new, ptr %ptr) {
787 ; -O0-LABEL: cmpxchg_i32_aligned_monotonic_monotonic:
788 ; -O0: ldaxr w0, [x2]
790 ; -O0: stlxr w8, w1, [x2]
792 ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic:
793 ; -O1: bl __aarch64_cas4_relax
794 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4
795 %r = extractvalue { i32, i1 } %pair, 0
799 define dso_local i32 @cmpxchg_i32_aligned_monotonic_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
800 ; -O0-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak:
801 ; -O0: ldaxr w0, [x2]
803 ; -O0: stlxr w8, w1, [x2]
805 ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_monotonic_weak:
806 ; -O1: bl __aarch64_cas4_relax
807 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 4
808 %r = extractvalue { i32, i1 } %pair, 0
812 define dso_local i32 @cmpxchg_i32_aligned_monotonic_acquire(i32 %expected, i32 %new, ptr %ptr) {
813 ; -O0-LABEL: cmpxchg_i32_aligned_monotonic_acquire:
814 ; -O0: ldaxr w0, [x2]
816 ; -O0: stlxr w8, w1, [x2]
818 ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire:
819 ; -O1: bl __aarch64_cas4_acq
820 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4
821 %r = extractvalue { i32, i1 } %pair, 0
825 define dso_local i32 @cmpxchg_i32_aligned_monotonic_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
826 ; -O0-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak:
827 ; -O0: ldaxr w0, [x2]
829 ; -O0: stlxr w8, w1, [x2]
831 ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_acquire_weak:
832 ; -O1: bl __aarch64_cas4_acq
833 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 4
834 %r = extractvalue { i32, i1 } %pair, 0
838 define dso_local i32 @cmpxchg_i32_aligned_monotonic_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
839 ; -O0-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst:
840 ; -O0: ldaxr w0, [x2]
842 ; -O0: stlxr w8, w1, [x2]
844 ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst:
845 ; -O1: bl __aarch64_cas4_acq_rel
846 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4
847 %r = extractvalue { i32, i1 } %pair, 0
851 define dso_local i32 @cmpxchg_i32_aligned_monotonic_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
852 ; -O0-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak:
853 ; -O0: ldaxr w0, [x2]
855 ; -O0: stlxr w8, w1, [x2]
857 ; -O1-LABEL: cmpxchg_i32_aligned_monotonic_seq_cst_weak:
858 ; -O1: bl __aarch64_cas4_acq_rel
859 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 4
860 %r = extractvalue { i32, i1 } %pair, 0
864 define dso_local i32 @cmpxchg_i32_aligned_acquire_monotonic(i32 %expected, i32 %new, ptr %ptr) {
865 ; -O0-LABEL: cmpxchg_i32_aligned_acquire_monotonic:
866 ; -O0: ldaxr w0, [x2]
868 ; -O0: stlxr w8, w1, [x2]
870 ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic:
871 ; -O1: bl __aarch64_cas4_acq
872 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4
873 %r = extractvalue { i32, i1 } %pair, 0
877 define dso_local i32 @cmpxchg_i32_aligned_acquire_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
878 ; -O0-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak:
879 ; -O0: ldaxr w0, [x2]
881 ; -O0: stlxr w8, w1, [x2]
883 ; -O1-LABEL: cmpxchg_i32_aligned_acquire_monotonic_weak:
884 ; -O1: bl __aarch64_cas4_acq
885 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 4
886 %r = extractvalue { i32, i1 } %pair, 0
890 define dso_local i32 @cmpxchg_i32_aligned_acquire_acquire(i32 %expected, i32 %new, ptr %ptr) {
891 ; -O0-LABEL: cmpxchg_i32_aligned_acquire_acquire:
892 ; -O0: ldaxr w0, [x2]
894 ; -O0: stlxr w8, w1, [x2]
896 ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire:
897 ; -O1: bl __aarch64_cas4_acq
898 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4
899 %r = extractvalue { i32, i1 } %pair, 0
903 define dso_local i32 @cmpxchg_i32_aligned_acquire_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
904 ; -O0-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak:
905 ; -O0: ldaxr w0, [x2]
907 ; -O0: stlxr w8, w1, [x2]
909 ; -O1-LABEL: cmpxchg_i32_aligned_acquire_acquire_weak:
910 ; -O1: bl __aarch64_cas4_acq
911 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 4
912 %r = extractvalue { i32, i1 } %pair, 0
916 define dso_local i32 @cmpxchg_i32_aligned_acquire_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
917 ; -O0-LABEL: cmpxchg_i32_aligned_acquire_seq_cst:
918 ; -O0: ldaxr w0, [x2]
920 ; -O0: stlxr w8, w1, [x2]
922 ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst:
923 ; -O1: bl __aarch64_cas4_acq_rel
924 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4
925 %r = extractvalue { i32, i1 } %pair, 0
929 define dso_local i32 @cmpxchg_i32_aligned_acquire_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
930 ; -O0-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak:
931 ; -O0: ldaxr w0, [x2]
933 ; -O0: stlxr w8, w1, [x2]
935 ; -O1-LABEL: cmpxchg_i32_aligned_acquire_seq_cst_weak:
936 ; -O1: bl __aarch64_cas4_acq_rel
937 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 4
938 %r = extractvalue { i32, i1 } %pair, 0
942 define dso_local i32 @cmpxchg_i32_aligned_release_monotonic(i32 %expected, i32 %new, ptr %ptr) {
943 ; -O0-LABEL: cmpxchg_i32_aligned_release_monotonic:
944 ; -O0: ldaxr w0, [x2]
946 ; -O0: stlxr w8, w1, [x2]
948 ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic:
949 ; -O1: bl __aarch64_cas4_rel
950 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new release monotonic, align 4
951 %r = extractvalue { i32, i1 } %pair, 0
955 define dso_local i32 @cmpxchg_i32_aligned_release_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
956 ; -O0-LABEL: cmpxchg_i32_aligned_release_monotonic_weak:
957 ; -O0: ldaxr w0, [x2]
959 ; -O0: stlxr w8, w1, [x2]
961 ; -O1-LABEL: cmpxchg_i32_aligned_release_monotonic_weak:
962 ; -O1: bl __aarch64_cas4_rel
963 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 4
964 %r = extractvalue { i32, i1 } %pair, 0
968 define dso_local i32 @cmpxchg_i32_aligned_release_acquire(i32 %expected, i32 %new, ptr %ptr) {
969 ; -O0-LABEL: cmpxchg_i32_aligned_release_acquire:
970 ; -O0: ldaxr w0, [x2]
972 ; -O0: stlxr w8, w1, [x2]
974 ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire:
975 ; -O1: bl __aarch64_cas4_acq_rel
976 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new release acquire, align 4
977 %r = extractvalue { i32, i1 } %pair, 0
981 define dso_local i32 @cmpxchg_i32_aligned_release_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
982 ; -O0-LABEL: cmpxchg_i32_aligned_release_acquire_weak:
983 ; -O0: ldaxr w0, [x2]
985 ; -O0: stlxr w8, w1, [x2]
987 ; -O1-LABEL: cmpxchg_i32_aligned_release_acquire_weak:
988 ; -O1: bl __aarch64_cas4_acq_rel
989 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 4
990 %r = extractvalue { i32, i1 } %pair, 0
994 define dso_local i32 @cmpxchg_i32_aligned_release_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
995 ; -O0-LABEL: cmpxchg_i32_aligned_release_seq_cst:
996 ; -O0: ldaxr w0, [x2]
998 ; -O0: stlxr w8, w1, [x2]
1000 ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst:
1001 ; -O1: bl __aarch64_cas4_acq_rel
1002 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4
1003 %r = extractvalue { i32, i1 } %pair, 0
1007 define dso_local i32 @cmpxchg_i32_aligned_release_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
1008 ; -O0-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak:
1009 ; -O0: ldaxr w0, [x2]
1011 ; -O0: stlxr w8, w1, [x2]
1013 ; -O1-LABEL: cmpxchg_i32_aligned_release_seq_cst_weak:
1014 ; -O1: bl __aarch64_cas4_acq_rel
1015 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 4
1016 %r = extractvalue { i32, i1 } %pair, 0
1020 define dso_local i32 @cmpxchg_i32_aligned_acq_rel_monotonic(i32 %expected, i32 %new, ptr %ptr) {
1021 ; -O0-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic:
1022 ; -O0: ldaxr w0, [x2]
1024 ; -O0: stlxr w8, w1, [x2]
1026 ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic:
1027 ; -O1: bl __aarch64_cas4_acq_rel
1028 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4
1029 %r = extractvalue { i32, i1 } %pair, 0
1033 define dso_local i32 @cmpxchg_i32_aligned_acq_rel_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
1034 ; -O0-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak:
1035 ; -O0: ldaxr w0, [x2]
1037 ; -O0: stlxr w8, w1, [x2]
1039 ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_monotonic_weak:
1040 ; -O1: bl __aarch64_cas4_acq_rel
1041 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 4
1042 %r = extractvalue { i32, i1 } %pair, 0
1046 define dso_local i32 @cmpxchg_i32_aligned_acq_rel_acquire(i32 %expected, i32 %new, ptr %ptr) {
1047 ; -O0-LABEL: cmpxchg_i32_aligned_acq_rel_acquire:
1048 ; -O0: ldaxr w0, [x2]
1050 ; -O0: stlxr w8, w1, [x2]
1052 ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire:
1053 ; -O1: bl __aarch64_cas4_acq_rel
1054 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4
1055 %r = extractvalue { i32, i1 } %pair, 0
1059 define dso_local i32 @cmpxchg_i32_aligned_acq_rel_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
1060 ; -O0-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak:
1061 ; -O0: ldaxr w0, [x2]
1063 ; -O0: stlxr w8, w1, [x2]
1065 ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_acquire_weak:
1066 ; -O1: bl __aarch64_cas4_acq_rel
1067 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 4
1068 %r = extractvalue { i32, i1 } %pair, 0
1072 define dso_local i32 @cmpxchg_i32_aligned_acq_rel_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
1073 ; -O0-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst:
1074 ; -O0: ldaxr w0, [x2]
1076 ; -O0: stlxr w8, w1, [x2]
1078 ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst:
1079 ; -O1: bl __aarch64_cas4_acq_rel
1080 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4
1081 %r = extractvalue { i32, i1 } %pair, 0
1085 define dso_local i32 @cmpxchg_i32_aligned_acq_rel_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
1086 ; -O0-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak:
1087 ; -O0: ldaxr w0, [x2]
1089 ; -O0: stlxr w8, w1, [x2]
1091 ; -O1-LABEL: cmpxchg_i32_aligned_acq_rel_seq_cst_weak:
1092 ; -O1: bl __aarch64_cas4_acq_rel
1093 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 4
1094 %r = extractvalue { i32, i1 } %pair, 0
1098 define dso_local i32 @cmpxchg_i32_aligned_seq_cst_monotonic(i32 %expected, i32 %new, ptr %ptr) {
1099 ; -O0-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic:
1100 ; -O0: ldaxr w0, [x2]
1102 ; -O0: stlxr w8, w1, [x2]
1104 ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic:
1105 ; -O1: bl __aarch64_cas4_acq_rel
1106 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4
1107 %r = extractvalue { i32, i1 } %pair, 0
1111 define dso_local i32 @cmpxchg_i32_aligned_seq_cst_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
1112 ; -O0-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak:
1113 ; -O0: ldaxr w0, [x2]
1115 ; -O0: stlxr w8, w1, [x2]
1117 ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_monotonic_weak:
1118 ; -O1: bl __aarch64_cas4_acq_rel
1119 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 4
1120 %r = extractvalue { i32, i1 } %pair, 0
1124 define dso_local i32 @cmpxchg_i32_aligned_seq_cst_acquire(i32 %expected, i32 %new, ptr %ptr) {
1125 ; -O0-LABEL: cmpxchg_i32_aligned_seq_cst_acquire:
1126 ; -O0: ldaxr w0, [x2]
1128 ; -O0: stlxr w8, w1, [x2]
1130 ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire:
1131 ; -O1: bl __aarch64_cas4_acq_rel
1132 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4
1133 %r = extractvalue { i32, i1 } %pair, 0
1137 define dso_local i32 @cmpxchg_i32_aligned_seq_cst_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
1138 ; -O0-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak:
1139 ; -O0: ldaxr w0, [x2]
1141 ; -O0: stlxr w8, w1, [x2]
1143 ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_acquire_weak:
1144 ; -O1: bl __aarch64_cas4_acq_rel
1145 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 4
1146 %r = extractvalue { i32, i1 } %pair, 0
1150 define dso_local i32 @cmpxchg_i32_aligned_seq_cst_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
1151 ; -O0-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst:
1152 ; -O0: ldaxr w0, [x2]
1154 ; -O0: stlxr w8, w1, [x2]
1156 ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst:
1157 ; -O1: bl __aarch64_cas4_acq_rel
1158 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4
1159 %r = extractvalue { i32, i1 } %pair, 0
1163 define dso_local i32 @cmpxchg_i32_aligned_seq_cst_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
1164 ; -O0-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak:
1165 ; -O0: ldaxr w0, [x2]
1167 ; -O0: stlxr w8, w1, [x2]
1169 ; -O1-LABEL: cmpxchg_i32_aligned_seq_cst_seq_cst_weak:
1170 ; -O1: bl __aarch64_cas4_acq_rel
1171 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 4
1172 %r = extractvalue { i32, i1 } %pair, 0
1176 define dso_local i64 @cmpxchg_i64_aligned_monotonic_monotonic(i64 %expected, i64 %new, ptr %ptr) {
1177 ; -O0-LABEL: cmpxchg_i64_aligned_monotonic_monotonic:
1178 ; -O0: ldaxr x0, [x2]
1180 ; -O0: stlxr w8, x1, [x2]
1182 ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic:
1183 ; -O1: bl __aarch64_cas8_relax
1184 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8
1185 %r = extractvalue { i64, i1 } %pair, 0
1189 define dso_local i64 @cmpxchg_i64_aligned_monotonic_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
1190 ; -O0-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak:
1191 ; -O0: ldaxr x0, [x2]
1193 ; -O0: stlxr w8, x1, [x2]
1195 ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_monotonic_weak:
1196 ; -O1: bl __aarch64_cas8_relax
1197 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 8
1198 %r = extractvalue { i64, i1 } %pair, 0
1202 define dso_local i64 @cmpxchg_i64_aligned_monotonic_acquire(i64 %expected, i64 %new, ptr %ptr) {
1203 ; -O0-LABEL: cmpxchg_i64_aligned_monotonic_acquire:
1204 ; -O0: ldaxr x0, [x2]
1206 ; -O0: stlxr w8, x1, [x2]
1208 ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire:
1209 ; -O1: bl __aarch64_cas8_acq
1210 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8
1211 %r = extractvalue { i64, i1 } %pair, 0
1215 define dso_local i64 @cmpxchg_i64_aligned_monotonic_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
1216 ; -O0-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak:
1217 ; -O0: ldaxr x0, [x2]
1219 ; -O0: stlxr w8, x1, [x2]
1221 ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_acquire_weak:
1222 ; -O1: bl __aarch64_cas8_acq
1223 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 8
1224 %r = extractvalue { i64, i1 } %pair, 0
1228 define dso_local i64 @cmpxchg_i64_aligned_monotonic_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
1229 ; -O0-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst:
1230 ; -O0: ldaxr x0, [x2]
1232 ; -O0: stlxr w8, x1, [x2]
1234 ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst:
1235 ; -O1: bl __aarch64_cas8_acq_rel
1236 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8
1237 %r = extractvalue { i64, i1 } %pair, 0
1241 define dso_local i64 @cmpxchg_i64_aligned_monotonic_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
1242 ; -O0-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak:
1243 ; -O0: ldaxr x0, [x2]
1245 ; -O0: stlxr w8, x1, [x2]
1247 ; -O1-LABEL: cmpxchg_i64_aligned_monotonic_seq_cst_weak:
1248 ; -O1: bl __aarch64_cas8_acq_rel
1249 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 8
1250 %r = extractvalue { i64, i1 } %pair, 0
1254 define dso_local i64 @cmpxchg_i64_aligned_acquire_monotonic(i64 %expected, i64 %new, ptr %ptr) {
1255 ; -O0-LABEL: cmpxchg_i64_aligned_acquire_monotonic:
1256 ; -O0: ldaxr x0, [x2]
1258 ; -O0: stlxr w8, x1, [x2]
1260 ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic:
1261 ; -O1: bl __aarch64_cas8_acq
1262 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8
1263 %r = extractvalue { i64, i1 } %pair, 0
1267 define dso_local i64 @cmpxchg_i64_aligned_acquire_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
1268 ; -O0-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak:
1269 ; -O0: ldaxr x0, [x2]
1271 ; -O0: stlxr w8, x1, [x2]
1273 ; -O1-LABEL: cmpxchg_i64_aligned_acquire_monotonic_weak:
1274 ; -O1: bl __aarch64_cas8_acq
1275 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 8
1276 %r = extractvalue { i64, i1 } %pair, 0
1280 define dso_local i64 @cmpxchg_i64_aligned_acquire_acquire(i64 %expected, i64 %new, ptr %ptr) {
1281 ; -O0-LABEL: cmpxchg_i64_aligned_acquire_acquire:
1282 ; -O0: ldaxr x0, [x2]
1284 ; -O0: stlxr w8, x1, [x2]
1286 ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire:
1287 ; -O1: bl __aarch64_cas8_acq
1288 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8
1289 %r = extractvalue { i64, i1 } %pair, 0
1293 define dso_local i64 @cmpxchg_i64_aligned_acquire_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
1294 ; -O0-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak:
1295 ; -O0: ldaxr x0, [x2]
1297 ; -O0: stlxr w8, x1, [x2]
1299 ; -O1-LABEL: cmpxchg_i64_aligned_acquire_acquire_weak:
1300 ; -O1: bl __aarch64_cas8_acq
1301 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 8
1302 %r = extractvalue { i64, i1 } %pair, 0
1306 define dso_local i64 @cmpxchg_i64_aligned_acquire_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
1307 ; -O0-LABEL: cmpxchg_i64_aligned_acquire_seq_cst:
1308 ; -O0: ldaxr x0, [x2]
1310 ; -O0: stlxr w8, x1, [x2]
1312 ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst:
1313 ; -O1: bl __aarch64_cas8_acq_rel
1314 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8
1315 %r = extractvalue { i64, i1 } %pair, 0
1319 define dso_local i64 @cmpxchg_i64_aligned_acquire_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
1320 ; -O0-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak:
1321 ; -O0: ldaxr x0, [x2]
1323 ; -O0: stlxr w8, x1, [x2]
1325 ; -O1-LABEL: cmpxchg_i64_aligned_acquire_seq_cst_weak:
1326 ; -O1: bl __aarch64_cas8_acq_rel
1327 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 8
1328 %r = extractvalue { i64, i1 } %pair, 0
1332 define dso_local i64 @cmpxchg_i64_aligned_release_monotonic(i64 %expected, i64 %new, ptr %ptr) {
1333 ; -O0-LABEL: cmpxchg_i64_aligned_release_monotonic:
1334 ; -O0: ldaxr x0, [x2]
1336 ; -O0: stlxr w8, x1, [x2]
1338 ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic:
1339 ; -O1: bl __aarch64_cas8_rel
1340 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new release monotonic, align 8
1341 %r = extractvalue { i64, i1 } %pair, 0
1345 define dso_local i64 @cmpxchg_i64_aligned_release_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
1346 ; -O0-LABEL: cmpxchg_i64_aligned_release_monotonic_weak:
1347 ; -O0: ldaxr x0, [x2]
1349 ; -O0: stlxr w8, x1, [x2]
1351 ; -O1-LABEL: cmpxchg_i64_aligned_release_monotonic_weak:
1352 ; -O1: bl __aarch64_cas8_rel
1353 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 8
1354 %r = extractvalue { i64, i1 } %pair, 0
1358 define dso_local i64 @cmpxchg_i64_aligned_release_acquire(i64 %expected, i64 %new, ptr %ptr) {
1359 ; -O0-LABEL: cmpxchg_i64_aligned_release_acquire:
1360 ; -O0: ldaxr x0, [x2]
1362 ; -O0: stlxr w8, x1, [x2]
1364 ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire:
1365 ; -O1: bl __aarch64_cas8_acq_rel
1366 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new release acquire, align 8
1367 %r = extractvalue { i64, i1 } %pair, 0
1371 define dso_local i64 @cmpxchg_i64_aligned_release_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
1372 ; -O0-LABEL: cmpxchg_i64_aligned_release_acquire_weak:
1373 ; -O0: ldaxr x0, [x2]
1375 ; -O0: stlxr w8, x1, [x2]
1377 ; -O1-LABEL: cmpxchg_i64_aligned_release_acquire_weak:
1378 ; -O1: bl __aarch64_cas8_acq_rel
1379 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 8
1380 %r = extractvalue { i64, i1 } %pair, 0
1384 define dso_local i64 @cmpxchg_i64_aligned_release_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
1385 ; -O0-LABEL: cmpxchg_i64_aligned_release_seq_cst:
1386 ; -O0: ldaxr x0, [x2]
1388 ; -O0: stlxr w8, x1, [x2]
1390 ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst:
1391 ; -O1: bl __aarch64_cas8_acq_rel
1392 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8
1393 %r = extractvalue { i64, i1 } %pair, 0
1397 define dso_local i64 @cmpxchg_i64_aligned_release_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
1398 ; -O0-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak:
1399 ; -O0: ldaxr x0, [x2]
1401 ; -O0: stlxr w8, x1, [x2]
1403 ; -O1-LABEL: cmpxchg_i64_aligned_release_seq_cst_weak:
1404 ; -O1: bl __aarch64_cas8_acq_rel
1405 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 8
1406 %r = extractvalue { i64, i1 } %pair, 0
1410 define dso_local i64 @cmpxchg_i64_aligned_acq_rel_monotonic(i64 %expected, i64 %new, ptr %ptr) {
1411 ; -O0-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic:
1412 ; -O0: ldaxr x0, [x2]
1414 ; -O0: stlxr w8, x1, [x2]
1416 ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic:
1417 ; -O1: bl __aarch64_cas8_acq_rel
1418 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8
1419 %r = extractvalue { i64, i1 } %pair, 0
1423 define dso_local i64 @cmpxchg_i64_aligned_acq_rel_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
1424 ; -O0-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak:
1425 ; -O0: ldaxr x0, [x2]
1427 ; -O0: stlxr w8, x1, [x2]
1429 ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_monotonic_weak:
1430 ; -O1: bl __aarch64_cas8_acq_rel
1431 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 8
1432 %r = extractvalue { i64, i1 } %pair, 0
1436 define dso_local i64 @cmpxchg_i64_aligned_acq_rel_acquire(i64 %expected, i64 %new, ptr %ptr) {
1437 ; -O0-LABEL: cmpxchg_i64_aligned_acq_rel_acquire:
1438 ; -O0: ldaxr x0, [x2]
1440 ; -O0: stlxr w8, x1, [x2]
1442 ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire:
1443 ; -O1: bl __aarch64_cas8_acq_rel
1444 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8
1445 %r = extractvalue { i64, i1 } %pair, 0
1449 define dso_local i64 @cmpxchg_i64_aligned_acq_rel_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
1450 ; -O0-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak:
1451 ; -O0: ldaxr x0, [x2]
1453 ; -O0: stlxr w8, x1, [x2]
1455 ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_acquire_weak:
1456 ; -O1: bl __aarch64_cas8_acq_rel
1457 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 8
1458 %r = extractvalue { i64, i1 } %pair, 0
1462 define dso_local i64 @cmpxchg_i64_aligned_acq_rel_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
1463 ; -O0-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst:
1464 ; -O0: ldaxr x0, [x2]
1466 ; -O0: stlxr w8, x1, [x2]
1468 ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst:
1469 ; -O1: bl __aarch64_cas8_acq_rel
1470 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8
1471 %r = extractvalue { i64, i1 } %pair, 0
1475 define dso_local i64 @cmpxchg_i64_aligned_acq_rel_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
1476 ; -O0-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak:
1477 ; -O0: ldaxr x0, [x2]
1479 ; -O0: stlxr w8, x1, [x2]
1481 ; -O1-LABEL: cmpxchg_i64_aligned_acq_rel_seq_cst_weak:
1482 ; -O1: bl __aarch64_cas8_acq_rel
1483 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 8
1484 %r = extractvalue { i64, i1 } %pair, 0
1488 define dso_local i64 @cmpxchg_i64_aligned_seq_cst_monotonic(i64 %expected, i64 %new, ptr %ptr) {
1489 ; -O0-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic:
1490 ; -O0: ldaxr x0, [x2]
1492 ; -O0: stlxr w8, x1, [x2]
1494 ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic:
1495 ; -O1: bl __aarch64_cas8_acq_rel
1496 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8
1497 %r = extractvalue { i64, i1 } %pair, 0
1501 define dso_local i64 @cmpxchg_i64_aligned_seq_cst_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
1502 ; -O0-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak:
1503 ; -O0: ldaxr x0, [x2]
1505 ; -O0: stlxr w8, x1, [x2]
1507 ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_monotonic_weak:
1508 ; -O1: bl __aarch64_cas8_acq_rel
1509 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 8
1510 %r = extractvalue { i64, i1 } %pair, 0
1514 define dso_local i64 @cmpxchg_i64_aligned_seq_cst_acquire(i64 %expected, i64 %new, ptr %ptr) {
1515 ; -O0-LABEL: cmpxchg_i64_aligned_seq_cst_acquire:
1516 ; -O0: ldaxr x0, [x2]
1518 ; -O0: stlxr w8, x1, [x2]
1520 ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire:
1521 ; -O1: bl __aarch64_cas8_acq_rel
1522 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8
1523 %r = extractvalue { i64, i1 } %pair, 0
1527 define dso_local i64 @cmpxchg_i64_aligned_seq_cst_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
1528 ; -O0-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak:
1529 ; -O0: ldaxr x0, [x2]
1531 ; -O0: stlxr w8, x1, [x2]
1533 ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_acquire_weak:
1534 ; -O1: bl __aarch64_cas8_acq_rel
1535 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 8
1536 %r = extractvalue { i64, i1 } %pair, 0
1540 define dso_local i64 @cmpxchg_i64_aligned_seq_cst_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
1541 ; -O0-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst:
1542 ; -O0: ldaxr x0, [x2]
1544 ; -O0: stlxr w8, x1, [x2]
1546 ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst:
1547 ; -O1: bl __aarch64_cas8_acq_rel
1548 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8
1549 %r = extractvalue { i64, i1 } %pair, 0
1553 define dso_local i64 @cmpxchg_i64_aligned_seq_cst_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
1554 ; -O0-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak:
1555 ; -O0: ldaxr x0, [x2]
1557 ; -O0: stlxr w8, x1, [x2]
1559 ; -O1-LABEL: cmpxchg_i64_aligned_seq_cst_seq_cst_weak:
1560 ; -O1: bl __aarch64_cas8_acq_rel
1561 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 8
1562 %r = extractvalue { i64, i1 } %pair, 0
1566 define dso_local i128 @cmpxchg_i128_aligned_monotonic_monotonic(i128 %expected, i128 %new, ptr %ptr) {
1567 ; -O0-LABEL: cmpxchg_i128_aligned_monotonic_monotonic:
1568 ; -O0: ldxp x0, x1, [x4]
1571 ; -O0: stxp w8, x2, x3, [x4]
1572 ; -O0: stxp w8, x0, x1, [x4]
1574 ; -O1-LABEL: cmpxchg_i128_aligned_monotonic_monotonic:
1575 ; -O1: bl __aarch64_cas16_relax
1576 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new monotonic monotonic, align 16
1577 %r = extractvalue { i128, i1 } %pair, 0
1581 define dso_local i128 @cmpxchg_i128_aligned_monotonic_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
1582 ; -O0-LABEL: cmpxchg_i128_aligned_monotonic_monotonic_weak:
1583 ; -O0: ldxp x0, x1, [x4]
1586 ; -O0: stxp w8, x2, x3, [x4]
1587 ; -O0: stxp w8, x0, x1, [x4]
1589 ; -O1-LABEL: cmpxchg_i128_aligned_monotonic_monotonic_weak:
1590 ; -O1: bl __aarch64_cas16_relax
1591 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new monotonic monotonic, align 16
1592 %r = extractvalue { i128, i1 } %pair, 0
1596 define dso_local i128 @cmpxchg_i128_aligned_monotonic_acquire(i128 %expected, i128 %new, ptr %ptr) {
1597 ; -O0-LABEL: cmpxchg_i128_aligned_monotonic_acquire:
1598 ; -O0: ldaxp x0, x1, [x4]
1601 ; -O0: stxp w8, x2, x3, [x4]
1602 ; -O0: stxp w8, x0, x1, [x4]
1604 ; -O1-LABEL: cmpxchg_i128_aligned_monotonic_acquire:
1605 ; -O1: bl __aarch64_cas16_acq
1606 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new monotonic acquire, align 16
1607 %r = extractvalue { i128, i1 } %pair, 0
1611 define dso_local i128 @cmpxchg_i128_aligned_monotonic_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
1612 ; -O0-LABEL: cmpxchg_i128_aligned_monotonic_acquire_weak:
1613 ; -O0: ldaxp x0, x1, [x4]
1616 ; -O0: stxp w8, x2, x3, [x4]
1617 ; -O0: stxp w8, x0, x1, [x4]
1619 ; -O1-LABEL: cmpxchg_i128_aligned_monotonic_acquire_weak:
1620 ; -O1: bl __aarch64_cas16_acq
1621 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new monotonic acquire, align 16
1622 %r = extractvalue { i128, i1 } %pair, 0
1626 define dso_local i128 @cmpxchg_i128_aligned_monotonic_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
1627 ; -O0-LABEL: cmpxchg_i128_aligned_monotonic_seq_cst:
1628 ; -O0: ldaxp x0, x1, [x4]
1631 ; -O0: stlxp w8, x2, x3, [x4]
1632 ; -O0: stlxp w8, x0, x1, [x4]
1634 ; -O1-LABEL: cmpxchg_i128_aligned_monotonic_seq_cst:
1635 ; -O1: bl __aarch64_cas16_acq_rel
1636 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new monotonic seq_cst, align 16
1637 %r = extractvalue { i128, i1 } %pair, 0
1641 define dso_local i128 @cmpxchg_i128_aligned_monotonic_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
1642 ; -O0-LABEL: cmpxchg_i128_aligned_monotonic_seq_cst_weak:
1643 ; -O0: ldaxp x0, x1, [x4]
1646 ; -O0: stlxp w8, x2, x3, [x4]
1647 ; -O0: stlxp w8, x0, x1, [x4]
1649 ; -O1-LABEL: cmpxchg_i128_aligned_monotonic_seq_cst_weak:
1650 ; -O1: bl __aarch64_cas16_acq_rel
1651 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new monotonic seq_cst, align 16
1652 %r = extractvalue { i128, i1 } %pair, 0
1656 define dso_local i128 @cmpxchg_i128_aligned_acquire_monotonic(i128 %expected, i128 %new, ptr %ptr) {
1657 ; -O0-LABEL: cmpxchg_i128_aligned_acquire_monotonic:
1658 ; -O0: ldaxp x0, x1, [x4]
1661 ; -O0: stxp w8, x2, x3, [x4]
1662 ; -O0: stxp w8, x0, x1, [x4]
1664 ; -O1-LABEL: cmpxchg_i128_aligned_acquire_monotonic:
1665 ; -O1: bl __aarch64_cas16_acq
1666 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acquire monotonic, align 16
1667 %r = extractvalue { i128, i1 } %pair, 0
1671 define dso_local i128 @cmpxchg_i128_aligned_acquire_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
1672 ; -O0-LABEL: cmpxchg_i128_aligned_acquire_monotonic_weak:
1673 ; -O0: ldaxp x0, x1, [x4]
1676 ; -O0: stxp w8, x2, x3, [x4]
1677 ; -O0: stxp w8, x0, x1, [x4]
1679 ; -O1-LABEL: cmpxchg_i128_aligned_acquire_monotonic_weak:
1680 ; -O1: bl __aarch64_cas16_acq
1681 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acquire monotonic, align 16
1682 %r = extractvalue { i128, i1 } %pair, 0
1686 define dso_local i128 @cmpxchg_i128_aligned_acquire_acquire(i128 %expected, i128 %new, ptr %ptr) {
1687 ; -O0-LABEL: cmpxchg_i128_aligned_acquire_acquire:
1688 ; -O0: ldaxp x0, x1, [x4]
1691 ; -O0: stxp w8, x2, x3, [x4]
1692 ; -O0: stxp w8, x0, x1, [x4]
1694 ; -O1-LABEL: cmpxchg_i128_aligned_acquire_acquire:
1695 ; -O1: bl __aarch64_cas16_acq
1696 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acquire acquire, align 16
1697 %r = extractvalue { i128, i1 } %pair, 0
1701 define dso_local i128 @cmpxchg_i128_aligned_acquire_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
1702 ; -O0-LABEL: cmpxchg_i128_aligned_acquire_acquire_weak:
1703 ; -O0: ldaxp x0, x1, [x4]
1706 ; -O0: stxp w8, x2, x3, [x4]
1707 ; -O0: stxp w8, x0, x1, [x4]
1709 ; -O1-LABEL: cmpxchg_i128_aligned_acquire_acquire_weak:
1710 ; -O1: bl __aarch64_cas16_acq
1711 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acquire acquire, align 16
1712 %r = extractvalue { i128, i1 } %pair, 0
1716 define dso_local i128 @cmpxchg_i128_aligned_acquire_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
1717 ; -O0-LABEL: cmpxchg_i128_aligned_acquire_seq_cst:
1718 ; -O0: ldaxp x0, x1, [x4]
1721 ; -O0: stlxp w8, x2, x3, [x4]
1722 ; -O0: stlxp w8, x0, x1, [x4]
1724 ; -O1-LABEL: cmpxchg_i128_aligned_acquire_seq_cst:
1725 ; -O1: bl __aarch64_cas16_acq_rel
1726 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acquire seq_cst, align 16
1727 %r = extractvalue { i128, i1 } %pair, 0
1731 define dso_local i128 @cmpxchg_i128_aligned_acquire_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
1732 ; -O0-LABEL: cmpxchg_i128_aligned_acquire_seq_cst_weak:
1733 ; -O0: ldaxp x0, x1, [x4]
1736 ; -O0: stlxp w8, x2, x3, [x4]
1737 ; -O0: stlxp w8, x0, x1, [x4]
1739 ; -O1-LABEL: cmpxchg_i128_aligned_acquire_seq_cst_weak:
1740 ; -O1: bl __aarch64_cas16_acq_rel
1741 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acquire seq_cst, align 16
1742 %r = extractvalue { i128, i1 } %pair, 0
1746 define dso_local i128 @cmpxchg_i128_aligned_release_monotonic(i128 %expected, i128 %new, ptr %ptr) {
1747 ; -O0-LABEL: cmpxchg_i128_aligned_release_monotonic:
1748 ; -O0: ldxp x0, x1, [x4]
1751 ; -O0: stlxp w8, x2, x3, [x4]
1752 ; -O0: stlxp w8, x0, x1, [x4]
1754 ; -O1-LABEL: cmpxchg_i128_aligned_release_monotonic:
1755 ; -O1: bl __aarch64_cas16_rel
1756 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new release monotonic, align 16
1757 %r = extractvalue { i128, i1 } %pair, 0
1761 define dso_local i128 @cmpxchg_i128_aligned_release_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
1762 ; -O0-LABEL: cmpxchg_i128_aligned_release_monotonic_weak:
1763 ; -O0: ldxp x0, x1, [x4]
1766 ; -O0: stlxp w8, x2, x3, [x4]
1767 ; -O0: stlxp w8, x0, x1, [x4]
1769 ; -O1-LABEL: cmpxchg_i128_aligned_release_monotonic_weak:
1770 ; -O1: bl __aarch64_cas16_rel
1771 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new release monotonic, align 16
1772 %r = extractvalue { i128, i1 } %pair, 0
1776 define dso_local i128 @cmpxchg_i128_aligned_release_acquire(i128 %expected, i128 %new, ptr %ptr) {
1777 ; -O0-LABEL: cmpxchg_i128_aligned_release_acquire:
1778 ; -O0: ldaxp x0, x1, [x4]
1781 ; -O0: stlxp w8, x2, x3, [x4]
1782 ; -O0: stlxp w8, x0, x1, [x4]
1784 ; -O1-LABEL: cmpxchg_i128_aligned_release_acquire:
1785 ; -O1: bl __aarch64_cas16_acq_rel
1786 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new release acquire, align 16
1787 %r = extractvalue { i128, i1 } %pair, 0
1791 define dso_local i128 @cmpxchg_i128_aligned_release_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
1792 ; -O0-LABEL: cmpxchg_i128_aligned_release_acquire_weak:
1793 ; -O0: ldaxp x0, x1, [x4]
1796 ; -O0: stlxp w8, x2, x3, [x4]
1797 ; -O0: stlxp w8, x0, x1, [x4]
1799 ; -O1-LABEL: cmpxchg_i128_aligned_release_acquire_weak:
1800 ; -O1: bl __aarch64_cas16_acq_rel
1801 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new release acquire, align 16
1802 %r = extractvalue { i128, i1 } %pair, 0
1806 define dso_local i128 @cmpxchg_i128_aligned_release_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
1807 ; -O0-LABEL: cmpxchg_i128_aligned_release_seq_cst:
1808 ; -O0: ldaxp x0, x1, [x4]
1811 ; -O0: stlxp w8, x2, x3, [x4]
1812 ; -O0: stlxp w8, x0, x1, [x4]
1814 ; -O1-LABEL: cmpxchg_i128_aligned_release_seq_cst:
1815 ; -O1: bl __aarch64_cas16_acq_rel
1816 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new release seq_cst, align 16
1817 %r = extractvalue { i128, i1 } %pair, 0
1821 define dso_local i128 @cmpxchg_i128_aligned_release_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
1822 ; -O0-LABEL: cmpxchg_i128_aligned_release_seq_cst_weak:
1823 ; -O0: ldaxp x0, x1, [x4]
1826 ; -O0: stlxp w8, x2, x3, [x4]
1827 ; -O0: stlxp w8, x0, x1, [x4]
1829 ; -O1-LABEL: cmpxchg_i128_aligned_release_seq_cst_weak:
1830 ; -O1: bl __aarch64_cas16_acq_rel
1831 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new release seq_cst, align 16
1832 %r = extractvalue { i128, i1 } %pair, 0
1836 define dso_local i128 @cmpxchg_i128_aligned_acq_rel_monotonic(i128 %expected, i128 %new, ptr %ptr) {
1837 ; -O0-LABEL: cmpxchg_i128_aligned_acq_rel_monotonic:
1838 ; -O0: ldaxp x0, x1, [x4]
1841 ; -O0: stlxp w8, x2, x3, [x4]
1842 ; -O0: stlxp w8, x0, x1, [x4]
1844 ; -O1-LABEL: cmpxchg_i128_aligned_acq_rel_monotonic:
1845 ; -O1: bl __aarch64_cas16_acq_rel
1846 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acq_rel monotonic, align 16
1847 %r = extractvalue { i128, i1 } %pair, 0
1851 define dso_local i128 @cmpxchg_i128_aligned_acq_rel_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
1852 ; -O0-LABEL: cmpxchg_i128_aligned_acq_rel_monotonic_weak:
1853 ; -O0: ldaxp x0, x1, [x4]
1856 ; -O0: stlxp w8, x2, x3, [x4]
1857 ; -O0: stlxp w8, x0, x1, [x4]
1859 ; -O1-LABEL: cmpxchg_i128_aligned_acq_rel_monotonic_weak:
1860 ; -O1: bl __aarch64_cas16_acq_rel
1861 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acq_rel monotonic, align 16
1862 %r = extractvalue { i128, i1 } %pair, 0
1866 define dso_local i128 @cmpxchg_i128_aligned_acq_rel_acquire(i128 %expected, i128 %new, ptr %ptr) {
1867 ; -O0-LABEL: cmpxchg_i128_aligned_acq_rel_acquire:
1868 ; -O0: ldaxp x0, x1, [x4]
1871 ; -O0: stlxp w8, x2, x3, [x4]
1872 ; -O0: stlxp w8, x0, x1, [x4]
1874 ; -O1-LABEL: cmpxchg_i128_aligned_acq_rel_acquire:
1875 ; -O1: bl __aarch64_cas16_acq_rel
1876 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acq_rel acquire, align 16
1877 %r = extractvalue { i128, i1 } %pair, 0
1881 define dso_local i128 @cmpxchg_i128_aligned_acq_rel_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
1882 ; -O0-LABEL: cmpxchg_i128_aligned_acq_rel_acquire_weak:
1883 ; -O0: ldaxp x0, x1, [x4]
1886 ; -O0: stlxp w8, x2, x3, [x4]
1887 ; -O0: stlxp w8, x0, x1, [x4]
1889 ; -O1-LABEL: cmpxchg_i128_aligned_acq_rel_acquire_weak:
1890 ; -O1: bl __aarch64_cas16_acq_rel
1891 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acq_rel acquire, align 16
1892 %r = extractvalue { i128, i1 } %pair, 0
1896 define dso_local i128 @cmpxchg_i128_aligned_acq_rel_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
1897 ; -O0-LABEL: cmpxchg_i128_aligned_acq_rel_seq_cst:
1898 ; -O0: ldaxp x0, x1, [x4]
1901 ; -O0: stlxp w8, x2, x3, [x4]
1902 ; -O0: stlxp w8, x0, x1, [x4]
1904 ; -O1-LABEL: cmpxchg_i128_aligned_acq_rel_seq_cst:
1905 ; -O1: bl __aarch64_cas16_acq_rel
1906 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acq_rel seq_cst, align 16
1907 %r = extractvalue { i128, i1 } %pair, 0
1911 define dso_local i128 @cmpxchg_i128_aligned_acq_rel_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
1912 ; -O0-LABEL: cmpxchg_i128_aligned_acq_rel_seq_cst_weak:
1913 ; -O0: ldaxp x0, x1, [x4]
1916 ; -O0: stlxp w8, x2, x3, [x4]
1917 ; -O0: stlxp w8, x0, x1, [x4]
1919 ; -O1-LABEL: cmpxchg_i128_aligned_acq_rel_seq_cst_weak:
1920 ; -O1: bl __aarch64_cas16_acq_rel
1921 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acq_rel seq_cst, align 16
1922 %r = extractvalue { i128, i1 } %pair, 0
1926 define dso_local i128 @cmpxchg_i128_aligned_seq_cst_monotonic(i128 %expected, i128 %new, ptr %ptr) {
1927 ; -O0-LABEL: cmpxchg_i128_aligned_seq_cst_monotonic:
1928 ; -O0: ldaxp x0, x1, [x4]
1931 ; -O0: stlxp w8, x2, x3, [x4]
1932 ; -O0: stlxp w8, x0, x1, [x4]
1934 ; -O1-LABEL: cmpxchg_i128_aligned_seq_cst_monotonic:
1935 ; -O1: bl __aarch64_cas16_acq_rel
1936 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new seq_cst monotonic, align 16
1937 %r = extractvalue { i128, i1 } %pair, 0
1941 define dso_local i128 @cmpxchg_i128_aligned_seq_cst_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
1942 ; -O0-LABEL: cmpxchg_i128_aligned_seq_cst_monotonic_weak:
1943 ; -O0: ldaxp x0, x1, [x4]
1946 ; -O0: stlxp w8, x2, x3, [x4]
1947 ; -O0: stlxp w8, x0, x1, [x4]
1949 ; -O1-LABEL: cmpxchg_i128_aligned_seq_cst_monotonic_weak:
1950 ; -O1: bl __aarch64_cas16_acq_rel
1951 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new seq_cst monotonic, align 16
1952 %r = extractvalue { i128, i1 } %pair, 0
1956 define dso_local i128 @cmpxchg_i128_aligned_seq_cst_acquire(i128 %expected, i128 %new, ptr %ptr) {
1957 ; -O0-LABEL: cmpxchg_i128_aligned_seq_cst_acquire:
1958 ; -O0: ldaxp x0, x1, [x4]
1961 ; -O0: stlxp w8, x2, x3, [x4]
1962 ; -O0: stlxp w8, x0, x1, [x4]
1964 ; -O1-LABEL: cmpxchg_i128_aligned_seq_cst_acquire:
1965 ; -O1: bl __aarch64_cas16_acq_rel
1966 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new seq_cst acquire, align 16
1967 %r = extractvalue { i128, i1 } %pair, 0
1971 define dso_local i128 @cmpxchg_i128_aligned_seq_cst_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
1972 ; -O0-LABEL: cmpxchg_i128_aligned_seq_cst_acquire_weak:
1973 ; -O0: ldaxp x0, x1, [x4]
1976 ; -O0: stlxp w8, x2, x3, [x4]
1977 ; -O0: stlxp w8, x0, x1, [x4]
1979 ; -O1-LABEL: cmpxchg_i128_aligned_seq_cst_acquire_weak:
1980 ; -O1: bl __aarch64_cas16_acq_rel
1981 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new seq_cst acquire, align 16
1982 %r = extractvalue { i128, i1 } %pair, 0
1986 define dso_local i128 @cmpxchg_i128_aligned_seq_cst_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
1987 ; -O0-LABEL: cmpxchg_i128_aligned_seq_cst_seq_cst:
1988 ; -O0: ldaxp x0, x1, [x4]
1991 ; -O0: stlxp w8, x2, x3, [x4]
1992 ; -O0: stlxp w8, x0, x1, [x4]
1994 ; -O1-LABEL: cmpxchg_i128_aligned_seq_cst_seq_cst:
1995 ; -O1: bl __aarch64_cas16_acq_rel
1996 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new seq_cst seq_cst, align 16
1997 %r = extractvalue { i128, i1 } %pair, 0
2001 define dso_local i128 @cmpxchg_i128_aligned_seq_cst_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
2002 ; -O0-LABEL: cmpxchg_i128_aligned_seq_cst_seq_cst_weak:
2003 ; -O0: ldaxp x0, x1, [x4]
2006 ; -O0: stlxp w8, x2, x3, [x4]
2007 ; -O0: stlxp w8, x0, x1, [x4]
2009 ; -O1-LABEL: cmpxchg_i128_aligned_seq_cst_seq_cst_weak:
2010 ; -O1: bl __aarch64_cas16_acq_rel
2011 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new seq_cst seq_cst, align 16
2012 %r = extractvalue { i128, i1 } %pair, 0
2016 define dso_local i8 @cmpxchg_i8_unaligned_monotonic_monotonic(i8 %expected, i8 %new, ptr %ptr) {
2017 ; -O0-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic:
2018 ; -O0: ldaxrb w0, [x2]
2019 ; -O0: cmp w0, w9, uxtb
2020 ; -O0: stlxrb w8, w1, [x2]
2022 ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic:
2023 ; -O1: bl __aarch64_cas1_relax
2024 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1
2025 %r = extractvalue { i8, i1 } %pair, 0
2029 define dso_local i8 @cmpxchg_i8_unaligned_monotonic_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
2030 ; -O0-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak:
2031 ; -O0: ldaxrb w0, [x2]
2032 ; -O0: cmp w0, w9, uxtb
2033 ; -O0: stlxrb w8, w1, [x2]
2035 ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_monotonic_weak:
2036 ; -O1: bl __aarch64_cas1_relax
2037 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic monotonic, align 1
2038 %r = extractvalue { i8, i1 } %pair, 0
2042 define dso_local i8 @cmpxchg_i8_unaligned_monotonic_acquire(i8 %expected, i8 %new, ptr %ptr) {
2043 ; -O0-LABEL: cmpxchg_i8_unaligned_monotonic_acquire:
2044 ; -O0: ldaxrb w0, [x2]
2045 ; -O0: cmp w0, w9, uxtb
2046 ; -O0: stlxrb w8, w1, [x2]
2048 ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire:
2049 ; -O1: bl __aarch64_cas1_acq
2050 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1
2051 %r = extractvalue { i8, i1 } %pair, 0
2055 define dso_local i8 @cmpxchg_i8_unaligned_monotonic_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
2056 ; -O0-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak:
2057 ; -O0: ldaxrb w0, [x2]
2058 ; -O0: cmp w0, w9, uxtb
2059 ; -O0: stlxrb w8, w1, [x2]
2061 ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_acquire_weak:
2062 ; -O1: bl __aarch64_cas1_acq
2063 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic acquire, align 1
2064 %r = extractvalue { i8, i1 } %pair, 0
2068 define dso_local i8 @cmpxchg_i8_unaligned_monotonic_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
2069 ; -O0-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst:
2070 ; -O0: ldaxrb w0, [x2]
2071 ; -O0: cmp w0, w9, uxtb
2072 ; -O0: stlxrb w8, w1, [x2]
2074 ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst:
2075 ; -O1: bl __aarch64_cas1_acq_rel
2076 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1
2077 %r = extractvalue { i8, i1 } %pair, 0
2081 define dso_local i8 @cmpxchg_i8_unaligned_monotonic_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
2082 ; -O0-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak:
2083 ; -O0: ldaxrb w0, [x2]
2084 ; -O0: cmp w0, w9, uxtb
2085 ; -O0: stlxrb w8, w1, [x2]
2087 ; -O1-LABEL: cmpxchg_i8_unaligned_monotonic_seq_cst_weak:
2088 ; -O1: bl __aarch64_cas1_acq_rel
2089 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new monotonic seq_cst, align 1
2090 %r = extractvalue { i8, i1 } %pair, 0
2094 define dso_local i8 @cmpxchg_i8_unaligned_acquire_monotonic(i8 %expected, i8 %new, ptr %ptr) {
2095 ; -O0-LABEL: cmpxchg_i8_unaligned_acquire_monotonic:
2096 ; -O0: ldaxrb w0, [x2]
2097 ; -O0: cmp w0, w9, uxtb
2098 ; -O0: stlxrb w8, w1, [x2]
2100 ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic:
2101 ; -O1: bl __aarch64_cas1_acq
2102 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1
2103 %r = extractvalue { i8, i1 } %pair, 0
2107 define dso_local i8 @cmpxchg_i8_unaligned_acquire_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
2108 ; -O0-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak:
2109 ; -O0: ldaxrb w0, [x2]
2110 ; -O0: cmp w0, w9, uxtb
2111 ; -O0: stlxrb w8, w1, [x2]
2113 ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_monotonic_weak:
2114 ; -O1: bl __aarch64_cas1_acq
2115 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire monotonic, align 1
2116 %r = extractvalue { i8, i1 } %pair, 0
2120 define dso_local i8 @cmpxchg_i8_unaligned_acquire_acquire(i8 %expected, i8 %new, ptr %ptr) {
2121 ; -O0-LABEL: cmpxchg_i8_unaligned_acquire_acquire:
2122 ; -O0: ldaxrb w0, [x2]
2123 ; -O0: cmp w0, w9, uxtb
2124 ; -O0: stlxrb w8, w1, [x2]
2126 ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire:
2127 ; -O1: bl __aarch64_cas1_acq
2128 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1
2129 %r = extractvalue { i8, i1 } %pair, 0
2133 define dso_local i8 @cmpxchg_i8_unaligned_acquire_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
2134 ; -O0-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak:
2135 ; -O0: ldaxrb w0, [x2]
2136 ; -O0: cmp w0, w9, uxtb
2137 ; -O0: stlxrb w8, w1, [x2]
2139 ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_acquire_weak:
2140 ; -O1: bl __aarch64_cas1_acq
2141 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire acquire, align 1
2142 %r = extractvalue { i8, i1 } %pair, 0
2146 define dso_local i8 @cmpxchg_i8_unaligned_acquire_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
2147 ; -O0-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst:
2148 ; -O0: ldaxrb w0, [x2]
2149 ; -O0: cmp w0, w9, uxtb
2150 ; -O0: stlxrb w8, w1, [x2]
2152 ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst:
2153 ; -O1: bl __aarch64_cas1_acq_rel
2154 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1
2155 %r = extractvalue { i8, i1 } %pair, 0
2159 define dso_local i8 @cmpxchg_i8_unaligned_acquire_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
2160 ; -O0-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak:
2161 ; -O0: ldaxrb w0, [x2]
2162 ; -O0: cmp w0, w9, uxtb
2163 ; -O0: stlxrb w8, w1, [x2]
2165 ; -O1-LABEL: cmpxchg_i8_unaligned_acquire_seq_cst_weak:
2166 ; -O1: bl __aarch64_cas1_acq_rel
2167 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acquire seq_cst, align 1
2168 %r = extractvalue { i8, i1 } %pair, 0
2172 define dso_local i8 @cmpxchg_i8_unaligned_release_monotonic(i8 %expected, i8 %new, ptr %ptr) {
2173 ; -O0-LABEL: cmpxchg_i8_unaligned_release_monotonic:
2174 ; -O0: ldaxrb w0, [x2]
2175 ; -O0: cmp w0, w9, uxtb
2176 ; -O0: stlxrb w8, w1, [x2]
2178 ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic:
2179 ; -O1: bl __aarch64_cas1_rel
2180 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new release monotonic, align 1
2181 %r = extractvalue { i8, i1 } %pair, 0
2185 define dso_local i8 @cmpxchg_i8_unaligned_release_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
2186 ; -O0-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak:
2187 ; -O0: ldaxrb w0, [x2]
2188 ; -O0: cmp w0, w9, uxtb
2189 ; -O0: stlxrb w8, w1, [x2]
2191 ; -O1-LABEL: cmpxchg_i8_unaligned_release_monotonic_weak:
2192 ; -O1: bl __aarch64_cas1_rel
2193 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release monotonic, align 1
2194 %r = extractvalue { i8, i1 } %pair, 0
2198 define dso_local i8 @cmpxchg_i8_unaligned_release_acquire(i8 %expected, i8 %new, ptr %ptr) {
2199 ; -O0-LABEL: cmpxchg_i8_unaligned_release_acquire:
2200 ; -O0: ldaxrb w0, [x2]
2201 ; -O0: cmp w0, w9, uxtb
2202 ; -O0: stlxrb w8, w1, [x2]
2204 ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire:
2205 ; -O1: bl __aarch64_cas1_acq_rel
2206 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new release acquire, align 1
2207 %r = extractvalue { i8, i1 } %pair, 0
2211 define dso_local i8 @cmpxchg_i8_unaligned_release_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
2212 ; -O0-LABEL: cmpxchg_i8_unaligned_release_acquire_weak:
2213 ; -O0: ldaxrb w0, [x2]
2214 ; -O0: cmp w0, w9, uxtb
2215 ; -O0: stlxrb w8, w1, [x2]
2217 ; -O1-LABEL: cmpxchg_i8_unaligned_release_acquire_weak:
2218 ; -O1: bl __aarch64_cas1_acq_rel
2219 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release acquire, align 1
2220 %r = extractvalue { i8, i1 } %pair, 0
2224 define dso_local i8 @cmpxchg_i8_unaligned_release_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
2225 ; -O0-LABEL: cmpxchg_i8_unaligned_release_seq_cst:
2226 ; -O0: ldaxrb w0, [x2]
2227 ; -O0: cmp w0, w9, uxtb
2228 ; -O0: stlxrb w8, w1, [x2]
2230 ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst:
2231 ; -O1: bl __aarch64_cas1_acq_rel
2232 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1
2233 %r = extractvalue { i8, i1 } %pair, 0
2237 define dso_local i8 @cmpxchg_i8_unaligned_release_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
2238 ; -O0-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak:
2239 ; -O0: ldaxrb w0, [x2]
2240 ; -O0: cmp w0, w9, uxtb
2241 ; -O0: stlxrb w8, w1, [x2]
2243 ; -O1-LABEL: cmpxchg_i8_unaligned_release_seq_cst_weak:
2244 ; -O1: bl __aarch64_cas1_acq_rel
2245 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new release seq_cst, align 1
2246 %r = extractvalue { i8, i1 } %pair, 0
2250 define dso_local i8 @cmpxchg_i8_unaligned_acq_rel_monotonic(i8 %expected, i8 %new, ptr %ptr) {
2251 ; -O0-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic:
2252 ; -O0: ldaxrb w0, [x2]
2253 ; -O0: cmp w0, w9, uxtb
2254 ; -O0: stlxrb w8, w1, [x2]
2256 ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic:
2257 ; -O1: bl __aarch64_cas1_acq_rel
2258 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1
2259 %r = extractvalue { i8, i1 } %pair, 0
2263 define dso_local i8 @cmpxchg_i8_unaligned_acq_rel_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
2264 ; -O0-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak:
2265 ; -O0: ldaxrb w0, [x2]
2266 ; -O0: cmp w0, w9, uxtb
2267 ; -O0: stlxrb w8, w1, [x2]
2269 ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_monotonic_weak:
2270 ; -O1: bl __aarch64_cas1_acq_rel
2271 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel monotonic, align 1
2272 %r = extractvalue { i8, i1 } %pair, 0
2276 define dso_local i8 @cmpxchg_i8_unaligned_acq_rel_acquire(i8 %expected, i8 %new, ptr %ptr) {
2277 ; -O0-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire:
2278 ; -O0: ldaxrb w0, [x2]
2279 ; -O0: cmp w0, w9, uxtb
2280 ; -O0: stlxrb w8, w1, [x2]
2282 ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire:
2283 ; -O1: bl __aarch64_cas1_acq_rel
2284 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1
2285 %r = extractvalue { i8, i1 } %pair, 0
2289 define dso_local i8 @cmpxchg_i8_unaligned_acq_rel_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
2290 ; -O0-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak:
2291 ; -O0: ldaxrb w0, [x2]
2292 ; -O0: cmp w0, w9, uxtb
2293 ; -O0: stlxrb w8, w1, [x2]
2295 ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_acquire_weak:
2296 ; -O1: bl __aarch64_cas1_acq_rel
2297 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel acquire, align 1
2298 %r = extractvalue { i8, i1 } %pair, 0
2302 define dso_local i8 @cmpxchg_i8_unaligned_acq_rel_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
2303 ; -O0-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst:
2304 ; -O0: ldaxrb w0, [x2]
2305 ; -O0: cmp w0, w9, uxtb
2306 ; -O0: stlxrb w8, w1, [x2]
2308 ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst:
2309 ; -O1: bl __aarch64_cas1_acq_rel
2310 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1
2311 %r = extractvalue { i8, i1 } %pair, 0
2315 define dso_local i8 @cmpxchg_i8_unaligned_acq_rel_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
2316 ; -O0-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak:
2317 ; -O0: ldaxrb w0, [x2]
2318 ; -O0: cmp w0, w9, uxtb
2319 ; -O0: stlxrb w8, w1, [x2]
2321 ; -O1-LABEL: cmpxchg_i8_unaligned_acq_rel_seq_cst_weak:
2322 ; -O1: bl __aarch64_cas1_acq_rel
2323 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new acq_rel seq_cst, align 1
2324 %r = extractvalue { i8, i1 } %pair, 0
2328 define dso_local i8 @cmpxchg_i8_unaligned_seq_cst_monotonic(i8 %expected, i8 %new, ptr %ptr) {
2329 ; -O0-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic:
2330 ; -O0: ldaxrb w0, [x2]
2331 ; -O0: cmp w0, w9, uxtb
2332 ; -O0: stlxrb w8, w1, [x2]
2334 ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic:
2335 ; -O1: bl __aarch64_cas1_acq_rel
2336 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1
2337 %r = extractvalue { i8, i1 } %pair, 0
2341 define dso_local i8 @cmpxchg_i8_unaligned_seq_cst_monotonic_weak(i8 %expected, i8 %new, ptr %ptr) {
2342 ; -O0-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak:
2343 ; -O0: ldaxrb w0, [x2]
2344 ; -O0: cmp w0, w9, uxtb
2345 ; -O0: stlxrb w8, w1, [x2]
2347 ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_monotonic_weak:
2348 ; -O1: bl __aarch64_cas1_acq_rel
2349 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst monotonic, align 1
2350 %r = extractvalue { i8, i1 } %pair, 0
2354 define dso_local i8 @cmpxchg_i8_unaligned_seq_cst_acquire(i8 %expected, i8 %new, ptr %ptr) {
2355 ; -O0-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire:
2356 ; -O0: ldaxrb w0, [x2]
2357 ; -O0: cmp w0, w9, uxtb
2358 ; -O0: stlxrb w8, w1, [x2]
2360 ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire:
2361 ; -O1: bl __aarch64_cas1_acq_rel
2362 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1
2363 %r = extractvalue { i8, i1 } %pair, 0
2367 define dso_local i8 @cmpxchg_i8_unaligned_seq_cst_acquire_weak(i8 %expected, i8 %new, ptr %ptr) {
2368 ; -O0-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak:
2369 ; -O0: ldaxrb w0, [x2]
2370 ; -O0: cmp w0, w9, uxtb
2371 ; -O0: stlxrb w8, w1, [x2]
2373 ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_acquire_weak:
2374 ; -O1: bl __aarch64_cas1_acq_rel
2375 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst acquire, align 1
2376 %r = extractvalue { i8, i1 } %pair, 0
2380 define dso_local i8 @cmpxchg_i8_unaligned_seq_cst_seq_cst(i8 %expected, i8 %new, ptr %ptr) {
2381 ; -O0-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst:
2382 ; -O0: ldaxrb w0, [x2]
2383 ; -O0: cmp w0, w9, uxtb
2384 ; -O0: stlxrb w8, w1, [x2]
2386 ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst:
2387 ; -O1: bl __aarch64_cas1_acq_rel
2388 %pair = cmpxchg ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1
2389 %r = extractvalue { i8, i1 } %pair, 0
2393 define dso_local i8 @cmpxchg_i8_unaligned_seq_cst_seq_cst_weak(i8 %expected, i8 %new, ptr %ptr) {
2394 ; -O0-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak:
2395 ; -O0: ldaxrb w0, [x2]
2396 ; -O0: cmp w0, w9, uxtb
2397 ; -O0: stlxrb w8, w1, [x2]
2399 ; -O1-LABEL: cmpxchg_i8_unaligned_seq_cst_seq_cst_weak:
2400 ; -O1: bl __aarch64_cas1_acq_rel
2401 %pair = cmpxchg weak ptr %ptr, i8 %expected, i8 %new seq_cst seq_cst, align 1
2402 %r = extractvalue { i8, i1 } %pair, 0
2406 define dso_local i16 @cmpxchg_i16_unaligned_monotonic_monotonic(i16 %expected, i16 %new, ptr %ptr) {
2407 ; CHECK-LABEL: cmpxchg_i16_unaligned_monotonic_monotonic:
2408 ; CHECK: bl __atomic_compare_exchange
2409 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 1
2410 %r = extractvalue { i16, i1 } %pair, 0
2414 define dso_local i16 @cmpxchg_i16_unaligned_monotonic_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
2415 ; CHECK-LABEL: cmpxchg_i16_unaligned_monotonic_monotonic_weak:
2416 ; CHECK: bl __atomic_compare_exchange
2417 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic monotonic, align 1
2418 %r = extractvalue { i16, i1 } %pair, 0
2422 define dso_local i16 @cmpxchg_i16_unaligned_monotonic_acquire(i16 %expected, i16 %new, ptr %ptr) {
2423 ; CHECK-LABEL: cmpxchg_i16_unaligned_monotonic_acquire:
2424 ; CHECK: bl __atomic_compare_exchange
2425 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 1
2426 %r = extractvalue { i16, i1 } %pair, 0
2430 define dso_local i16 @cmpxchg_i16_unaligned_monotonic_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
2431 ; CHECK-LABEL: cmpxchg_i16_unaligned_monotonic_acquire_weak:
2432 ; CHECK: bl __atomic_compare_exchange
2433 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic acquire, align 1
2434 %r = extractvalue { i16, i1 } %pair, 0
2438 define dso_local i16 @cmpxchg_i16_unaligned_monotonic_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
2439 ; CHECK-LABEL: cmpxchg_i16_unaligned_monotonic_seq_cst:
2440 ; CHECK: bl __atomic_compare_exchange
2441 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 1
2442 %r = extractvalue { i16, i1 } %pair, 0
2446 define dso_local i16 @cmpxchg_i16_unaligned_monotonic_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
2447 ; CHECK-LABEL: cmpxchg_i16_unaligned_monotonic_seq_cst_weak:
2448 ; CHECK: bl __atomic_compare_exchange
2449 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new monotonic seq_cst, align 1
2450 %r = extractvalue { i16, i1 } %pair, 0
2454 define dso_local i16 @cmpxchg_i16_unaligned_acquire_monotonic(i16 %expected, i16 %new, ptr %ptr) {
2455 ; CHECK-LABEL: cmpxchg_i16_unaligned_acquire_monotonic:
2456 ; CHECK: bl __atomic_compare_exchange
2457 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 1
2458 %r = extractvalue { i16, i1 } %pair, 0
2462 define dso_local i16 @cmpxchg_i16_unaligned_acquire_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
2463 ; CHECK-LABEL: cmpxchg_i16_unaligned_acquire_monotonic_weak:
2464 ; CHECK: bl __atomic_compare_exchange
2465 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire monotonic, align 1
2466 %r = extractvalue { i16, i1 } %pair, 0
2470 define dso_local i16 @cmpxchg_i16_unaligned_acquire_acquire(i16 %expected, i16 %new, ptr %ptr) {
2471 ; CHECK-LABEL: cmpxchg_i16_unaligned_acquire_acquire:
2472 ; CHECK: bl __atomic_compare_exchange
2473 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acquire acquire, align 1
2474 %r = extractvalue { i16, i1 } %pair, 0
2478 define dso_local i16 @cmpxchg_i16_unaligned_acquire_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
2479 ; CHECK-LABEL: cmpxchg_i16_unaligned_acquire_acquire_weak:
2480 ; CHECK: bl __atomic_compare_exchange
2481 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire acquire, align 1
2482 %r = extractvalue { i16, i1 } %pair, 0
2486 define dso_local i16 @cmpxchg_i16_unaligned_acquire_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
2487 ; CHECK-LABEL: cmpxchg_i16_unaligned_acquire_seq_cst:
2488 ; CHECK: bl __atomic_compare_exchange
2489 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 1
2490 %r = extractvalue { i16, i1 } %pair, 0
2494 define dso_local i16 @cmpxchg_i16_unaligned_acquire_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
2495 ; CHECK-LABEL: cmpxchg_i16_unaligned_acquire_seq_cst_weak:
2496 ; CHECK: bl __atomic_compare_exchange
2497 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acquire seq_cst, align 1
2498 %r = extractvalue { i16, i1 } %pair, 0
2502 define dso_local i16 @cmpxchg_i16_unaligned_release_monotonic(i16 %expected, i16 %new, ptr %ptr) {
2503 ; CHECK-LABEL: cmpxchg_i16_unaligned_release_monotonic:
2504 ; CHECK: bl __atomic_compare_exchange
2505 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new release monotonic, align 1
2506 %r = extractvalue { i16, i1 } %pair, 0
2510 define dso_local i16 @cmpxchg_i16_unaligned_release_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
2511 ; CHECK-LABEL: cmpxchg_i16_unaligned_release_monotonic_weak:
2512 ; CHECK: bl __atomic_compare_exchange
2513 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release monotonic, align 1
2514 %r = extractvalue { i16, i1 } %pair, 0
2518 define dso_local i16 @cmpxchg_i16_unaligned_release_acquire(i16 %expected, i16 %new, ptr %ptr) {
2519 ; CHECK-LABEL: cmpxchg_i16_unaligned_release_acquire:
2520 ; CHECK: bl __atomic_compare_exchange
2521 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new release acquire, align 1
2522 %r = extractvalue { i16, i1 } %pair, 0
2526 define dso_local i16 @cmpxchg_i16_unaligned_release_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
2527 ; CHECK-LABEL: cmpxchg_i16_unaligned_release_acquire_weak:
2528 ; CHECK: bl __atomic_compare_exchange
2529 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release acquire, align 1
2530 %r = extractvalue { i16, i1 } %pair, 0
2534 define dso_local i16 @cmpxchg_i16_unaligned_release_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
2535 ; CHECK-LABEL: cmpxchg_i16_unaligned_release_seq_cst:
2536 ; CHECK: bl __atomic_compare_exchange
2537 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new release seq_cst, align 1
2538 %r = extractvalue { i16, i1 } %pair, 0
2542 define dso_local i16 @cmpxchg_i16_unaligned_release_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
2543 ; CHECK-LABEL: cmpxchg_i16_unaligned_release_seq_cst_weak:
2544 ; CHECK: bl __atomic_compare_exchange
2545 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new release seq_cst, align 1
2546 %r = extractvalue { i16, i1 } %pair, 0
2550 define dso_local i16 @cmpxchg_i16_unaligned_acq_rel_monotonic(i16 %expected, i16 %new, ptr %ptr) {
2551 ; CHECK-LABEL: cmpxchg_i16_unaligned_acq_rel_monotonic:
2552 ; CHECK: bl __atomic_compare_exchange
2553 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 1
2554 %r = extractvalue { i16, i1 } %pair, 0
2558 define dso_local i16 @cmpxchg_i16_unaligned_acq_rel_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
2559 ; CHECK-LABEL: cmpxchg_i16_unaligned_acq_rel_monotonic_weak:
2560 ; CHECK: bl __atomic_compare_exchange
2561 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel monotonic, align 1
2562 %r = extractvalue { i16, i1 } %pair, 0
2566 define dso_local i16 @cmpxchg_i16_unaligned_acq_rel_acquire(i16 %expected, i16 %new, ptr %ptr) {
2567 ; CHECK-LABEL: cmpxchg_i16_unaligned_acq_rel_acquire:
2568 ; CHECK: bl __atomic_compare_exchange
2569 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 1
2570 %r = extractvalue { i16, i1 } %pair, 0
2574 define dso_local i16 @cmpxchg_i16_unaligned_acq_rel_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
2575 ; CHECK-LABEL: cmpxchg_i16_unaligned_acq_rel_acquire_weak:
2576 ; CHECK: bl __atomic_compare_exchange
2577 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel acquire, align 1
2578 %r = extractvalue { i16, i1 } %pair, 0
2582 define dso_local i16 @cmpxchg_i16_unaligned_acq_rel_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
2583 ; CHECK-LABEL: cmpxchg_i16_unaligned_acq_rel_seq_cst:
2584 ; CHECK: bl __atomic_compare_exchange
2585 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 1
2586 %r = extractvalue { i16, i1 } %pair, 0
2590 define dso_local i16 @cmpxchg_i16_unaligned_acq_rel_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
2591 ; CHECK-LABEL: cmpxchg_i16_unaligned_acq_rel_seq_cst_weak:
2592 ; CHECK: bl __atomic_compare_exchange
2593 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new acq_rel seq_cst, align 1
2594 %r = extractvalue { i16, i1 } %pair, 0
2598 define dso_local i16 @cmpxchg_i16_unaligned_seq_cst_monotonic(i16 %expected, i16 %new, ptr %ptr) {
2599 ; CHECK-LABEL: cmpxchg_i16_unaligned_seq_cst_monotonic:
2600 ; CHECK: bl __atomic_compare_exchange
2601 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 1
2602 %r = extractvalue { i16, i1 } %pair, 0
2606 define dso_local i16 @cmpxchg_i16_unaligned_seq_cst_monotonic_weak(i16 %expected, i16 %new, ptr %ptr) {
2607 ; CHECK-LABEL: cmpxchg_i16_unaligned_seq_cst_monotonic_weak:
2608 ; CHECK: bl __atomic_compare_exchange
2609 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst monotonic, align 1
2610 %r = extractvalue { i16, i1 } %pair, 0
2614 define dso_local i16 @cmpxchg_i16_unaligned_seq_cst_acquire(i16 %expected, i16 %new, ptr %ptr) {
2615 ; CHECK-LABEL: cmpxchg_i16_unaligned_seq_cst_acquire:
2616 ; CHECK: bl __atomic_compare_exchange
2617 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 1
2618 %r = extractvalue { i16, i1 } %pair, 0
2622 define dso_local i16 @cmpxchg_i16_unaligned_seq_cst_acquire_weak(i16 %expected, i16 %new, ptr %ptr) {
2623 ; CHECK-LABEL: cmpxchg_i16_unaligned_seq_cst_acquire_weak:
2624 ; CHECK: bl __atomic_compare_exchange
2625 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst acquire, align 1
2626 %r = extractvalue { i16, i1 } %pair, 0
2630 define dso_local i16 @cmpxchg_i16_unaligned_seq_cst_seq_cst(i16 %expected, i16 %new, ptr %ptr) {
2631 ; CHECK-LABEL: cmpxchg_i16_unaligned_seq_cst_seq_cst:
2632 ; CHECK: bl __atomic_compare_exchange
2633 %pair = cmpxchg ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 1
2634 %r = extractvalue { i16, i1 } %pair, 0
2638 define dso_local i16 @cmpxchg_i16_unaligned_seq_cst_seq_cst_weak(i16 %expected, i16 %new, ptr %ptr) {
2639 ; CHECK-LABEL: cmpxchg_i16_unaligned_seq_cst_seq_cst_weak:
2640 ; CHECK: bl __atomic_compare_exchange
2641 %pair = cmpxchg weak ptr %ptr, i16 %expected, i16 %new seq_cst seq_cst, align 1
2642 %r = extractvalue { i16, i1 } %pair, 0
2646 define dso_local i32 @cmpxchg_i32_unaligned_monotonic_monotonic(i32 %expected, i32 %new, ptr %ptr) {
2647 ; CHECK-LABEL: cmpxchg_i32_unaligned_monotonic_monotonic:
2648 ; CHECK: bl __atomic_compare_exchange
2649 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 1
2650 %r = extractvalue { i32, i1 } %pair, 0
2654 define dso_local i32 @cmpxchg_i32_unaligned_monotonic_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
2655 ; CHECK-LABEL: cmpxchg_i32_unaligned_monotonic_monotonic_weak:
2656 ; CHECK: bl __atomic_compare_exchange
2657 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic monotonic, align 1
2658 %r = extractvalue { i32, i1 } %pair, 0
2662 define dso_local i32 @cmpxchg_i32_unaligned_monotonic_acquire(i32 %expected, i32 %new, ptr %ptr) {
2663 ; CHECK-LABEL: cmpxchg_i32_unaligned_monotonic_acquire:
2664 ; CHECK: bl __atomic_compare_exchange
2665 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 1
2666 %r = extractvalue { i32, i1 } %pair, 0
2670 define dso_local i32 @cmpxchg_i32_unaligned_monotonic_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
2671 ; CHECK-LABEL: cmpxchg_i32_unaligned_monotonic_acquire_weak:
2672 ; CHECK: bl __atomic_compare_exchange
2673 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic acquire, align 1
2674 %r = extractvalue { i32, i1 } %pair, 0
2678 define dso_local i32 @cmpxchg_i32_unaligned_monotonic_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
2679 ; CHECK-LABEL: cmpxchg_i32_unaligned_monotonic_seq_cst:
2680 ; CHECK: bl __atomic_compare_exchange
2681 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 1
2682 %r = extractvalue { i32, i1 } %pair, 0
2686 define dso_local i32 @cmpxchg_i32_unaligned_monotonic_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
2687 ; CHECK-LABEL: cmpxchg_i32_unaligned_monotonic_seq_cst_weak:
2688 ; CHECK: bl __atomic_compare_exchange
2689 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new monotonic seq_cst, align 1
2690 %r = extractvalue { i32, i1 } %pair, 0
2694 define dso_local i32 @cmpxchg_i32_unaligned_acquire_monotonic(i32 %expected, i32 %new, ptr %ptr) {
2695 ; CHECK-LABEL: cmpxchg_i32_unaligned_acquire_monotonic:
2696 ; CHECK: bl __atomic_compare_exchange
2697 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 1
2698 %r = extractvalue { i32, i1 } %pair, 0
2702 define dso_local i32 @cmpxchg_i32_unaligned_acquire_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
2703 ; CHECK-LABEL: cmpxchg_i32_unaligned_acquire_monotonic_weak:
2704 ; CHECK: bl __atomic_compare_exchange
2705 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire monotonic, align 1
2706 %r = extractvalue { i32, i1 } %pair, 0
2710 define dso_local i32 @cmpxchg_i32_unaligned_acquire_acquire(i32 %expected, i32 %new, ptr %ptr) {
2711 ; CHECK-LABEL: cmpxchg_i32_unaligned_acquire_acquire:
2712 ; CHECK: bl __atomic_compare_exchange
2713 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acquire acquire, align 1
2714 %r = extractvalue { i32, i1 } %pair, 0
2718 define dso_local i32 @cmpxchg_i32_unaligned_acquire_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
2719 ; CHECK-LABEL: cmpxchg_i32_unaligned_acquire_acquire_weak:
2720 ; CHECK: bl __atomic_compare_exchange
2721 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire acquire, align 1
2722 %r = extractvalue { i32, i1 } %pair, 0
2726 define dso_local i32 @cmpxchg_i32_unaligned_acquire_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
2727 ; CHECK-LABEL: cmpxchg_i32_unaligned_acquire_seq_cst:
2728 ; CHECK: bl __atomic_compare_exchange
2729 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 1
2730 %r = extractvalue { i32, i1 } %pair, 0
2734 define dso_local i32 @cmpxchg_i32_unaligned_acquire_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
2735 ; CHECK-LABEL: cmpxchg_i32_unaligned_acquire_seq_cst_weak:
2736 ; CHECK: bl __atomic_compare_exchange
2737 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acquire seq_cst, align 1
2738 %r = extractvalue { i32, i1 } %pair, 0
2742 define dso_local i32 @cmpxchg_i32_unaligned_release_monotonic(i32 %expected, i32 %new, ptr %ptr) {
2743 ; CHECK-LABEL: cmpxchg_i32_unaligned_release_monotonic:
2744 ; CHECK: bl __atomic_compare_exchange
2745 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new release monotonic, align 1
2746 %r = extractvalue { i32, i1 } %pair, 0
2750 define dso_local i32 @cmpxchg_i32_unaligned_release_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
2751 ; CHECK-LABEL: cmpxchg_i32_unaligned_release_monotonic_weak:
2752 ; CHECK: bl __atomic_compare_exchange
2753 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release monotonic, align 1
2754 %r = extractvalue { i32, i1 } %pair, 0
2758 define dso_local i32 @cmpxchg_i32_unaligned_release_acquire(i32 %expected, i32 %new, ptr %ptr) {
2759 ; CHECK-LABEL: cmpxchg_i32_unaligned_release_acquire:
2760 ; CHECK: bl __atomic_compare_exchange
2761 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new release acquire, align 1
2762 %r = extractvalue { i32, i1 } %pair, 0
2766 define dso_local i32 @cmpxchg_i32_unaligned_release_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
2767 ; CHECK-LABEL: cmpxchg_i32_unaligned_release_acquire_weak:
2768 ; CHECK: bl __atomic_compare_exchange
2769 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release acquire, align 1
2770 %r = extractvalue { i32, i1 } %pair, 0
2774 define dso_local i32 @cmpxchg_i32_unaligned_release_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
2775 ; CHECK-LABEL: cmpxchg_i32_unaligned_release_seq_cst:
2776 ; CHECK: bl __atomic_compare_exchange
2777 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new release seq_cst, align 1
2778 %r = extractvalue { i32, i1 } %pair, 0
2782 define dso_local i32 @cmpxchg_i32_unaligned_release_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
2783 ; CHECK-LABEL: cmpxchg_i32_unaligned_release_seq_cst_weak:
2784 ; CHECK: bl __atomic_compare_exchange
2785 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new release seq_cst, align 1
2786 %r = extractvalue { i32, i1 } %pair, 0
2790 define dso_local i32 @cmpxchg_i32_unaligned_acq_rel_monotonic(i32 %expected, i32 %new, ptr %ptr) {
2791 ; CHECK-LABEL: cmpxchg_i32_unaligned_acq_rel_monotonic:
2792 ; CHECK: bl __atomic_compare_exchange
2793 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 1
2794 %r = extractvalue { i32, i1 } %pair, 0
2798 define dso_local i32 @cmpxchg_i32_unaligned_acq_rel_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
2799 ; CHECK-LABEL: cmpxchg_i32_unaligned_acq_rel_monotonic_weak:
2800 ; CHECK: bl __atomic_compare_exchange
2801 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel monotonic, align 1
2802 %r = extractvalue { i32, i1 } %pair, 0
2806 define dso_local i32 @cmpxchg_i32_unaligned_acq_rel_acquire(i32 %expected, i32 %new, ptr %ptr) {
2807 ; CHECK-LABEL: cmpxchg_i32_unaligned_acq_rel_acquire:
2808 ; CHECK: bl __atomic_compare_exchange
2809 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 1
2810 %r = extractvalue { i32, i1 } %pair, 0
2814 define dso_local i32 @cmpxchg_i32_unaligned_acq_rel_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
2815 ; CHECK-LABEL: cmpxchg_i32_unaligned_acq_rel_acquire_weak:
2816 ; CHECK: bl __atomic_compare_exchange
2817 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel acquire, align 1
2818 %r = extractvalue { i32, i1 } %pair, 0
2822 define dso_local i32 @cmpxchg_i32_unaligned_acq_rel_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
2823 ; CHECK-LABEL: cmpxchg_i32_unaligned_acq_rel_seq_cst:
2824 ; CHECK: bl __atomic_compare_exchange
2825 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 1
2826 %r = extractvalue { i32, i1 } %pair, 0
2830 define dso_local i32 @cmpxchg_i32_unaligned_acq_rel_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
2831 ; CHECK-LABEL: cmpxchg_i32_unaligned_acq_rel_seq_cst_weak:
2832 ; CHECK: bl __atomic_compare_exchange
2833 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new acq_rel seq_cst, align 1
2834 %r = extractvalue { i32, i1 } %pair, 0
2838 define dso_local i32 @cmpxchg_i32_unaligned_seq_cst_monotonic(i32 %expected, i32 %new, ptr %ptr) {
2839 ; CHECK-LABEL: cmpxchg_i32_unaligned_seq_cst_monotonic:
2840 ; CHECK: bl __atomic_compare_exchange
2841 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 1
2842 %r = extractvalue { i32, i1 } %pair, 0
2846 define dso_local i32 @cmpxchg_i32_unaligned_seq_cst_monotonic_weak(i32 %expected, i32 %new, ptr %ptr) {
2847 ; CHECK-LABEL: cmpxchg_i32_unaligned_seq_cst_monotonic_weak:
2848 ; CHECK: bl __atomic_compare_exchange
2849 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst monotonic, align 1
2850 %r = extractvalue { i32, i1 } %pair, 0
2854 define dso_local i32 @cmpxchg_i32_unaligned_seq_cst_acquire(i32 %expected, i32 %new, ptr %ptr) {
2855 ; CHECK-LABEL: cmpxchg_i32_unaligned_seq_cst_acquire:
2856 ; CHECK: bl __atomic_compare_exchange
2857 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 1
2858 %r = extractvalue { i32, i1 } %pair, 0
2862 define dso_local i32 @cmpxchg_i32_unaligned_seq_cst_acquire_weak(i32 %expected, i32 %new, ptr %ptr) {
2863 ; CHECK-LABEL: cmpxchg_i32_unaligned_seq_cst_acquire_weak:
2864 ; CHECK: bl __atomic_compare_exchange
2865 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst acquire, align 1
2866 %r = extractvalue { i32, i1 } %pair, 0
2870 define dso_local i32 @cmpxchg_i32_unaligned_seq_cst_seq_cst(i32 %expected, i32 %new, ptr %ptr) {
2871 ; CHECK-LABEL: cmpxchg_i32_unaligned_seq_cst_seq_cst:
2872 ; CHECK: bl __atomic_compare_exchange
2873 %pair = cmpxchg ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 1
2874 %r = extractvalue { i32, i1 } %pair, 0
2878 define dso_local i32 @cmpxchg_i32_unaligned_seq_cst_seq_cst_weak(i32 %expected, i32 %new, ptr %ptr) {
2879 ; CHECK-LABEL: cmpxchg_i32_unaligned_seq_cst_seq_cst_weak:
2880 ; CHECK: bl __atomic_compare_exchange
2881 %pair = cmpxchg weak ptr %ptr, i32 %expected, i32 %new seq_cst seq_cst, align 1
2882 %r = extractvalue { i32, i1 } %pair, 0
2886 define dso_local i64 @cmpxchg_i64_unaligned_monotonic_monotonic(i64 %expected, i64 %new, ptr %ptr) {
2887 ; CHECK-LABEL: cmpxchg_i64_unaligned_monotonic_monotonic:
2888 ; CHECK: bl __atomic_compare_exchange
2889 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 1
2890 %r = extractvalue { i64, i1 } %pair, 0
2894 define dso_local i64 @cmpxchg_i64_unaligned_monotonic_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
2895 ; CHECK-LABEL: cmpxchg_i64_unaligned_monotonic_monotonic_weak:
2896 ; CHECK: bl __atomic_compare_exchange
2897 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic monotonic, align 1
2898 %r = extractvalue { i64, i1 } %pair, 0
2902 define dso_local i64 @cmpxchg_i64_unaligned_monotonic_acquire(i64 %expected, i64 %new, ptr %ptr) {
2903 ; CHECK-LABEL: cmpxchg_i64_unaligned_monotonic_acquire:
2904 ; CHECK: bl __atomic_compare_exchange
2905 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 1
2906 %r = extractvalue { i64, i1 } %pair, 0
2910 define dso_local i64 @cmpxchg_i64_unaligned_monotonic_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
2911 ; CHECK-LABEL: cmpxchg_i64_unaligned_monotonic_acquire_weak:
2912 ; CHECK: bl __atomic_compare_exchange
2913 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic acquire, align 1
2914 %r = extractvalue { i64, i1 } %pair, 0
2918 define dso_local i64 @cmpxchg_i64_unaligned_monotonic_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
2919 ; CHECK-LABEL: cmpxchg_i64_unaligned_monotonic_seq_cst:
2920 ; CHECK: bl __atomic_compare_exchange
2921 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 1
2922 %r = extractvalue { i64, i1 } %pair, 0
2926 define dso_local i64 @cmpxchg_i64_unaligned_monotonic_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
2927 ; CHECK-LABEL: cmpxchg_i64_unaligned_monotonic_seq_cst_weak:
2928 ; CHECK: bl __atomic_compare_exchange
2929 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new monotonic seq_cst, align 1
2930 %r = extractvalue { i64, i1 } %pair, 0
2934 define dso_local i64 @cmpxchg_i64_unaligned_acquire_monotonic(i64 %expected, i64 %new, ptr %ptr) {
2935 ; CHECK-LABEL: cmpxchg_i64_unaligned_acquire_monotonic:
2936 ; CHECK: bl __atomic_compare_exchange
2937 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 1
2938 %r = extractvalue { i64, i1 } %pair, 0
2942 define dso_local i64 @cmpxchg_i64_unaligned_acquire_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
2943 ; CHECK-LABEL: cmpxchg_i64_unaligned_acquire_monotonic_weak:
2944 ; CHECK: bl __atomic_compare_exchange
2945 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire monotonic, align 1
2946 %r = extractvalue { i64, i1 } %pair, 0
2950 define dso_local i64 @cmpxchg_i64_unaligned_acquire_acquire(i64 %expected, i64 %new, ptr %ptr) {
2951 ; CHECK-LABEL: cmpxchg_i64_unaligned_acquire_acquire:
2952 ; CHECK: bl __atomic_compare_exchange
2953 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acquire acquire, align 1
2954 %r = extractvalue { i64, i1 } %pair, 0
2958 define dso_local i64 @cmpxchg_i64_unaligned_acquire_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
2959 ; CHECK-LABEL: cmpxchg_i64_unaligned_acquire_acquire_weak:
2960 ; CHECK: bl __atomic_compare_exchange
2961 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire acquire, align 1
2962 %r = extractvalue { i64, i1 } %pair, 0
2966 define dso_local i64 @cmpxchg_i64_unaligned_acquire_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
2967 ; CHECK-LABEL: cmpxchg_i64_unaligned_acquire_seq_cst:
2968 ; CHECK: bl __atomic_compare_exchange
2969 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 1
2970 %r = extractvalue { i64, i1 } %pair, 0
2974 define dso_local i64 @cmpxchg_i64_unaligned_acquire_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
2975 ; CHECK-LABEL: cmpxchg_i64_unaligned_acquire_seq_cst_weak:
2976 ; CHECK: bl __atomic_compare_exchange
2977 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acquire seq_cst, align 1
2978 %r = extractvalue { i64, i1 } %pair, 0
2982 define dso_local i64 @cmpxchg_i64_unaligned_release_monotonic(i64 %expected, i64 %new, ptr %ptr) {
2983 ; CHECK-LABEL: cmpxchg_i64_unaligned_release_monotonic:
2984 ; CHECK: bl __atomic_compare_exchange
2985 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new release monotonic, align 1
2986 %r = extractvalue { i64, i1 } %pair, 0
2990 define dso_local i64 @cmpxchg_i64_unaligned_release_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
2991 ; CHECK-LABEL: cmpxchg_i64_unaligned_release_monotonic_weak:
2992 ; CHECK: bl __atomic_compare_exchange
2993 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release monotonic, align 1
2994 %r = extractvalue { i64, i1 } %pair, 0
2998 define dso_local i64 @cmpxchg_i64_unaligned_release_acquire(i64 %expected, i64 %new, ptr %ptr) {
2999 ; CHECK-LABEL: cmpxchg_i64_unaligned_release_acquire:
3000 ; CHECK: bl __atomic_compare_exchange
3001 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new release acquire, align 1
3002 %r = extractvalue { i64, i1 } %pair, 0
3006 define dso_local i64 @cmpxchg_i64_unaligned_release_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
3007 ; CHECK-LABEL: cmpxchg_i64_unaligned_release_acquire_weak:
3008 ; CHECK: bl __atomic_compare_exchange
3009 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release acquire, align 1
3010 %r = extractvalue { i64, i1 } %pair, 0
3014 define dso_local i64 @cmpxchg_i64_unaligned_release_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
3015 ; CHECK-LABEL: cmpxchg_i64_unaligned_release_seq_cst:
3016 ; CHECK: bl __atomic_compare_exchange
3017 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new release seq_cst, align 1
3018 %r = extractvalue { i64, i1 } %pair, 0
3022 define dso_local i64 @cmpxchg_i64_unaligned_release_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
3023 ; CHECK-LABEL: cmpxchg_i64_unaligned_release_seq_cst_weak:
3024 ; CHECK: bl __atomic_compare_exchange
3025 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new release seq_cst, align 1
3026 %r = extractvalue { i64, i1 } %pair, 0
3030 define dso_local i64 @cmpxchg_i64_unaligned_acq_rel_monotonic(i64 %expected, i64 %new, ptr %ptr) {
3031 ; CHECK-LABEL: cmpxchg_i64_unaligned_acq_rel_monotonic:
3032 ; CHECK: bl __atomic_compare_exchange
3033 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 1
3034 %r = extractvalue { i64, i1 } %pair, 0
3038 define dso_local i64 @cmpxchg_i64_unaligned_acq_rel_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
3039 ; CHECK-LABEL: cmpxchg_i64_unaligned_acq_rel_monotonic_weak:
3040 ; CHECK: bl __atomic_compare_exchange
3041 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel monotonic, align 1
3042 %r = extractvalue { i64, i1 } %pair, 0
3046 define dso_local i64 @cmpxchg_i64_unaligned_acq_rel_acquire(i64 %expected, i64 %new, ptr %ptr) {
3047 ; CHECK-LABEL: cmpxchg_i64_unaligned_acq_rel_acquire:
3048 ; CHECK: bl __atomic_compare_exchange
3049 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 1
3050 %r = extractvalue { i64, i1 } %pair, 0
3054 define dso_local i64 @cmpxchg_i64_unaligned_acq_rel_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
3055 ; CHECK-LABEL: cmpxchg_i64_unaligned_acq_rel_acquire_weak:
3056 ; CHECK: bl __atomic_compare_exchange
3057 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel acquire, align 1
3058 %r = extractvalue { i64, i1 } %pair, 0
3062 define dso_local i64 @cmpxchg_i64_unaligned_acq_rel_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
3063 ; CHECK-LABEL: cmpxchg_i64_unaligned_acq_rel_seq_cst:
3064 ; CHECK: bl __atomic_compare_exchange
3065 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 1
3066 %r = extractvalue { i64, i1 } %pair, 0
3070 define dso_local i64 @cmpxchg_i64_unaligned_acq_rel_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
3071 ; CHECK-LABEL: cmpxchg_i64_unaligned_acq_rel_seq_cst_weak:
3072 ; CHECK: bl __atomic_compare_exchange
3073 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new acq_rel seq_cst, align 1
3074 %r = extractvalue { i64, i1 } %pair, 0
3078 define dso_local i64 @cmpxchg_i64_unaligned_seq_cst_monotonic(i64 %expected, i64 %new, ptr %ptr) {
3079 ; CHECK-LABEL: cmpxchg_i64_unaligned_seq_cst_monotonic:
3080 ; CHECK: bl __atomic_compare_exchange
3081 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 1
3082 %r = extractvalue { i64, i1 } %pair, 0
3086 define dso_local i64 @cmpxchg_i64_unaligned_seq_cst_monotonic_weak(i64 %expected, i64 %new, ptr %ptr) {
3087 ; CHECK-LABEL: cmpxchg_i64_unaligned_seq_cst_monotonic_weak:
3088 ; CHECK: bl __atomic_compare_exchange
3089 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst monotonic, align 1
3090 %r = extractvalue { i64, i1 } %pair, 0
3094 define dso_local i64 @cmpxchg_i64_unaligned_seq_cst_acquire(i64 %expected, i64 %new, ptr %ptr) {
3095 ; CHECK-LABEL: cmpxchg_i64_unaligned_seq_cst_acquire:
3096 ; CHECK: bl __atomic_compare_exchange
3097 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 1
3098 %r = extractvalue { i64, i1 } %pair, 0
3102 define dso_local i64 @cmpxchg_i64_unaligned_seq_cst_acquire_weak(i64 %expected, i64 %new, ptr %ptr) {
3103 ; CHECK-LABEL: cmpxchg_i64_unaligned_seq_cst_acquire_weak:
3104 ; CHECK: bl __atomic_compare_exchange
3105 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst acquire, align 1
3106 %r = extractvalue { i64, i1 } %pair, 0
3110 define dso_local i64 @cmpxchg_i64_unaligned_seq_cst_seq_cst(i64 %expected, i64 %new, ptr %ptr) {
3111 ; CHECK-LABEL: cmpxchg_i64_unaligned_seq_cst_seq_cst:
3112 ; CHECK: bl __atomic_compare_exchange
3113 %pair = cmpxchg ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 1
3114 %r = extractvalue { i64, i1 } %pair, 0
3118 define dso_local i64 @cmpxchg_i64_unaligned_seq_cst_seq_cst_weak(i64 %expected, i64 %new, ptr %ptr) {
3119 ; CHECK-LABEL: cmpxchg_i64_unaligned_seq_cst_seq_cst_weak:
3120 ; CHECK: bl __atomic_compare_exchange
3121 %pair = cmpxchg weak ptr %ptr, i64 %expected, i64 %new seq_cst seq_cst, align 1
3122 %r = extractvalue { i64, i1 } %pair, 0
3126 define dso_local i128 @cmpxchg_i128_unaligned_monotonic_monotonic(i128 %expected, i128 %new, ptr %ptr) {
3127 ; CHECK-LABEL: cmpxchg_i128_unaligned_monotonic_monotonic:
3128 ; CHECK: bl __atomic_compare_exchange
3129 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new monotonic monotonic, align 1
3130 %r = extractvalue { i128, i1 } %pair, 0
3134 define dso_local i128 @cmpxchg_i128_unaligned_monotonic_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
3135 ; CHECK-LABEL: cmpxchg_i128_unaligned_monotonic_monotonic_weak:
3136 ; CHECK: bl __atomic_compare_exchange
3137 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new monotonic monotonic, align 1
3138 %r = extractvalue { i128, i1 } %pair, 0
3142 define dso_local i128 @cmpxchg_i128_unaligned_monotonic_acquire(i128 %expected, i128 %new, ptr %ptr) {
3143 ; CHECK-LABEL: cmpxchg_i128_unaligned_monotonic_acquire:
3144 ; CHECK: bl __atomic_compare_exchange
3145 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new monotonic acquire, align 1
3146 %r = extractvalue { i128, i1 } %pair, 0
3150 define dso_local i128 @cmpxchg_i128_unaligned_monotonic_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
3151 ; CHECK-LABEL: cmpxchg_i128_unaligned_monotonic_acquire_weak:
3152 ; CHECK: bl __atomic_compare_exchange
3153 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new monotonic acquire, align 1
3154 %r = extractvalue { i128, i1 } %pair, 0
3158 define dso_local i128 @cmpxchg_i128_unaligned_monotonic_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
3159 ; CHECK-LABEL: cmpxchg_i128_unaligned_monotonic_seq_cst:
3160 ; CHECK: bl __atomic_compare_exchange
3161 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new monotonic seq_cst, align 1
3162 %r = extractvalue { i128, i1 } %pair, 0
3166 define dso_local i128 @cmpxchg_i128_unaligned_monotonic_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
3167 ; CHECK-LABEL: cmpxchg_i128_unaligned_monotonic_seq_cst_weak:
3168 ; CHECK: bl __atomic_compare_exchange
3169 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new monotonic seq_cst, align 1
3170 %r = extractvalue { i128, i1 } %pair, 0
3174 define dso_local i128 @cmpxchg_i128_unaligned_acquire_monotonic(i128 %expected, i128 %new, ptr %ptr) {
3175 ; CHECK-LABEL: cmpxchg_i128_unaligned_acquire_monotonic:
3176 ; CHECK: bl __atomic_compare_exchange
3177 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acquire monotonic, align 1
3178 %r = extractvalue { i128, i1 } %pair, 0
3182 define dso_local i128 @cmpxchg_i128_unaligned_acquire_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
3183 ; CHECK-LABEL: cmpxchg_i128_unaligned_acquire_monotonic_weak:
3184 ; CHECK: bl __atomic_compare_exchange
3185 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acquire monotonic, align 1
3186 %r = extractvalue { i128, i1 } %pair, 0
3190 define dso_local i128 @cmpxchg_i128_unaligned_acquire_acquire(i128 %expected, i128 %new, ptr %ptr) {
3191 ; CHECK-LABEL: cmpxchg_i128_unaligned_acquire_acquire:
3192 ; CHECK: bl __atomic_compare_exchange
3193 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acquire acquire, align 1
3194 %r = extractvalue { i128, i1 } %pair, 0
3198 define dso_local i128 @cmpxchg_i128_unaligned_acquire_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
3199 ; CHECK-LABEL: cmpxchg_i128_unaligned_acquire_acquire_weak:
3200 ; CHECK: bl __atomic_compare_exchange
3201 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acquire acquire, align 1
3202 %r = extractvalue { i128, i1 } %pair, 0
3206 define dso_local i128 @cmpxchg_i128_unaligned_acquire_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
3207 ; CHECK-LABEL: cmpxchg_i128_unaligned_acquire_seq_cst:
3208 ; CHECK: bl __atomic_compare_exchange
3209 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acquire seq_cst, align 1
3210 %r = extractvalue { i128, i1 } %pair, 0
3214 define dso_local i128 @cmpxchg_i128_unaligned_acquire_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
3215 ; CHECK-LABEL: cmpxchg_i128_unaligned_acquire_seq_cst_weak:
3216 ; CHECK: bl __atomic_compare_exchange
3217 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acquire seq_cst, align 1
3218 %r = extractvalue { i128, i1 } %pair, 0
3222 define dso_local i128 @cmpxchg_i128_unaligned_release_monotonic(i128 %expected, i128 %new, ptr %ptr) {
3223 ; CHECK-LABEL: cmpxchg_i128_unaligned_release_monotonic:
3224 ; CHECK: bl __atomic_compare_exchange
3225 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new release monotonic, align 1
3226 %r = extractvalue { i128, i1 } %pair, 0
3230 define dso_local i128 @cmpxchg_i128_unaligned_release_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
3231 ; CHECK-LABEL: cmpxchg_i128_unaligned_release_monotonic_weak:
3232 ; CHECK: bl __atomic_compare_exchange
3233 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new release monotonic, align 1
3234 %r = extractvalue { i128, i1 } %pair, 0
3238 define dso_local i128 @cmpxchg_i128_unaligned_release_acquire(i128 %expected, i128 %new, ptr %ptr) {
3239 ; CHECK-LABEL: cmpxchg_i128_unaligned_release_acquire:
3240 ; CHECK: bl __atomic_compare_exchange
3241 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new release acquire, align 1
3242 %r = extractvalue { i128, i1 } %pair, 0
3246 define dso_local i128 @cmpxchg_i128_unaligned_release_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
3247 ; CHECK-LABEL: cmpxchg_i128_unaligned_release_acquire_weak:
3248 ; CHECK: bl __atomic_compare_exchange
3249 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new release acquire, align 1
3250 %r = extractvalue { i128, i1 } %pair, 0
3254 define dso_local i128 @cmpxchg_i128_unaligned_release_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
3255 ; CHECK-LABEL: cmpxchg_i128_unaligned_release_seq_cst:
3256 ; CHECK: bl __atomic_compare_exchange
3257 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new release seq_cst, align 1
3258 %r = extractvalue { i128, i1 } %pair, 0
3262 define dso_local i128 @cmpxchg_i128_unaligned_release_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
3263 ; CHECK-LABEL: cmpxchg_i128_unaligned_release_seq_cst_weak:
3264 ; CHECK: bl __atomic_compare_exchange
3265 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new release seq_cst, align 1
3266 %r = extractvalue { i128, i1 } %pair, 0
3270 define dso_local i128 @cmpxchg_i128_unaligned_acq_rel_monotonic(i128 %expected, i128 %new, ptr %ptr) {
3271 ; CHECK-LABEL: cmpxchg_i128_unaligned_acq_rel_monotonic:
3272 ; CHECK: bl __atomic_compare_exchange
3273 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acq_rel monotonic, align 1
3274 %r = extractvalue { i128, i1 } %pair, 0
3278 define dso_local i128 @cmpxchg_i128_unaligned_acq_rel_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
3279 ; CHECK-LABEL: cmpxchg_i128_unaligned_acq_rel_monotonic_weak:
3280 ; CHECK: bl __atomic_compare_exchange
3281 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acq_rel monotonic, align 1
3282 %r = extractvalue { i128, i1 } %pair, 0
3286 define dso_local i128 @cmpxchg_i128_unaligned_acq_rel_acquire(i128 %expected, i128 %new, ptr %ptr) {
3287 ; CHECK-LABEL: cmpxchg_i128_unaligned_acq_rel_acquire:
3288 ; CHECK: bl __atomic_compare_exchange
3289 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acq_rel acquire, align 1
3290 %r = extractvalue { i128, i1 } %pair, 0
3294 define dso_local i128 @cmpxchg_i128_unaligned_acq_rel_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
3295 ; CHECK-LABEL: cmpxchg_i128_unaligned_acq_rel_acquire_weak:
3296 ; CHECK: bl __atomic_compare_exchange
3297 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acq_rel acquire, align 1
3298 %r = extractvalue { i128, i1 } %pair, 0
3302 define dso_local i128 @cmpxchg_i128_unaligned_acq_rel_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
3303 ; CHECK-LABEL: cmpxchg_i128_unaligned_acq_rel_seq_cst:
3304 ; CHECK: bl __atomic_compare_exchange
3305 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new acq_rel seq_cst, align 1
3306 %r = extractvalue { i128, i1 } %pair, 0
3310 define dso_local i128 @cmpxchg_i128_unaligned_acq_rel_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
3311 ; CHECK-LABEL: cmpxchg_i128_unaligned_acq_rel_seq_cst_weak:
3312 ; CHECK: bl __atomic_compare_exchange
3313 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new acq_rel seq_cst, align 1
3314 %r = extractvalue { i128, i1 } %pair, 0
3318 define dso_local i128 @cmpxchg_i128_unaligned_seq_cst_monotonic(i128 %expected, i128 %new, ptr %ptr) {
3319 ; CHECK-LABEL: cmpxchg_i128_unaligned_seq_cst_monotonic:
3320 ; CHECK: bl __atomic_compare_exchange
3321 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new seq_cst monotonic, align 1
3322 %r = extractvalue { i128, i1 } %pair, 0
3326 define dso_local i128 @cmpxchg_i128_unaligned_seq_cst_monotonic_weak(i128 %expected, i128 %new, ptr %ptr) {
3327 ; CHECK-LABEL: cmpxchg_i128_unaligned_seq_cst_monotonic_weak:
3328 ; CHECK: bl __atomic_compare_exchange
3329 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new seq_cst monotonic, align 1
3330 %r = extractvalue { i128, i1 } %pair, 0
3334 define dso_local i128 @cmpxchg_i128_unaligned_seq_cst_acquire(i128 %expected, i128 %new, ptr %ptr) {
3335 ; CHECK-LABEL: cmpxchg_i128_unaligned_seq_cst_acquire:
3336 ; CHECK: bl __atomic_compare_exchange
3337 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new seq_cst acquire, align 1
3338 %r = extractvalue { i128, i1 } %pair, 0
3342 define dso_local i128 @cmpxchg_i128_unaligned_seq_cst_acquire_weak(i128 %expected, i128 %new, ptr %ptr) {
3343 ; CHECK-LABEL: cmpxchg_i128_unaligned_seq_cst_acquire_weak:
3344 ; CHECK: bl __atomic_compare_exchange
3345 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new seq_cst acquire, align 1
3346 %r = extractvalue { i128, i1 } %pair, 0
3350 define dso_local i128 @cmpxchg_i128_unaligned_seq_cst_seq_cst(i128 %expected, i128 %new, ptr %ptr) {
3351 ; CHECK-LABEL: cmpxchg_i128_unaligned_seq_cst_seq_cst:
3352 ; CHECK: bl __atomic_compare_exchange
3353 %pair = cmpxchg ptr %ptr, i128 %expected, i128 %new seq_cst seq_cst, align 1
3354 %r = extractvalue { i128, i1 } %pair, 0
3358 define dso_local i128 @cmpxchg_i128_unaligned_seq_cst_seq_cst_weak(i128 %expected, i128 %new, ptr %ptr) {
3359 ; CHECK-LABEL: cmpxchg_i128_unaligned_seq_cst_seq_cst_weak:
3360 ; CHECK: bl __atomic_compare_exchange
3361 %pair = cmpxchg weak ptr %ptr, i128 %expected, i128 %new seq_cst seq_cst, align 1
3362 %r = extractvalue { i128, i1 } %pair, 0