Dan Gohman | da594cf | 2009-09-09 00:09:15 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=arm -mattr=+vfp2 | FileCheck %s -check-prefix=VFP2 |
David Goodwin | 736fed9 | 2009-10-01 22:19:57 +0000 | [diff] [blame] | 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 |
Dan Gohman | da594cf | 2009-09-09 00:09:15 +0000 | [diff] [blame] | 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 |
Chris Lattner | e82b2a2 | 2009-08-11 15:54:17 +0000 | [diff] [blame] | 6 | |
| 7 | define i32 @test1(float %a, float %b) { |
| 8 | ; VFP2: test1: |
Jim Grosbach | e2fda53 | 2009-11-09 00:11:35 +0000 | [diff] [blame] | 9 | ; VFP2: vcvt.s32.f32 s0, s0 |
Chris Lattner | e82b2a2 | 2009-08-11 15:54:17 +0000 | [diff] [blame] | 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: |
Jim Grosbach | e2fda53 | 2009-11-09 00:11:35 +0000 | [diff] [blame] | 20 | ; VFP2: vcvt.u32.f32 s0, s0 |
Chris Lattner | e82b2a2 | 2009-08-11 15:54:17 +0000 | [diff] [blame] | 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: |
Jim Grosbach | e2fda53 | 2009-11-09 00:11:35 +0000 | [diff] [blame] | 31 | ; VFP2: vcvt.f32.u32 s0, s0 |
Chris Lattner | e82b2a2 | 2009-08-11 15:54:17 +0000 | [diff] [blame] | 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: |
Jim Grosbach | e2fda53 | 2009-11-09 00:11:35 +0000 | [diff] [blame] | 42 | ; VFP2: vcvt.f32.s32 s0, s0 |
Chris Lattner | e82b2a2 | 2009-08-11 15:54:17 +0000 | [diff] [blame] | 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 | } |