1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP32
3 # RUN: llc -O0 -mtriple=mipsel-linux-gnu -mattr=+fp64,+mips32r2 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s -check-prefixes=FP64
6 define void @f32toi64() {entry: ret void}
7 define void @f32toi32() {entry: ret void}
8 define void @f32toi16() {entry: ret void}
9 define void @f32toi8() {entry: ret void}
10 define void @f64toi64() {entry: ret void}
11 define void @f64toi32() {entry: ret void}
12 define void @f64toi16() {entry: ret void}
13 define void @f64toi8() {entry: ret void}
14 define void @f32tou64() {entry: ret void}
15 define void @f32tou32() {entry: ret void}
16 define void @f32tou16() {entry: ret void}
17 define void @f32tou8() {entry: ret void}
18 define void @f64tou64() {entry: ret void}
19 define void @f64tou32() {entry: ret void}
20 define void @f64tou16() {entry: ret void}
21 define void @f64tou8() {entry: ret void}
27 tracksRegLiveness: true
32 ; FP32-LABEL: name: f32toi64
34 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
35 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
36 ; FP32: $f12 = COPY [[COPY]](s32)
37 ; FP32: JAL &__fixsfdi, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $v0, implicit-def $v1
38 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
39 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
40 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
41 ; FP32: $v0 = COPY [[COPY1]](s32)
42 ; FP32: $v1 = COPY [[COPY2]](s32)
43 ; FP32: RetRA implicit $v0, implicit $v1
44 ; FP64-LABEL: name: f32toi64
46 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
47 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
48 ; FP64: $f12 = COPY [[COPY]](s32)
49 ; FP64: JAL &__fixsfdi, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $v0, implicit-def $v1
50 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
51 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
52 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
53 ; FP64: $v0 = COPY [[COPY1]](s32)
54 ; FP64: $v1 = COPY [[COPY2]](s32)
55 ; FP64: RetRA implicit $v0, implicit $v1
57 %1:_(s64) = G_FPTOSI %0(s32)
58 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %1(s64)
61 RetRA implicit $v0, implicit $v1
67 tracksRegLiveness: true
72 ; FP32-LABEL: name: f32toi32
74 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
75 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
76 ; FP32: $v0 = COPY [[FPTOSI]](s32)
77 ; FP32: RetRA implicit $v0
78 ; FP64-LABEL: name: f32toi32
80 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
81 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
82 ; FP64: $v0 = COPY [[FPTOSI]](s32)
83 ; FP64: RetRA implicit $v0
85 %1:_(s32) = G_FPTOSI %0(s32)
93 tracksRegLiveness: true
98 ; FP32-LABEL: name: f32toi16
100 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
101 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
102 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
103 ; FP32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
104 ; FP32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
105 ; FP32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
106 ; FP32: $v0 = COPY [[ASHR]](s32)
107 ; FP32: RetRA implicit $v0
108 ; FP64-LABEL: name: f32toi16
109 ; FP64: liveins: $f12
110 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
111 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
112 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
113 ; FP64: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
114 ; FP64: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
115 ; FP64: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
116 ; FP64: $v0 = COPY [[ASHR]](s32)
117 ; FP64: RetRA implicit $v0
118 %0:_(s32) = COPY $f12
119 %1:_(s16) = G_FPTOSI %0(s32)
120 %2:_(s32) = G_SEXT %1(s16)
128 tracksRegLiveness: true
133 ; FP32-LABEL: name: f32toi8
134 ; FP32: liveins: $f12
135 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
136 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
137 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
138 ; FP32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
139 ; FP32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
140 ; FP32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
141 ; FP32: $v0 = COPY [[ASHR]](s32)
142 ; FP32: RetRA implicit $v0
143 ; FP64-LABEL: name: f32toi8
144 ; FP64: liveins: $f12
145 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
146 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
147 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
148 ; FP64: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
149 ; FP64: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
150 ; FP64: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
151 ; FP64: $v0 = COPY [[ASHR]](s32)
152 ; FP64: RetRA implicit $v0
153 %0:_(s32) = COPY $f12
154 %1:_(s8) = G_FPTOSI %0(s32)
155 %2:_(s32) = G_SEXT %1(s8)
163 tracksRegLiveness: true
168 ; FP32-LABEL: name: f64toi64
170 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
171 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
172 ; FP32: $d6 = COPY [[COPY]](s64)
173 ; FP32: JAL &__fixdfdi, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit-def $v0, implicit-def $v1
174 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
175 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
176 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
177 ; FP32: $v0 = COPY [[COPY1]](s32)
178 ; FP32: $v1 = COPY [[COPY2]](s32)
179 ; FP32: RetRA implicit $v0, implicit $v1
180 ; FP64-LABEL: name: f64toi64
182 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
183 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
184 ; FP64: $d12_64 = COPY [[COPY]](s64)
185 ; FP64: JAL &__fixdfdi, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $d12_64, implicit-def $v0, implicit-def $v1
186 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
187 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
188 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
189 ; FP64: $v0 = COPY [[COPY1]](s32)
190 ; FP64: $v1 = COPY [[COPY2]](s32)
191 ; FP64: RetRA implicit $v0, implicit $v1
193 %1:_(s64) = G_FPTOSI %0(s64)
194 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %1(s64)
197 RetRA implicit $v0, implicit $v1
203 tracksRegLiveness: true
208 ; FP32-LABEL: name: f64toi32
210 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
211 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
212 ; FP32: $v0 = COPY [[FPTOSI]](s32)
213 ; FP32: RetRA implicit $v0
214 ; FP64-LABEL: name: f64toi32
216 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
217 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
218 ; FP64: $v0 = COPY [[FPTOSI]](s32)
219 ; FP64: RetRA implicit $v0
221 %1:_(s32) = G_FPTOSI %0(s64)
229 tracksRegLiveness: true
234 ; FP32-LABEL: name: f64toi16
236 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
237 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
238 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
239 ; FP32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
240 ; FP32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
241 ; FP32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
242 ; FP32: $v0 = COPY [[ASHR]](s32)
243 ; FP32: RetRA implicit $v0
244 ; FP64-LABEL: name: f64toi16
246 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
247 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
248 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
249 ; FP64: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
250 ; FP64: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
251 ; FP64: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
252 ; FP64: $v0 = COPY [[ASHR]](s32)
253 ; FP64: RetRA implicit $v0
255 %1:_(s16) = G_FPTOSI %0(s64)
256 %2:_(s32) = G_SEXT %1(s16)
264 tracksRegLiveness: true
269 ; FP32-LABEL: name: f64toi8
271 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
272 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
273 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
274 ; FP32: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
275 ; FP32: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
276 ; FP32: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
277 ; FP32: $v0 = COPY [[ASHR]](s32)
278 ; FP32: RetRA implicit $v0
279 ; FP64-LABEL: name: f64toi8
281 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
282 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
283 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FPTOSI]](s32)
284 ; FP64: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
285 ; FP64: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C]](s32)
286 ; FP64: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SHL]], [[C]](s32)
287 ; FP64: $v0 = COPY [[ASHR]](s32)
288 ; FP64: RetRA implicit $v0
290 %1:_(s8) = G_FPTOSI %0(s64)
291 %2:_(s32) = G_SEXT %1(s8)
299 tracksRegLiveness: true
304 ; FP32-LABEL: name: f32tou64
305 ; FP32: liveins: $f12
306 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
307 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
308 ; FP32: $f12 = COPY [[COPY]](s32)
309 ; FP32: JAL &__fixunssfdi, csr_o32, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $v0, implicit-def $v1
310 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
311 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
312 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
313 ; FP32: $v0 = COPY [[COPY1]](s32)
314 ; FP32: $v1 = COPY [[COPY2]](s32)
315 ; FP32: RetRA implicit $v0, implicit $v1
316 ; FP64-LABEL: name: f32tou64
317 ; FP64: liveins: $f12
318 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
319 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
320 ; FP64: $f12 = COPY [[COPY]](s32)
321 ; FP64: JAL &__fixunssfdi, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $f12, implicit-def $v0, implicit-def $v1
322 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
323 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
324 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
325 ; FP64: $v0 = COPY [[COPY1]](s32)
326 ; FP64: $v1 = COPY [[COPY2]](s32)
327 ; FP64: RetRA implicit $v0, implicit $v1
328 %0:_(s32) = COPY $f12
329 %1:_(s64) = G_FPTOUI %0(s32)
330 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %1(s64)
333 RetRA implicit $v0, implicit $v1
339 tracksRegLiveness: true
344 ; FP32-LABEL: name: f32tou32
345 ; FP32: liveins: $f12
346 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
347 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
348 ; FP32: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
349 ; FP32: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
350 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
351 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
352 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
353 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
354 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
355 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
356 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
357 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
358 ; FP32: $v0 = COPY [[SELECT]](s32)
359 ; FP32: RetRA implicit $v0
360 ; FP64-LABEL: name: f32tou32
361 ; FP64: liveins: $f12
362 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
363 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
364 ; FP64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
365 ; FP64: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
366 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
367 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
368 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
369 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
370 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
371 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
372 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
373 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
374 ; FP64: $v0 = COPY [[SELECT]](s32)
375 ; FP64: RetRA implicit $v0
376 %0:_(s32) = COPY $f12
377 %1:_(s32) = G_FPTOUI %0(s32)
385 tracksRegLiveness: true
390 ; FP32-LABEL: name: f32tou16
391 ; FP32: liveins: $f12
392 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
393 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
394 ; FP32: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
395 ; FP32: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
396 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
397 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
398 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
399 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
400 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
401 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
402 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
403 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
404 ; FP32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
405 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
406 ; FP32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
407 ; FP32: $v0 = COPY [[AND1]](s32)
408 ; FP32: RetRA implicit $v0
409 ; FP64-LABEL: name: f32tou16
410 ; FP64: liveins: $f12
411 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
412 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
413 ; FP64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
414 ; FP64: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
415 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
416 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
417 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
418 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
419 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
420 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
421 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
422 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
423 ; FP64: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
424 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
425 ; FP64: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
426 ; FP64: $v0 = COPY [[AND1]](s32)
427 ; FP64: RetRA implicit $v0
428 %0:_(s32) = COPY $f12
429 %1:_(s16) = G_FPTOUI %0(s32)
430 %2:_(s32) = G_ZEXT %1(s16)
438 tracksRegLiveness: true
443 ; FP32-LABEL: name: f32tou8
444 ; FP32: liveins: $f12
445 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
446 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
447 ; FP32: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
448 ; FP32: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
449 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
450 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
451 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
452 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
453 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
454 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
455 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
456 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
457 ; FP32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
458 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
459 ; FP32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
460 ; FP32: $v0 = COPY [[AND1]](s32)
461 ; FP32: RetRA implicit $v0
462 ; FP64-LABEL: name: f32tou8
463 ; FP64: liveins: $f12
464 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
465 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
466 ; FP64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
467 ; FP64: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
468 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
469 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
470 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
471 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
472 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
473 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
474 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
475 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
476 ; FP64: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
477 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
478 ; FP64: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
479 ; FP64: $v0 = COPY [[AND1]](s32)
480 ; FP64: RetRA implicit $v0
481 %0:_(s32) = COPY $f12
482 %1:_(s8) = G_FPTOUI %0(s32)
483 %2:_(s32) = G_ZEXT %1(s8)
491 tracksRegLiveness: true
496 ; FP32-LABEL: name: f64tou64
498 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
499 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
500 ; FP32: $d6 = COPY [[COPY]](s64)
501 ; FP32: JAL &__fixunsdfdi, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit-def $v0, implicit-def $v1
502 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
503 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
504 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
505 ; FP32: $v0 = COPY [[COPY1]](s32)
506 ; FP32: $v1 = COPY [[COPY2]](s32)
507 ; FP32: RetRA implicit $v0, implicit $v1
508 ; FP64-LABEL: name: f64tou64
510 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
511 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
512 ; FP64: $d12_64 = COPY [[COPY]](s64)
513 ; FP64: JAL &__fixunsdfdi, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $d12_64, implicit-def $v0, implicit-def $v1
514 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
515 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
516 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
517 ; FP64: $v0 = COPY [[COPY1]](s32)
518 ; FP64: $v1 = COPY [[COPY2]](s32)
519 ; FP64: RetRA implicit $v0, implicit $v1
521 %1:_(s64) = G_FPTOUI %0(s64)
522 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %1(s64)
525 RetRA implicit $v0, implicit $v1
531 tracksRegLiveness: true
536 ; FP32-LABEL: name: f64tou32
538 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
539 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
540 ; FP32: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
541 ; FP32: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
542 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
543 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
544 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
545 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
546 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
547 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
548 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
549 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
550 ; FP32: $v0 = COPY [[SELECT]](s32)
551 ; FP32: RetRA implicit $v0
552 ; FP64-LABEL: name: f64tou32
554 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
555 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
556 ; FP64: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
557 ; FP64: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
558 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
559 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
560 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
561 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
562 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
563 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
564 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
565 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
566 ; FP64: $v0 = COPY [[SELECT]](s32)
567 ; FP64: RetRA implicit $v0
569 %1:_(s32) = G_FPTOUI %0(s64)
577 tracksRegLiveness: true
582 ; FP32-LABEL: name: f64tou16
584 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
585 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
586 ; FP32: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
587 ; FP32: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
588 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
589 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
590 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
591 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
592 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
593 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
594 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
595 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
596 ; FP32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
597 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
598 ; FP32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
599 ; FP32: $v0 = COPY [[AND1]](s32)
600 ; FP32: RetRA implicit $v0
601 ; FP64-LABEL: name: f64tou16
603 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
604 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
605 ; FP64: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
606 ; FP64: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
607 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
608 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
609 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
610 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
611 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
612 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
613 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
614 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
615 ; FP64: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
616 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
617 ; FP64: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
618 ; FP64: $v0 = COPY [[AND1]](s32)
619 ; FP64: RetRA implicit $v0
621 %1:_(s16) = G_FPTOUI %0(s64)
622 %2:_(s32) = G_ZEXT %1(s16)
630 tracksRegLiveness: true
635 ; FP32-LABEL: name: f64tou8
637 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
638 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
639 ; FP32: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
640 ; FP32: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
641 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
642 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
643 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
644 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
645 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
646 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
647 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
648 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
649 ; FP32: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
650 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
651 ; FP32: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
652 ; FP32: $v0 = COPY [[AND1]](s32)
653 ; FP32: RetRA implicit $v0
654 ; FP64-LABEL: name: f64tou8
656 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
657 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
658 ; FP64: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
659 ; FP64: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
660 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
661 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
662 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
663 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
664 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
665 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[FCMP]](s32)
666 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
667 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[AND]](s32), [[FPTOSI]], [[XOR]]
668 ; FP64: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
669 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
670 ; FP64: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY2]], [[C3]]
671 ; FP64: $v0 = COPY [[AND1]](s32)
672 ; FP64: RetRA implicit $v0
674 %1:_(s8) = G_FPTOUI %0(s64)
675 %2:_(s32) = G_ZEXT %1(s8)