1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=riscv32 -mattr=-d -mattr=-f -run-pass=legalizer %s -o - \
10 ; CHECK-LABEL: name: fptosi_s1_s32
11 ; CHECK: liveins: $x10
13 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
14 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
15 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
16 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixsfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
17 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
19 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
20 ; CHECK-NEXT: PseudoRET implicit $x10
22 %1:_(s1) = G_FPTOSI %0:_(s32)
23 %2:_(s32) = G_ANYEXT %1:_(s1)
25 PseudoRET implicit $x10
32 ; CHECK-LABEL: name: fptoui_s1_s32
33 ; CHECK: liveins: $x10
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
36 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
37 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
38 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunssfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
39 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
40 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
41 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
42 ; CHECK-NEXT: PseudoRET implicit $x10
44 %1:_(s1) = G_FPTOUI %0:_(s32)
45 %2:_(s32) = G_ANYEXT %1:_(s1)
47 PseudoRET implicit $x10
54 ; CHECK-LABEL: name: fptosi_s8_s32
55 ; CHECK: liveins: $x10
57 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
58 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
59 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
60 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixsfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
61 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
62 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
63 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
64 ; CHECK-NEXT: PseudoRET implicit $x10
66 %1:_(s8) = G_FPTOSI %0:_(s32)
67 %2:_(s32) = G_ANYEXT %1:_(s8)
69 PseudoRET implicit $x10
77 ; CHECK-LABEL: name: fptoui_s8_s32
78 ; CHECK: liveins: $x10
80 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
81 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
82 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
83 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunssfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
84 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
85 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
86 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
87 ; CHECK-NEXT: PseudoRET implicit $x10
89 %1:_(s8) = G_FPTOUI %0:_(s32)
90 %2:_(s32) = G_ANYEXT %1:_(s8)
92 PseudoRET implicit $x10
100 ; CHECK-LABEL: name: fptosi_s16_s32
101 ; CHECK: liveins: $x10
103 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
104 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
105 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
106 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixsfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
107 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
108 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
109 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
110 ; CHECK-NEXT: PseudoRET implicit $x10
111 %0:_(s32) = COPY $x10
112 %1:_(s16) = G_FPTOSI %0:_(s32)
113 %2:_(s32) = G_ANYEXT %1:_(s16)
114 $x10 = COPY %2:_(s32)
115 PseudoRET implicit $x10
123 ; CHECK-LABEL: name: fptoui_s16_s32
124 ; CHECK: liveins: $x10
126 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
127 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
128 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
129 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunssfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
130 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
131 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
132 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
133 ; CHECK-NEXT: PseudoRET implicit $x10
134 %0:_(s32) = COPY $x10
135 %1:_(s16) = G_FPTOUI %0:_(s32)
136 %2:_(s32) = G_ANYEXT %1:_(s16)
137 $x10 = COPY %2:_(s32)
138 PseudoRET implicit $x10
146 ; CHECK-LABEL: name: fptosi_s32_s32
147 ; CHECK: liveins: $x10
149 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
150 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
151 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
152 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixsfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
153 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
154 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
155 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
156 ; CHECK-NEXT: PseudoRET implicit $x10
157 %0:_(s32) = COPY $x10
158 %1:_(s32) = G_FPTOSI %0:_(s32)
159 $x10 = COPY %1:_(s32)
160 PseudoRET implicit $x10
168 ; CHECK-LABEL: name: fptoui_s32_s32
169 ; CHECK: liveins: $x10
171 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
172 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
173 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
174 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunssfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit-def $x10
175 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
176 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
177 ; CHECK-NEXT: $x10 = COPY [[COPY1]](s32)
178 ; CHECK-NEXT: PseudoRET implicit $x10
179 %0:_(s32) = COPY $x10
180 %1:_(s32) = G_FPTOUI %0:_(s32)
181 $x10 = COPY %1:_(s32)
182 PseudoRET implicit $x10
190 ; CHECK-LABEL: name: fptosi_s1_s64
191 ; CHECK: liveins: $x10, $x11
193 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
194 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
195 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
196 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
197 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
198 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
199 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
200 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
201 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
202 ; CHECK-NEXT: PseudoRET implicit $x10
203 %1:_(s32) = COPY $x10
204 %2:_(s32) = COPY $x11
205 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
206 %3:_(s1) = G_FPTOSI %0:_(s64)
207 %4:_(s32) = G_ANYEXT %3:_(s1)
208 $x10 = COPY %4:_(s32)
209 PseudoRET implicit $x10
217 ; CHECK-LABEL: name: fptoui_s1_s64
218 ; CHECK: liveins: $x10, $x11
220 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
221 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
222 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
223 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
224 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
225 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunsdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
226 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
227 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
228 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
229 ; CHECK-NEXT: PseudoRET implicit $x10
230 %1:_(s32) = COPY $x10
231 %2:_(s32) = COPY $x11
232 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
233 %3:_(s1) = G_FPTOUI %0:_(s64)
234 %4:_(s32) = G_ANYEXT %3:_(s1)
235 $x10 = COPY %4:_(s32)
236 PseudoRET implicit $x10
244 ; CHECK-LABEL: name: fptosi_s8_s64
245 ; CHECK: liveins: $x10, $x11
247 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
248 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
249 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
250 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
251 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
252 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
253 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
254 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
255 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
256 ; CHECK-NEXT: PseudoRET implicit $x10
257 %1:_(s32) = COPY $x10
258 %2:_(s32) = COPY $x11
259 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
260 %3:_(s8) = G_FPTOSI %0:_(s64)
261 %4:_(s32) = G_ANYEXT %3:_(s8)
262 $x10 = COPY %4:_(s32)
263 PseudoRET implicit $x10
270 ; CHECK-LABEL: name: fptoui_s8_s64
271 ; CHECK: liveins: $x10, $x11
273 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
274 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
275 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
276 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
277 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
278 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunsdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
279 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
280 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
281 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
282 ; CHECK-NEXT: PseudoRET implicit $x10
283 %1:_(s32) = COPY $x10
284 %2:_(s32) = COPY $x11
285 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
286 %3:_(s8) = G_FPTOUI %0:_(s64)
287 %4:_(s32) = G_ANYEXT %3:_(s8)
288 $x10 = COPY %4:_(s32)
289 PseudoRET implicit $x10
297 ; CHECK-LABEL: name: fptosi_s16_s64
298 ; CHECK: liveins: $x10, $x11
300 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
301 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
302 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
303 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
304 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
305 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
306 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
307 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
308 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
309 ; CHECK-NEXT: PseudoRET implicit $x10
310 %1:_(s32) = COPY $x10
311 %2:_(s32) = COPY $x11
312 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
313 %3:_(s16) = G_FPTOSI %0:_(s64)
314 %4:_(s32) = G_ANYEXT %3:_(s16)
315 $x10 = COPY %4:_(s32)
316 PseudoRET implicit $x10
324 ; CHECK-LABEL: name: fptoui_s16_s64
325 ; CHECK: liveins: $x10, $x11
327 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
328 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
329 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
330 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
331 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
332 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunsdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
333 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
334 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
335 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
336 ; CHECK-NEXT: PseudoRET implicit $x10
337 %1:_(s32) = COPY $x10
338 %2:_(s32) = COPY $x11
339 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
340 %3:_(s16) = G_FPTOUI %0:_(s64)
341 %4:_(s32) = G_ANYEXT %3:_(s16)
342 $x10 = COPY %4:_(s32)
343 PseudoRET implicit $x10
351 ; CHECK-LABEL: name: fptosi_s32_s64
352 ; CHECK: liveins: $x10, $x11
354 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
355 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
356 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
357 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
358 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
359 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
360 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
361 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
362 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
363 ; CHECK-NEXT: PseudoRET implicit $x10
364 %1:_(s32) = COPY $x10
365 %2:_(s32) = COPY $x11
366 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
367 %3:_(s32) = G_FPTOSI %0:_(s64)
368 $x10 = COPY %3:_(s32)
369 PseudoRET implicit $x10
376 ; CHECK-LABEL: name: fptoui_s32_s64
377 ; CHECK: liveins: $x10, $x11
379 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
380 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
381 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
382 ; CHECK-NEXT: $x10 = COPY [[COPY]](s32)
383 ; CHECK-NEXT: $x11 = COPY [[COPY1]](s32)
384 ; CHECK-NEXT: PseudoCALL target-flags(riscv-call) &__fixunsdfsi, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit-def $x10
385 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
386 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x10
387 ; CHECK-NEXT: $x10 = COPY [[COPY2]](s32)
388 ; CHECK-NEXT: PseudoRET implicit $x10
389 %1:_(s32) = COPY $x10
390 %2:_(s32) = COPY $x11
391 %0:_(s64) = G_MERGE_VALUES %1:_(s32), %2:_(s32)
392 %3:_(s32) = G_FPTOUI %0:_(s64)
393 $x10 = COPY %3:_(s32)
394 PseudoRET implicit $x10