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
This commit is contained in:
Dan Gohman 2007-10-15 22:07:31 +00:00
parent 4859e277f7
commit c4c9660129

View File

@ -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;
}
}