blob: 2adac78cf806d566891967c99e155a3d683f784d [file] [log] [blame]
Dan Gohmanda594cf2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s -check-prefix=VFP2
David Goodwin736fed92009-10-01 22:19:57 +00002; 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
Dan Gohmanda594cf2009-09-09 00:09:15 +00004; 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
Chris Lattnere82b2a22009-08-11 15:54:17 +00006
7define i32 @test1(float %a, float %b) {
8; VFP2: test1:
Jim Grosbache2fda532009-11-09 00:11:35 +00009; VFP2: vcvt.s32.f32 s0, s0
Chris Lattnere82b2a22009-08-11 15:54:17 +000010; 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:
Jim Grosbache2fda532009-11-09 00:11:35 +000020; VFP2: vcvt.u32.f32 s0, s0
Chris Lattnere82b2a22009-08-11 15:54:17 +000021; 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:
Jim Grosbache2fda532009-11-09 00:11:35 +000031; VFP2: vcvt.f32.u32 s0, s0
Chris Lattnere82b2a22009-08-11 15:54:17 +000032; 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:
Jim Grosbache2fda532009-11-09 00:11:35 +000042; VFP2: vcvt.f32.s32 s0, s0
Chris Lattnere82b2a22009-08-11 15:54:17 +000043; 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}