1 ; RUN: llvm-as < %s | llvm-dis | FileCheck %s
3 ; Test to verify that constrained intrinsics all have the strictfp attribute.
4 ; Ordering is from Intrinsics.td.
6 define void @func(double %a, double %b, double %c, i32 %i) strictfp {
7 ; CHECK-LABEL: define void @func
8 ; CHECK-SAME: (double [[A:%.*]], double [[B:%.*]], double [[C:%.*]], i32 [[I:%.*]]) #[[ATTR0:[0-9]+]] {
10 %add = call double @llvm.experimental.constrained.fadd.f64(
12 metadata !"round.dynamic",
13 metadata !"fpexcept.strict")
15 %sub = call double @llvm.experimental.constrained.fsub.f64(
17 metadata !"round.dynamic",
18 metadata !"fpexcept.strict")
20 %mul = call double @llvm.experimental.constrained.fmul.f64(
22 metadata !"round.dynamic",
23 metadata !"fpexcept.strict")
25 %div = call double @llvm.experimental.constrained.fdiv.f64(
27 metadata !"round.dynamic",
28 metadata !"fpexcept.strict")
30 %rem = call double @llvm.experimental.constrained.frem.f64(
32 metadata !"round.dynamic",
33 metadata !"fpexcept.strict")
35 %fma = call double @llvm.experimental.constrained.fma.f64(
36 double %a, double %b, double %c,
37 metadata !"round.dynamic",
38 metadata !"fpexcept.strict")
40 %fmuladd = call double @llvm.experimental.constrained.fmuladd.f64(
41 double %a, double %b, double %c,
42 metadata !"round.dynamic",
43 metadata !"fpexcept.strict")
45 %si = call i32 @llvm.experimental.constrained.fptosi.i32.f64(double %a,
46 metadata !"fpexcept.strict")
48 %ui = call i32 @llvm.experimental.constrained.fptoui.i32.f64(double %a,
49 metadata !"fpexcept.strict")
51 %sfp = call double @llvm.experimental.constrained.sitofp.f64.i32(i32 %i,
52 metadata !"round.dynamic",
53 metadata !"fpexcept.strict")
55 %ufp = call double @llvm.experimental.constrained.uitofp.f64.i32(i32 %i,
56 metadata !"round.dynamic",
57 metadata !"fpexcept.strict")
59 %fptrunc = call float @llvm.experimental.constrained.fptrunc.f32.f64(
61 metadata !"round.dynamic",
62 metadata !"fpexcept.strict")
64 %ext = call double @llvm.experimental.constrained.fpext.f64.f32(
66 metadata !"fpexcept.strict")
68 %sqrt = call double @llvm.experimental.constrained.sqrt.f64(
70 metadata !"round.dynamic",
71 metadata !"fpexcept.strict")
73 %powi = call double @llvm.experimental.constrained.powi.f64(
75 metadata !"round.dynamic",
76 metadata !"fpexcept.strict")
78 %sin = call double @llvm.experimental.constrained.sin.f64(
80 metadata !"round.dynamic",
81 metadata !"fpexcept.strict")
83 %cos = call double @llvm.experimental.constrained.cos.f64(
85 metadata !"round.dynamic",
86 metadata !"fpexcept.strict")
88 %tan = call double @llvm.experimental.constrained.tan.f64(
90 metadata !"round.dynamic",
91 metadata !"fpexcept.strict")
93 %acos = call double @llvm.experimental.constrained.acos.f64(
95 metadata !"round.dynamic",
96 metadata !"fpexcept.strict")
98 %asin = call double @llvm.experimental.constrained.asin.f64(
100 metadata !"round.dynamic",
101 metadata !"fpexcept.strict")
103 %atan = call double @llvm.experimental.constrained.atan.f64(
105 metadata !"round.dynamic",
106 metadata !"fpexcept.strict")
108 %cosh = call double @llvm.experimental.constrained.cosh.f64(
110 metadata !"round.dynamic",
111 metadata !"fpexcept.strict")
113 %sinh = call double @llvm.experimental.constrained.sinh.f64(
115 metadata !"round.dynamic",
116 metadata !"fpexcept.strict")
118 %tanh = call double @llvm.experimental.constrained.tanh.f64(
120 metadata !"round.dynamic",
121 metadata !"fpexcept.strict")
123 %pow = call double @llvm.experimental.constrained.pow.f64(
124 double %a, double %b,
125 metadata !"round.dynamic",
126 metadata !"fpexcept.strict")
128 %log = call double @llvm.experimental.constrained.log.f64(
130 metadata !"round.dynamic",
131 metadata !"fpexcept.strict")
133 %log10 = call double @llvm.experimental.constrained.log10.f64(
135 metadata !"round.dynamic",
136 metadata !"fpexcept.strict")
138 %log2 = call double @llvm.experimental.constrained.log2.f64(
140 metadata !"round.dynamic",
141 metadata !"fpexcept.strict")
143 %exp = call double @llvm.experimental.constrained.exp.f64(
145 metadata !"round.dynamic",
146 metadata !"fpexcept.strict")
148 %exp2 = call double @llvm.experimental.constrained.exp2.f64(
150 metadata !"round.dynamic",
151 metadata !"fpexcept.strict")
153 %rint = call double @llvm.experimental.constrained.rint.f64(
155 metadata !"round.dynamic",
156 metadata !"fpexcept.strict")
158 %neari = call double @llvm.experimental.constrained.nearbyint.f64(
160 metadata !"round.dynamic",
161 metadata !"fpexcept.strict")
163 %x32 = call i32 @llvm.experimental.constrained.lrint.i32.f64(
165 metadata !"round.dynamic",
166 metadata !"fpexcept.strict")
168 %x64 = call i64 @llvm.experimental.constrained.llrint.i64.f64(
170 metadata !"round.dynamic",
171 metadata !"fpexcept.strict")
173 %maxnum = call double @llvm.experimental.constrained.maxnum.f64(
174 double %a, double %b,
175 metadata !"fpexcept.strict")
177 %minnum = call double @llvm.experimental.constrained.minnum.f64(
178 double %a, double %b,
179 metadata !"fpexcept.strict")
181 %maxmum = call double @llvm.experimental.constrained.maximum.f64(
182 double %a, double %b,
183 metadata !"fpexcept.strict")
185 %minmum = call double @llvm.experimental.constrained.minimum.f64(
186 double %a, double %b,
187 metadata !"fpexcept.strict")
189 %ceil = call double @llvm.experimental.constrained.ceil.f64(
191 metadata !"fpexcept.strict")
193 %floor = call double @llvm.experimental.constrained.floor.f64(
195 metadata !"fpexcept.strict")
197 %y32 = call i32 @llvm.experimental.constrained.lround.i32.f64(
199 metadata !"fpexcept.strict")
201 %y64 = call i64 @llvm.experimental.constrained.llround.i64.f64(
203 metadata !"fpexcept.strict")
205 %round = call double @llvm.experimental.constrained.round.f64(
207 metadata !"fpexcept.strict")
209 %roundev = call double @llvm.experimental.constrained.roundeven.f64(
211 metadata !"fpexcept.strict")
213 %trunc = call double @llvm.experimental.constrained.trunc.f64(
215 metadata !"fpexcept.strict")
217 %q1 = call i1 @llvm.experimental.constrained.fcmp.f64(
218 double %a, double %b,
220 metadata !"fpexcept.strict")
222 %s1 = call i1 @llvm.experimental.constrained.fcmps.f64(
223 double %a, double %b,
225 metadata !"fpexcept.strict")
231 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata)
232 ; CHECK: @llvm.experimental.constrained.fadd.f64({{.*}}) #[[ATTR1:[0-9]+]]
234 declare double @llvm.experimental.constrained.fsub.f64(double, double, metadata, metadata)
235 ; CHECK: @llvm.experimental.constrained.fsub.f64({{.*}}) #[[ATTR1]]
237 declare double @llvm.experimental.constrained.fmul.f64(double, double, metadata, metadata)
238 ; CHECK: @llvm.experimental.constrained.fmul.f64({{.*}}) #[[ATTR1]]
240 declare double @llvm.experimental.constrained.fdiv.f64(double, double, metadata, metadata)
241 ; CHECK: @llvm.experimental.constrained.fdiv.f64({{.*}}) #[[ATTR1]]
243 declare double @llvm.experimental.constrained.frem.f64(double, double, metadata, metadata)
244 ; CHECK: @llvm.experimental.constrained.frem.f64({{.*}}) #[[ATTR1]]
246 declare double @llvm.experimental.constrained.fma.f64(double, double, double, metadata, metadata)
247 ; CHECK: @llvm.experimental.constrained.fma.f64({{.*}}) #[[ATTR1]]
249 declare double @llvm.experimental.constrained.fmuladd.f64(double, double, double, metadata, metadata)
250 ; CHECK: @llvm.experimental.constrained.fmuladd.f64({{.*}}) #[[ATTR1]]
252 declare i32 @llvm.experimental.constrained.fptosi.i32.f64(double, metadata)
253 ; CHECK: @llvm.experimental.constrained.fptosi.i32.f64({{.*}}) #[[ATTR1]]
255 declare i32 @llvm.experimental.constrained.fptoui.i32.f64(double, metadata)
256 ; CHECK: @llvm.experimental.constrained.fptoui.i32.f64({{.*}}) #[[ATTR1]]
258 declare double @llvm.experimental.constrained.sitofp.f64.i32(i32, metadata, metadata)
259 ; CHECK: @llvm.experimental.constrained.sitofp.f64.i32({{.*}}) #[[ATTR1]]
261 declare double @llvm.experimental.constrained.uitofp.f64.i32(i32, metadata, metadata)
262 ; CHECK: @llvm.experimental.constrained.uitofp.f64.i32({{.*}}) #[[ATTR1]]
264 declare float @llvm.experimental.constrained.fptrunc.f32.f64(double, metadata, metadata)
265 ; CHECK: @llvm.experimental.constrained.fptrunc.f32.f64({{.*}}) #[[ATTR1]]
267 declare double @llvm.experimental.constrained.fpext.f64.f32(float, metadata)
268 ; CHECK: @llvm.experimental.constrained.fpext.f64.f32({{.*}}) #[[ATTR1]]
270 declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata)
271 ; CHECK: @llvm.experimental.constrained.sqrt.f64({{.*}}) #[[ATTR1]]
273 declare double @llvm.experimental.constrained.powi.f64(double, i32, metadata, metadata)
274 ; CHECK: @llvm.experimental.constrained.powi.f64({{.*}}) #[[ATTR1]]
276 declare double @llvm.experimental.constrained.sin.f64(double, metadata, metadata)
277 ; CHECK: @llvm.experimental.constrained.sin.f64({{.*}}) #[[ATTR1]]
279 declare double @llvm.experimental.constrained.cos.f64(double, metadata, metadata)
280 ; CHECK: @llvm.experimental.constrained.cos.f64({{.*}}) #[[ATTR1]]
282 declare double @llvm.experimental.constrained.tan.f64(double, metadata, metadata)
283 ; CHECK: @llvm.experimental.constrained.tan.f64({{.*}}) #[[ATTR1]]
285 declare double @llvm.experimental.constrained.asin.f64(double, metadata, metadata)
286 ; CHECK: @llvm.experimental.constrained.asin.f64({{.*}}) #[[ATTR1]]
288 declare double @llvm.experimental.constrained.acos.f64(double, metadata, metadata)
289 ; CHECK: @llvm.experimental.constrained.acos.f64({{.*}}) #[[ATTR1]]
291 declare double @llvm.experimental.constrained.atan.f64(double, metadata, metadata)
292 ; CHECK: @llvm.experimental.constrained.atan.f64({{.*}}) #[[ATTR1]]
294 declare double @llvm.experimental.constrained.sinh.f64(double, metadata, metadata)
295 ; CHECK: @llvm.experimental.constrained.sinh.f64({{.*}}) #[[ATTR1]]
297 declare double @llvm.experimental.constrained.cosh.f64(double, metadata, metadata)
298 ; CHECK: @llvm.experimental.constrained.cosh.f64({{.*}}) #[[ATTR1]]
300 declare double @llvm.experimental.constrained.tanh.f64(double, metadata, metadata)
301 ; CHECK: @llvm.experimental.constrained.tanh.f64({{.*}}) #[[ATTR1]]
303 declare double @llvm.experimental.constrained.pow.f64(double, double, metadata, metadata)
304 ; CHECK: @llvm.experimental.constrained.pow.f64({{.*}}) #[[ATTR1]]
306 declare double @llvm.experimental.constrained.log.f64(double, metadata, metadata)
307 ; CHECK: @llvm.experimental.constrained.log.f64({{.*}}) #[[ATTR1]]
309 declare double @llvm.experimental.constrained.log10.f64(double, metadata, metadata)
310 ; CHECK: @llvm.experimental.constrained.log10.f64({{.*}}) #[[ATTR1]]
312 declare double @llvm.experimental.constrained.log2.f64(double, metadata, metadata)
313 ; CHECK: @llvm.experimental.constrained.log2.f64({{.*}}) #[[ATTR1]]
315 declare double @llvm.experimental.constrained.exp.f64(double, metadata, metadata)
316 ; CHECK: @llvm.experimental.constrained.exp.f64({{.*}}) #[[ATTR1]]
318 declare double @llvm.experimental.constrained.exp2.f64(double, metadata, metadata)
319 ; CHECK: @llvm.experimental.constrained.exp2.f64({{.*}}) #[[ATTR1]]
321 declare double @llvm.experimental.constrained.rint.f64(double, metadata, metadata)
322 ; CHECK: @llvm.experimental.constrained.rint.f64({{.*}}) #[[ATTR1]]
324 declare double @llvm.experimental.constrained.nearbyint.f64(double, metadata, metadata)
325 ; CHECK: @llvm.experimental.constrained.nearbyint.f64({{.*}}) #[[ATTR1]]
327 declare i32 @llvm.experimental.constrained.lrint.i32.f64(double, metadata, metadata)
328 ; CHECK: @llvm.experimental.constrained.lrint.i32.f64({{.*}}) #[[ATTR1]]
330 declare i64 @llvm.experimental.constrained.llrint.i64.f64(double, metadata, metadata)
331 ; CHECK: @llvm.experimental.constrained.llrint.i64.f64({{.*}}) #[[ATTR1]]
333 declare double @llvm.experimental.constrained.maxnum.f64(double, double, metadata)
334 ; CHECK: @llvm.experimental.constrained.maxnum.f64({{.*}}) #[[ATTR1]]
336 declare double @llvm.experimental.constrained.minnum.f64(double, double, metadata)
337 ; CHECK: @llvm.experimental.constrained.minnum.f64({{.*}}) #[[ATTR1]]
339 declare double @llvm.experimental.constrained.maximum.f64(double, double, metadata)
340 ; CHECK: @llvm.experimental.constrained.maximum.f64({{.*}}) #[[ATTR1]]
342 declare double @llvm.experimental.constrained.minimum.f64(double, double, metadata)
343 ; CHECK: @llvm.experimental.constrained.minimum.f64({{.*}}) #[[ATTR1]]
345 declare double @llvm.experimental.constrained.ceil.f64(double, metadata)
346 ; CHECK: @llvm.experimental.constrained.ceil.f64({{.*}}) #[[ATTR1]]
348 declare double @llvm.experimental.constrained.floor.f64(double, metadata)
349 ; CHECK: @llvm.experimental.constrained.floor.f64({{.*}}) #[[ATTR1]]
351 declare i32 @llvm.experimental.constrained.lround.i32.f64(double, metadata)
352 ; CHECK: @llvm.experimental.constrained.lround.i32.f64({{.*}}) #[[ATTR1]]
354 declare i64 @llvm.experimental.constrained.llround.i64.f64(double, metadata)
355 ; CHECK: @llvm.experimental.constrained.llround.i64.f64({{.*}}) #[[ATTR1]]
357 declare double @llvm.experimental.constrained.round.f64(double, metadata)
358 ; CHECK: @llvm.experimental.constrained.round.f64({{.*}}) #[[ATTR1]]
360 declare double @llvm.experimental.constrained.roundeven.f64(double, metadata)
361 ; CHECK: @llvm.experimental.constrained.roundeven.f64({{.*}}) #[[ATTR1]]
363 declare double @llvm.experimental.constrained.trunc.f64(double, metadata)
364 ; CHECK: @llvm.experimental.constrained.trunc.f64({{.*}}) #[[ATTR1]]
366 declare i1 @llvm.experimental.constrained.fcmp.f64(double, double, metadata, metadata)
367 ; CHECK: @llvm.experimental.constrained.fcmp.f64({{.*}}) #[[ATTR1]]
369 declare i1 @llvm.experimental.constrained.fcmps.f64(double, double, metadata, metadata)
370 ; CHECK: @llvm.experimental.constrained.fcmps.f64({{.*}}) #[[ATTR1]]
372 ; CHECK: attributes #[[ATTR0]] = {{{.*}} strictfp {{.*}}}
373 ; CHECK: attributes #[[ATTR1]] = { {{.*}} strictfp {{.*}} }