mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-22 20:20:03 +00:00
Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131927 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9728ea2447
commit
f89532f8f6
@ -359,6 +359,7 @@ def : Pat<(f32 (sint_to_fp CPURegs:$src)), (CVTS_W32 (MTC1 CPURegs:$src))>;
|
||||
def : Pat<(f64 (sint_to_fp CPURegs:$src)), (CVTD_W32 (MTC1 CPURegs:$src))>;
|
||||
|
||||
def : Pat<(i32 (fp_to_sint FGR32:$src)), (MFC1 (TRUNC_W_S32 FGR32:$src))>;
|
||||
def : Pat<(i32 (fp_to_sint AFGR64:$src)), (MFC1 (TRUNC_W_D32 AFGR64:$src))>;
|
||||
|
||||
def : Pat<(i32 (bitconvert FGR32:$src)), (MFC1 FGR32:$src)>;
|
||||
def : Pat<(f32 (bitconvert CPURegs:$src)), (MTC1 CPURegs:$src)>;
|
||||
|
8
test/CodeGen/Mips/double2int.ll
Normal file
8
test/CodeGen/Mips/double2int.ll
Normal file
@ -0,0 +1,8 @@
|
||||
; RUN: llc -march=mips -mcpu=4ke < %s | FileCheck %s
|
||||
|
||||
define i32 @f1(double %d) nounwind readnone {
|
||||
entry:
|
||||
; CHECK: trunc.w.d $f{{[0-9]+}}, $f12
|
||||
%conv = fptosi double %d to i32
|
||||
ret i32 %conv
|
||||
}
|
Loading…
Reference in New Issue
Block a user