1; Test strict conversions of signed i64s to floating-point values.
2;
3; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4
5declare float @llvm.experimental.constrained.sitofp.f32.i64(i64, metadata, metadata)
6declare double @llvm.experimental.constrained.sitofp.f64.i64(i64, metadata, metadata)
7declare fp128 @llvm.experimental.constrained.sitofp.f128.i64(i64, metadata, metadata)
8
9; Test i64->f32.
10define float @f1(i64 %i) #0 {
11; CHECK-LABEL: f1:
12; CHECK: cegbr %f0, %r2
13; CHECK: br %r14
14  %conv = call float @llvm.experimental.constrained.sitofp.f32.i64(i64 %i,
15                                               metadata !"round.dynamic",
16                                               metadata !"fpexcept.strict") #0
17  ret float %conv
18}
19
20; Test i64->f64.
21define double @f2(i64 %i) #0 {
22; CHECK-LABEL: f2:
23; CHECK: cdgbr %f0, %r2
24; CHECK: br %r14
25  %conv = call double @llvm.experimental.constrained.sitofp.f64.i64(i64 %i,
26                                               metadata !"round.dynamic",
27                                               metadata !"fpexcept.strict") #0
28  ret double %conv
29}
30
31; Test i64->f128.
32define void @f3(i64 %i, fp128 *%dst) #0 {
33; CHECK-LABEL: f3:
34; CHECK: cxgbr %f0, %r2
35; CHECK: std %f0, 0(%r3)
36; CHECK: std %f2, 8(%r3)
37; CHECK: br %r14
38  %conv = call fp128 @llvm.experimental.constrained.sitofp.f128.i64(i64 %i,
39                                               metadata !"round.dynamic",
40                                               metadata !"fpexcept.strict") #0
41  store fp128 %conv, fp128 *%dst
42  ret void
43}
44
45attributes #0 = { strictfp }
46