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) {
9 ; CHECK: fiebr %f0, 0, %f0
11 %res = call float @llvm.experimental.constrained.rint.f32(
13 metadata !"round.dynamic",
14 metadata !"fpexcept.strict")
19 declare double @llvm.experimental.constrained.rint.f64(double, metadata, metadata)
20 define double @f2(double %f) {
22 ; CHECK: fidbr %f0, 0, %f0
24 %res = call double @llvm.experimental.constrained.rint.f64(
26 metadata !"round.dynamic",
27 metadata !"fpexcept.strict")
32 declare fp128 @llvm.experimental.constrained.rint.f128(fp128, metadata, metadata)
33 define void @f3(fp128 *%ptr) {
35 ; CHECK: fixbr %f0, 0, %f0
37 %src = load fp128, fp128 *%ptr
38 %res = call fp128 @llvm.experimental.constrained.rint.f128(
40 metadata !"round.dynamic",
41 metadata !"fpexcept.strict")
42 store fp128 %res, fp128 *%ptr
46 ; Test nearbyint for f32.
47 declare float @llvm.experimental.constrained.nearbyint.f32(float, metadata, metadata)
48 define float @f4(float %f) {
50 ; CHECK: brasl %r14, nearbyintf@PLT
52 %res = call float @llvm.experimental.constrained.nearbyint.f32(
54 metadata !"round.dynamic",
55 metadata !"fpexcept.strict")
59 ; Test nearbyint for f64.
60 declare double @llvm.experimental.constrained.nearbyint.f64(double, metadata, metadata)
61 define double @f5(double %f) {
63 ; CHECK: brasl %r14, nearbyint@PLT
65 %res = call double @llvm.experimental.constrained.nearbyint.f64(
67 metadata !"round.dynamic",
68 metadata !"fpexcept.strict")
72 ; Test nearbyint for f128.
73 declare fp128 @llvm.experimental.constrained.nearbyint.f128(fp128, metadata, metadata)
74 define void @f6(fp128 *%ptr) {
76 ; CHECK: brasl %r14, nearbyintl@PLT
78 %src = load fp128, fp128 *%ptr
79 %res = call fp128 @llvm.experimental.constrained.nearbyint.f128(
81 metadata !"round.dynamic",
82 metadata !"fpexcept.strict")
83 store fp128 %res, fp128 *%ptr
88 declare float @llvm.experimental.constrained.floor.f32(float, metadata, metadata)
89 define float @f7(float %f) {
91 ; CHECK: brasl %r14, floorf@PLT
93 %res = call float @llvm.experimental.constrained.floor.f32(
95 metadata !"round.dynamic",
96 metadata !"fpexcept.strict")
100 ; Test floor for f64.
101 declare double @llvm.experimental.constrained.floor.f64(double, metadata, metadata)
102 define double @f8(double %f) {
104 ; CHECK: brasl %r14, floor@PLT
106 %res = call double @llvm.experimental.constrained.floor.f64(
108 metadata !"round.dynamic",
109 metadata !"fpexcept.strict")
113 ; Test floor for f128.
114 declare fp128 @llvm.experimental.constrained.floor.f128(fp128, metadata, metadata)
115 define void @f9(fp128 *%ptr) {
117 ; CHECK: brasl %r14, floorl@PLT
119 %src = load fp128, fp128 *%ptr
120 %res = call fp128 @llvm.experimental.constrained.floor.f128(
122 metadata !"round.dynamic",
123 metadata !"fpexcept.strict")
124 store fp128 %res, fp128 *%ptr
129 declare float @llvm.experimental.constrained.ceil.f32(float, metadata, metadata)
130 define float @f10(float %f) {
132 ; CHECK: brasl %r14, ceilf@PLT
134 %res = call float @llvm.experimental.constrained.ceil.f32(
136 metadata !"round.dynamic",
137 metadata !"fpexcept.strict")
142 declare double @llvm.experimental.constrained.ceil.f64(double, metadata, metadata)
143 define double @f11(double %f) {
145 ; CHECK: brasl %r14, ceil@PLT
147 %res = call double @llvm.experimental.constrained.ceil.f64(
149 metadata !"round.dynamic",
150 metadata !"fpexcept.strict")
154 ; Test ceil for f128.
155 declare fp128 @llvm.experimental.constrained.ceil.f128(fp128, metadata, metadata)
156 define void @f12(fp128 *%ptr) {
158 ; CHECK: brasl %r14, ceill@PLT
160 %src = load fp128, fp128 *%ptr
161 %res = call fp128 @llvm.experimental.constrained.ceil.f128(
163 metadata !"round.dynamic",
164 metadata !"fpexcept.strict")
165 store fp128 %res, fp128 *%ptr
169 ; Test trunc for f32.
170 declare float @llvm.experimental.constrained.trunc.f32(float, metadata, metadata)
171 define float @f13(float %f) {
173 ; CHECK: brasl %r14, truncf@PLT
175 %res = call float @llvm.experimental.constrained.trunc.f32(
177 metadata !"round.dynamic",
178 metadata !"fpexcept.strict")
182 ; Test trunc for f64.
183 declare double @llvm.experimental.constrained.trunc.f64(double, metadata, metadata)
184 define double @f14(double %f) {
186 ; CHECK: brasl %r14, trunc@PLT
188 %res = call double @llvm.experimental.constrained.trunc.f64(
190 metadata !"round.dynamic",
191 metadata !"fpexcept.strict")
195 ; Test trunc for f128.
196 declare fp128 @llvm.experimental.constrained.trunc.f128(fp128, metadata, metadata)
197 define void @f15(fp128 *%ptr) {
199 ; CHECK: brasl %r14, truncl@PLT
201 %src = load fp128, fp128 *%ptr
202 %res = call fp128 @llvm.experimental.constrained.trunc.f128(
204 metadata !"round.dynamic",
205 metadata !"fpexcept.strict")
206 store fp128 %res, fp128 *%ptr
210 ; Test round for f32.
211 declare float @llvm.experimental.constrained.round.f32(float, metadata, metadata)
212 define float @f16(float %f) {
214 ; CHECK: brasl %r14, roundf@PLT
216 %res = call float @llvm.experimental.constrained.round.f32(
218 metadata !"round.dynamic",
219 metadata !"fpexcept.strict")
223 ; Test round for f64.
224 declare double @llvm.experimental.constrained.round.f64(double, metadata, metadata)
225 define double @f17(double %f) {
227 ; CHECK: brasl %r14, round@PLT
229 %res = call double @llvm.experimental.constrained.round.f64(
231 metadata !"round.dynamic",
232 metadata !"fpexcept.strict")
236 ; Test round for f128.
237 declare fp128 @llvm.experimental.constrained.round.f128(fp128, metadata, metadata)
238 define void @f18(fp128 *%ptr) {
240 ; CHECK: brasl %r14, roundl@PLT
242 %src = load fp128, fp128 *%ptr
243 %res = call fp128 @llvm.experimental.constrained.round.f128(
245 metadata !"round.dynamic",
246 metadata !"fpexcept.strict")
247 store fp128 %res, fp128 *%ptr