Add pattern for double-to-integer conversion. Patch by Sasa Stankovic.
[oota-llvm.git] / test / CodeGen / Mips / double2int.ll
diff --git a/test/CodeGen/Mips/double2int.ll b/test/CodeGen/Mips/double2int.ll
new file mode 100644 (file)
index 0000000..3d033e1
--- /dev/null
@@ -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
+}