blob: fa9e97ea03ef19a961be065364ff2f5d04dfc535 [file] [log] [blame]
Chris Lattnere82b2a22009-08-11 15:54:17 +00001; RUN: llvm-as < %s | llc -march=arm -mattr=+vfp2 | FileCheck %s -check-prefix=VFP2
2; RUN: llvm-as < %s | llc -march=arm -mattr=+neon,+neonfp | FileCheck %s -check-prefix=NEON
3; RUN: llvm-as < %s | llc -march=arm -mattr=+neon,-neonfp | FileCheck %s -check-prefix=VFP2
4; RUN: llvm-as < %s | llc -march=arm -mcpu=cortex-a8 | FileCheck %s -check-prefix=NEON
5; RUN: llvm-as < %s | llc -march=arm -mcpu=cortex-a9 | FileCheck %s -check-prefix=VFP2
6
7define i32 @test1(float %a, float %b) {
8; VFP2: test1:
9; VFP2: ftosizs s0, s0
10; NEON: test1:
11; NEON: vcvt.s32.f32 d0, d0
12entry:
13 %0 = fadd float %a, %b
14 %1 = fptosi float %0 to i32
15 ret i32 %1
16}
17
18define i32 @test2(float %a, float %b) {
19; VFP2: test2:
20; VFP2: ftouizs s0, s0
21; NEON: test2:
22; NEON: vcvt.u32.f32 d0, d0
23entry:
24 %0 = fadd float %a, %b
25 %1 = fptoui float %0 to i32
26 ret i32 %1
27}
28
29define float @test3(i32 %a, i32 %b) {
30; VFP2: test3:
31; VFP2: fuitos s0, s0
32; NEON: test3:
33; NEON: vcvt.f32.u32 d0, d0
34entry:
35 %0 = add i32 %a, %b
36 %1 = uitofp i32 %0 to float
37 ret float %1
38}
39
40define float @test4(i32 %a, i32 %b) {
41; VFP2: test4:
42; VFP2: fsitos s0, s0
43; NEON: test4:
44; NEON: vcvt.f32.s32 d0, d0
45entry:
46 %0 = add i32 %a, %b
47 %1 = sitofp i32 %0 to float
48 ret float %1
49}