summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/ARM/fp16.ll
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-07-17 10:51:23 +0000
committerTim Northover <tnorthover@apple.com>2014-07-17 10:51:23 +0000
commitfd7e4249359f510d21c2b682176cdb28dfa4e7e4 (patch)
treec6f154b34d59f3708bea28534939101fdc74b37d /llvm/test/CodeGen/ARM/fp16.ll
parent2355066e4303a8c948ee9c7b8e3f28d778eb2180 (diff)
downloadbcm5719-llvm-fd7e4249359f510d21c2b682176cdb28dfa4e7e4.tar.gz
bcm5719-llvm-fd7e4249359f510d21c2b682176cdb28dfa4e7e4.zip
CodeGen: extend f16 conversions to permit types > float.
This makes the two intrinsics @llvm.convert.from.f16 and @llvm.convert.to.f16 accept types other than simple "float". This is only strictly needed for the truncate operation, since otherwise double rounding occurs and there's no way to represent the strict IEEE conversion. However, for symmetry we allow larger types in the extend too. During legalization, we can expand an "fp16_to_double" operation into two extends for convenience, but abort when the truncate isn't legal. A new libcall is probably needed here. Even after this commit, various target tweaks are needed to actually use the extended intrinsics. I've put these into separate commits for clarity, so there are no actual tests of f64 conversion here. llvm-svn: 213248
Diffstat (limited to 'llvm/test/CodeGen/ARM/fp16.ll')
-rw-r--r--llvm/test/CodeGen/ARM/fp16.ll10
1 files changed, 5 insertions, 5 deletions
diff --git a/llvm/test/CodeGen/ARM/fp16.ll b/llvm/test/CodeGen/ARM/fp16.ll
index fba794676d4..7a99c175751 100644
--- a/llvm/test/CodeGen/ARM/fp16.ll
+++ b/llvm/test/CodeGen/ARM/fp16.ll
@@ -13,20 +13,20 @@ define arm_aapcs_vfpcc void @foo() nounwind {
entry:
%0 = load i16* @x, align 2
%1 = load i16* @y, align 2
- %2 = tail call float @llvm.convert.from.fp16(i16 %0)
+ %2 = tail call float @llvm.convert.from.fp16.f32(i16 %0)
; CHECK: __gnu_h2f_ieee
; CHECK-FP16: vcvtb.f32.f16
- %3 = tail call float @llvm.convert.from.fp16(i16 %1)
+ %3 = tail call float @llvm.convert.from.fp16.f32(i16 %1)
; CHECK: __gnu_h2f_ieee
; CHECK-FP16: vcvtb.f32.f16
%4 = fadd float %2, %3
- %5 = tail call i16 @llvm.convert.to.fp16(float %4)
+ %5 = tail call i16 @llvm.convert.to.fp16.f32(float %4)
; CHECK: __gnu_f2h_ieee
; CHECK-FP16: vcvtb.f16.f32
store i16 %5, i16* @x, align 2
ret void
}
-declare float @llvm.convert.from.fp16(i16) nounwind readnone
+declare float @llvm.convert.from.fp16.f32(i16) nounwind readnone
-declare i16 @llvm.convert.to.fp16(float) nounwind readnone
+declare i16 @llvm.convert.to.fp16.f32(float) nounwind readnone
OpenPOWER on IntegriCloud