2018-10-27 23:00:38 +08:00
|
|
|
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
|
|
|
; RUN: llc < %s -mtriple=mips-- | FileCheck %s
|
2008-08-08 12:03:25 +08:00
|
|
|
|
|
|
|
define i32 @fptoint(float %a) nounwind {
|
2018-10-27 23:00:38 +08:00
|
|
|
; CHECK-LABEL: fptoint:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: trunc.w.s $f0, $f12
|
|
|
|
; CHECK-NEXT: jr $ra
|
|
|
|
; CHECK-NEXT: mfc1 $2, $f0
|
2008-08-08 12:03:25 +08:00
|
|
|
entry:
|
2011-12-03 06:28:09 +08:00
|
|
|
fptosi float %a to i32 ; <i32>:0 [#uses=1]
|
|
|
|
ret i32 %0
|
2008-08-08 12:03:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
define i32 @fptouint(float %a) nounwind {
|
2018-10-27 23:00:38 +08:00
|
|
|
; CHECK-LABEL: fptouint:
|
|
|
|
; CHECK: # %bb.0: # %entry
|
|
|
|
; CHECK-NEXT: lui $1, %hi($CPI1_0)
|
|
|
|
; CHECK-NEXT: lwc1 $f0, %lo($CPI1_0)($1)
|
|
|
|
; CHECK-NEXT: sub.s $f1, $f12, $f0
|
|
|
|
; CHECK-NEXT: trunc.w.s $f1, $f1
|
|
|
|
; CHECK-NEXT: mfc1 $1, $f1
|
|
|
|
; CHECK-NEXT: lui $2, 32768
|
|
|
|
; CHECK-NEXT: xor $2, $1, $2
|
|
|
|
; CHECK-NEXT: trunc.w.s $f1, $f12
|
|
|
|
; CHECK-NEXT: mfc1 $1, $f1
|
|
|
|
; CHECK-NEXT: c.olt.s $f12, $f0
|
|
|
|
; CHECK-NEXT: jr $ra
|
|
|
|
; CHECK-NEXT: movt $2, $1, $fcc0
|
2008-08-08 12:03:25 +08:00
|
|
|
entry:
|
2011-12-03 06:28:09 +08:00
|
|
|
fptoui float %a to i32 ; <i32>:0 [#uses=1]
|
|
|
|
ret i32 %0
|
2008-08-08 12:03:25 +08:00
|
|
|
}
|