diff options
author | Oliver Stannard <oliver.stannard@arm.com> | 2014-08-27 16:31:57 +0000 |
---|---|---|
committer | Oliver Stannard <oliver.stannard@arm.com> | 2014-08-27 16:31:57 +0000 |
commit | ed8ecc8429e53dc638763fb8f48c620b6dbae174 (patch) | |
tree | e141e1da5d0632038e1b6c04a30997cfd87489a6 /clang/lib/CodeGen/CGExprConstant.cpp | |
parent | 6107a8f4db4fe74a3884c2b49b6ded009063335e (diff) | |
download | bcm5719-llvm-ed8ecc8429e53dc638763fb8f48c620b6dbae174.tar.gz bcm5719-llvm-ed8ecc8429e53dc638763fb8f48c620b6dbae174.zip |
Allow __fp16 as a function arg or return type for AArch64
ACLE 2.0 allows __fp16 to be used as a function argument or return
type. This enables this for AArch64.
This also fixes an existing bug that causes clang to not allow
homogeneous floating-point aggregates with a base type of __fp16. This
is valid for AAPCS64, but not for AAPCS-VFP.
llvm-svn: 216558
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExprConstant.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp index b508dcb446f..3fdab85d5f0 100644 --- a/clang/lib/CodeGen/CGExprConstant.cpp +++ b/clang/lib/CodeGen/CGExprConstant.cpp @@ -1132,7 +1132,8 @@ llvm::Constant *CodeGenModule::EmitConstantValue(const APValue &Value, case APValue::Float: { const llvm::APFloat &Init = Value.getFloat(); if (&Init.getSemantics() == &llvm::APFloat::IEEEhalf && - !Context.getLangOpts().NativeHalfType) + !Context.getLangOpts().NativeHalfType && + !Context.getLangOpts().HalfArgsAndReturns) return llvm::ConstantInt::get(VMContext, Init.bitcastToAPInt()); else return llvm::ConstantFP::get(VMContext, Init); |