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 %pow = call double @llvm.experimental.constrained.pow.f64(
90 metadata !"round.dynamic",
91 metadata !"fpexcept.strict")
93 %log = call double @llvm.experimental.constrained.log.f64(
95 metadata !"round.dynamic",
96 metadata !"fpexcept.strict")
98 %log10 = call double @llvm.experimental.constrained.log10.f64(
100 metadata !"round.dynamic",
101 metadata !"fpexcept.strict")
103 %log2 = call double @llvm.experimental.constrained.log2.f64(
105 metadata !"round.dynamic",
106 metadata !"fpexcept.strict")
108 %exp = call double @llvm.experimental.constrained.exp.f64(
110 metadata !"round.dynamic",
111 metadata !"fpexcept.strict")
113 %exp2 = call double @llvm.experimental.constrained.exp2.f64(
115 metadata !"round.dynamic",
116 metadata !"fpexcept.strict")
118 %rint = call double @llvm.experimental.constrained.rint.f64(
120 metadata !"round.dynamic",
121 metadata !"fpexcept.strict")
123 %neari = call double @llvm.experimental.constrained.nearbyint.f64(
125 metadata !"round.dynamic",
126 metadata !"fpexcept.strict")
128 %x32 = call i32 @llvm.experimental.constrained.lrint.i32.f64(
130 metadata !"round.dynamic",
131 metadata !"fpexcept.strict")
133 %x64 = call i64 @llvm.experimental.constrained.llrint.i64.f64(
135 metadata !"round.dynamic",
136 metadata !"fpexcept.strict")
138 %maxnum = call double @llvm.experimental.constrained.maxnum.f64(
139 double %a, double %b,
140 metadata !"fpexcept.strict")
142 %minnum = call double @llvm.experimental.constrained.minnum.f64(
143 double %a, double %b,
144 metadata !"fpexcept.strict")
146 %maxmum = call double @llvm.experimental.constrained.maximum.f64(
147 double %a, double %b,
148 metadata !"fpexcept.strict")
150 %minmum = call double @llvm.experimental.constrained.minimum.f64(
151 double %a, double %b,
152 metadata !"fpexcept.strict")
154 %ceil = call double @llvm.experimental.constrained.ceil.f64(
156 metadata !"fpexcept.strict")
158 %floor = call double @llvm.experimental.constrained.floor.f64(
160 metadata !"fpexcept.strict")
162 %y32 = call i32 @llvm.experimental.constrained.lround.i32.f64(
164 metadata !"fpexcept.strict")
166 %y64 = call i64 @llvm.experimental.constrained.llround.i64.f64(
168 metadata !"fpexcept.strict")
170 %round = call double @llvm.experimental.constrained.round.f64(
172 metadata !"fpexcept.strict")
174 %roundev = call double @llvm.experimental.constrained.roundeven.f64(
176 metadata !"fpexcept.strict")
178 %trunc = call double @llvm.experimental.constrained.trunc.f64(
180 metadata !"fpexcept.strict")
182 %q1 = call i1 @llvm.experimental.constrained.fcmp.f64(
183 double %a, double %b,
185 metadata !"fpexcept.strict")
187 %s1 = call i1 @llvm.experimental.constrained.fcmps.f64(
188 double %a, double %b,
190 metadata !"fpexcept.strict")
196 declare double @llvm.experimental.constrained.fadd.f64(double, double, metadata, metadata)
197 ; CHECK: @llvm.experimental.constrained.fadd.f64({{.*}}) #[[ATTR1:[0-9]+]]
199 declare double @llvm.experimental.constrained.fsub.f64(double, double, metadata, metadata)
200 ; CHECK: @llvm.experimental.constrained.fsub.f64({{.*}}) #[[ATTR1]]
202 declare double @llvm.experimental.constrained.fmul.f64(double, double, metadata, metadata)
203 ; CHECK: @llvm.experimental.constrained.fmul.f64({{.*}}) #[[ATTR1]]
205 declare double @llvm.experimental.constrained.fdiv.f64(double, double, metadata, metadata)
206 ; CHECK: @llvm.experimental.constrained.fdiv.f64({{.*}}) #[[ATTR1]]
208 declare double @llvm.experimental.constrained.frem.f64(double, double, metadata, metadata)
209 ; CHECK: @llvm.experimental.constrained.frem.f64({{.*}}) #[[ATTR1]]
211 declare double @llvm.experimental.constrained.fma.f64(double, double, double, metadata, metadata)
212 ; CHECK: @llvm.experimental.constrained.fma.f64({{.*}}) #[[ATTR1]]
214 declare double @llvm.experimental.constrained.fmuladd.f64(double, double, double, metadata, metadata)
215 ; CHECK: @llvm.experimental.constrained.fmuladd.f64({{.*}}) #[[ATTR1]]
217 declare i32 @llvm.experimental.constrained.fptosi.i32.f64(double, metadata)
218 ; CHECK: @llvm.experimental.constrained.fptosi.i32.f64({{.*}}) #[[ATTR1]]
220 declare i32 @llvm.experimental.constrained.fptoui.i32.f64(double, metadata)
221 ; CHECK: @llvm.experimental.constrained.fptoui.i32.f64({{.*}}) #[[ATTR1]]
223 declare double @llvm.experimental.constrained.sitofp.f64.i32(i32, metadata, metadata)
224 ; CHECK: @llvm.experimental.constrained.sitofp.f64.i32({{.*}}) #[[ATTR1]]
226 declare double @llvm.experimental.constrained.uitofp.f64.i32(i32, metadata, metadata)
227 ; CHECK: @llvm.experimental.constrained.uitofp.f64.i32({{.*}}) #[[ATTR1]]
229 declare float @llvm.experimental.constrained.fptrunc.f32.f64(double, metadata, metadata)
230 ; CHECK: @llvm.experimental.constrained.fptrunc.f32.f64({{.*}}) #[[ATTR1]]
232 declare double @llvm.experimental.constrained.fpext.f64.f32(float, metadata)
233 ; CHECK: @llvm.experimental.constrained.fpext.f64.f32({{.*}}) #[[ATTR1]]
235 declare double @llvm.experimental.constrained.sqrt.f64(double, metadata, metadata)
236 ; CHECK: @llvm.experimental.constrained.sqrt.f64({{.*}}) #[[ATTR1]]
238 declare double @llvm.experimental.constrained.powi.f64(double, i32, metadata, metadata)
239 ; CHECK: @llvm.experimental.constrained.powi.f64({{.*}}) #[[ATTR1]]
241 declare double @llvm.experimental.constrained.sin.f64(double, metadata, metadata)
242 ; CHECK: @llvm.experimental.constrained.sin.f64({{.*}}) #[[ATTR1]]
244 declare double @llvm.experimental.constrained.cos.f64(double, metadata, metadata)
245 ; CHECK: @llvm.experimental.constrained.cos.f64({{.*}}) #[[ATTR1]]
247 declare double @llvm.experimental.constrained.pow.f64(double, double, metadata, metadata)
248 ; CHECK: @llvm.experimental.constrained.pow.f64({{.*}}) #[[ATTR1]]
250 declare double @llvm.experimental.constrained.log.f64(double, metadata, metadata)
251 ; CHECK: @llvm.experimental.constrained.log.f64({{.*}}) #[[ATTR1]]
253 declare double @llvm.experimental.constrained.log10.f64(double, metadata, metadata)
254 ; CHECK: @llvm.experimental.constrained.log10.f64({{.*}}) #[[ATTR1]]
256 declare double @llvm.experimental.constrained.log2.f64(double, metadata, metadata)
257 ; CHECK: @llvm.experimental.constrained.log2.f64({{.*}}) #[[ATTR1]]
259 declare double @llvm.experimental.constrained.exp.f64(double, metadata, metadata)
260 ; CHECK: @llvm.experimental.constrained.exp.f64({{.*}}) #[[ATTR1]]
262 declare double @llvm.experimental.constrained.exp2.f64(double, metadata, metadata)
263 ; CHECK: @llvm.experimental.constrained.exp2.f64({{.*}}) #[[ATTR1]]
265 declare double @llvm.experimental.constrained.rint.f64(double, metadata, metadata)
266 ; CHECK: @llvm.experimental.constrained.rint.f64({{.*}}) #[[ATTR1]]
268 declare double @llvm.experimental.constrained.nearbyint.f64(double, metadata, metadata)
269 ; CHECK: @llvm.experimental.constrained.nearbyint.f64({{.*}}) #[[ATTR1]]
271 declare i32 @llvm.experimental.constrained.lrint.i32.f64(double, metadata, metadata)
272 ; CHECK: @llvm.experimental.constrained.lrint.i32.f64({{.*}}) #[[ATTR1]]
274 declare i64 @llvm.experimental.constrained.llrint.i64.f64(double, metadata, metadata)
275 ; CHECK: @llvm.experimental.constrained.llrint.i64.f64({{.*}}) #[[ATTR1]]
277 declare double @llvm.experimental.constrained.maxnum.f64(double, double, metadata)
278 ; CHECK: @llvm.experimental.constrained.maxnum.f64({{.*}}) #[[ATTR1]]
280 declare double @llvm.experimental.constrained.minnum.f64(double, double, metadata)
281 ; CHECK: @llvm.experimental.constrained.minnum.f64({{.*}}) #[[ATTR1]]
283 declare double @llvm.experimental.constrained.maximum.f64(double, double, metadata)
284 ; CHECK: @llvm.experimental.constrained.maximum.f64({{.*}}) #[[ATTR1]]
286 declare double @llvm.experimental.constrained.minimum.f64(double, double, metadata)
287 ; CHECK: @llvm.experimental.constrained.minimum.f64({{.*}}) #[[ATTR1]]
289 declare double @llvm.experimental.constrained.ceil.f64(double, metadata)
290 ; CHECK: @llvm.experimental.constrained.ceil.f64({{.*}}) #[[ATTR1]]
292 declare double @llvm.experimental.constrained.floor.f64(double, metadata)
293 ; CHECK: @llvm.experimental.constrained.floor.f64({{.*}}) #[[ATTR1]]
295 declare i32 @llvm.experimental.constrained.lround.i32.f64(double, metadata)
296 ; CHECK: @llvm.experimental.constrained.lround.i32.f64({{.*}}) #[[ATTR1]]
298 declare i64 @llvm.experimental.constrained.llround.i64.f64(double, metadata)
299 ; CHECK: @llvm.experimental.constrained.llround.i64.f64({{.*}}) #[[ATTR1]]
301 declare double @llvm.experimental.constrained.round.f64(double, metadata)
302 ; CHECK: @llvm.experimental.constrained.round.f64({{.*}}) #[[ATTR1]]
304 declare double @llvm.experimental.constrained.roundeven.f64(double, metadata)
305 ; CHECK: @llvm.experimental.constrained.roundeven.f64({{.*}}) #[[ATTR1]]
307 declare double @llvm.experimental.constrained.trunc.f64(double, metadata)
308 ; CHECK: @llvm.experimental.constrained.trunc.f64({{.*}}) #[[ATTR1]]
310 declare i1 @llvm.experimental.constrained.fcmp.f64(double, double, metadata, metadata)
311 ; CHECK: @llvm.experimental.constrained.fcmp.f64({{.*}}) #[[ATTR1]]
313 declare i1 @llvm.experimental.constrained.fcmps.f64(double, double, metadata, metadata)
314 ; CHECK: @llvm.experimental.constrained.fcmps.f64({{.*}}) #[[ATTR1]]
316 ; CHECK: attributes #[[ATTR0]] = {{{.*}} strictfp {{.*}}}
317 ; CHECK: attributes #[[ATTR1]] = { {{.*}} strictfp {{.*}} }