1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -run-pass=instruction-select %s -o - \
3 # RUN: -disable-gisel-legality-check | FileCheck %s
9 tracksRegLiveness: true
14 ; CHECK-LABEL: name: store_i8_i64
15 ; CHECK: liveins: $x10, $x11
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
19 ; CHECK-NEXT: SB [[COPY]], [[COPY1]], 0 :: (store (s8))
20 ; CHECK-NEXT: PseudoRET
21 %0:gprb(s64) = COPY $x10
22 %1:gprb(p0) = COPY $x11
23 G_STORE %0(s64), %1(p0) :: (store (s8))
31 tracksRegLiveness: true
36 ; CHECK-LABEL: name: store_i16_i64
37 ; CHECK: liveins: $x10, $x11
39 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
40 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
41 ; CHECK-NEXT: SH [[COPY]], [[COPY1]], 0 :: (store (s16))
42 ; CHECK-NEXT: PseudoRET
43 %0:gprb(s64) = COPY $x10
44 %1:gprb(p0) = COPY $x11
45 G_STORE %0(s64), %1(p0) :: (store (s16))
53 tracksRegLiveness: true
58 ; CHECK-LABEL: name: store_i8_i16
59 ; CHECK: liveins: $x10, $x11
61 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
62 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
63 ; CHECK-NEXT: SB [[COPY]], [[COPY1]], 0 :: (store (s8))
64 ; CHECK-NEXT: PseudoRET
65 %0:gprb(s64) = COPY $x10
66 %1:gprb(p0) = COPY $x11
67 %2:gprb(s16) = G_TRUNC %0
68 G_STORE %2(s16), %1(p0) :: (store (s8))
76 tracksRegLiveness: true
81 ; CHECK-LABEL: name: store_i16_i16
82 ; CHECK: liveins: $x10, $x11
84 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
85 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
86 ; CHECK-NEXT: SH [[COPY]], [[COPY1]], 0 :: (store (s16))
87 ; CHECK-NEXT: PseudoRET
88 %0:gprb(s64) = COPY $x10
89 %1:gprb(p0) = COPY $x11
90 %2:gprb(s16) = G_TRUNC %0
91 G_STORE %2(s16), %1(p0) :: (store (s16))
99 tracksRegLiveness: true
104 ; CHECK-LABEL: name: store_i32_i64
105 ; CHECK: liveins: $x10, $x11
107 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
108 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
109 ; CHECK-NEXT: SW [[COPY]], [[COPY1]], 0 :: (store (s32))
110 ; CHECK-NEXT: PseudoRET
111 %0:gprb(s64) = COPY $x10
112 %1:gprb(p0) = COPY $x11
113 G_STORE %0(s64), %1(p0) :: (store (s32))
120 regBankSelected: true
121 tracksRegLiveness: true
126 ; CHECK-LABEL: name: store_i64_i64
127 ; CHECK: liveins: $x10, $x11
129 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
130 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
131 ; CHECK-NEXT: SD [[COPY]], [[COPY1]], 0 :: (store (s64))
132 ; CHECK-NEXT: PseudoRET
133 %0:gprb(s64) = COPY $x10
134 %1:gprb(p0) = COPY $x11
135 G_STORE %0(s64), %1(p0) :: (store (s64))
142 regBankSelected: true
143 tracksRegLiveness: true
148 ; CHECK-LABEL: name: store_p0
149 ; CHECK: liveins: $x10, $x11
151 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
152 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
153 ; CHECK-NEXT: SD [[COPY]], [[COPY1]], 0 :: (store (p0))
154 ; CHECK-NEXT: PseudoRET
155 %0:gprb(p0) = COPY $x10
156 %1:gprb(p0) = COPY $x11
157 G_STORE %0(p0), %1(p0) :: (store (p0))
162 name: truncstore_i8_i32
164 regBankSelected: true
165 tracksRegLiveness: true
170 ; CHECK-LABEL: name: truncstore_i8_i32
171 ; CHECK: liveins: $x10, $x11
173 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
174 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
175 ; CHECK-NEXT: SB [[COPY1]], [[COPY]], 0 :: (store (s8))
176 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x0
177 ; CHECK-NEXT: $x10 = COPY [[COPY2]]
178 ; CHECK-NEXT: PseudoRET implicit $x10
179 %0:gprb(p0) = COPY $x10
180 %3:gprb(s64) = COPY $x11
181 %9:gprb(s32) = G_TRUNC %3(s64)
182 G_STORE %9(s32), %0(p0) :: (store (s8))
183 %7:gprb(s64) = G_CONSTANT i64 0
185 PseudoRET implicit $x10
189 name: truncstore_i16_i32
191 regBankSelected: true
192 tracksRegLiveness: true
197 ; CHECK-LABEL: name: truncstore_i16_i32
198 ; CHECK: liveins: $x10, $x11
200 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
201 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
202 ; CHECK-NEXT: SH [[COPY1]], [[COPY]], 0 :: (store (s16))
203 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x0
204 ; CHECK-NEXT: $x10 = COPY [[COPY2]]
205 ; CHECK-NEXT: PseudoRET implicit $x10
206 %0:gprb(p0) = COPY $x10
207 %3:gprb(s64) = COPY $x11
208 %9:gprb(s32) = G_TRUNC %3(s64)
209 G_STORE %9(s32), %0(p0) :: (store (s16))
210 %7:gprb(s64) = G_CONSTANT i64 0
212 PseudoRET implicit $x10
218 regBankSelected: true
219 tracksRegLiveness: true
224 ; CHECK-LABEL: name: store_i32_i32
225 ; CHECK: liveins: $x10, $x11
227 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
228 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
229 ; CHECK-NEXT: SW [[COPY1]], [[COPY]], 0 :: (store (s32))
230 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:gpr = COPY $x0
231 ; CHECK-NEXT: $x10 = COPY [[COPY2]]
232 ; CHECK-NEXT: PseudoRET implicit $x10
233 %0:gprb(p0) = COPY $x10
234 %3:gprb(s64) = COPY $x11
235 %9:gprb(s32) = G_TRUNC %3(s64)
236 G_STORE %9(s32), %0(p0) :: (store (s32))
237 %7:gprb(s64) = G_CONSTANT i64 0
239 PseudoRET implicit $x10
243 name: store_fi_i64_i64
245 regBankSelected: true
246 tracksRegLiveness: true
249 - { id: 0, offset: 0, size: 8, alignment: 8 }
255 ; CHECK-LABEL: name: store_fi_i64_i64
256 ; CHECK: liveins: $x10
258 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
259 ; CHECK-NEXT: SD [[COPY]], %stack.0, 0 :: (store (s64))
260 ; CHECK-NEXT: PseudoRET
261 %0:gprb(s64) = COPY $x10
262 %1:gprb(p0) = G_FRAME_INDEX %stack.0
263 G_STORE %0(s64), %1(p0) :: (store (s64))
268 name: store_fi_gep_i64_i64
270 regBankSelected: true
271 tracksRegLiveness: true
274 - { id: 0, offset: 0, size: 16, alignment: 8 }
280 ; CHECK-LABEL: name: store_fi_gep_i64_i64
281 ; CHECK: liveins: $x10
283 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
284 ; CHECK-NEXT: SD [[COPY]], %stack.0, 8 :: (store (s64))
285 ; CHECK-NEXT: PseudoRET
286 %0:gprb(s64) = COPY $x10
287 %1:gprb(p0) = G_FRAME_INDEX %stack.0
288 %2:gprb(s64) = G_CONSTANT i64 8
289 %3:gprb(p0) = G_PTR_ADD %1(p0), %2(s64)
290 G_STORE %0(s64), %3(p0) :: (store (s64))
295 name: store_gep_i64_i64
297 regBankSelected: true
298 tracksRegLiveness: true
303 ; CHECK-LABEL: name: store_gep_i64_i64
304 ; CHECK: liveins: $x10, $x11
306 ; CHECK-NEXT: [[COPY:%[0-9]+]]:gpr = COPY $x10
307 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:gpr = COPY $x11
308 ; CHECK-NEXT: SD [[COPY]], [[COPY1]], 8 :: (store (s64))
309 ; CHECK-NEXT: PseudoRET
310 %0:gprb(s64) = COPY $x10
311 %1:gprb(p0) = COPY $x11
312 %2:gprb(s64) = G_CONSTANT i64 8
313 %3:gprb(p0) = G_PTR_ADD %1(p0), %2(s64)
314 G_STORE %0(s64), %3(p0) :: (store (s64))