1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv64 -mattr=+d -run-pass=legalizer %s -o - \
11 ; CHECK-LABEL: name: fptosi_s1_s32
12 ; CHECK: liveins: $f10_f
14 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
15 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s32), 1
16 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
17 ; CHECK-NEXT: PseudoRET implicit $x10
18 %0:_(s32) = COPY $f10_f
19 %1:_(s1) = G_FPTOSI %0(s32)
20 %2:_(s64) = G_ANYEXT %1(s1)
22 PseudoRET implicit $x10
31 ; CHECK-LABEL: name: fptoui_s1_s32
32 ; CHECK: liveins: $f10_f
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
35 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s32), 1
36 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
37 ; CHECK-NEXT: PseudoRET implicit $x10
38 %0:_(s32) = COPY $f10_f
39 %1:_(s1) = G_FPTOUI %0(s32)
40 %2:_(s64) = G_ANYEXT %1(s1)
42 PseudoRET implicit $x10
51 ; CHECK-LABEL: name: fptosi_s8_s32
52 ; CHECK: liveins: $f10_f
54 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
55 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s32), 1
56 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
57 ; CHECK-NEXT: PseudoRET implicit $x10
58 %0:_(s32) = COPY $f10_f
59 %1:_(s8) = G_FPTOSI %0(s32)
60 %2:_(s64) = G_ANYEXT %1(s8)
62 PseudoRET implicit $x10
71 ; CHECK-LABEL: name: fptoui_s8_s32
72 ; CHECK: liveins: $f10_f
74 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
75 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s32), 1
76 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
77 ; CHECK-NEXT: PseudoRET implicit $x10
78 %0:_(s32) = COPY $f10_f
79 %1:_(s8) = G_FPTOUI %0(s32)
80 %2:_(s64) = G_ANYEXT %1(s8)
82 PseudoRET implicit $x10
91 ; CHECK-LABEL: name: fptosi_s16_s32
92 ; CHECK: liveins: $f10_f
94 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
95 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s32), 1
96 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
97 ; CHECK-NEXT: PseudoRET implicit $x10
98 %0:_(s32) = COPY $f10_f
99 %1:_(s16) = G_FPTOSI %0(s32)
100 %2:_(s64) = G_ANYEXT %1(s16)
102 PseudoRET implicit $x10
111 ; CHECK-LABEL: name: fptoui_s16_s32
112 ; CHECK: liveins: $f10_f
114 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
115 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s32), 1
116 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
117 ; CHECK-NEXT: PseudoRET implicit $x10
118 %0:_(s32) = COPY $f10_f
119 %1:_(s16) = G_FPTOUI %0(s32)
120 %2:_(s64) = G_ANYEXT %1(s16)
122 PseudoRET implicit $x10
131 ; CHECK-LABEL: name: fptosi_s32_s32
132 ; CHECK: liveins: $f10_f
134 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
135 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s32), 1
136 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
137 ; CHECK-NEXT: PseudoRET implicit $x10
138 %0:_(s32) = COPY $f10_f
139 %1:_(s32) = G_FPTOSI %0(s32)
140 %2:_(s64) = G_ANYEXT %1(s32)
142 PseudoRET implicit $x10
151 ; CHECK-LABEL: name: fptoui_s32_s32
152 ; CHECK: liveins: $f10_f
154 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
155 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s32), 1
156 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
157 ; CHECK-NEXT: PseudoRET implicit $x10
158 %0:_(s32) = COPY $f10_f
159 %1:_(s32) = G_FPTOUI %0(s32)
160 %2:_(s64) = G_ANYEXT %1(s32)
162 PseudoRET implicit $x10
171 ; CHECK-LABEL: name: fptosi_s64_s32
172 ; CHECK: liveins: $f10_f
174 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
175 ; CHECK-NEXT: [[FPTOSI:%[0-9]+]]:_(s64) = G_FPTOSI [[COPY]](s32)
176 ; CHECK-NEXT: $x10 = COPY [[FPTOSI]](s64)
177 ; CHECK-NEXT: PseudoRET implicit $x10
178 %0:_(s32) = COPY $f10_f
179 %1:_(s64) = G_FPTOSI %0(s32)
181 PseudoRET implicit $x10
190 ; CHECK-LABEL: name: fptoui_s64_s32
191 ; CHECK: liveins: $f10_f
193 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $f10_f
194 ; CHECK-NEXT: [[FPTOUI:%[0-9]+]]:_(s64) = G_FPTOUI [[COPY]](s32)
195 ; CHECK-NEXT: $x10 = COPY [[FPTOUI]](s64)
196 ; CHECK-NEXT: PseudoRET implicit $x10
197 %0:_(s32) = COPY $f10_f
198 %1:_(s64) = G_FPTOUI %0(s32)
200 PseudoRET implicit $x10
209 ; CHECK-LABEL: name: fptosi_s1_s64
210 ; CHECK: liveins: $f10_d
212 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
213 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s64), 1
214 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
215 ; CHECK-NEXT: PseudoRET implicit $x10
216 %0:_(s64) = COPY $f10_d
217 %1:_(s1) = G_FPTOSI %0(s64)
218 %2:_(s64) = G_ANYEXT %1(s1)
220 PseudoRET implicit $x10
229 ; CHECK-LABEL: name: fptoui_s1_s64
230 ; CHECK: liveins: $f10_d
232 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
233 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s64), 1
234 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
235 ; CHECK-NEXT: PseudoRET implicit $x10
236 %0:_(s64) = COPY $f10_d
237 %1:_(s1) = G_FPTOUI %0(s64)
238 %2:_(s64) = G_ANYEXT %1(s1)
240 PseudoRET implicit $x10
249 ; CHECK-LABEL: name: fptosi_s8_s64
250 ; CHECK: liveins: $f10_d
252 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
253 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s64), 1
254 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
255 ; CHECK-NEXT: PseudoRET implicit $x10
256 %0:_(s64) = COPY $f10_d
257 %1:_(s8) = G_FPTOSI %0(s64)
258 %2:_(s64) = G_ANYEXT %1(s8)
260 PseudoRET implicit $x10
269 ; CHECK-LABEL: name: fptoui_s8_s64
270 ; CHECK: liveins: $f10_d
272 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
273 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s64), 1
274 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
275 ; CHECK-NEXT: PseudoRET implicit $x10
276 %0:_(s64) = COPY $f10_d
277 %1:_(s8) = G_FPTOUI %0(s64)
278 %2:_(s64) = G_ANYEXT %1(s8)
280 PseudoRET implicit $x10
289 ; CHECK-LABEL: name: fptosi_s16_s64
290 ; CHECK: liveins: $f10_d
292 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
293 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s64), 1
294 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
295 ; CHECK-NEXT: PseudoRET implicit $x10
296 %0:_(s64) = COPY $f10_d
297 %1:_(s16) = G_FPTOSI %0(s64)
298 %2:_(s64) = G_ANYEXT %1(s16)
300 PseudoRET implicit $x10
309 ; CHECK-LABEL: name: fptoui_s16_s64
310 ; CHECK: liveins: $f10_d
312 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
313 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s64), 1
314 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
315 ; CHECK-NEXT: PseudoRET implicit $x10
316 %0:_(s64) = COPY $f10_d
317 %1:_(s16) = G_FPTOUI %0(s64)
318 %2:_(s64) = G_ANYEXT %1(s16)
320 PseudoRET implicit $x10
329 ; CHECK-LABEL: name: fptosi_s32_s64
330 ; CHECK: liveins: $f10_d
332 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
333 ; CHECK-NEXT: [[FCVT_W_RV64_:%[0-9]+]]:_(s64) = G_FCVT_W_RV64 [[COPY]](s64), 1
334 ; CHECK-NEXT: $x10 = COPY [[FCVT_W_RV64_]](s64)
335 ; CHECK-NEXT: PseudoRET implicit $x10
336 %0:_(s64) = COPY $f10_d
337 %1:_(s32) = G_FPTOSI %0(s64)
338 %2:_(s64) = G_ANYEXT %1(s32)
340 PseudoRET implicit $x10
349 ; CHECK-LABEL: name: fptoui_s32_s64
350 ; CHECK: liveins: $f10_d
352 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
353 ; CHECK-NEXT: [[FCVT_WU_RV64_:%[0-9]+]]:_(s64) = G_FCVT_WU_RV64 [[COPY]](s64), 1
354 ; CHECK-NEXT: $x10 = COPY [[FCVT_WU_RV64_]](s64)
355 ; CHECK-NEXT: PseudoRET implicit $x10
356 %0:_(s64) = COPY $f10_d
357 %1:_(s32) = G_FPTOUI %0(s64)
358 %2:_(s64) = G_ANYEXT %1(s32)
360 PseudoRET implicit $x10
369 ; CHECK-LABEL: name: fptosi_s64_s64
370 ; CHECK: liveins: $f10_d
372 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
373 ; CHECK-NEXT: [[FPTOSI:%[0-9]+]]:_(s64) = G_FPTOSI [[COPY]](s64)
374 ; CHECK-NEXT: $x10 = COPY [[FPTOSI]](s64)
375 ; CHECK-NEXT: PseudoRET implicit $x10
376 %0:_(s64) = COPY $f10_d
377 %1:_(s64) = G_FPTOSI %0(s64)
379 PseudoRET implicit $x10
388 ; CHECK-LABEL: name: fptoui_s64_s64
389 ; CHECK: liveins: $f10_d
391 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $f10_d
392 ; CHECK-NEXT: [[FPTOUI:%[0-9]+]]:_(s64) = G_FPTOUI [[COPY]](s64)
393 ; CHECK-NEXT: $x10 = COPY [[FPTOUI]](s64)
394 ; CHECK-NEXT: PseudoRET implicit $x10
395 %0:_(s64) = COPY $f10_d
396 %1:_(s64) = G_FPTOUI %0(s64)
398 PseudoRET implicit $x10