diff options
author | Dan Gohman <gohman@apple.com> | 2007-10-15 22:07:31 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2007-10-15 22:07:31 +0000 |
commit | c4c966012901691fff21eed02d72a3de44dd47f1 (patch) | |
tree | 9e7fb6e127e704ed424fdadac8ce8336ba8a77e3 /lib/CodeGen/IntrinsicLowering.cpp | |
parent | 4859e277f773180924241beeb25fb4c37f7fa337 (diff) | |
download | external_llvm-c4c966012901691fff21eed02d72a3de44dd47f1.zip external_llvm-c4c966012901691fff21eed02d72a3de44dd47f1.tar.gz external_llvm-c4c966012901691fff21eed02d72a3de44dd47f1.tar.bz2 |
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.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index cf47091..bd3d74d 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; } } |