Revert "Replace a big gob of old coalescer logic with the new CoalescerPair class."
[oota-llvm.git] / test / CodeGen / ARM / fp16.ll
1 ; RUN: llc < %s | FileCheck %s
2 ; RUN: llc -mattr=+vfp3,+fp16 < %s | FileCheck --check-prefix=CHECK-FP16 %s
3 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"
4 target triple = "armv7-eabi"
5
6 @x = global i16 12902
7 @y = global i16 0
8 @z = common global i16 0
9
10 define arm_aapcs_vfpcc void @foo() nounwind {
11 ; CHECK: foo:
12 ; CHECK-FP6: foo:
13 entry:
14   %0 = load i16* @x, align 2
15   %1 = load i16* @y, align 2
16   %2 = tail call float @llvm.convert.from.fp16(i16 %0)
17 ; CHECK: __gnu_h2f_ieee
18 ; CHECK-FP16: vcvtb.f16.f32
19   %3 = tail call float @llvm.convert.from.fp16(i16 %1)
20 ; CHECK: __gnu_h2f_ieee
21 ; CHECK-FP16: vcvtb.f16.f32
22   %4 = fadd float %2, %3
23   %5 = tail call i16 @llvm.convert.to.fp16(float %4)
24 ; CHECK: __gnu_f2h_ieee
25 ; CHECK-FP16: vcvtb.f32.f16
26   store i16 %5, i16* @x, align 2
27   ret void
28 }
29
30 declare float @llvm.convert.from.fp16(i16) nounwind readnone
31
32 declare i16 @llvm.convert.to.fp16(float) nounwind readnone