Use fconsts and fconstd to materialize small fp constants.
[oota-llvm.git] / test / CodeGen / ARM / fpconsts.ll
1 ; RUN: llc < %s -march=arm -mattr=+vfp3 | FileCheck %s
2
3 define arm_apcscc float @t1(float %x) nounwind readnone optsize {
4 entry:
5 ; CHECK: t1:
6 ; CHECK: fconsts s1, 16
7   %0 = fadd float %x, 4.000000e+00
8   ret float %0
9 }
10
11 define arm_apcscc double @t2(double %x) nounwind readnone optsize {
12 entry:
13 ; CHECK: t2:
14 ; CHECK: fconstd d1, 8
15   %0 = fadd double %x, 3.000000e+00
16   ret double %0
17 }
18
19 define arm_apcscc double @t3(double %x) nounwind readnone optsize {
20 entry:
21 ; CHECK: t3:
22 ; CHECK: fconstd d1, 170
23   %0 = fmul double %x, -1.300000e+01
24   ret double %0
25 }
26
27 define arm_apcscc float @t4(float %x) nounwind readnone optsize {
28 entry:
29 ; CHECK: t4:
30 ; CHECK: fconsts s1, 184
31   %0 = fmul float %x, -2.400000e+01
32   ret float %0
33 }