1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
7 define void @store_s64_gpr(i64* %addr) { ret void }
8 define void @store_s32_gpr(i32* %addr) { ret void }
9 define void @store_s16_gpr(i16* %addr) { ret void }
10 define void @store_s8_gpr(i8* %addr) { ret void }
12 define void @store_zero_s64_gpr(i64* %addr) { ret void }
13 define void @store_zero_s32_gpr(i32* %addr) { ret void }
15 define void @store_fi_s64_gpr() {
20 define void @store_gep_128_s64_gpr(i64* %addr) { ret void }
21 define void @store_gep_512_s32_gpr(i32* %addr) { ret void }
22 define void @store_gep_64_s16_gpr(i16* %addr) { ret void }
23 define void @store_gep_1_s8_gpr(i8* %addr) { ret void }
25 define void @store_s64_fpr(i64* %addr) { ret void }
26 define void @store_s32_fpr(i32* %addr) { ret void }
28 define void @store_gep_8_s64_fpr(i64* %addr) { ret void }
29 define void @store_gep_8_s32_fpr(i32* %addr) { ret void }
31 define void @store_v2s32(i64 *%addr) { ret void }
40 - { id: 0, class: gpr }
41 - { id: 1, class: gpr }
47 ; CHECK-LABEL: name: store_s64_gpr
48 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
49 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
50 ; CHECK: STRXui [[COPY1]], [[COPY]], 0 :: (store 8 into %ir.addr)
53 G_STORE %1, %0 :: (store 8 into %ir.addr)
63 - { id: 0, class: gpr }
64 - { id: 1, class: gpr }
70 ; CHECK-LABEL: name: store_s32_gpr
71 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
72 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
73 ; CHECK: STRWui [[COPY1]], [[COPY]], 0 :: (store 4 into %ir.addr)
76 G_STORE %1, %0 :: (store 4 into %ir.addr)
86 - { id: 0, class: gpr }
87 - { id: 1, class: gpr }
93 ; CHECK-LABEL: name: store_s16_gpr
94 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
95 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
96 ; CHECK: STRHHui [[COPY1]], [[COPY]], 0 :: (store 2 into %ir.addr)
98 %2:gpr(s32) = COPY $w1
100 G_STORE %1, %0 :: (store 2 into %ir.addr)
107 regBankSelected: true
110 - { id: 0, class: gpr }
111 - { id: 1, class: gpr }
117 ; CHECK-LABEL: name: store_s8_gpr
118 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
119 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
120 ; CHECK: STRBBui [[COPY1]], [[COPY]], 0 :: (store 1 into %ir.addr)
122 %2:gpr(s32) = COPY $w1
124 G_STORE %1, %0 :: (store 1 into %ir.addr)
129 name: store_zero_s64_gpr
131 regBankSelected: true
134 - { id: 0, class: gpr }
135 - { id: 1, class: gpr }
141 ; CHECK-LABEL: name: store_zero_s64_gpr
142 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
143 ; CHECK: STRXui $xzr, [[COPY]], 0 :: (store 8 into %ir.addr)
145 %1(s64) = G_CONSTANT i64 0
146 G_STORE %1, %0 :: (store 8 into %ir.addr)
151 name: store_zero_s32_gpr
153 regBankSelected: true
156 - { id: 0, class: gpr }
157 - { id: 1, class: gpr }
163 ; CHECK-LABEL: name: store_zero_s32_gpr
164 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
165 ; CHECK: STRWui $wzr, [[COPY]], 0 :: (store 4 into %ir.addr)
167 %1(s32) = G_CONSTANT i32 0
168 G_STORE %1, %0 :: (store 4 into %ir.addr)
173 name: store_fi_s64_gpr
175 regBankSelected: true
178 - { id: 0, class: gpr }
179 - { id: 1, class: gpr }
182 - { id: 0, name: ptr0, offset: 0, size: 8, alignment: 8 }
188 ; CHECK-LABEL: name: store_fi_s64_gpr
189 ; CHECK: [[COPY:%[0-9]+]]:gpr64 = COPY $x0
190 ; CHECK: STRXui [[COPY]], %stack.0.ptr0, 0 :: (store 8)
192 %1(p0) = G_FRAME_INDEX %stack.0.ptr0
193 G_STORE %0, %1 :: (store 8)
197 name: store_gep_128_s64_gpr
199 regBankSelected: true
202 - { id: 0, class: gpr }
203 - { id: 1, class: gpr }
204 - { id: 2, class: gpr }
205 - { id: 3, class: gpr }
211 ; CHECK-LABEL: name: store_gep_128_s64_gpr
212 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
213 ; CHECK: [[COPY1:%[0-9]+]]:gpr64 = COPY $x1
214 ; CHECK: STRXui [[COPY1]], [[COPY]], 16 :: (store 8 into %ir.addr)
217 %2(s64) = G_CONSTANT i64 128
218 %3(p0) = G_GEP %0, %2
219 G_STORE %1, %3 :: (store 8 into %ir.addr)
223 name: store_gep_512_s32_gpr
225 regBankSelected: true
228 - { id: 0, class: gpr }
229 - { id: 1, class: gpr }
230 - { id: 2, class: gpr }
231 - { id: 3, class: gpr }
237 ; CHECK-LABEL: name: store_gep_512_s32_gpr
238 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
239 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
240 ; CHECK: STRWui [[COPY1]], [[COPY]], 128 :: (store 4 into %ir.addr)
243 %2(s64) = G_CONSTANT i64 512
244 %3(p0) = G_GEP %0, %2
245 G_STORE %1, %3 :: (store 4 into %ir.addr)
249 name: store_gep_64_s16_gpr
251 regBankSelected: true
254 - { id: 0, class: gpr }
255 - { id: 1, class: gpr }
256 - { id: 2, class: gpr }
257 - { id: 3, class: gpr }
263 ; CHECK-LABEL: name: store_gep_64_s16_gpr
264 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
265 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
266 ; CHECK: STRHHui [[COPY1]], [[COPY]], 32 :: (store 2 into %ir.addr)
268 %4:gpr(s32) = COPY $w1
270 %2(s64) = G_CONSTANT i64 64
271 %3(p0) = G_GEP %0, %2
272 G_STORE %1, %3 :: (store 2 into %ir.addr)
276 name: store_gep_1_s8_gpr
278 regBankSelected: true
281 - { id: 0, class: gpr }
282 - { id: 1, class: gpr }
283 - { id: 2, class: gpr }
284 - { id: 3, class: gpr }
290 ; CHECK-LABEL: name: store_gep_1_s8_gpr
291 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
292 ; CHECK: [[COPY1:%[0-9]+]]:gpr32 = COPY $w1
293 ; CHECK: STRBBui [[COPY1]], [[COPY]], 1 :: (store 1 into %ir.addr)
295 %4:gpr(s32) = COPY $w1
297 %2(s64) = G_CONSTANT i64 1
298 %3(p0) = G_GEP %0, %2
299 G_STORE %1, %3 :: (store 1 into %ir.addr)
305 regBankSelected: true
308 - { id: 0, class: gpr }
309 - { id: 1, class: fpr }
315 ; CHECK-LABEL: name: store_s64_fpr
316 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
317 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
318 ; CHECK: STRDui [[COPY1]], [[COPY]], 0 :: (store 8 into %ir.addr)
321 G_STORE %1, %0 :: (store 8 into %ir.addr)
328 regBankSelected: true
331 - { id: 0, class: gpr }
332 - { id: 1, class: fpr }
338 ; CHECK-LABEL: name: store_s32_fpr
339 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
340 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
341 ; CHECK: STRSui [[COPY1]], [[COPY]], 0 :: (store 4 into %ir.addr)
344 G_STORE %1, %0 :: (store 4 into %ir.addr)
349 name: store_gep_8_s64_fpr
351 regBankSelected: true
354 - { id: 0, class: gpr }
355 - { id: 1, class: fpr }
356 - { id: 2, class: gpr }
357 - { id: 3, class: gpr }
363 ; CHECK-LABEL: name: store_gep_8_s64_fpr
364 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
365 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
366 ; CHECK: STRDui [[COPY1]], [[COPY]], 1 :: (store 8 into %ir.addr)
369 %2(s64) = G_CONSTANT i64 8
370 %3(p0) = G_GEP %0, %2
371 G_STORE %1, %3 :: (store 8 into %ir.addr)
375 name: store_gep_8_s32_fpr
377 regBankSelected: true
380 - { id: 0, class: gpr }
381 - { id: 1, class: fpr }
382 - { id: 2, class: gpr }
383 - { id: 3, class: gpr }
389 ; CHECK-LABEL: name: store_gep_8_s32_fpr
390 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
391 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
392 ; CHECK: STRSui [[COPY1]], [[COPY]], 2 :: (store 4 into %ir.addr)
395 %2(s64) = G_CONSTANT i64 8
396 %3(p0) = G_GEP %0, %2
397 G_STORE %1, %3 :: (store 4 into %ir.addr)
402 regBankSelected: true
405 - { id: 0, class: gpr }
406 - { id: 1, class: fpr }
412 ; CHECK-LABEL: name: store_v2s32
413 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
414 ; CHECK: [[COPY1:%[0-9]+]]:fpr64 = COPY $d1
415 ; CHECK: STRDui [[COPY1]], [[COPY]], 0 :: (store 8 into %ir.addr)
417 %1(<2 x s32>) = COPY $d1
418 G_STORE %1, %0 :: (store 8 into %ir.addr)