1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64 %s -disable-strictnode-mutation -o - | FileCheck %s
3 ; RUN: llc -mtriple=aarch64 -global-isel=true -global-isel-abort=2 -disable-strictnode-mutation %s -o - | FileCheck %s
5 ; Check that constrained fp vector intrinsics are correctly lowered.
8 ; Single-precision intrinsics
10 define <4 x float> @add_v4f32(<4 x float> %x, <4 x float> %y) #0 {
11 ; CHECK-LABEL: add_v4f32:
13 ; CHECK-NEXT: fadd v0.4s, v0.4s, v1.4s
15 %val = call <4 x float> @llvm.experimental.constrained.fadd.v4f32(<4 x float> %x, <4 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
19 define <4 x float> @sub_v4f32(<4 x float> %x, <4 x float> %y) #0 {
20 ; CHECK-LABEL: sub_v4f32:
22 ; CHECK-NEXT: fsub v0.4s, v0.4s, v1.4s
24 %val = call <4 x float> @llvm.experimental.constrained.fsub.v4f32(<4 x float> %x, <4 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
28 define <4 x float> @mul_v4f32(<4 x float> %x, <4 x float> %y) #0 {
29 ; CHECK-LABEL: mul_v4f32:
31 ; CHECK-NEXT: fmul v0.4s, v0.4s, v1.4s
33 %val = call <4 x float> @llvm.experimental.constrained.fmul.v4f32(<4 x float> %x, <4 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
37 define <4 x float> @div_v4f32(<4 x float> %x, <4 x float> %y) #0 {
38 ; CHECK-LABEL: div_v4f32:
40 ; CHECK-NEXT: fdiv v0.4s, v0.4s, v1.4s
42 %val = call <4 x float> @llvm.experimental.constrained.fdiv.v4f32(<4 x float> %x, <4 x float> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
46 define <4 x float> @fma_v4f32(<4 x float> %x, <4 x float> %y, <4 x float> %z) #0 {
47 ; CHECK-LABEL: fma_v4f32:
49 ; CHECK-NEXT: fmla v2.4s, v1.4s, v0.4s
50 ; CHECK-NEXT: mov v0.16b, v2.16b
52 %val = call <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float> %x, <4 x float> %y, <4 x float> %z, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
56 define <4 x i32> @fptosi_v4i32_v4f32(<4 x float> %x) #0 {
57 ; CHECK-LABEL: fptosi_v4i32_v4f32:
59 ; CHECK-NEXT: fcvtzs v0.4s, v0.4s
61 %val = call <4 x i32> @llvm.experimental.constrained.fptosi.v4i32.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
65 define <4 x i32> @fptoui_v4i32_v4f32(<4 x float> %x) #0 {
66 ; CHECK-LABEL: fptoui_v4i32_v4f32:
68 ; CHECK-NEXT: fcvtzu v0.4s, v0.4s
70 %val = call <4 x i32> @llvm.experimental.constrained.fptoui.v4i32.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
74 define <4 x i64> @fptosi_v4i64_v4f32(<4 x float> %x) #0 {
75 ; CHECK-LABEL: fptosi_v4i64_v4f32:
77 ; CHECK-NEXT: fcvtl2 v1.2d, v0.4s
78 ; CHECK-NEXT: fcvtl v0.2d, v0.2s
79 ; CHECK-NEXT: fcvtzs v1.2d, v1.2d
80 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
82 %val = call <4 x i64> @llvm.experimental.constrained.fptosi.v4i64.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
86 define <4 x i64> @fptoui_v4i64_v4f32(<4 x float> %x) #0 {
87 ; CHECK-LABEL: fptoui_v4i64_v4f32:
89 ; CHECK-NEXT: fcvtl2 v1.2d, v0.4s
90 ; CHECK-NEXT: fcvtl v0.2d, v0.2s
91 ; CHECK-NEXT: fcvtzu v1.2d, v1.2d
92 ; CHECK-NEXT: fcvtzu v0.2d, v0.2d
94 %val = call <4 x i64> @llvm.experimental.constrained.fptoui.v4i64.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
98 define <4 x float> @sitofp_v4f32_v4i32(<4 x i32> %x) #0 {
99 ; CHECK-LABEL: sitofp_v4f32_v4i32:
101 ; CHECK-NEXT: scvtf v0.4s, v0.4s
103 %val = call <4 x float> @llvm.experimental.constrained.sitofp.v4f32.v4i32(<4 x i32> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
107 define <4 x float> @uitofp_v4f32_v4i32(<4 x i32> %x) #0 {
108 ; CHECK-LABEL: uitofp_v4f32_v4i32:
110 ; CHECK-NEXT: ucvtf v0.4s, v0.4s
112 %val = call <4 x float> @llvm.experimental.constrained.uitofp.v4f32.v4i32(<4 x i32> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
116 define <4 x float> @sitofp_v4f32_v4i64(<4 x i64> %x) #0 {
117 ; CHECK-LABEL: sitofp_v4f32_v4i64:
119 ; CHECK-NEXT: scvtf v0.2d, v0.2d
120 ; CHECK-NEXT: scvtf v1.2d, v1.2d
121 ; CHECK-NEXT: fcvtn v0.2s, v0.2d
122 ; CHECK-NEXT: fcvtn2 v0.4s, v1.2d
124 %val = call <4 x float> @llvm.experimental.constrained.sitofp.v4f32.v4i64(<4 x i64> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
128 define <4 x float> @uitofp_v4f32_v4i64(<4 x i64> %x) #0 {
129 ; CHECK-LABEL: uitofp_v4f32_v4i64:
131 ; CHECK-NEXT: ucvtf v0.2d, v0.2d
132 ; CHECK-NEXT: ucvtf v1.2d, v1.2d
133 ; CHECK-NEXT: fcvtn v0.2s, v0.2d
134 ; CHECK-NEXT: fcvtn2 v0.4s, v1.2d
136 %val = call <4 x float> @llvm.experimental.constrained.uitofp.v4f32.v4i64(<4 x i64> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
140 define <4 x float> @sqrt_v4f32(<4 x float> %x) #0 {
141 ; CHECK-LABEL: sqrt_v4f32:
143 ; CHECK-NEXT: fsqrt v0.4s, v0.4s
145 %val = call <4 x float> @llvm.experimental.constrained.sqrt.v4f32(<4 x float> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
149 define <4 x float> @rint_v4f32(<4 x float> %x) #0 {
150 ; CHECK-LABEL: rint_v4f32:
152 ; CHECK-NEXT: frintx v0.4s, v0.4s
154 %val = call <4 x float> @llvm.experimental.constrained.rint.v4f32(<4 x float> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
158 define <4 x float> @nearbyint_v4f32(<4 x float> %x) #0 {
159 ; CHECK-LABEL: nearbyint_v4f32:
161 ; CHECK-NEXT: frinti v0.4s, v0.4s
163 %val = call <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
167 define <4 x float> @maxnum_v4f32(<4 x float> %x, <4 x float> %y) #0 {
168 ; CHECK-LABEL: maxnum_v4f32:
170 ; CHECK-NEXT: fmaxnm v0.4s, v0.4s, v1.4s
172 %val = call <4 x float> @llvm.experimental.constrained.maxnum.v4f32(<4 x float> %x, <4 x float> %y, metadata !"fpexcept.strict") #0
176 define <4 x float> @minnum_v4f32(<4 x float> %x, <4 x float> %y) #0 {
177 ; CHECK-LABEL: minnum_v4f32:
179 ; CHECK-NEXT: fminnm v0.4s, v0.4s, v1.4s
181 %val = call <4 x float> @llvm.experimental.constrained.minnum.v4f32(<4 x float> %x, <4 x float> %y, metadata !"fpexcept.strict") #0
185 define <4 x float> @ceil_v4f32(<4 x float> %x) #0 {
186 ; CHECK-LABEL: ceil_v4f32:
188 ; CHECK-NEXT: frintp v0.4s, v0.4s
190 %val = call <4 x float> @llvm.experimental.constrained.ceil.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
194 define <4 x float> @floor_v4f32(<4 x float> %x) #0 {
195 ; CHECK-LABEL: floor_v4f32:
197 ; CHECK-NEXT: frintm v0.4s, v0.4s
199 %val = call <4 x float> @llvm.experimental.constrained.floor.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
203 define <4 x float> @round_v4f32(<4 x float> %x) #0 {
204 ; CHECK-LABEL: round_v4f32:
206 ; CHECK-NEXT: frinta v0.4s, v0.4s
208 %val = call <4 x float> @llvm.experimental.constrained.round.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
212 define <4 x float> @roundeven_v4f32(<4 x float> %x) #0 {
213 ; CHECK-LABEL: roundeven_v4f32:
215 ; CHECK-NEXT: frintn v0.4s, v0.4s
217 %val = call <4 x float> @llvm.experimental.constrained.roundeven.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
221 define <4 x float> @trunc_v4f32(<4 x float> %x) #0 {
222 ; CHECK-LABEL: trunc_v4f32:
224 ; CHECK-NEXT: frintz v0.4s, v0.4s
226 %val = call <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float> %x, metadata !"fpexcept.strict") #0
230 define <4 x i1> @fcmp_v4f32(<4 x float> %x, <4 x float> %y) #0 {
231 ; CHECK-LABEL: fcmp_v4f32:
232 ; CHECK: // %bb.0: // %entry
233 ; CHECK-NEXT: mov s2, v1.s[1]
234 ; CHECK-NEXT: mov s3, v0.s[1]
235 ; CHECK-NEXT: fcmp s0, s1
236 ; CHECK-NEXT: csetm w8, eq
237 ; CHECK-NEXT: fcmp s3, s2
238 ; CHECK-NEXT: mov s2, v1.s[2]
239 ; CHECK-NEXT: mov s3, v0.s[2]
240 ; CHECK-NEXT: fmov s4, w8
241 ; CHECK-NEXT: mov s1, v1.s[3]
242 ; CHECK-NEXT: mov s0, v0.s[3]
243 ; CHECK-NEXT: csetm w8, eq
244 ; CHECK-NEXT: mov v4.s[1], w8
245 ; CHECK-NEXT: fcmp s3, s2
246 ; CHECK-NEXT: csetm w8, eq
247 ; CHECK-NEXT: fcmp s0, s1
248 ; CHECK-NEXT: mov v4.s[2], w8
249 ; CHECK-NEXT: csetm w8, eq
250 ; CHECK-NEXT: mov v4.s[3], w8
251 ; CHECK-NEXT: xtn v0.4h, v4.4s
254 %val = call <4 x i1> @llvm.experimental.constrained.fcmp.v4f64(<4 x float> %x, <4 x float> %y, metadata !"oeq", metadata !"fpexcept.strict")
258 define <4 x i1> @fcmps_v4f32(<4 x float> %x, <4 x float> %y) #0 {
259 ; CHECK-LABEL: fcmps_v4f32:
260 ; CHECK: // %bb.0: // %entry
261 ; CHECK-NEXT: mov s2, v1.s[1]
262 ; CHECK-NEXT: mov s3, v0.s[1]
263 ; CHECK-NEXT: fcmpe s0, s1
264 ; CHECK-NEXT: csetm w8, eq
265 ; CHECK-NEXT: fcmpe s3, s2
266 ; CHECK-NEXT: mov s2, v1.s[2]
267 ; CHECK-NEXT: mov s3, v0.s[2]
268 ; CHECK-NEXT: fmov s4, w8
269 ; CHECK-NEXT: mov s1, v1.s[3]
270 ; CHECK-NEXT: mov s0, v0.s[3]
271 ; CHECK-NEXT: csetm w8, eq
272 ; CHECK-NEXT: mov v4.s[1], w8
273 ; CHECK-NEXT: fcmpe s3, s2
274 ; CHECK-NEXT: csetm w8, eq
275 ; CHECK-NEXT: fcmpe s0, s1
276 ; CHECK-NEXT: mov v4.s[2], w8
277 ; CHECK-NEXT: csetm w8, eq
278 ; CHECK-NEXT: mov v4.s[3], w8
279 ; CHECK-NEXT: xtn v0.4h, v4.4s
282 %val = call <4 x i1> @llvm.experimental.constrained.fcmps.v4f64(<4 x float> %x, <4 x float> %y, metadata !"oeq", metadata !"fpexcept.strict")
287 ; Double-precision intrinsics
289 define <2 x double> @add_v2f64(<2 x double> %x, <2 x double> %y) #0 {
290 ; CHECK-LABEL: add_v2f64:
292 ; CHECK-NEXT: fadd v0.2d, v0.2d, v1.2d
294 %val = call <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
295 ret <2 x double> %val
298 define <2 x double> @sub_v2f64(<2 x double> %x, <2 x double> %y) #0 {
299 ; CHECK-LABEL: sub_v2f64:
301 ; CHECK-NEXT: fsub v0.2d, v0.2d, v1.2d
303 %val = call <2 x double> @llvm.experimental.constrained.fsub.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
304 ret <2 x double> %val
307 define <2 x double> @mul_v2f64(<2 x double> %x, <2 x double> %y) #0 {
308 ; CHECK-LABEL: mul_v2f64:
310 ; CHECK-NEXT: fmul v0.2d, v0.2d, v1.2d
312 %val = call <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
313 ret <2 x double> %val
316 define <2 x double> @div_v2f64(<2 x double> %x, <2 x double> %y) #0 {
317 ; CHECK-LABEL: div_v2f64:
319 ; CHECK-NEXT: fdiv v0.2d, v0.2d, v1.2d
321 %val = call <2 x double> @llvm.experimental.constrained.fdiv.v2f64(<2 x double> %x, <2 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
322 ret <2 x double> %val
325 define <2 x double> @fma_v2f64(<2 x double> %x, <2 x double> %y, <2 x double> %z) #0 {
326 ; CHECK-LABEL: fma_v2f64:
328 ; CHECK-NEXT: fmla v2.2d, v1.2d, v0.2d
329 ; CHECK-NEXT: mov v0.16b, v2.16b
331 %val = call <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double> %x, <2 x double> %y, <2 x double> %z, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
332 ret <2 x double> %val
335 define <2 x i32> @fptosi_v2i32_v2f64(<2 x double> %x) #0 {
336 ; CHECK-LABEL: fptosi_v2i32_v2f64:
338 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
339 ; CHECK-NEXT: xtn v0.2s, v0.2d
341 %val = call <2 x i32> @llvm.experimental.constrained.fptosi.v2i32.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
345 define <2 x i32> @fptoui_v2i32_v2f64(<2 x double> %x) #0 {
346 ; CHECK-LABEL: fptoui_v2i32_v2f64:
348 ; CHECK-NEXT: fcvtzu v0.2d, v0.2d
349 ; CHECK-NEXT: xtn v0.2s, v0.2d
351 %val = call <2 x i32> @llvm.experimental.constrained.fptoui.v2i32.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
355 define <2 x i64> @fptosi_v2i64_v2f64(<2 x double> %x) #0 {
356 ; CHECK-LABEL: fptosi_v2i64_v2f64:
358 ; CHECK-NEXT: fcvtzs v0.2d, v0.2d
360 %val = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
364 define <2 x i64> @fptoui_v2i64_v2f64(<2 x double> %x) #0 {
365 ; CHECK-LABEL: fptoui_v2i64_v2f64:
367 ; CHECK-NEXT: fcvtzu v0.2d, v0.2d
369 %val = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
373 define <2 x double> @sitofp_v2f64_v2i32(<2 x i32> %x) #0 {
374 ; CHECK-LABEL: sitofp_v2f64_v2i32:
376 ; CHECK-NEXT: sshll v0.2d, v0.2s, #0
377 ; CHECK-NEXT: scvtf v0.2d, v0.2d
379 %val = call <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i32(<2 x i32> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
380 ret <2 x double> %val
383 define <2 x double> @uitofp_v2f64_v2i32(<2 x i32> %x) #0 {
384 ; CHECK-LABEL: uitofp_v2f64_v2i32:
386 ; CHECK-NEXT: ushll v0.2d, v0.2s, #0
387 ; CHECK-NEXT: ucvtf v0.2d, v0.2d
389 %val = call <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i32(<2 x i32> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
390 ret <2 x double> %val
393 define <2 x double> @sitofp_v2f64_v2i64(<2 x i64> %x) #0 {
394 ; CHECK-LABEL: sitofp_v2f64_v2i64:
396 ; CHECK-NEXT: scvtf v0.2d, v0.2d
398 %val = call <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i64(<2 x i64> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
399 ret <2 x double> %val
402 define <2 x double> @uitofp_v2f64_v2i64(<2 x i64> %x) #0 {
403 ; CHECK-LABEL: uitofp_v2f64_v2i64:
405 ; CHECK-NEXT: ucvtf v0.2d, v0.2d
407 %val = call <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i64(<2 x i64> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
408 ret <2 x double> %val
411 define <2 x double> @sqrt_v2f64(<2 x double> %x) #0 {
412 ; CHECK-LABEL: sqrt_v2f64:
414 ; CHECK-NEXT: fsqrt v0.2d, v0.2d
416 %val = call <2 x double> @llvm.experimental.constrained.sqrt.v2f64(<2 x double> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
417 ret <2 x double> %val
420 define <2 x double> @rint_v2f64(<2 x double> %x) #0 {
421 ; CHECK-LABEL: rint_v2f64:
423 ; CHECK-NEXT: frintx v0.2d, v0.2d
425 %val = call <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
426 ret <2 x double> %val
429 define <2 x double> @nearbyint_v2f64(<2 x double> %x) #0 {
430 ; CHECK-LABEL: nearbyint_v2f64:
432 ; CHECK-NEXT: frinti v0.2d, v0.2d
434 %val = call <2 x double> @llvm.experimental.constrained.nearbyint.v2f64(<2 x double> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
435 ret <2 x double> %val
438 define <2 x double> @maxnum_v2f64(<2 x double> %x, <2 x double> %y) #0 {
439 ; CHECK-LABEL: maxnum_v2f64:
441 ; CHECK-NEXT: fmaxnm v0.2d, v0.2d, v1.2d
443 %val = call <2 x double> @llvm.experimental.constrained.maxnum.v2f64(<2 x double> %x, <2 x double> %y, metadata !"fpexcept.strict") #0
444 ret <2 x double> %val
447 define <2 x double> @minnum_v2f64(<2 x double> %x, <2 x double> %y) #0 {
448 ; CHECK-LABEL: minnum_v2f64:
450 ; CHECK-NEXT: fminnm v0.2d, v0.2d, v1.2d
452 %val = call <2 x double> @llvm.experimental.constrained.minnum.v2f64(<2 x double> %x, <2 x double> %y, metadata !"fpexcept.strict") #0
453 ret <2 x double> %val
456 define <2 x double> @ceil_v2f64(<2 x double> %x) #0 {
457 ; CHECK-LABEL: ceil_v2f64:
459 ; CHECK-NEXT: frintp v0.2d, v0.2d
461 %val = call <2 x double> @llvm.experimental.constrained.ceil.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
462 ret <2 x double> %val
465 define <2 x double> @floor_v2f64(<2 x double> %x) #0 {
466 ; CHECK-LABEL: floor_v2f64:
468 ; CHECK-NEXT: frintm v0.2d, v0.2d
470 %val = call <2 x double> @llvm.experimental.constrained.floor.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
471 ret <2 x double> %val
474 define <2 x double> @round_v2f64(<2 x double> %x) #0 {
475 ; CHECK-LABEL: round_v2f64:
477 ; CHECK-NEXT: frinta v0.2d, v0.2d
479 %val = call <2 x double> @llvm.experimental.constrained.round.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
480 ret <2 x double> %val
483 define <2 x double> @roundeven_v2f64(<2 x double> %x) #0 {
484 ; CHECK-LABEL: roundeven_v2f64:
486 ; CHECK-NEXT: frintn v0.2d, v0.2d
488 %val = call <2 x double> @llvm.experimental.constrained.roundeven.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
489 ret <2 x double> %val
492 define <2 x double> @trunc_v2f64(<2 x double> %x) #0 {
493 ; CHECK-LABEL: trunc_v2f64:
495 ; CHECK-NEXT: frintz v0.2d, v0.2d
497 %val = call <2 x double> @llvm.experimental.constrained.trunc.v2f64(<2 x double> %x, metadata !"fpexcept.strict") #0
498 ret <2 x double> %val
501 define <2 x i1> @fcmp_v2f64(<2 x double> %x, <2 x double> %y) #0 {
502 ; CHECK-LABEL: fcmp_v2f64:
503 ; CHECK: // %bb.0: // %entry
504 ; CHECK-NEXT: mov d2, v1.d[1]
505 ; CHECK-NEXT: mov d3, v0.d[1]
506 ; CHECK-NEXT: fcmp d0, d1
507 ; CHECK-NEXT: csetm x8, eq
508 ; CHECK-NEXT: fcmp d3, d2
509 ; CHECK-NEXT: fmov d0, x8
510 ; CHECK-NEXT: csetm x8, eq
511 ; CHECK-NEXT: mov v0.d[1], x8
512 ; CHECK-NEXT: xtn v0.2s, v0.2d
515 %val = call <2 x i1> @llvm.experimental.constrained.fcmp.v2f64(<2 x double> %x, <2 x double> %y, metadata !"oeq", metadata !"fpexcept.strict")
519 define <2 x i1> @fcmps_v2f64(<2 x double> %x, <2 x double> %y) #0 {
520 ; CHECK-LABEL: fcmps_v2f64:
521 ; CHECK: // %bb.0: // %entry
522 ; CHECK-NEXT: mov d2, v1.d[1]
523 ; CHECK-NEXT: mov d3, v0.d[1]
524 ; CHECK-NEXT: fcmpe d0, d1
525 ; CHECK-NEXT: csetm x8, eq
526 ; CHECK-NEXT: fcmpe d3, d2
527 ; CHECK-NEXT: fmov d0, x8
528 ; CHECK-NEXT: csetm x8, eq
529 ; CHECK-NEXT: mov v0.d[1], x8
530 ; CHECK-NEXT: xtn v0.2s, v0.2d
533 %val = call <2 x i1> @llvm.experimental.constrained.fcmps.v2f64(<2 x double> %x, <2 x double> %y, metadata !"oeq", metadata !"fpexcept.strict")
538 ; Double-precision single element intrinsics
540 define <1 x double> @add_v1f64(<1 x double> %x, <1 x double> %y) #0 {
541 ; CHECK-LABEL: add_v1f64:
543 ; CHECK-NEXT: fadd d0, d0, d1
545 %val = call <1 x double> @llvm.experimental.constrained.fadd.v1f64(<1 x double> %x, <1 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
546 ret <1 x double> %val
549 define <1 x double> @sub_v1f64(<1 x double> %x, <1 x double> %y) #0 {
550 ; CHECK-LABEL: sub_v1f64:
552 ; CHECK-NEXT: fsub d0, d0, d1
554 %val = call <1 x double> @llvm.experimental.constrained.fsub.v1f64(<1 x double> %x, <1 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
555 ret <1 x double> %val
558 define <1 x double> @mul_v1f64(<1 x double> %x, <1 x double> %y) #0 {
559 ; CHECK-LABEL: mul_v1f64:
561 ; CHECK-NEXT: fmul d0, d0, d1
563 %val = call <1 x double> @llvm.experimental.constrained.fmul.v1f64(<1 x double> %x, <1 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
564 ret <1 x double> %val
567 define <1 x double> @div_v1f64(<1 x double> %x, <1 x double> %y) #0 {
568 ; CHECK-LABEL: div_v1f64:
570 ; CHECK-NEXT: fdiv d0, d0, d1
572 %val = call <1 x double> @llvm.experimental.constrained.fdiv.v1f64(<1 x double> %x, <1 x double> %y, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
573 ret <1 x double> %val
576 define <1 x double> @fma_v1f64(<1 x double> %x, <1 x double> %y, <1 x double> %z) #0 {
577 ; CHECK-LABEL: fma_v1f64:
579 ; CHECK-NEXT: fmadd d0, d0, d1, d2
581 %val = call <1 x double> @llvm.experimental.constrained.fma.v1f64(<1 x double> %x, <1 x double> %y, <1 x double> %z, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
582 ret <1 x double> %val
585 define <1 x i32> @fptosi_v1i32_v1f64(<1 x double> %x) #0 {
586 ; CHECK-LABEL: fptosi_v1i32_v1f64:
588 ; CHECK-NEXT: fcvtzs w8, d0
589 ; CHECK-NEXT: fmov s0, w8
591 %val = call <1 x i32> @llvm.experimental.constrained.fptosi.v1i32.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
595 define <1 x i32> @fptoui_v1i32_v1f64(<1 x double> %x) #0 {
596 ; CHECK-LABEL: fptoui_v1i32_v1f64:
598 ; CHECK-NEXT: fcvtzu w8, d0
599 ; CHECK-NEXT: fmov s0, w8
601 %val = call <1 x i32> @llvm.experimental.constrained.fptoui.v1i32.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
605 define <1 x i64> @fptosi_v1i64_v1f64(<1 x double> %x) #0 {
606 ; CHECK-LABEL: fptosi_v1i64_v1f64:
608 ; CHECK-NEXT: fcvtzs x8, d0
609 ; CHECK-NEXT: fmov d0, x8
611 %val = call <1 x i64> @llvm.experimental.constrained.fptosi.v1i64.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
615 define <1 x i64> @fptoui_v1i64_v1f64(<1 x double> %x) #0 {
616 ; CHECK-LABEL: fptoui_v1i64_v1f64:
618 ; CHECK-NEXT: fcvtzu x8, d0
619 ; CHECK-NEXT: fmov d0, x8
621 %val = call <1 x i64> @llvm.experimental.constrained.fptoui.v1i64.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
625 define <1 x double> @sitofp_v1f64_v1i32(<1 x i32> %x) #0 {
626 ; CHECK-LABEL: sitofp_v1f64_v1i32:
628 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
629 ; CHECK-NEXT: fmov w8, s0
630 ; CHECK-NEXT: scvtf d0, w8
632 %val = call <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i32(<1 x i32> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
633 ret <1 x double> %val
636 define <1 x double> @uitofp_v1f64_v1i32(<1 x i32> %x) #0 {
637 ; CHECK-LABEL: uitofp_v1f64_v1i32:
639 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
640 ; CHECK-NEXT: fmov w8, s0
641 ; CHECK-NEXT: ucvtf d0, w8
643 %val = call <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i32(<1 x i32> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
644 ret <1 x double> %val
647 define <1 x double> @sitofp_v1f64_v1i64(<1 x i64> %x) #0 {
648 ; CHECK-LABEL: sitofp_v1f64_v1i64:
650 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
651 ; CHECK-NEXT: fmov x8, d0
652 ; CHECK-NEXT: scvtf d0, x8
654 %val = call <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i64(<1 x i64> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
655 ret <1 x double> %val
658 define <1 x double> @uitofp_v1f64_v1i64(<1 x i64> %x) #0 {
659 ; CHECK-LABEL: uitofp_v1f64_v1i64:
661 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
662 ; CHECK-NEXT: fmov x8, d0
663 ; CHECK-NEXT: ucvtf d0, x8
665 %val = call <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i64(<1 x i64> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
666 ret <1 x double> %val
669 define <1 x double> @sqrt_v1f64(<1 x double> %x) #0 {
670 ; CHECK-LABEL: sqrt_v1f64:
672 ; CHECK-NEXT: fsqrt d0, d0
674 %val = call <1 x double> @llvm.experimental.constrained.sqrt.v1f64(<1 x double> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
675 ret <1 x double> %val
678 define <1 x double> @rint_v1f64(<1 x double> %x) #0 {
679 ; CHECK-LABEL: rint_v1f64:
681 ; CHECK-NEXT: frintx d0, d0
683 %val = call <1 x double> @llvm.experimental.constrained.rint.v1f64(<1 x double> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
684 ret <1 x double> %val
687 define <1 x double> @nearbyint_v1f64(<1 x double> %x) #0 {
688 ; CHECK-LABEL: nearbyint_v1f64:
690 ; CHECK-NEXT: frinti d0, d0
692 %val = call <1 x double> @llvm.experimental.constrained.nearbyint.v1f64(<1 x double> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
693 ret <1 x double> %val
696 define <1 x double> @maxnum_v1f64(<1 x double> %x, <1 x double> %y) #0 {
697 ; CHECK-LABEL: maxnum_v1f64:
699 ; CHECK-NEXT: fmaxnm d0, d0, d1
701 %val = call <1 x double> @llvm.experimental.constrained.maxnum.v1f64(<1 x double> %x, <1 x double> %y, metadata !"fpexcept.strict") #0
702 ret <1 x double> %val
705 define <1 x double> @minnum_v1f64(<1 x double> %x, <1 x double> %y) #0 {
706 ; CHECK-LABEL: minnum_v1f64:
708 ; CHECK-NEXT: fminnm d0, d0, d1
710 %val = call <1 x double> @llvm.experimental.constrained.minnum.v1f64(<1 x double> %x, <1 x double> %y, metadata !"fpexcept.strict") #0
711 ret <1 x double> %val
714 define <1 x double> @ceil_v1f64(<1 x double> %x) #0 {
715 ; CHECK-LABEL: ceil_v1f64:
717 ; CHECK-NEXT: frintp d0, d0
719 %val = call <1 x double> @llvm.experimental.constrained.ceil.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
720 ret <1 x double> %val
723 define <1 x double> @floor_v1f64(<1 x double> %x) #0 {
724 ; CHECK-LABEL: floor_v1f64:
726 ; CHECK-NEXT: frintm d0, d0
728 %val = call <1 x double> @llvm.experimental.constrained.floor.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
729 ret <1 x double> %val
732 define <1 x double> @round_v1f64(<1 x double> %x) #0 {
733 ; CHECK-LABEL: round_v1f64:
735 ; CHECK-NEXT: frinta d0, d0
737 %val = call <1 x double> @llvm.experimental.constrained.round.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
738 ret <1 x double> %val
741 define <1 x double> @roundeven_v1f64(<1 x double> %x) #0 {
742 ; CHECK-LABEL: roundeven_v1f64:
744 ; CHECK-NEXT: frintn d0, d0
746 %val = call <1 x double> @llvm.experimental.constrained.roundeven.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
747 ret <1 x double> %val
750 define <1 x double> @trunc_v1f64(<1 x double> %x) #0 {
751 ; CHECK-LABEL: trunc_v1f64:
753 ; CHECK-NEXT: frintz d0, d0
755 %val = call <1 x double> @llvm.experimental.constrained.trunc.v1f64(<1 x double> %x, metadata !"fpexcept.strict") #0
756 ret <1 x double> %val
759 define <1 x i1> @fcmp_v1f61(<1 x double> %x, <1 x double> %y) #0 {
760 ; CHECK-LABEL: fcmp_v1f61:
761 ; CHECK: // %bb.0: // %entry
762 ; CHECK-NEXT: fcmp d0, d1
763 ; CHECK-NEXT: cset w0, eq
766 %val = call <1 x i1> @llvm.experimental.constrained.fcmp.v1f64(<1 x double> %x, <1 x double> %y, metadata !"oeq", metadata !"fpexcept.strict")
770 define <1 x i1> @fcmps_v1f61(<1 x double> %x, <1 x double> %y) #0 {
771 ; CHECK-LABEL: fcmps_v1f61:
772 ; CHECK: // %bb.0: // %entry
773 ; CHECK-NEXT: fcmpe d0, d1
774 ; CHECK-NEXT: cset w0, eq
777 %val = call <1 x i1> @llvm.experimental.constrained.fcmps.v1f64(<1 x double> %x, <1 x double> %y, metadata !"oeq", metadata !"fpexcept.strict")
782 ; Intrinsics to convert between floating-point types
784 define <2 x float> @fptrunc_v2f32_v2f64(<2 x double> %x) #0 {
785 ; CHECK-LABEL: fptrunc_v2f32_v2f64:
787 ; CHECK-NEXT: fcvtn v0.2s, v0.2d
789 %val = call <2 x float> @llvm.experimental.constrained.fptrunc.v2f32.v2f64(<2 x double> %x, metadata !"round.tonearest", metadata !"fpexcept.strict") #0
793 define <2 x double> @fpext_v2f64_v2f32(<2 x float> %x) #0 {
794 ; CHECK-LABEL: fpext_v2f64_v2f32:
796 ; CHECK-NEXT: fcvtl v0.2d, v0.2s
798 %val = call <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float> %x, metadata !"fpexcept.strict") #0
799 ret <2 x double> %val
803 attributes #0 = { strictfp }
805 declare <4 x float> @llvm.experimental.constrained.fadd.v4f32(<4 x float>, <4 x float>, metadata, metadata)
806 declare <4 x float> @llvm.experimental.constrained.fsub.v4f32(<4 x float>, <4 x float>, metadata, metadata)
807 declare <4 x float> @llvm.experimental.constrained.fmul.v4f32(<4 x float>, <4 x float>, metadata, metadata)
808 declare <4 x float> @llvm.experimental.constrained.fdiv.v4f32(<4 x float>, <4 x float>, metadata, metadata)
809 declare <4 x float> @llvm.experimental.constrained.fma.v4f32(<4 x float>, <4 x float>, <4 x float>, metadata, metadata)
810 declare <4 x i32> @llvm.experimental.constrained.fptosi.v4i32.v4f32(<4 x float>, metadata)
811 declare <4 x i32> @llvm.experimental.constrained.fptoui.v4i32.v4f32(<4 x float>, metadata)
812 declare <4 x i64> @llvm.experimental.constrained.fptosi.v4i64.v4f32(<4 x float>, metadata)
813 declare <4 x i64> @llvm.experimental.constrained.fptoui.v4i64.v4f32(<4 x float>, metadata)
814 declare <4 x float> @llvm.experimental.constrained.sitofp.v4f32.v4i32(<4 x i32>, metadata, metadata)
815 declare <4 x float> @llvm.experimental.constrained.uitofp.v4f32.v4i32(<4 x i32>, metadata, metadata)
816 declare <4 x float> @llvm.experimental.constrained.sitofp.v4f32.v4i64(<4 x i64>, metadata, metadata)
817 declare <4 x float> @llvm.experimental.constrained.uitofp.v4f32.v4i64(<4 x i64>, metadata, metadata)
818 declare <4 x float> @llvm.experimental.constrained.sqrt.v4f32(<4 x float>, metadata, metadata)
819 declare <4 x float> @llvm.experimental.constrained.rint.v4f32(<4 x float>, metadata, metadata)
820 declare <4 x float> @llvm.experimental.constrained.nearbyint.v4f32(<4 x float>, metadata, metadata)
821 declare <4 x float> @llvm.experimental.constrained.maxnum.v4f32(<4 x float>, <4 x float>, metadata)
822 declare <4 x float> @llvm.experimental.constrained.minnum.v4f32(<4 x float>, <4 x float>, metadata)
823 declare <4 x float> @llvm.experimental.constrained.ceil.v4f32(<4 x float>, metadata)
824 declare <4 x float> @llvm.experimental.constrained.floor.v4f32(<4 x float>, metadata)
825 declare <4 x float> @llvm.experimental.constrained.round.v4f32(<4 x float>, metadata)
826 declare <4 x float> @llvm.experimental.constrained.roundeven.v4f32(<4 x float>, metadata)
827 declare <4 x float> @llvm.experimental.constrained.trunc.v4f32(<4 x float>, metadata)
828 declare <4 x i1> @llvm.experimental.constrained.fcmp.v4f64(<4 x float>, <4 x float>, metadata, metadata)
829 declare <4 x i1> @llvm.experimental.constrained.fcmps.v4f64(<4 x float>, <4 x float>, metadata, metadata)
831 declare <2 x double> @llvm.experimental.constrained.fadd.v2f64(<2 x double>, <2 x double>, metadata, metadata)
832 declare <2 x double> @llvm.experimental.constrained.fsub.v2f64(<2 x double>, <2 x double>, metadata, metadata)
833 declare <2 x double> @llvm.experimental.constrained.fmul.v2f64(<2 x double>, <2 x double>, metadata, metadata)
834 declare <2 x double> @llvm.experimental.constrained.fdiv.v2f64(<2 x double>, <2 x double>, metadata, metadata)
835 declare <2 x double> @llvm.experimental.constrained.fma.v2f64(<2 x double>, <2 x double>, <2 x double>, metadata, metadata)
836 declare <2 x i32> @llvm.experimental.constrained.fptosi.v2i32.v2f64(<2 x double>, metadata)
837 declare <2 x i32> @llvm.experimental.constrained.fptoui.v2i32.v2f64(<2 x double>, metadata)
838 declare <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double>, metadata)
839 declare <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double>, metadata)
840 declare <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i32(<2 x i32>, metadata, metadata)
841 declare <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i32(<2 x i32>, metadata, metadata)
842 declare <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i64(<2 x i64>, metadata, metadata)
843 declare <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i64(<2 x i64>, metadata, metadata)
844 declare <2 x double> @llvm.experimental.constrained.sqrt.v2f64(<2 x double>, metadata, metadata)
845 declare <2 x double> @llvm.experimental.constrained.rint.v2f64(<2 x double>, metadata, metadata)
846 declare <2 x double> @llvm.experimental.constrained.nearbyint.v2f64(<2 x double>, metadata, metadata)
847 declare <2 x double> @llvm.experimental.constrained.maxnum.v2f64(<2 x double>, <2 x double>, metadata)
848 declare <2 x double> @llvm.experimental.constrained.minnum.v2f64(<2 x double>, <2 x double>, metadata)
849 declare <2 x double> @llvm.experimental.constrained.ceil.v2f64(<2 x double>, metadata)
850 declare <2 x double> @llvm.experimental.constrained.floor.v2f64(<2 x double>, metadata)
851 declare <2 x double> @llvm.experimental.constrained.round.v2f64(<2 x double>, metadata)
852 declare <2 x double> @llvm.experimental.constrained.roundeven.v2f64(<2 x double>, metadata)
853 declare <2 x double> @llvm.experimental.constrained.trunc.v2f64(<2 x double>, metadata)
854 declare <2 x i1> @llvm.experimental.constrained.fcmp.v2f64(<2 x double>, <2 x double>, metadata, metadata)
855 declare <2 x i1> @llvm.experimental.constrained.fcmps.v2f64(<2 x double>, <2 x double>, metadata, metadata)
857 declare <1 x double> @llvm.experimental.constrained.fadd.v1f64(<1 x double>, <1 x double>, metadata, metadata)
858 declare <1 x double> @llvm.experimental.constrained.fsub.v1f64(<1 x double>, <1 x double>, metadata, metadata)
859 declare <1 x double> @llvm.experimental.constrained.fmul.v1f64(<1 x double>, <1 x double>, metadata, metadata)
860 declare <1 x double> @llvm.experimental.constrained.fdiv.v1f64(<1 x double>, <1 x double>, metadata, metadata)
861 declare <1 x double> @llvm.experimental.constrained.fma.v1f64(<1 x double>, <1 x double>, <1 x double>, metadata, metadata)
862 declare <1 x i32> @llvm.experimental.constrained.fptosi.v1i32.v1f64(<1 x double>, metadata)
863 declare <1 x i32> @llvm.experimental.constrained.fptoui.v1i32.v1f64(<1 x double>, metadata)
864 declare <1 x i64> @llvm.experimental.constrained.fptosi.v1i64.v1f64(<1 x double>, metadata)
865 declare <1 x i64> @llvm.experimental.constrained.fptoui.v1i64.v1f64(<1 x double>, metadata)
866 declare <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i32(<1 x i32>, metadata, metadata)
867 declare <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i32(<1 x i32>, metadata, metadata)
868 declare <1 x double> @llvm.experimental.constrained.sitofp.v1f64.v1i64(<1 x i64>, metadata, metadata)
869 declare <1 x double> @llvm.experimental.constrained.uitofp.v1f64.v1i64(<1 x i64>, metadata, metadata)
870 declare <1 x double> @llvm.experimental.constrained.sqrt.v1f64(<1 x double>, metadata, metadata)
871 declare <1 x double> @llvm.experimental.constrained.rint.v1f64(<1 x double>, metadata, metadata)
872 declare <1 x double> @llvm.experimental.constrained.nearbyint.v1f64(<1 x double>, metadata, metadata)
873 declare <1 x double> @llvm.experimental.constrained.maxnum.v1f64(<1 x double>, <1 x double>, metadata)
874 declare <1 x double> @llvm.experimental.constrained.minnum.v1f64(<1 x double>, <1 x double>, metadata)
875 declare <1 x double> @llvm.experimental.constrained.ceil.v1f64(<1 x double>, metadata)
876 declare <1 x double> @llvm.experimental.constrained.floor.v1f64(<1 x double>, metadata)
877 declare <1 x double> @llvm.experimental.constrained.round.v1f64(<1 x double>, metadata)
878 declare <1 x double> @llvm.experimental.constrained.roundeven.v1f64(<1 x double>, metadata)
879 declare <1 x double> @llvm.experimental.constrained.trunc.v1f64(<1 x double>, metadata)
880 declare <1 x i1> @llvm.experimental.constrained.fcmp.v1f64(<1 x double>, <1 x double>, metadata, metadata)
881 declare <1 x i1> @llvm.experimental.constrained.fcmps.v1f64(<1 x double>, <1 x double>, metadata, metadata)
883 declare <2 x float> @llvm.experimental.constrained.fptrunc.v2f32.v2f64(<2 x double>, metadata, metadata)
884 declare <2 x double> @llvm.experimental.constrained.fpext.v2f64.v2f32(<2 x float>, metadata)