[llvm-commits] [llvm] r43020 - /llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
Dan Gohman
djg at cray.com
Mon Oct 15 15:07:31 PDT 2007
Author: djg
Date: Mon Oct 15 17:07:31 2007
New Revision: 43020
URL: http://llvm.org/viewvc/llvm-project?rev=43020&view=rev
Log:
Teach IntrinsicLowering.cpp about the sin, cos, and pow intrinsics.
Modified:
llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
Modified: llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp?rev=43020&r1=43019&r2=43020&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp (original)
+++ llvm/trunk/lib/CodeGen/IntrinsicLowering.cpp Mon Oct 15 17:07:31 2007
@@ -114,6 +114,51 @@
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;
}
}
More information about the llvm-commits
mailing list