summaryrefslogtreecommitdiff
path: root/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2007-10-15 22:07:31 +0000
committerDan Gohman <gohman@apple.com>2007-10-15 22:07:31 +0000
commitc4c966012901691fff21eed02d72a3de44dd47f1 (patch)
tree9e7fb6e127e704ed424fdadac8ce8336ba8a77e3 /lib/CodeGen/IntrinsicLowering.cpp
parent4859e277f773180924241beeb25fb4c37f7fa337 (diff)
downloadllvm-c4c966012901691fff21eed02d72a3de44dd47f1.tar.gz
llvm-c4c966012901691fff21eed02d72a3de44dd47f1.tar.bz2
llvm-c4c966012901691fff21eed02d72a3de44dd47f1.tar.xz
Teach IntrinsicLowering.cpp about the sin, cos, and pow intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43020 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index cf47091a5c..bd3d74d27a 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -114,6 +114,51 @@ void IntrinsicLowering::AddPrototypes(Module &M) {
I->arg_begin()->getType());
}
break;
+ case Intrinsic::sin:
+ switch((int)I->arg_begin()->getType()->getTypeID()) {
+ case Type::FloatTyID:
+ EnsureFunctionExists(M, "sinf", I->arg_begin(), I->arg_end(),
+ Type::FloatTy);
+ case Type::DoubleTyID:
+ EnsureFunctionExists(M, "sin", I->arg_begin(), I->arg_end(),
+ Type::DoubleTy);
+ case Type::X86_FP80TyID:
+ case Type::FP128TyID:
+ case Type::PPC_FP128TyID:
+ EnsureFunctionExists(M, "sinl", I->arg_begin(), I->arg_end(),
+ I->arg_begin()->getType());
+ }
+ break;
+ case Intrinsic::cos:
+ switch((int)I->arg_begin()->getType()->getTypeID()) {
+ case Type::FloatTyID:
+ EnsureFunctionExists(M, "cosf", I->arg_begin(), I->arg_end(),
+ Type::FloatTy);
+ case Type::DoubleTyID:
+ EnsureFunctionExists(M, "cos", I->arg_begin(), I->arg_end(),
+ Type::DoubleTy);
+ case Type::X86_FP80TyID:
+ case Type::FP128TyID:
+ case Type::PPC_FP128TyID:
+ EnsureFunctionExists(M, "cosl", I->arg_begin(), I->arg_end(),
+ I->arg_begin()->getType());
+ }
+ break;
+ case Intrinsic::pow:
+ switch((int)I->arg_begin()->getType()->getTypeID()) {
+ case Type::FloatTyID:
+ EnsureFunctionExists(M, "powf", I->arg_begin(), I->arg_end(),
+ Type::FloatTy);
+ case Type::DoubleTyID:
+ EnsureFunctionExists(M, "pow", I->arg_begin(), I->arg_end(),
+ Type::DoubleTy);
+ case Type::X86_FP80TyID:
+ case Type::FP128TyID:
+ case Type::PPC_FP128TyID:
+ EnsureFunctionExists(M, "powl", I->arg_begin(), I->arg_end(),
+ I->arg_begin()->getType());
+ }
+ break;
}
}