summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2010-08-03 21:32:34 +0000
committerNate Begeman <natebegeman@mac.com>2010-08-03 21:32:34 +0000
commitf568b074dbf0c1e8950d2786873a32e5c4baa5c4 (patch)
tree060b74a56a4a9def75cd3a732560a8d977077f8b /clang/lib/CodeGen/CGBuiltin.cpp
parentb69b1821918e0fe4341f8754c9b6bebe51582ac4 (diff)
downloadbcm5719-llvm-f568b074dbf0c1e8950d2786873a32e5c4baa5c4.tar.gz
bcm5719-llvm-f568b074dbf0c1e8950d2786873a32e5c4baa5c4.zip
Add support for VFP status & control operations for ARM.
llvm-svn: 110153
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 7a14033b0e2..666be7421ff 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -1061,9 +1061,6 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
a, b);
}
- // Determine the type of this overloaded NEON intrinsic.
- assert(BuiltinID > ARM::BI__builtin_arm_usat);
-
llvm::SmallVector<Value*, 4> Ops;
for (unsigned i = 0, e = E->getNumArgs() - 1; i != e; i++)
Ops.push_back(EmitScalarExpr(E->getArg(i)));
@@ -1073,6 +1070,25 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
if (!Arg->isIntegerConstantExpr(Result, getContext()))
return 0;
+ if (BuiltinID == ARM::BI__builtin_arm_vcvtr_f ||
+ BuiltinID == ARM::BI__builtin_arm_vcvtr_d) {
+ // Determine the overloaded type of this builtin.
+ const llvm::Type *Ty;
+ if (BuiltinID == ARM::BI__builtin_arm_vcvtr_f)
+ Ty = llvm::Type::getFloatTy(VMContext);
+ else
+ Ty = llvm::Type::getDoubleTy(VMContext);
+
+ // Determine whether this is an unsigned conversion or not.
+ bool usgn = Result.getZExtValue() == 1;
+ unsigned Int = usgn ? Intrinsic::arm_vcvtru : Intrinsic::arm_vcvtr;
+
+ // Call the appropriate intrinsic.
+ Function *F = CGM.getIntrinsic(Int, &Ty, 1);
+ return Builder.CreateCall(F, Ops.begin(), Ops.end(), "vcvtr");
+ }
+
+ // Determine the type of this overloaded NEON intrinsic.
unsigned type = Result.getZExtValue();
bool usgn = type & 0x08;
bool quad = type & 0x10;
OpenPOWER on IntegriCloud