From 8d28c5e9094297de3aa4e28b29635b0858ca4940 Mon Sep 17 00:00:00 2001 From: Stefano Sanfilippo Date: Sat, 7 Mar 2015 14:11:38 +0100 Subject: [PATCH] Fix bug in FP to integer conversion. --- BitcodeEmitter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BitcodeEmitter.cpp b/BitcodeEmitter.cpp index bf8f9c4..0d48ff6 100644 --- a/BitcodeEmitter.cpp +++ b/BitcodeEmitter.cpp @@ -177,7 +177,7 @@ llvm::Value* coerce(BitcodeEmitter::Private *d, llvm::Value *val, llvm::Type *to } } else if (isFP(toType) && isInt(fromType)) { - return d->builder.CreateFPToSI(val, toType); + return d->builder.CreateSIToFP(val, toType); } else if (fromType->isFloatTy() && toType->isDoubleTy()) { return d->builder.CreateFPExt(val, toType);