blob: f247648d814a5d70b508fe6f3ea15ec32fa98d82 [file] [log] [blame]
Oliver Stannardd4e0a4f2014-10-01 13:13:18 +00001; RUN: llc < %s -mtriple=armv8-linux-gnueabihf -mattr=+fp-armv8 | FileCheck --check-prefix=CHECK --check-prefix=DP %s
2; RUN: llc < %s -mtriple=thumbv7em-linux-gnueabihf -mattr=+fp-armv8,+d16,+fp-only-sp | FileCheck --check-prefix=SP %s
3; RUN: llc < %s -mtriple=thumbv7em-linux-gnueabihf -mattr=+fp-armv8,+d16 | FileCheck --check-prefix=DP %s
Chad Rosierb1bbf6f2014-08-15 21:38:16 +00004
5; CHECK-LABEL: test1
6; CHECK: vrintm.f32
7define float @test1(float %a) {
8entry:
9 %call = call float @floorf(float %a) nounwind readnone
10 ret float %call
11}
12
13; CHECK-LABEL: test2
Oliver Stannardd4e0a4f2014-10-01 13:13:18 +000014; SP: b floor
15; DP: vrintm.f64
Chad Rosierb1bbf6f2014-08-15 21:38:16 +000016define double @test2(double %a) {
17entry:
18 %call = call double @floor(double %a) nounwind readnone
19 ret double %call
20}
21
22; CHECK-LABEL: test3
23; CHECK: vrintp.f32
24define float @test3(float %a) {
25entry:
26 %call = call float @ceilf(float %a) nounwind readnone
27 ret float %call
28}
29
30; CHECK-LABEL: test4
Oliver Stannardd4e0a4f2014-10-01 13:13:18 +000031; SP: b ceil
32; DP: vrintp.f64
Chad Rosierb1bbf6f2014-08-15 21:38:16 +000033define double @test4(double %a) {
34entry:
35 %call = call double @ceil(double %a) nounwind readnone
36 ret double %call
37}
38
39; CHECK-LABEL: test5
40; CHECK: vrinta.f32
41define float @test5(float %a) {
42entry:
43 %call = call float @roundf(float %a) nounwind readnone
44 ret float %call
45}
46
47; CHECK-LABEL: test6
Oliver Stannardd4e0a4f2014-10-01 13:13:18 +000048; SP: b round
49; DP: vrinta.f64
Chad Rosierb1bbf6f2014-08-15 21:38:16 +000050define double @test6(double %a) {
51entry:
52 %call = call double @round(double %a) nounwind readnone
53 ret double %call
54}
55
56; CHECK-LABEL: test7
57; CHECK: vrintz.f32
58define float @test7(float %a) {
59entry:
60 %call = call float @truncf(float %a) nounwind readnone
61 ret float %call
62}
63
64; CHECK-LABEL: test8
Oliver Stannardd4e0a4f2014-10-01 13:13:18 +000065; SP: b trunc
66; DP: vrintz.f64
Chad Rosierb1bbf6f2014-08-15 21:38:16 +000067define double @test8(double %a) {
68entry:
69 %call = call double @trunc(double %a) nounwind readnone
70 ret double %call
71}
72
73; CHECK-LABEL: test9
74; CHECK: vrintr.f32
75define float @test9(float %a) {
76entry:
77 %call = call float @nearbyintf(float %a) nounwind readnone
78 ret float %call
79}
80
81; CHECK-LABEL: test10
Oliver Stannardd4e0a4f2014-10-01 13:13:18 +000082; SP: b nearbyint
83; DP: vrintr.f64
Chad Rosierb1bbf6f2014-08-15 21:38:16 +000084define double @test10(double %a) {
85entry:
86 %call = call double @nearbyint(double %a) nounwind readnone
87 ret double %call
88}
89
90; CHECK-LABEL: test11
91; CHECK: vrintx.f32
92define float @test11(float %a) {
93entry:
94 %call = call float @rintf(float %a) nounwind readnone
95 ret float %call
96}
97
98; CHECK-LABEL: test12
Oliver Stannardd4e0a4f2014-10-01 13:13:18 +000099; SP: b rint
100; DP: vrintx.f64
Chad Rosierb1bbf6f2014-08-15 21:38:16 +0000101define double @test12(double %a) {
102entry:
103 %call = call double @rint(double %a) nounwind readnone
104 ret double %call
105}
106
107declare float @floorf(float) nounwind readnone
108declare double @floor(double) nounwind readnone
109declare float @ceilf(float) nounwind readnone
110declare double @ceil(double) nounwind readnone
111declare float @roundf(float) nounwind readnone
112declare double @round(double) nounwind readnone
113declare float @truncf(float) nounwind readnone
114declare double @trunc(double) nounwind readnone
115declare float @nearbyintf(float) nounwind readnone
116declare double @nearbyint(double) nounwind readnone
117declare float @rintf(float) nounwind readnone
118declare double @rint(double) nounwind readnone