summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-07-17 10:51:31 +0000
committerTim Northover <tnorthover@apple.com>2014-07-17 10:51:31 +0000
commit6dbcbac98b41df8e08ba4fdea2a835617cf9e8b8 (patch)
tree47e1f84b2402f751dcb16eea02c4b5a7b48b1bd8 /clang/lib/CodeGen
parentfd7e4249359f510d21c2b682176cdb28dfa4e7e4 (diff)
downloadbcm5719-llvm-6dbcbac98b41df8e08ba4fdea2a835617cf9e8b8.tar.gz
bcm5719-llvm-6dbcbac98b41df8e08ba4fdea2a835617cf9e8b8.zip
IR: update Clang to use polymorphic __fp16 conversion intrinsics.
There should be no change in semantics at this stage. llvm-svn: 213249
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index ab5aa28206a..86f47872aea 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -701,7 +701,10 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType,
// If casting to/from storage-only half FP, use special intrinsics.
if (SrcType->isHalfType() && !CGF.getContext().getLangOpts().NativeHalfType) {
- Src = Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16), Src);
+ Src = Builder.CreateCall(
+ CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16,
+ CGF.CGM.FloatTy),
+ Src);
SrcType = CGF.getContext().FloatTy;
SrcTy = CGF.FloatTy;
}
@@ -797,7 +800,9 @@ Value *ScalarExprEmitter::EmitScalarConversion(Value *Src, QualType SrcType,
if (DstTy != ResTy) {
assert(ResTy->isIntegerTy(16) && "Only half FP requires extra conversion");
- Res = Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16), Res);
+ Res = Builder.CreateCall(
+ CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16, CGF.CGM.FloatTy),
+ Res);
}
return Res;
@@ -1686,9 +1691,10 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
if (type->isHalfType() && !CGF.getContext().getLangOpts().NativeHalfType) {
// Another special case: half FP increment should be done via float
- value =
- Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16),
- input);
+ value = Builder.CreateCall(
+ CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_from_fp16,
+ CGF.CGM.FloatTy),
+ input);
}
if (value->getType()->isFloatTy())
@@ -1707,9 +1713,10 @@ ScalarExprEmitter::EmitScalarPrePostIncDec(const UnaryOperator *E, LValue LV,
value = Builder.CreateFAdd(value, amt, isInc ? "inc" : "dec");
if (type->isHalfType() && !CGF.getContext().getLangOpts().NativeHalfType)
- value =
- Builder.CreateCall(CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16),
- value);
+ value = Builder.CreateCall(
+ CGF.CGM.getIntrinsic(llvm::Intrinsic::convert_to_fp16,
+ CGF.CGM.FloatTy),
+ value);
// Objective-C pointer types.
} else {
OpenPOWER on IntegriCloud