summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-07-21 18:44:41 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-07-21 18:44:41 +0000
commitc2f67966f4807d7f80849838dbb672631c4f8a50 (patch)
treea21b57c5caf0e8bdae843587c516964de112fb5e /clang/lib
parent5b288788b3eb72380311e477ec72bb0b7508a46d (diff)
downloadbcm5719-llvm-c2f67966f4807d7f80849838dbb672631c4f8a50.tar.gz
bcm5719-llvm-c2f67966f4807d7f80849838dbb672631c4f8a50.zip
Add __builtin_powi[fl] support
llvm-svn: 53866
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index d186a716197..a85f139a0d5 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -192,6 +192,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
}
case Builtin::BI__builtin_expect:
+ // FIXME: pass expect through to LLVM
return RValue::get(EmitScalarExpr(E->getArg(0)));
case Builtin::BI__builtin_bswap32:
case Builtin::BI__builtin_bswap64: {
@@ -226,6 +227,19 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
// Otherwise, call libm 'nan'.
break;
}
+ case Builtin::BI__builtin_powi:
+ case Builtin::BI__builtin_powif:
+ case Builtin::BI__builtin_powil: {
+ Value *Base = EmitScalarExpr(E->getArg(0));
+ Value *Exponent = EmitScalarExpr(E->getArg(1));
+
+ const llvm::Type *ArgType = Base->getType();
+ Value *F = CGM.getIntrinsic(Intrinsic::powi, &ArgType, 1);
+
+ const llvm::Type *ResultType = ConvertType(E->getType());
+ return RValue::get(Builder.CreateCall2(F, Base, Exponent, "tmp"));
+ }
+
case Builtin::BI__builtin_isgreater:
case Builtin::BI__builtin_isgreaterequal:
case Builtin::BI__builtin_isless:
OpenPOWER on IntegriCloud