xref: /llvm-project/llvm/test/CodeGen/AArch64/Atomics/aarch64-atomic-store-rcpc.ll (revision f3fb973924a9ba3bdd8dfee4dc85337e8b033ab4)
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 -mattr=+rcpc -O0 | FileCheck %s --check-prefixes=CHECK,-O0
4; RUN: llc %s -o - -verify-machineinstrs -mtriple=aarch64 -mattr=+rcpc -O1 | FileCheck %s --check-prefixes=CHECK,-O1
5
6define dso_local void @store_atomic_i8_aligned_unordered(i8 %value, ptr %ptr) {
7; CHECK-LABEL: store_atomic_i8_aligned_unordered:
8; CHECK:    strb w0, [x1]
9    store atomic i8 %value, ptr %ptr unordered, align 1
10    ret void
11}
12
13define 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
17    ret void
18}
19
20define 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
24    ret void
25}
26
27define 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
31    ret void
32}
33
34define 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
38    ret void
39}
40
41define 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
45    ret void
46}
47
48define 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
52    ret void
53}
54
55define 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
59    ret void
60}
61
62define dso_local void @store_atomic_i32_aligned_unordered(i32 %value, ptr %ptr) {
63; CHECK-LABEL: store_atomic_i32_aligned_unordered:
64; CHECK:    str w0, [x1]
65    store atomic i32 %value, ptr %ptr unordered, align 4
66    ret void
67}
68
69define dso_local void @store_atomic_i32_aligned_monotonic(i32 %value, ptr %ptr) {
70; CHECK-LABEL: store_atomic_i32_aligned_monotonic:
71; CHECK:    str w0, [x1]
72    store atomic i32 %value, ptr %ptr monotonic, align 4
73    ret void
74}
75
76define 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
80    ret void
81}
82
83define 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
87    ret void
88}
89
90define dso_local void @store_atomic_i64_aligned_unordered(i64 %value, ptr %ptr) {
91; CHECK-LABEL: store_atomic_i64_aligned_unordered:
92; CHECK:    str x0, [x1]
93    store atomic i64 %value, ptr %ptr unordered, align 8
94    ret void
95}
96
97define dso_local void @store_atomic_i64_aligned_monotonic(i64 %value, ptr %ptr) {
98; CHECK-LABEL: store_atomic_i64_aligned_monotonic:
99; CHECK:    str x0, [x1]
100    store atomic i64 %value, ptr %ptr monotonic, align 8
101    ret void
102}
103
104define 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
108    ret void
109}
110
111define 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
115    ret void
116}
117
118define dso_local void @store_atomic_i128_aligned_unordered(i128 %value, ptr %ptr) {
119; -O0-LABEL: store_atomic_i128_aligned_unordered:
120; -O0:    ldxp x10, x9, [x11]
121; -O0:    cmp x10, x12
122; -O0:    cmp x9, x13
123; -O0:    stxp w8, x14, x15, [x11]
124; -O0:    stxp w8, x10, x9, [x11]
125; -O0:    eor x8, x10, x8
126; -O0:    eor x11, x9, x11
127; -O0:    orr x8, x8, x11
128; -O0:    subs x8, x8, #0
129;
130; -O1-LABEL: store_atomic_i128_aligned_unordered:
131; -O1:    ldxp xzr, x8, [x2]
132; -O1:    stxp w8, x0, x1, [x2]
133    store atomic i128 %value, ptr %ptr unordered, align 16
134    ret void
135}
136
137define dso_local void @store_atomic_i128_aligned_monotonic(i128 %value, ptr %ptr) {
138; -O0-LABEL: store_atomic_i128_aligned_monotonic:
139; -O0:    ldxp x10, x9, [x11]
140; -O0:    cmp x10, x12
141; -O0:    cmp x9, x13
142; -O0:    stxp w8, x14, x15, [x11]
143; -O0:    stxp w8, x10, x9, [x11]
144; -O0:    eor x8, x10, x8
145; -O0:    eor x11, x9, x11
146; -O0:    orr x8, x8, x11
147; -O0:    subs x8, x8, #0
148;
149; -O1-LABEL: store_atomic_i128_aligned_monotonic:
150; -O1:    ldxp xzr, x8, [x2]
151; -O1:    stxp w8, x0, x1, [x2]
152    store atomic i128 %value, ptr %ptr monotonic, align 16
153    ret void
154}
155
156define dso_local void @store_atomic_i128_aligned_release(i128 %value, ptr %ptr) {
157; -O0-LABEL: store_atomic_i128_aligned_release:
158; -O0:    ldxp x10, x9, [x11]
159; -O0:    cmp x10, x12
160; -O0:    cmp x9, x13
161; -O0:    stlxp w8, x14, x15, [x11]
162; -O0:    stlxp w8, x10, x9, [x11]
163; -O0:    eor x8, x10, x8
164; -O0:    eor x11, x9, x11
165; -O0:    orr x8, x8, x11
166; -O0:    subs x8, x8, #0
167;
168; -O1-LABEL: store_atomic_i128_aligned_release:
169; -O1:    ldxp xzr, x8, [x2]
170; -O1:    stlxp w8, x0, x1, [x2]
171    store atomic i128 %value, ptr %ptr release, align 16
172    ret void
173}
174
175define dso_local void @store_atomic_i128_aligned_seq_cst(i128 %value, ptr %ptr) {
176; -O0-LABEL: store_atomic_i128_aligned_seq_cst:
177; -O0:    ldaxp x10, x9, [x11]
178; -O0:    cmp x10, x12
179; -O0:    cmp x9, x13
180; -O0:    stlxp w8, x14, x15, [x11]
181; -O0:    stlxp w8, x10, x9, [x11]
182; -O0:    eor x8, x10, x8
183; -O0:    eor x11, x9, x11
184; -O0:    orr x8, x8, x11
185; -O0:    subs x8, x8, #0
186;
187; -O1-LABEL: store_atomic_i128_aligned_seq_cst:
188; -O1:    ldaxp xzr, x8, [x2]
189; -O1:    stlxp w8, x0, x1, [x2]
190    store atomic i128 %value, ptr %ptr seq_cst, align 16
191    ret void
192}
193
194define dso_local void @store_atomic_i8_unaligned_unordered(i8 %value, ptr %ptr) {
195; CHECK-LABEL: store_atomic_i8_unaligned_unordered:
196; CHECK:    strb w0, [x1]
197    store atomic i8 %value, ptr %ptr unordered, align 1
198    ret void
199}
200
201define dso_local void @store_atomic_i8_unaligned_monotonic(i8 %value, ptr %ptr) {
202; CHECK-LABEL: store_atomic_i8_unaligned_monotonic:
203; CHECK:    strb w0, [x1]
204    store atomic i8 %value, ptr %ptr monotonic, align 1
205    ret void
206}
207
208define dso_local void @store_atomic_i8_unaligned_release(i8 %value, ptr %ptr) {
209; CHECK-LABEL: store_atomic_i8_unaligned_release:
210; CHECK:    stlrb w0, [x1]
211    store atomic i8 %value, ptr %ptr release, align 1
212    ret void
213}
214
215define dso_local void @store_atomic_i8_unaligned_seq_cst(i8 %value, ptr %ptr) {
216; CHECK-LABEL: store_atomic_i8_unaligned_seq_cst:
217; CHECK:    stlrb w0, [x1]
218    store atomic i8 %value, ptr %ptr seq_cst, align 1
219    ret void
220}
221
222define dso_local void @store_atomic_i16_unaligned_unordered(i16 %value, ptr %ptr) {
223; CHECK-LABEL: store_atomic_i16_unaligned_unordered:
224; CHECK:    bl __atomic_store
225    store atomic i16 %value, ptr %ptr unordered, align 1
226    ret void
227}
228
229define dso_local void @store_atomic_i16_unaligned_monotonic(i16 %value, ptr %ptr) {
230; CHECK-LABEL: store_atomic_i16_unaligned_monotonic:
231; CHECK:    bl __atomic_store
232    store atomic i16 %value, ptr %ptr monotonic, align 1
233    ret void
234}
235
236define dso_local void @store_atomic_i16_unaligned_release(i16 %value, ptr %ptr) {
237; CHECK-LABEL: store_atomic_i16_unaligned_release:
238; CHECK:    bl __atomic_store
239    store atomic i16 %value, ptr %ptr release, align 1
240    ret void
241}
242
243define dso_local void @store_atomic_i16_unaligned_seq_cst(i16 %value, ptr %ptr) {
244; CHECK-LABEL: store_atomic_i16_unaligned_seq_cst:
245; CHECK:    bl __atomic_store
246    store atomic i16 %value, ptr %ptr seq_cst, align 1
247    ret void
248}
249
250define dso_local void @store_atomic_i32_unaligned_unordered(i32 %value, ptr %ptr) {
251; CHECK-LABEL: store_atomic_i32_unaligned_unordered:
252; CHECK:    bl __atomic_store
253    store atomic i32 %value, ptr %ptr unordered, align 1
254    ret void
255}
256
257define dso_local void @store_atomic_i32_unaligned_monotonic(i32 %value, ptr %ptr) {
258; CHECK-LABEL: store_atomic_i32_unaligned_monotonic:
259; CHECK:    bl __atomic_store
260    store atomic i32 %value, ptr %ptr monotonic, align 1
261    ret void
262}
263
264define dso_local void @store_atomic_i32_unaligned_release(i32 %value, ptr %ptr) {
265; CHECK-LABEL: store_atomic_i32_unaligned_release:
266; CHECK:    bl __atomic_store
267    store atomic i32 %value, ptr %ptr release, align 1
268    ret void
269}
270
271define dso_local void @store_atomic_i32_unaligned_seq_cst(i32 %value, ptr %ptr) {
272; CHECK-LABEL: store_atomic_i32_unaligned_seq_cst:
273; CHECK:    bl __atomic_store
274    store atomic i32 %value, ptr %ptr seq_cst, align 1
275    ret void
276}
277
278define dso_local void @store_atomic_i64_unaligned_unordered(i64 %value, ptr %ptr) {
279; CHECK-LABEL: store_atomic_i64_unaligned_unordered:
280; CHECK:    bl __atomic_store
281    store atomic i64 %value, ptr %ptr unordered, align 1
282    ret void
283}
284
285define dso_local void @store_atomic_i64_unaligned_monotonic(i64 %value, ptr %ptr) {
286; CHECK-LABEL: store_atomic_i64_unaligned_monotonic:
287; CHECK:    bl __atomic_store
288    store atomic i64 %value, ptr %ptr monotonic, align 1
289    ret void
290}
291
292define dso_local void @store_atomic_i64_unaligned_release(i64 %value, ptr %ptr) {
293; CHECK-LABEL: store_atomic_i64_unaligned_release:
294; CHECK:    bl __atomic_store
295    store atomic i64 %value, ptr %ptr release, align 1
296    ret void
297}
298
299define dso_local void @store_atomic_i64_unaligned_seq_cst(i64 %value, ptr %ptr) {
300; CHECK-LABEL: store_atomic_i64_unaligned_seq_cst:
301; CHECK:    bl __atomic_store
302    store atomic i64 %value, ptr %ptr seq_cst, align 1
303    ret void
304}
305
306define dso_local void @store_atomic_i128_unaligned_unordered(i128 %value, ptr %ptr) {
307; CHECK-LABEL: store_atomic_i128_unaligned_unordered:
308; CHECK:    bl __atomic_store
309    store atomic i128 %value, ptr %ptr unordered, align 1
310    ret void
311}
312
313define dso_local void @store_atomic_i128_unaligned_monotonic(i128 %value, ptr %ptr) {
314; CHECK-LABEL: store_atomic_i128_unaligned_monotonic:
315; CHECK:    bl __atomic_store
316    store atomic i128 %value, ptr %ptr monotonic, align 1
317    ret void
318}
319
320define dso_local void @store_atomic_i128_unaligned_release(i128 %value, ptr %ptr) {
321; CHECK-LABEL: store_atomic_i128_unaligned_release:
322; CHECK:    bl __atomic_store
323    store atomic i128 %value, ptr %ptr release, align 1
324    ret void
325}
326
327define dso_local void @store_atomic_i128_unaligned_seq_cst(i128 %value, ptr %ptr) {
328; CHECK-LABEL: store_atomic_i128_unaligned_seq_cst:
329; CHECK:    bl __atomic_store
330    store atomic i128 %value, ptr %ptr seq_cst, align 1
331    ret void
332}
333