blob: 1ef9f7f321641a78823d2bba81b4f44ea5284056 [file] [log] [blame]
Dan Gohmanfce288f2009-09-09 00:09:15 +00001; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s -check-prefix=VFP2
Jim Grosbach7ec7a0e2010-03-25 23:47:34 +00002; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s -check-prefix=VFP2
Dan Gohmanfce288f2009-09-09 00:09:15 +00003; 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
Chris Lattnerd3fe75e2009-08-11 15:54:17 +00005
6define i32 @test1(float %a, float %b) {
7; VFP2: test1:
Jim Grosbache5165492009-11-09 00:11:35 +00008; VFP2: vcvt.s32.f32 s0, s0
Chris Lattnerd3fe75e2009-08-11 15:54:17 +00009; NEON: test1:
10; NEON: vcvt.s32.f32 d0, d0
11entry:
12 %0 = fadd float %a, %b
13 %1 = fptosi float %0 to i32
14 ret i32 %1
15}
16
17define i32 @test2(float %a, float %b) {
18; VFP2: test2:
Jim Grosbache5165492009-11-09 00:11:35 +000019; VFP2: vcvt.u32.f32 s0, s0
Chris Lattnerd3fe75e2009-08-11 15:54:17 +000020; NEON: test2:
21; NEON: vcvt.u32.f32 d0, d0
22entry:
23 %0 = fadd float %a, %b
24 %1 = fptoui float %0 to i32
25 ret i32 %1
26}
27
28define float @test3(i32 %a, i32 %b) {
29; VFP2: test3:
Jim Grosbache5165492009-11-09 00:11:35 +000030; VFP2: vcvt.f32.u32 s0, s0
Chris Lattnerd3fe75e2009-08-11 15:54:17 +000031; NEON: test3:
32; NEON: vcvt.f32.u32 d0, d0
33entry:
34 %0 = add i32 %a, %b
35 %1 = uitofp i32 %0 to float
36 ret float %1
37}
38
39define float @test4(i32 %a, i32 %b) {
40; VFP2: test4:
Jim Grosbache5165492009-11-09 00:11:35 +000041; VFP2: vcvt.f32.s32 s0, s0
Chris Lattnerd3fe75e2009-08-11 15:54:17 +000042; NEON: test4:
43; NEON: vcvt.f32.s32 d0, d0
44entry:
45 %0 = add i32 %a, %b
46 %1 = sitofp i32 %0 to float
47 ret float %1
48}