blob: c5df2c4a7c39e1bc1cf25d0c5ed4da26ac7dfb20 [file] [log] [blame]
Sjoerd Meijerc9bde542018-02-17 19:59:29 +00001; 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
4declare float @llvm.arm.vcvtr.f32(float)
5declare float @llvm.arm.vcvtru.f32(float)
6declare float @llvm.arm.vcvtr.f64(double)
7declare float @llvm.arm.vcvtru.f64(double)
8
9define float @test_vcvtrf0(float %f) {
10entry:
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
16define float @test_vcvtrf1(float %f) {
17entry:
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
23define float @test_vcvtrd0(double %d) {
24entry:
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
30define float @test_vcvtrd1(double %d) {
31entry:
32; CHECK-VFP: vcvtr.u32.f64 s0, d{{.*}}
33 %vcvtr = tail call float @llvm.arm.vcvtru.f64(double %d)
34 ret float %vcvtr
35}