From 7c79c1c5299108e58852905182abcc7d3ba6fa40 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 13 Sep 2014 19:01:17 -0700 Subject: [Core] Fix implementation of FRem for LLVM 3.3+, which was wrong (caught by FloatingPointOps.ll). --- lib/Core/Executor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/Core') diff --git a/lib/Core/Executor.cpp b/lib/Core/Executor.cpp index 152b8c44..d2978642 100644 --- a/lib/Core/Executor.cpp +++ b/lib/Core/Executor.cpp @@ -2138,7 +2138,8 @@ void Executor::executeInstruction(ExecutionState &state, KInstruction *ki) { return terminateStateOnExecError(state, "Unsupported FRem operation"); #if LLVM_VERSION_CODE >= LLVM_VERSION(3, 3) llvm::APFloat Res(*fpWidthToSemantics(left->getWidth()), left->getAPValue()); - Res.remainder(APFloat(*fpWidthToSemantics(right->getWidth()),right->getAPValue())); + Res.mod(APFloat(*fpWidthToSemantics(right->getWidth()),right->getAPValue()), + APFloat::rmNearestTiesToEven); #else llvm::APFloat Res(left->getAPValue()); Res.mod(APFloat(right->getAPValue()), APFloat::rmNearestTiesToEven); -- cgit 1.4.1