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|swp|cas|bl|add|and|eor|orn|orr|sub|mvn|sxt|cmp|ccmp|csel|dmb)"
2 ; The base test file was generated by ./llvm/test/CodeGen/AArch64/Atomics/generate-tests.py
3 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+outline-atomics -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4 ; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64_be -mattr=+outline-atomics -O1 | FileCheck %s --check-prefixes=CHECK,-O1
6 define dso_local void @store_atomic_i8_aligned_unordered(i8 %value, ptr %ptr) {
7 ; CHECK-LABEL: store_atomic_i8_aligned_unordered:
9 store atomic i8 %value, ptr %ptr unordered, align 1
13 define dso_local void @store_atomic_i8_aligned_monotonic(i8 %value, ptr %ptr) {
14 ; CHECK-LABEL: store_atomic_i8_aligned_monotonic:
15 ; CHECK: strb w0, [x1]
16 store atomic i8 %value, ptr %ptr monotonic, align 1
20 define dso_local void @store_atomic_i8_aligned_release(i8 %value, ptr %ptr) {
21 ; CHECK-LABEL: store_atomic_i8_aligned_release:
22 ; CHECK: stlrb w0, [x1]
23 store atomic i8 %value, ptr %ptr release, align 1
27 define dso_local void @store_atomic_i8_aligned_seq_cst(i8 %value, ptr %ptr) {
28 ; CHECK-LABEL: store_atomic_i8_aligned_seq_cst:
29 ; CHECK: stlrb w0, [x1]
30 store atomic i8 %value, ptr %ptr seq_cst, align 1
34 define dso_local void @store_atomic_i16_aligned_unordered(i16 %value, ptr %ptr) {
35 ; CHECK-LABEL: store_atomic_i16_aligned_unordered:
36 ; CHECK: strh w0, [x1]
37 store atomic i16 %value, ptr %ptr unordered, align 2
41 define dso_local void @store_atomic_i16_aligned_monotonic(i16 %value, ptr %ptr) {
42 ; CHECK-LABEL: store_atomic_i16_aligned_monotonic:
43 ; CHECK: strh w0, [x1]
44 store atomic i16 %value, ptr %ptr monotonic, align 2
48 define dso_local void @store_atomic_i16_aligned_release(i16 %value, ptr %ptr) {
49 ; CHECK-LABEL: store_atomic_i16_aligned_release:
50 ; CHECK: stlrh w0, [x1]
51 store atomic i16 %value, ptr %ptr release, align 2
55 define dso_local void @store_atomic_i16_aligned_seq_cst(i16 %value, ptr %ptr) {
56 ; CHECK-LABEL: store_atomic_i16_aligned_seq_cst:
57 ; CHECK: stlrh w0, [x1]
58 store atomic i16 %value, ptr %ptr seq_cst, align 2
62 define dso_local void @store_atomic_i32_aligned_unordered(i32 %value, ptr %ptr) {
63 ; CHECK-LABEL: store_atomic_i32_aligned_unordered:
65 store atomic i32 %value, ptr %ptr unordered, align 4
69 define dso_local void @store_atomic_i32_aligned_monotonic(i32 %value, ptr %ptr) {
70 ; CHECK-LABEL: store_atomic_i32_aligned_monotonic:
72 store atomic i32 %value, ptr %ptr monotonic, align 4
76 define dso_local void @store_atomic_i32_aligned_release(i32 %value, ptr %ptr) {
77 ; CHECK-LABEL: store_atomic_i32_aligned_release:
78 ; CHECK: stlr w0, [x1]
79 store atomic i32 %value, ptr %ptr release, align 4
83 define dso_local void @store_atomic_i32_aligned_seq_cst(i32 %value, ptr %ptr) {
84 ; CHECK-LABEL: store_atomic_i32_aligned_seq_cst:
85 ; CHECK: stlr w0, [x1]
86 store atomic i32 %value, ptr %ptr seq_cst, align 4
90 define dso_local void @store_atomic_i64_aligned_unordered(i64 %value, ptr %ptr) {
91 ; CHECK-LABEL: store_atomic_i64_aligned_unordered:
93 store atomic i64 %value, ptr %ptr unordered, align 8
97 define dso_local void @store_atomic_i64_aligned_monotonic(i64 %value, ptr %ptr) {
98 ; CHECK-LABEL: store_atomic_i64_aligned_monotonic:
100 store atomic i64 %value, ptr %ptr monotonic, align 8
104 define dso_local void @store_atomic_i64_aligned_release(i64 %value, ptr %ptr) {
105 ; CHECK-LABEL: store_atomic_i64_aligned_release:
106 ; CHECK: stlr x0, [x1]
107 store atomic i64 %value, ptr %ptr release, align 8
111 define dso_local void @store_atomic_i64_aligned_seq_cst(i64 %value, ptr %ptr) {
112 ; CHECK-LABEL: store_atomic_i64_aligned_seq_cst:
113 ; CHECK: stlr x0, [x1]
114 store atomic i64 %value, ptr %ptr seq_cst, align 8
118 define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr) {
119 ; -O0-LABEL: store_atomic_i128_aligned_unordered:
120 ; -O0: bl __aarch64_cas16_relax
121 ; -O0: subs x10, x10, x11
122 ; -O0: ccmp x8, x9, #0, eq
124 ; -O1-LABEL: store_atomic_i128_aligned_unordered:
125 ; -O1: ldxp xzr, x8, [x2]
126 ; -O1: stxp w8, x1, x0, [x2]
127 store atomic i128 %value, ptr %ptr unordered, align 16
131 define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) {
132 ; -O0-LABEL: store_atomic_i128_aligned_monotonic:
133 ; -O0: bl __aarch64_cas16_relax
134 ; -O0: subs x10, x10, x11
135 ; -O0: ccmp x8, x9, #0, eq
137 ; -O1-LABEL: store_atomic_i128_aligned_monotonic:
138 ; -O1: ldxp xzr, x8, [x2]
139 ; -O1: stxp w8, x1, x0, [x2]
140 store atomic i128 %value, ptr %ptr monotonic, align 16
144 define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) {
145 ; -O0-LABEL: store_atomic_i128_aligned_release:
146 ; -O0: bl __aarch64_cas16_rel
147 ; -O0: subs x10, x10, x11
148 ; -O0: ccmp x8, x9, #0, eq
150 ; -O1-LABEL: store_atomic_i128_aligned_release:
151 ; -O1: ldxp xzr, x8, [x2]
152 ; -O1: stlxp w8, x1, x0, [x2]
153 store atomic i128 %value, ptr %ptr release, align 16
157 define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) {
158 ; -O0-LABEL: store_atomic_i128_aligned_seq_cst:
159 ; -O0: bl __aarch64_cas16_acq_rel
160 ; -O0: subs x10, x10, x11
161 ; -O0: ccmp x8, x9, #0, eq
163 ; -O1-LABEL: store_atomic_i128_aligned_seq_cst:
164 ; -O1: ldaxp xzr, x8, [x2]
165 ; -O1: stlxp w8, x1, x0, [x2]
166 store atomic i128 %value, ptr %ptr seq_cst, align 16
170 define dso_local void @store_atomic_i8_unaligned_unordered(i8 %value, ptr %ptr) {
171 ; CHECK-LABEL: store_atomic_i8_unaligned_unordered:
172 ; CHECK: strb w0, [x1]
173 store atomic i8 %value, ptr %ptr unordered, align 1
177 define dso_local void @store_atomic_i8_unaligned_monotonic(i8 %value, ptr %ptr) {
178 ; CHECK-LABEL: store_atomic_i8_unaligned_monotonic:
179 ; CHECK: strb w0, [x1]
180 store atomic i8 %value, ptr %ptr monotonic, align 1
184 define dso_local void @store_atomic_i8_unaligned_release(i8 %value, ptr %ptr) {
185 ; CHECK-LABEL: store_atomic_i8_unaligned_release:
186 ; CHECK: stlrb w0, [x1]
187 store atomic i8 %value, ptr %ptr release, align 1
191 define dso_local void @store_atomic_i8_unaligned_seq_cst(i8 %value, ptr %ptr) {
192 ; CHECK-LABEL: store_atomic_i8_unaligned_seq_cst:
193 ; CHECK: stlrb w0, [x1]
194 store atomic i8 %value, ptr %ptr seq_cst, align 1
198 define dso_local void @store_atomic_i16_unaligned_unordered(i16 %value, ptr %ptr) {
199 ; CHECK-LABEL: store_atomic_i16_unaligned_unordered:
200 ; CHECK: bl __atomic_store
201 store atomic i16 %value, ptr %ptr unordered, align 1
205 define dso_local void @store_atomic_i16_unaligned_monotonic(i16 %value, ptr %ptr) {
206 ; CHECK-LABEL: store_atomic_i16_unaligned_monotonic:
207 ; CHECK: bl __atomic_store
208 store atomic i16 %value, ptr %ptr monotonic, align 1
212 define dso_local void @store_atomic_i16_unaligned_release(i16 %value, ptr %ptr) {
213 ; CHECK-LABEL: store_atomic_i16_unaligned_release:
214 ; CHECK: bl __atomic_store
215 store atomic i16 %value, ptr %ptr release, align 1
219 define dso_local void @store_atomic_i16_unaligned_seq_cst(i16 %value, ptr %ptr) {
220 ; CHECK-LABEL: store_atomic_i16_unaligned_seq_cst:
221 ; CHECK: bl __atomic_store
222 store atomic i16 %value, ptr %ptr seq_cst, align 1
226 define dso_local void @store_atomic_i32_unaligned_unordered(i32 %value, ptr %ptr) {
227 ; CHECK-LABEL: store_atomic_i32_unaligned_unordered:
228 ; CHECK: bl __atomic_store
229 store atomic i32 %value, ptr %ptr unordered, align 1
233 define dso_local void @store_atomic_i32_unaligned_monotonic(i32 %value, ptr %ptr) {
234 ; CHECK-LABEL: store_atomic_i32_unaligned_monotonic:
235 ; CHECK: bl __atomic_store
236 store atomic i32 %value, ptr %ptr monotonic, align 1
240 define dso_local void @store_atomic_i32_unaligned_release(i32 %value, ptr %ptr) {
241 ; CHECK-LABEL: store_atomic_i32_unaligned_release:
242 ; CHECK: bl __atomic_store
243 store atomic i32 %value, ptr %ptr release, align 1
247 define dso_local void @store_atomic_i32_unaligned_seq_cst(i32 %value, ptr %ptr) {
248 ; CHECK-LABEL: store_atomic_i32_unaligned_seq_cst:
249 ; CHECK: bl __atomic_store
250 store atomic i32 %value, ptr %ptr seq_cst, align 1
254 define dso_local void @store_atomic_i64_unaligned_unordered(i64 %value, ptr %ptr) {
255 ; CHECK-LABEL: store_atomic_i64_unaligned_unordered:
256 ; CHECK: bl __atomic_store
257 store atomic i64 %value, ptr %ptr unordered, align 1
261 define dso_local void @store_atomic_i64_unaligned_monotonic(i64 %value, ptr %ptr) {
262 ; CHECK-LABEL: store_atomic_i64_unaligned_monotonic:
263 ; CHECK: bl __atomic_store
264 store atomic i64 %value, ptr %ptr monotonic, align 1
268 define dso_local void @store_atomic_i64_unaligned_release(i64 %value, ptr %ptr) {
269 ; CHECK-LABEL: store_atomic_i64_unaligned_release:
270 ; CHECK: bl __atomic_store
271 store atomic i64 %value, ptr %ptr release, align 1
275 define dso_local void @store_atomic_i64_unaligned_seq_cst(i64 %value, ptr %ptr) {
276 ; CHECK-LABEL: store_atomic_i64_unaligned_seq_cst:
277 ; CHECK: bl __atomic_store
278 store atomic i64 %value, ptr %ptr seq_cst, align 1
282 define dso_local void @store_atomic_i128_unaligned_unordered(i128 %value, ptr %ptr) {
283 ; CHECK-LABEL: store_atomic_i128_unaligned_unordered:
284 ; CHECK: bl __atomic_store
285 store atomic i128 %value, ptr %ptr unordered, align 1
289 define dso_local void @store_atomic_i128_unaligned_monotonic(i128 %value, ptr %ptr) {
290 ; CHECK-LABEL: store_atomic_i128_unaligned_monotonic:
291 ; CHECK: bl __atomic_store
292 store atomic i128 %value, ptr %ptr monotonic, align 1
296 define dso_local void @store_atomic_i128_unaligned_release(i128 %value, ptr %ptr) {
297 ; CHECK-LABEL: store_atomic_i128_unaligned_release:
298 ; CHECK: bl __atomic_store
299 store atomic i128 %value, ptr %ptr release, align 1
303 define dso_local void @store_atomic_i128_unaligned_seq_cst(i128 %value, ptr %ptr) {
304 ; CHECK-LABEL: store_atomic_i128_unaligned_seq_cst:
305 ; CHECK: bl __atomic_store
306 store atomic i128 %value, ptr %ptr seq_cst, align 1