1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.

llvm-svn: 131927
This commit is contained in:
Akira Hatanaka 2011-05-23 22:16:43 +00:00
parent e829168e05
commit 5b696387f7
2 changed files with 9 additions and 0 deletions

View File

@ -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)>;

View 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
}