1 ; Test strict rounding functions for z10.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
6 declare float @llvm.experimental.constrained.rint.f32(float, metadata, metadata)
7 define float @f1(float %f) #0 {
9 ; CHECK: fiebr %f0, 0, %f0
11 %res = call float @llvm.experimental.constrained.rint.f32(
13 metadata !"round.dynamic",
14 metadata !"fpexcept.strict") #0
19 declare double @llvm.experimental.constrained.rint.f64(double, metadata, metadata)
20 define double @f2(double %f) #0 {
22 ; CHECK: fidbr %f0, 0, %f0
24 %res = call double @llvm.experimental.constrained.rint.f64(
26 metadata !"round.dynamic",
27 metadata !"fpexcept.strict") #0
32 declare fp128 @llvm.experimental.constrained.rint.f128(fp128, metadata, metadata)
33 define void @f3(ptr %ptr) #0 {
35 ; CHECK: fixbr %f0, 0, %f0
37 %src = load fp128, ptr %ptr
38 %res = call fp128 @llvm.experimental.constrained.rint.f128(
40 metadata !"round.dynamic",
41 metadata !"fpexcept.strict") #0
42 store fp128 %res, ptr %ptr
46 ; Test nearbyint for f32.
47 declare float @llvm.experimental.constrained.nearbyint.f32(float, metadata, metadata)
48 define float @f4(float %f) #0 {
50 ; CHECK: brasl %r14, nearbyintf@PLT
52 %res = call float @llvm.experimental.constrained.nearbyint.f32(
54 metadata !"round.dynamic",
55 metadata !"fpexcept.strict") #0
59 ; Test nearbyint for f64.
60 declare double @llvm.experimental.constrained.nearbyint.f64(double, metadata, metadata)
61 define double @f5(double %f) #0 {
63 ; CHECK: brasl %r14, nearbyint@PLT
65 %res = call double @llvm.experimental.constrained.nearbyint.f64(
67 metadata !"round.dynamic",
68 metadata !"fpexcept.strict") #0
72 ; Test nearbyint for f128.
73 declare fp128 @llvm.experimental.constrained.nearbyint.f128(fp128, metadata, metadata)
74 define void @f6(ptr %ptr) #0 {
76 ; CHECK: brasl %r14, nearbyintl@PLT
78 %src = load fp128, ptr %ptr
79 %res = call fp128 @llvm.experimental.constrained.nearbyint.f128(
81 metadata !"round.dynamic",
82 metadata !"fpexcept.strict") #0
83 store fp128 %res, ptr %ptr
88 declare float @llvm.experimental.constrained.floor.f32(float, metadata)
89 define float @f7(float %f) #0 {
91 ; CHECK: brasl %r14, floorf@PLT
93 %res = call float @llvm.experimental.constrained.floor.f32(
95 metadata !"fpexcept.strict") #0
100 declare double @llvm.experimental.constrained.floor.f64(double, metadata)
101 define double @f8(double %f) #0 {
103 ; CHECK: brasl %r14, floor@PLT
105 %res = call double @llvm.experimental.constrained.floor.f64(
107 metadata !"fpexcept.strict") #0
111 ; Test floor for f128.
112 declare fp128 @llvm.experimental.constrained.floor.f128(fp128, metadata)
113 define void @f9(ptr %ptr) #0 {
115 ; CHECK: brasl %r14, floorl@PLT
117 %src = load fp128, ptr %ptr
118 %res = call fp128 @llvm.experimental.constrained.floor.f128(
120 metadata !"fpexcept.strict") #0
121 store fp128 %res, ptr %ptr
126 declare float @llvm.experimental.constrained.ceil.f32(float, metadata)
127 define float @f10(float %f) #0 {
129 ; CHECK: brasl %r14, ceilf@PLT
131 %res = call float @llvm.experimental.constrained.ceil.f32(
133 metadata !"fpexcept.strict") #0
138 declare double @llvm.experimental.constrained.ceil.f64(double, metadata)
139 define double @f11(double %f) #0 {
141 ; CHECK: brasl %r14, ceil@PLT
143 %res = call double @llvm.experimental.constrained.ceil.f64(
145 metadata !"fpexcept.strict") #0
149 ; Test ceil for f128.
150 declare fp128 @llvm.experimental.constrained.ceil.f128(fp128, metadata)
151 define void @f12(ptr %ptr) #0 {
153 ; CHECK: brasl %r14, ceill@PLT
155 %src = load fp128, ptr %ptr
156 %res = call fp128 @llvm.experimental.constrained.ceil.f128(
158 metadata !"fpexcept.strict") #0
159 store fp128 %res, ptr %ptr
163 ; Test trunc for f32.
164 declare float @llvm.experimental.constrained.trunc.f32(float, metadata)
165 define float @f13(float %f) #0 {
167 ; CHECK: brasl %r14, truncf@PLT
169 %res = call float @llvm.experimental.constrained.trunc.f32(
171 metadata !"fpexcept.strict") #0
175 ; Test trunc for f64.
176 declare double @llvm.experimental.constrained.trunc.f64(double, metadata)
177 define double @f14(double %f) #0 {
179 ; CHECK: brasl %r14, trunc@PLT
181 %res = call double @llvm.experimental.constrained.trunc.f64(
183 metadata !"fpexcept.strict") #0
187 ; Test trunc for f128.
188 declare fp128 @llvm.experimental.constrained.trunc.f128(fp128, metadata)
189 define void @f15(ptr %ptr) #0 {
191 ; CHECK: brasl %r14, truncl@PLT
193 %src = load fp128, ptr %ptr
194 %res = call fp128 @llvm.experimental.constrained.trunc.f128(
196 metadata !"fpexcept.strict") #0
197 store fp128 %res, ptr %ptr
201 ; Test round for f32.
202 declare float @llvm.experimental.constrained.round.f32(float, metadata)
203 define float @f16(float %f) #0 {
205 ; CHECK: brasl %r14, roundf@PLT
207 %res = call float @llvm.experimental.constrained.round.f32(
209 metadata !"fpexcept.strict") #0
213 ; Test round for f64.
214 declare double @llvm.experimental.constrained.round.f64(double, metadata)
215 define double @f17(double %f) #0 {
217 ; CHECK: brasl %r14, round@PLT
219 %res = call double @llvm.experimental.constrained.round.f64(
221 metadata !"fpexcept.strict") #0
225 ; Test round for f128.
226 declare fp128 @llvm.experimental.constrained.round.f128(fp128, metadata)
227 define void @f18(ptr %ptr) #0 {
229 ; CHECK: brasl %r14, roundl@PLT
231 %src = load fp128, ptr %ptr
232 %res = call fp128 @llvm.experimental.constrained.round.f128(
234 metadata !"fpexcept.strict") #0
235 store fp128 %res, ptr %ptr
239 attributes #0 = { strictfp }