PR8921: LDM/POP do not support interworking prior to v5t.
[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 | FileCheck %s -check-prefix=VFP2
3 ; RUN: llc < %s -march=arm -mcpu=cortex-a8 | FileCheck %s -check-prefix=NEON
4 ; RUN: llc < %s -march=arm -mcpu=cortex-a9 | FileCheck %s -check-prefix=VFP2
5
6 define i32 @test1(float %a, float %b) {
7 ; VFP2: test1:
8 ; VFP2: vcvt.s32.f32 s0, s0
9 ; NEON: test1:
10 ; NEON: vcvt.s32.f32 d0, d0
11 entry:
12         %0 = fadd float %a, %b
13         %1 = fptosi float %0 to i32
14         ret i32 %1
15 }
16
17 define i32 @test2(float %a, float %b) {
18 ; VFP2: test2:
19 ; VFP2: vcvt.u32.f32 s0, s0
20 ; NEON: test2:
21 ; NEON: vcvt.u32.f32 d0, d0
22 entry:
23         %0 = fadd float %a, %b
24         %1 = fptoui float %0 to i32
25         ret i32 %1
26 }
27
28 define float @test3(i32 %a, i32 %b) {
29 ; VFP2: test3:
30 ; VFP2: vcvt.f32.u32 s0, s0
31 ; NEON: test3:
32 ; NEON: vcvt.f32.u32 d0, d0
33 entry:
34         %0 = add i32 %a, %b
35         %1 = uitofp i32 %0 to float
36         ret float %1
37 }
38
39 define float @test4(i32 %a, i32 %b) {
40 ; VFP2: test4:
41 ; VFP2: vcvt.f32.s32 s0, s0
42 ; NEON: test4:
43 ; NEON: vcvt.f32.s32 d0, d0
44 entry:
45         %0 = add i32 %a, %b
46         %1 = sitofp i32 %0 to float
47         ret float %1
48 }