From e1900dc9207b4286ad30e2a191bd0d39c0c96bda Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Sat, 30 Aug 2014 18:33:35 +0000 Subject: [PATCH][Interpreter] Add missing FP intrinsic lowering. Summary: This extends the work done in [1], adding missing intrinsic lowering for floor, trunc, round and copysign. [1] http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/199372 Test Plan: Extended `test/ExecutionEngine/Interpreter/intrinsics.ll` to test the additional missing intrinsics. All tests pass. Reviewers: dexonsmith Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D5120 llvm-svn: 216827 --- llvm/lib/CodeGen/IntrinsicLowering.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'llvm/lib/CodeGen/IntrinsicLowering.cpp') diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp index 4ec3bae6f67..2c95e9e7d0d 100644 --- a/llvm/lib/CodeGen/IntrinsicLowering.cpp +++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp @@ -536,10 +536,26 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { ReplaceFPIntrinsicWithCall(CI, "cosf", "cos", "cosl"); break; } + case Intrinsic::floor: { + ReplaceFPIntrinsicWithCall(CI, "floorf", "floor", "floorl"); + break; + } case Intrinsic::ceil: { ReplaceFPIntrinsicWithCall(CI, "ceilf", "ceil", "ceill"); break; } + case Intrinsic::trunc: { + ReplaceFPIntrinsicWithCall(CI, "truncf", "trunc", "truncl"); + break; + } + case Intrinsic::round: { + ReplaceFPIntrinsicWithCall(CI, "roundf", "round", "roundl"); + break; + } + case Intrinsic::copysign: { + ReplaceFPIntrinsicWithCall(CI, "copysignf", "copysign", "copysignl"); + break; + } case Intrinsic::flt_rounds: // Lower to "round to the nearest" if (!CI->getType()->isVoidTy()) -- cgit v1.2.3