summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorJosh Klontz <josh.klontz@gmail.com>2014-08-30 18:33:35 +0000
committerJosh Klontz <josh.klontz@gmail.com>2014-08-30 18:33:35 +0000
commite1900dc9207b4286ad30e2a191bd0d39c0c96bda (patch)
treed57a5e18a0e94de16c8d06c58cf69ec4ea98f77d /llvm/lib/CodeGen/IntrinsicLowering.cpp
parent88eb534517a3fbd4104bf788518e783e68d99bd9 (diff)
downloadbcm5719-llvm-e1900dc9207b4286ad30e2a191bd0d39c0c96bda.tar.gz
bcm5719-llvm-e1900dc9207b4286ad30e2a191bd0d39c0c96bda.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/IntrinsicLowering.cpp16
1 files changed, 16 insertions, 0 deletions
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())
OpenPOWER on IntegriCloud