Sjoerd Meijer | c9bde54 | 2018-02-17 19:59:29 +0000 | [diff] [blame] | 1 | ; RUN: llc -mtriple=arm-eabi -mattr=+vfp2 %s -o - | FileCheck %s --check-prefix=CHECK-VFP |
| 2 | ; RUN: llc -mtriple=thumbv7-eabi -mattr=+vfp2 %s -o - | FileCheck %s --check-prefix=CHECK-VFP |
| 3 | |
| 4 | declare float @llvm.arm.vcvtr.f32(float) |
| 5 | declare float @llvm.arm.vcvtru.f32(float) |
| 6 | declare float @llvm.arm.vcvtr.f64(double) |
| 7 | declare float @llvm.arm.vcvtru.f64(double) |
| 8 | |
| 9 | define float @test_vcvtrf0(float %f) { |
| 10 | entry: |
| 11 | ; CHECK-VFP: vcvtr.s32.f32 s0, s0 |
| 12 | %vcvtr = tail call float @llvm.arm.vcvtr.f32(float %f) |
| 13 | ret float %vcvtr |
| 14 | } |
| 15 | |
| 16 | define float @test_vcvtrf1(float %f) { |
| 17 | entry: |
| 18 | ; CHECK-VFP: vcvtr.u32.f32 s0, s0 |
| 19 | %vcvtr = tail call float @llvm.arm.vcvtru.f32(float %f) |
| 20 | ret float %vcvtr |
| 21 | } |
| 22 | |
| 23 | define float @test_vcvtrd0(double %d) { |
| 24 | entry: |
| 25 | ; CHECK-VFP: vcvtr.s32.f64 s0, d{{.*}} |
| 26 | %vcvtr = tail call float @llvm.arm.vcvtr.f64(double %d) |
| 27 | ret float %vcvtr |
| 28 | } |
| 29 | |
| 30 | define float @test_vcvtrd1(double %d) { |
| 31 | entry: |
| 32 | ; CHECK-VFP: vcvtr.u32.f64 s0, d{{.*}} |
| 33 | %vcvtr = tail call float @llvm.arm.vcvtru.f64(double %d) |
| 34 | ret float %vcvtr |
| 35 | } |