1 ; RUN: llc < %s -mtriple=armv8-linux-gnueabi -mattr=+fp-armv8 | FileCheck %s
2 ; RUN: llc < %s -mtriple=armv8-linux-gnueabihf -mattr=+fp-armv8 | FileCheck %s
6 define i32 @test1(float %a) {
8 %call = call float @floorf(float %a) nounwind readnone
9 %conv = fptosi float %call to i32
14 ; CHECK: vcvtm.u32.f32
15 define i32 @test2(float %a) {
17 %call = call float @floorf(float %a) nounwind readnone
18 %conv = fptoui float %call to i32
23 ; CHECK: vcvtm.s32.f64
24 define i32 @test3(double %a) {
26 %call = call double @floor(double %a) nounwind readnone
27 %conv = fptosi double %call to i32
32 ; CHECK: vcvtm.u32.f64
33 define i32 @test4(double %a) {
35 %call = call double @floor(double %a) nounwind readnone
36 %conv = fptoui double %call to i32
41 ; CHECK: vcvtp.s32.f32
42 define i32 @test5(float %a) {
44 %call = call float @ceilf(float %a) nounwind readnone
45 %conv = fptosi float %call to i32
50 ; CHECK: vcvtp.u32.f32
51 define i32 @test6(float %a) {
53 %call = call float @ceilf(float %a) nounwind readnone
54 %conv = fptoui float %call to i32
59 ; CHECK: vcvtp.s32.f64
60 define i32 @test7(double %a) {
62 %call = call double @ceil(double %a) nounwind readnone
63 %conv = fptosi double %call to i32
68 ; CHECK: vcvtp.u32.f64
69 define i32 @test8(double %a) {
71 %call = call double @ceil(double %a) nounwind readnone
72 %conv = fptoui double %call to i32
77 ; CHECK: vcvta.s32.f32
78 define i32 @test9(float %a) {
80 %call = call float @roundf(float %a) nounwind readnone
81 %conv = fptosi float %call to i32
86 ; CHECK: vcvta.u32.f32
87 define i32 @test10(float %a) {
89 %call = call float @roundf(float %a) nounwind readnone
90 %conv = fptoui float %call to i32
95 ; CHECK: vcvta.s32.f64
96 define i32 @test11(double %a) {
98 %call = call double @round(double %a) nounwind readnone
99 %conv = fptosi double %call to i32
103 ; CHECK-LABEL: test12
104 ; CHECK: vcvta.u32.f64
105 define i32 @test12(double %a) {
107 %call = call double @round(double %a) nounwind readnone
108 %conv = fptoui double %call to i32
112 declare float @floorf(float) nounwind readnone
113 declare double @floor(double) nounwind readnone
114 declare float @ceilf(float) nounwind readnone
115 declare double @ceil(double) nounwind readnone
116 declare float @roundf(float) nounwind readnone
117 declare double @round(double) nounwind readnone