diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2010-03-14 18:42:43 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2010-03-14 18:42:43 +0000 |
commit | b9b5840d96c68566a91d8e1840c7a811442f3753 (patch) | |
tree | 86e986a1a1eea32010f87b55687b6d171dea1ab8 /test | |
parent | 631379e79c0971c5bac13629b8caf8912ed4c35c (diff) | |
download | external_llvm-b9b5840d96c68566a91d8e1840c7a811442f3753.zip external_llvm-b9b5840d96c68566a91d8e1840c7a811442f3753.tar.gz external_llvm-b9b5840d96c68566a91d8e1840c7a811442f3753.tar.bz2 |
Feature test for half precision FP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98504 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CodeGen/ARM/fp16.ll | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/test/CodeGen/ARM/fp16.ll b/test/CodeGen/ARM/fp16.ll new file mode 100644 index 0000000..8f90040 --- /dev/null +++ b/test/CodeGen/ARM/fp16.ll @@ -0,0 +1,32 @@ +; RUN: llc < %s | FileCheck %s +; RUN: llc -mattr=+fp16,+vfp3 | FileCheck --check-prefix=CHECK-FP16 %s +target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-n32" +target triple = "armv7-eabi" + +@x = global i16 12902 +@y = global i16 0 +@z = common global i16 0 + +define arm_aapcs_vfpcc void @foo() nounwind { +; CHECK: foo: +; CHECK-FP6: foo: +entry: + %0 = load i16* @x, align 2 + %1 = load i16* @y, align 2 + %2 = tail call float @llvm.convert.from.fp16(i16 %0) +; CHECK: __gnu_h2f_ieee +; CHECK-FP16: vcvtb.f16.f32 + %3 = tail call float @llvm.convert.from.fp16(i16 %1) +; CHECK: __gnu_h2f_ieee +; CHECK-FP16: vcvtb.f16.f32 + %4 = fadd float %2, %3 + %5 = tail call i16 @llvm.convert.to.fp16(float %4) +; CHECK: __gnu_f2h_ieee +; CHECK-FP16: vcvtb.f32.f16 + store i16 %5, i16* @x, align 2 + ret void +} + +declare float @llvm.convert.from.fp16(i16) nounwind readnone + +declare i16 @llvm.convert.to.fp16(float) nounwind readnone |