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: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
355 ; FP32: $v0 = COPY [[SELECT]](s32)
356 ; FP32: RetRA implicit $v0
357 ; FP64-LABEL: name: f32tou32
358 ; FP64: liveins: $f12
359 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
360 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
361 ; FP64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
362 ; FP64: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
363 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
364 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
365 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
366 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
367 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
368 ; FP64: $v0 = COPY [[SELECT]](s32)
369 ; FP64: RetRA implicit $v0
370 %0:_(s32) = COPY $f12
371 %1:_(s32) = G_FPTOUI %0(s32)
379 tracksRegLiveness: true
384 ; FP32-LABEL: name: f32tou16
385 ; FP32: liveins: $f12
386 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
387 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
388 ; FP32: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
389 ; FP32: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
390 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
391 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
392 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
393 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
394 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
395 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
396 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
397 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
398 ; FP32: $v0 = COPY [[AND]](s32)
399 ; FP32: RetRA implicit $v0
400 ; FP64-LABEL: name: f32tou16
401 ; FP64: liveins: $f12
402 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
403 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
404 ; FP64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
405 ; FP64: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
406 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
407 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
408 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
409 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
410 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
411 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
412 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
413 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
414 ; FP64: $v0 = COPY [[AND]](s32)
415 ; FP64: RetRA implicit $v0
416 %0:_(s32) = COPY $f12
417 %1:_(s16) = G_FPTOUI %0(s32)
418 %2:_(s32) = G_ZEXT %1(s16)
426 tracksRegLiveness: true
431 ; FP32-LABEL: name: f32tou8
432 ; FP32: liveins: $f12
433 ; FP32: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
434 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
435 ; FP32: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
436 ; FP32: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
437 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
438 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
439 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
440 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
441 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
442 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
443 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
444 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
445 ; FP32: $v0 = COPY [[AND]](s32)
446 ; FP32: RetRA implicit $v0
447 ; FP64-LABEL: name: f32tou8
448 ; FP64: liveins: $f12
449 ; FP64: [[COPY:%[0-9]+]]:_(s32) = COPY $f12
450 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s32)
451 ; FP64: [[C:%[0-9]+]]:_(s32) = G_FCONSTANT float 0x41E0000000000000
452 ; FP64: [[FSUB:%[0-9]+]]:_(s32) = G_FSUB [[COPY]], [[C]]
453 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s32)
454 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
455 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
456 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s32), [[C]]
457 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
458 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
459 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
460 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
461 ; FP64: $v0 = COPY [[AND]](s32)
462 ; FP64: RetRA implicit $v0
463 %0:_(s32) = COPY $f12
464 %1:_(s8) = G_FPTOUI %0(s32)
465 %2:_(s32) = G_ZEXT %1(s8)
473 tracksRegLiveness: true
478 ; FP32-LABEL: name: f64tou64
480 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
481 ; FP32: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
482 ; FP32: $d6 = COPY [[COPY]](s64)
483 ; FP32: JAL &__fixunsdfdi, csr_o32, implicit-def $ra, implicit-def $sp, implicit $d6, implicit-def $v0, implicit-def $v1
484 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
485 ; FP32: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
486 ; FP32: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
487 ; FP32: $v0 = COPY [[COPY1]](s32)
488 ; FP32: $v1 = COPY [[COPY2]](s32)
489 ; FP32: RetRA implicit $v0, implicit $v1
490 ; FP64-LABEL: name: f64tou64
492 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
493 ; FP64: ADJCALLSTACKDOWN 16, 0, implicit-def $sp, implicit $sp
494 ; FP64: $d12_64 = COPY [[COPY]](s64)
495 ; FP64: JAL &__fixunsdfdi, csr_o32_fp64, implicit-def $ra, implicit-def $sp, implicit $d12_64, implicit-def $v0, implicit-def $v1
496 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY $v0
497 ; FP64: [[COPY2:%[0-9]+]]:_(s32) = COPY $v1
498 ; FP64: ADJCALLSTACKUP 16, 0, implicit-def $sp, implicit $sp
499 ; FP64: $v0 = COPY [[COPY1]](s32)
500 ; FP64: $v1 = COPY [[COPY2]](s32)
501 ; FP64: RetRA implicit $v0, implicit $v1
503 %1:_(s64) = G_FPTOUI %0(s64)
504 %2:_(s32), %3:_(s32) = G_UNMERGE_VALUES %1(s64)
507 RetRA implicit $v0, implicit $v1
513 tracksRegLiveness: true
518 ; FP32-LABEL: name: f64tou32
520 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
521 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
522 ; FP32: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
523 ; FP32: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
524 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
525 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
526 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
527 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
528 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
529 ; FP32: $v0 = COPY [[SELECT]](s32)
530 ; FP32: RetRA implicit $v0
531 ; FP64-LABEL: name: f64tou32
533 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
534 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
535 ; FP64: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
536 ; FP64: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
537 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
538 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
539 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
540 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
541 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
542 ; FP64: $v0 = COPY [[SELECT]](s32)
543 ; FP64: RetRA implicit $v0
545 %1:_(s32) = G_FPTOUI %0(s64)
553 tracksRegLiveness: true
558 ; FP32-LABEL: name: f64tou16
560 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
561 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
562 ; FP32: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
563 ; FP32: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
564 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
565 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
566 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
567 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
568 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
569 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
570 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
571 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
572 ; FP32: $v0 = COPY [[AND]](s32)
573 ; FP32: RetRA implicit $v0
574 ; FP64-LABEL: name: f64tou16
576 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
577 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
578 ; FP64: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
579 ; FP64: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
580 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
581 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
582 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
583 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
584 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
585 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535
586 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
587 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
588 ; FP64: $v0 = COPY [[AND]](s32)
589 ; FP64: RetRA implicit $v0
591 %1:_(s16) = G_FPTOUI %0(s64)
592 %2:_(s32) = G_ZEXT %1(s16)
600 tracksRegLiveness: true
605 ; FP32-LABEL: name: f64tou8
607 ; FP32: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
608 ; FP32: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
609 ; FP32: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
610 ; FP32: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
611 ; FP32: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
612 ; FP32: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
613 ; FP32: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
614 ; FP32: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
615 ; FP32: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
616 ; FP32: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
617 ; FP32: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
618 ; FP32: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
619 ; FP32: $v0 = COPY [[AND]](s32)
620 ; FP32: RetRA implicit $v0
621 ; FP64-LABEL: name: f64tou8
623 ; FP64: [[COPY:%[0-9]+]]:_(s64) = COPY $d6
624 ; FP64: [[FPTOSI:%[0-9]+]]:_(s32) = G_FPTOSI [[COPY]](s64)
625 ; FP64: [[C:%[0-9]+]]:_(s64) = G_FCONSTANT double 0x41E0000000000000
626 ; FP64: [[FSUB:%[0-9]+]]:_(s64) = G_FSUB [[COPY]], [[C]]
627 ; FP64: [[FPTOSI1:%[0-9]+]]:_(s32) = G_FPTOSI [[FSUB]](s64)
628 ; FP64: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648
629 ; FP64: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[FPTOSI1]], [[C1]]
630 ; FP64: [[FCMP:%[0-9]+]]:_(s32) = G_FCMP floatpred(ult), [[COPY]](s64), [[C]]
631 ; FP64: [[SELECT:%[0-9]+]]:_(s32) = G_SELECT [[FCMP]](s32), [[FPTOSI]], [[XOR]]
632 ; FP64: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255
633 ; FP64: [[COPY1:%[0-9]+]]:_(s32) = COPY [[SELECT]](s32)
634 ; FP64: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C2]]
635 ; FP64: $v0 = COPY [[AND]](s32)
636 ; FP64: RetRA implicit $v0
638 %1:_(s8) = G_FPTOUI %0(s64)
639 %2:_(s32) = G_ZEXT %1(s8)