Remove neonfp attribute and instead set default based on CPU string. Add -arm-use...
[oota-llvm.git] / test / CodeGen / ARM / fp_convert.ll
1 ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s -check-prefix=VFP2
2 ; RUN: llc < %s -march=arm -mattr=+neon -arm-use-neon-fp=1 | FileCheck %s -check-prefix=NEON
3 ; RUN: llc < %s -march=arm -mattr=+neon -arm-use-neon-fp=0 | FileCheck %s -check-prefix=VFP2
4 ; RUN: llc < %s -march=arm -mcpu=cortex-a8 | FileCheck %s -check-prefix=NEON
5 ; RUN: llc < %s -march=arm -mcpu=cortex-a9 | FileCheck %s -check-prefix=VFP2
6
7 define i32 @test1(float %a, float %b) {
8 ; VFP2: test1:
9 ; VFP2: ftosizs s0, s0
10 ; NEON: test1:
11 ; NEON: vcvt.s32.f32 d0, d0
12 entry:
13         %0 = fadd float %a, %b
14         %1 = fptosi float %0 to i32
15         ret i32 %1
16 }
17
18 define i32 @test2(float %a, float %b) {
19 ; VFP2: test2:
20 ; VFP2: ftouizs s0, s0
21 ; NEON: test2:
22 ; NEON: vcvt.u32.f32 d0, d0
23 entry:
24         %0 = fadd float %a, %b
25         %1 = fptoui float %0 to i32
26         ret i32 %1
27 }
28
29 define float @test3(i32 %a, i32 %b) {
30 ; VFP2: test3:
31 ; VFP2: fuitos s0, s0
32 ; NEON: test3:
33 ; NEON: vcvt.f32.u32 d0, d0
34 entry:
35         %0 = add i32 %a, %b
36         %1 = uitofp i32 %0 to float
37         ret float %1
38 }
39
40 define float @test4(i32 %a, i32 %b) {
41 ; VFP2: test4:
42 ; VFP2: fsitos s0, s0
43 ; NEON: test4:
44 ; NEON: vcvt.f32.s32 d0, d0
45 entry:
46         %0 = add i32 %a, %b
47         %1 = sitofp i32 %0 to float
48         ret float %1
49 }