1 ; Test floating-point strict conversion to/from 128-bit integers.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 declare fp128 @llvm.experimental.constrained.sitofp.f128.i128(i128, metadata, metadata)
7 declare double @llvm.experimental.constrained.sitofp.f64.i128(i128, metadata, metadata)
8 declare float @llvm.experimental.constrained.sitofp.f32.i128(i128, metadata, metadata)
10 declare fp128 @llvm.experimental.constrained.uitofp.f128.i128(i128, metadata, metadata)
11 declare double @llvm.experimental.constrained.uitofp.f64.i128(i128, metadata, metadata)
12 declare float @llvm.experimental.constrained.uitofp.f32.i128(i128, metadata, metadata)
14 declare i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128, metadata)
15 declare i128 @llvm.experimental.constrained.fptosi.i128.f64(double, metadata)
16 declare i128 @llvm.experimental.constrained.fptosi.i128.f32(float, metadata)
18 declare i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128, metadata)
19 declare i128 @llvm.experimental.constrained.fptoui.i128.f64(double, metadata)
20 declare i128 @llvm.experimental.constrained.fptoui.i128.f32(float, metadata)
22 ; Test signed i128->f128.
23 define fp128 @f1(i128 %i) #0 {
25 ; CHECK: brasl %r14, __floattitf@PLT
27 %conv = call fp128 @llvm.experimental.constrained.sitofp.f128.i128(i128 %i,
28 metadata !"round.dynamic",
29 metadata !"fpexcept.strict") #0
33 ; Test signed i128->f64.
34 define double @f2(i128 %i) #0 {
36 ; CHECK: brasl %r14, __floattidf@PLT
38 %conv = call double @llvm.experimental.constrained.sitofp.f64.i128(i128 %i,
39 metadata !"round.dynamic",
40 metadata !"fpexcept.strict") #0
44 ; Test signed i128->f32.
45 define float @f3(i128 %i) #0 {
47 ; CHECK: brasl %r14, __floattisf@PLT
49 %conv = call float @llvm.experimental.constrained.sitofp.f32.i128(i128 %i,
50 metadata !"round.dynamic",
51 metadata !"fpexcept.strict") #0
55 ; Test unsigned i128->f128.
56 define fp128 @f4(i128 %i) #0 {
58 ; CHECK: brasl %r14, __floatuntitf@PLT
60 %conv = call fp128 @llvm.experimental.constrained.uitofp.f128.i128(i128 %i,
61 metadata !"round.dynamic",
62 metadata !"fpexcept.strict") #0
66 ; Test unsigned i128->f64.
67 define double @f5(i128 %i) #0 {
69 ; CHECK: brasl %r14, __floatuntidf@PLT
71 %conv = call double @llvm.experimental.constrained.uitofp.f64.i128(i128 %i,
72 metadata !"round.dynamic",
73 metadata !"fpexcept.strict") #0
77 ; Test unsigned i128->f32.
78 define float @f6(i128 %i) #0 {
80 ; CHECK: brasl %r14, __floatuntisf@PLT
82 %conv = call float @llvm.experimental.constrained.uitofp.f32.i128(i128 %i,
83 metadata !"round.dynamic",
84 metadata !"fpexcept.strict") #0
88 ; Test signed f128->i128.
89 define i128 @f7(fp128 %f) #0 {
91 ; CHECK: brasl %r14, __fixtfti@PLT
93 %conv = call i128 @llvm.experimental.constrained.fptosi.i128.f128(fp128 %f,
94 metadata !"fpexcept.strict") #0
98 ; Test signed f64->i128.
99 define i128 @f8(double %f) #0 {
101 ; CHECK: brasl %r14, __fixdfti@PLT
103 %conv = call i128 @llvm.experimental.constrained.fptosi.i128.f64(double %f,
104 metadata !"fpexcept.strict") #0
108 ; Test signed f9->i128.
109 define i128 @f9(float %f) #0 {
111 ; CHECK: brasl %r14, __fixsfti@PLT
113 %conv = call i128 @llvm.experimental.constrained.fptosi.i128.f32(float %f,
114 metadata !"fpexcept.strict") #0
118 ; Test unsigned f128->i128.
119 define i128 @f10(fp128 %f) #0 {
121 ; CHECK: brasl %r14, __fixunstfti@PLT
123 %conv = call i128 @llvm.experimental.constrained.fptoui.i128.f128(fp128 %f,
124 metadata !"fpexcept.strict") #0
128 ; Test unsigned f64->i128.
129 define i128 @f11(double %f) #0 {
131 ; CHECK: brasl %r14, __fixunsdfti@PLT
133 %conv = call i128 @llvm.experimental.constrained.fptoui.i128.f64(double %f,
134 metadata !"fpexcept.strict") #0
138 ; Test unsigned f32->i128.
139 define i128 @f12(float %f) #0 {
141 ; CHECK: brasl %r14, __fixunssfti@PLT
143 %conv = call i128 @llvm.experimental.constrained.fptoui.i128.f32(float %f,
144 metadata !"fpexcept.strict") #0
148 attributes #0 = { strictfp }