1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 3
2 # RUN: llc -mtriple=riscv64 -mattr=+d -run-pass=legalizer %s -o - \
7 tracksRegLiveness: true
12 ; CHECK-LABEL: name: sitofp_s32_s1
13 ; CHECK: liveins: $x10
15 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
16 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
17 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
18 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
19 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s64)
20 ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
21 ; CHECK-NEXT: PseudoRET implicit $f10_f
23 %0:_(s1) = G_TRUNC %1(s64)
24 %2:_(s32) = G_SITOFP %0(s1)
26 PseudoRET implicit $f10_f
31 tracksRegLiveness: true
36 ; CHECK-LABEL: name: uitofp_s32_s1
37 ; CHECK: liveins: $x10
39 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
40 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
41 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
42 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s64)
43 ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
44 ; CHECK-NEXT: PseudoRET implicit $f10_f
46 %0:_(s1) = G_TRUNC %1(s64)
47 %2:_(s32) = G_UITOFP %0(s1)
49 PseudoRET implicit $f10_f
54 tracksRegLiveness: true
59 ; CHECK-LABEL: name: sitofp_s32_s8
60 ; CHECK: liveins: $x10
62 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
63 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
64 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
65 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
66 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s64)
67 ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
68 ; CHECK-NEXT: PseudoRET implicit $f10_f
70 %0:_(s8) = G_TRUNC %1(s64)
71 %2:_(s32) = G_SITOFP %0(s8)
73 PseudoRET implicit $f10_f
78 tracksRegLiveness: true
83 ; CHECK-LABEL: name: uitofp_s32_s8
84 ; CHECK: liveins: $x10
86 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
87 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
88 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
89 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s64)
90 ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
91 ; CHECK-NEXT: PseudoRET implicit $f10_f
93 %0:_(s8) = G_TRUNC %1(s64)
94 %2:_(s32) = G_UITOFP %0(s8)
96 PseudoRET implicit $f10_f
101 tracksRegLiveness: true
106 ; CHECK-LABEL: name: sitofp_s32_s16
107 ; CHECK: liveins: $x10
109 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
110 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
111 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
112 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
113 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[ASHR]](s64)
114 ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
115 ; CHECK-NEXT: PseudoRET implicit $f10_f
116 %1:_(s64) = COPY $x10
117 %0:_(s16) = G_TRUNC %1(s64)
118 %2:_(s32) = G_SITOFP %0(s16)
119 $f10_f = COPY %2(s32)
120 PseudoRET implicit $f10_f
125 tracksRegLiveness: true
130 ; CHECK-LABEL: name: uitofp_s32_s16
131 ; CHECK: liveins: $x10
133 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
134 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
135 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
136 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s64)
137 ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
138 ; CHECK-NEXT: PseudoRET implicit $f10_f
139 %1:_(s64) = COPY $x10
140 %0:_(s16) = G_TRUNC %1(s64)
141 %2:_(s32) = G_UITOFP %0(s16)
142 $f10_f = COPY %2(s32)
143 PseudoRET implicit $f10_f
148 tracksRegLiveness: true
153 ; CHECK-LABEL: name: sitofp_s32_s32
154 ; CHECK: liveins: $x10
156 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
157 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
158 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[SEXT_INREG]](s64)
159 ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
160 ; CHECK-NEXT: PseudoRET implicit $f10_f
161 %1:_(s64) = COPY $x10
162 %0:_(s32) = G_TRUNC %1(s64)
163 %2:_(s32) = G_SITOFP %0(s32)
164 $f10_f = COPY %2(s32)
165 PseudoRET implicit $f10_f
170 tracksRegLiveness: true
175 ; CHECK-LABEL: name: uitofp_s32_s32
176 ; CHECK: liveins: $x10
178 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
179 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
180 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
181 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[AND]](s64)
182 ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
183 ; CHECK-NEXT: PseudoRET implicit $f10_f
184 %1:_(s64) = COPY $x10
185 %0:_(s32) = G_TRUNC %1(s64)
186 %2:_(s32) = G_UITOFP %0(s32)
187 $f10_f = COPY %2(s32)
188 PseudoRET implicit $f10_f
193 tracksRegLiveness: true
198 ; CHECK-LABEL: name: sitofp_s32_s64
199 ; CHECK: liveins: $x10
201 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
202 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s32) = G_SITOFP [[COPY]](s64)
203 ; CHECK-NEXT: $f10_f = COPY [[SITOFP]](s32)
204 ; CHECK-NEXT: PseudoRET implicit $f10_f
205 %0:_(s64) = COPY $x10
206 %1:_(s32) = G_SITOFP %0(s64)
207 $f10_f = COPY %1(s32)
208 PseudoRET implicit $f10_f
213 tracksRegLiveness: true
218 ; CHECK-LABEL: name: uitofp_s32_s64
219 ; CHECK: liveins: $x10
221 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
222 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s32) = G_UITOFP [[COPY]](s64)
223 ; CHECK-NEXT: $f10_f = COPY [[UITOFP]](s32)
224 ; CHECK-NEXT: PseudoRET implicit $f10_f
225 %0:_(s64) = COPY $x10
226 %1:_(s32) = G_UITOFP %0(s64)
227 $f10_f = COPY %1(s32)
228 PseudoRET implicit $f10_f
233 tracksRegLiveness: true
238 ; CHECK-LABEL: name: sitofp_s64_s1
239 ; CHECK: liveins: $x10
241 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
242 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 63
243 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
244 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
245 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s64)
246 ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
247 ; CHECK-NEXT: PseudoRET implicit $f10_d
248 %1:_(s64) = COPY $x10
249 %0:_(s1) = G_TRUNC %1(s64)
250 %2:_(s64) = G_SITOFP %0(s1)
251 $f10_d = COPY %2(s64)
252 PseudoRET implicit $f10_d
257 tracksRegLiveness: true
262 ; CHECK-LABEL: name: uitofp_s64_s1
263 ; CHECK: liveins: $x10
265 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
266 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1
267 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
268 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s64)
269 ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
270 ; CHECK-NEXT: PseudoRET implicit $f10_d
271 %1:_(s64) = COPY $x10
272 %0:_(s1) = G_TRUNC %1(s64)
273 %2:_(s64) = G_UITOFP %0(s1)
274 $f10_d = COPY %2(s64)
275 PseudoRET implicit $f10_d
280 tracksRegLiveness: true
285 ; CHECK-LABEL: name: sitofp_s64_s8
286 ; CHECK: liveins: $x10
288 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
289 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 56
290 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
291 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
292 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s64)
293 ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
294 ; CHECK-NEXT: PseudoRET implicit $f10_d
295 %1:_(s64) = COPY $x10
296 %0:_(s8) = G_TRUNC %1(s64)
297 %2:_(s64) = G_SITOFP %0(s8)
298 $f10_d = COPY %2(s64)
299 PseudoRET implicit $f10_d
304 tracksRegLiveness: true
309 ; CHECK-LABEL: name: uitofp_s64_s8
310 ; CHECK: liveins: $x10
312 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
313 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 255
314 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
315 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s64)
316 ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
317 ; CHECK-NEXT: PseudoRET implicit $f10_d
318 %1:_(s64) = COPY $x10
319 %0:_(s8) = G_TRUNC %1(s64)
320 %2:_(s64) = G_UITOFP %0(s8)
321 $f10_d = COPY %2(s64)
322 PseudoRET implicit $f10_d
327 tracksRegLiveness: true
332 ; CHECK-LABEL: name: sitofp_s64_s16
333 ; CHECK: liveins: $x10
335 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
336 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 48
337 ; CHECK-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64)
338 ; CHECK-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C]](s64)
339 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[ASHR]](s64)
340 ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
341 ; CHECK-NEXT: PseudoRET implicit $f10_d
342 %1:_(s64) = COPY $x10
343 %0:_(s16) = G_TRUNC %1(s64)
344 %2:_(s64) = G_SITOFP %0(s16)
345 $f10_d = COPY %2(s64)
346 PseudoRET implicit $f10_d
351 tracksRegLiveness: true
356 ; CHECK-LABEL: name: uitofp_s64_s16
357 ; CHECK: liveins: $x10
359 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
360 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 65535
361 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
362 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s64)
363 ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
364 ; CHECK-NEXT: PseudoRET implicit $f10_d
365 %1:_(s64) = COPY $x10
366 %0:_(s16) = G_TRUNC %1(s64)
367 %2:_(s64) = G_UITOFP %0(s16)
368 $f10_d = COPY %2(s64)
369 PseudoRET implicit $f10_d
374 tracksRegLiveness: true
379 ; CHECK-LABEL: name: sitofp_s64_s32
380 ; CHECK: liveins: $x10
382 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
383 ; CHECK-NEXT: [[SEXT_INREG:%[0-9]+]]:_(s64) = G_SEXT_INREG [[COPY]], 32
384 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[SEXT_INREG]](s64)
385 ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
386 ; CHECK-NEXT: PseudoRET implicit $f10_d
387 %1:_(s64) = COPY $x10
388 %0:_(s32) = G_TRUNC %1(s64)
389 %2:_(s64) = G_SITOFP %0(s32)
390 $f10_d = COPY %2(s64)
391 PseudoRET implicit $f10_d
396 tracksRegLiveness: true
401 ; CHECK-LABEL: name: uitofp_s64_s32
402 ; CHECK: liveins: $x10
404 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
405 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295
406 ; CHECK-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]]
407 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[AND]](s64)
408 ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
409 ; CHECK-NEXT: PseudoRET implicit $f10_d
410 %1:_(s64) = COPY $x10
411 %0:_(s32) = G_TRUNC %1(s64)
412 %2:_(s64) = G_UITOFP %0(s32)
413 $f10_d = COPY %2(s64)
414 PseudoRET implicit $f10_d
419 tracksRegLiveness: true
424 ; CHECK-LABEL: name: sitofp_s64_s64
425 ; CHECK: liveins: $x10
427 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
428 ; CHECK-NEXT: [[SITOFP:%[0-9]+]]:_(s64) = G_SITOFP [[COPY]](s64)
429 ; CHECK-NEXT: $f10_d = COPY [[SITOFP]](s64)
430 ; CHECK-NEXT: PseudoRET implicit $f10_d
431 %0:_(s64) = COPY $x10
432 %1:_(s64) = G_SITOFP %0(s64)
433 $f10_d = COPY %1(s64)
434 PseudoRET implicit $f10_d
439 tracksRegLiveness: true
444 ; CHECK-LABEL: name: uitofp_s64_s64
445 ; CHECK: liveins: $x10
447 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10
448 ; CHECK-NEXT: [[UITOFP:%[0-9]+]]:_(s64) = G_UITOFP [[COPY]](s64)
449 ; CHECK-NEXT: $f10_d = COPY [[UITOFP]](s64)
450 ; CHECK-NEXT: PseudoRET implicit $f10_d
451 %0:_(s64) = COPY $x10
452 %1:_(s64) = G_UITOFP %0(s64)
453 $f10_d = COPY %1(s64)
454 PseudoRET implicit $f10_d