1 ; Test strict conversions between integer and float elements.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 declare <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double>, metadata)
6 declare <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double>, metadata)
7 declare <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i64(<2 x i64>, metadata, metadata)
8 declare <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i64(<2 x i64>, metadata, metadata)
10 declare <2 x i32> @llvm.experimental.constrained.fptoui.v2i32.v2f64(<2 x double>, metadata)
11 declare <2 x i32> @llvm.experimental.constrained.fptosi.v2i32.v2f64(<2 x double>, metadata)
12 declare <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i32(<2 x i32>, metadata, metadata)
13 declare <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i32(<2 x i32>, metadata, metadata)
15 declare <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f32(<2 x float>, metadata)
16 declare <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f32(<2 x float>, metadata)
17 declare <2 x float> @llvm.experimental.constrained.uitofp.v2f32.v2i64(<2 x i64>, metadata, metadata)
18 declare <2 x float> @llvm.experimental.constrained.sitofp.v2f32.v2i64(<2 x i64>, metadata, metadata)
20 ; Test conversion of f64s to signed i64s.
21 define <2 x i64> @f1(<2 x double> %doubles) #0 {
23 ; CHECK: vcgdb %v24, %v24, 0, 5
25 %dwords = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double> %doubles,
26 metadata !"fpexcept.strict") #0
30 ; Test conversion of f64s to unsigned i64s.
31 define <2 x i64> @f2(<2 x double> %doubles) #0 {
33 ; CHECK: vclgdb %v24, %v24, 0, 5
35 %dwords = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double> %doubles,
36 metadata !"fpexcept.strict") #0
40 ; Test conversion of signed i64s to f64s.
41 define <2 x double> @f3(<2 x i64> %dwords) #0 {
43 ; CHECK: vcdgb %v24, %v24, 0, 0
45 %doubles = call <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i64(<2 x i64> %dwords,
46 metadata !"round.dynamic",
47 metadata !"fpexcept.strict") #0
48 ret <2 x double> %doubles
51 ; Test conversion of unsigned i64s to f64s.
52 define <2 x double> @f4(<2 x i64> %dwords) #0 {
54 ; CHECK: vcdlgb %v24, %v24, 0, 0
56 %doubles = call <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i64(<2 x i64> %dwords,
57 metadata !"round.dynamic",
58 metadata !"fpexcept.strict") #0
59 ret <2 x double> %doubles
62 ; Test conversion of f64s to signed i32s, which must compile.
63 define void @f5(<2 x double> %doubles, ptr %ptr) #0 {
64 %words = call <2 x i32> @llvm.experimental.constrained.fptosi.v2i32.v2f64(<2 x double> %doubles,
65 metadata !"fpexcept.strict") #0
66 store <2 x i32> %words, ptr %ptr
70 ; Test conversion of f64s to unsigned i32s, which must compile.
71 define void @f6(<2 x double> %doubles, ptr %ptr) #0 {
72 %words = call <2 x i32> @llvm.experimental.constrained.fptoui.v2i32.v2f64(<2 x double> %doubles,
73 metadata !"fpexcept.strict") #0
74 store <2 x i32> %words, ptr %ptr
78 ; Test conversion of signed i32s to f64s, which must compile.
79 define <2 x double> @f7(ptr %ptr) #0 {
80 %words = load <2 x i32>, ptr %ptr
81 %doubles = call <2 x double> @llvm.experimental.constrained.sitofp.v2f64.v2i32(<2 x i32> %words,
82 metadata !"round.dynamic",
83 metadata !"fpexcept.strict") #0
84 ret <2 x double> %doubles
87 ; Test conversion of unsigned i32s to f64s, which must compile.
88 define <2 x double> @f8(ptr %ptr) #0 {
89 %words = load <2 x i32>, ptr %ptr
90 %doubles = call <2 x double> @llvm.experimental.constrained.uitofp.v2f64.v2i32(<2 x i32> %words,
91 metadata !"round.dynamic",
92 metadata !"fpexcept.strict") #0
93 ret <2 x double> %doubles
96 ; Test conversion of f32s to signed i64s, which must compile.
97 define <2 x i64> @f9(ptr %ptr) #0 {
98 %floats = load <2 x float>, ptr %ptr
99 %dwords = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f32(<2 x float> %floats,
100 metadata !"fpexcept.strict") #0
101 ret <2 x i64> %dwords
104 ; Test conversion of f32s to unsigned i64s, which must compile.
105 define <2 x i64> @f10(ptr %ptr) #0 {
106 %floats = load <2 x float>, ptr %ptr
107 %dwords = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f32(<2 x float> %floats,
108 metadata !"fpexcept.strict") #0
109 ret <2 x i64> %dwords
112 ; Test conversion of signed i64s to f32, which must compile.
113 define void @f11(<2 x i64> %dwords, ptr %ptr) #0 {
114 %floats = call <2 x float> @llvm.experimental.constrained.sitofp.v2f32.v2i64(<2 x i64> %dwords,
115 metadata !"round.dynamic",
116 metadata !"fpexcept.strict") #0
117 store <2 x float> %floats, ptr %ptr
121 ; Test conversion of unsigned i64s to f32, which must compile.
122 define void @f12(<2 x i64> %dwords, ptr %ptr) #0 {
123 %floats = call <2 x float> @llvm.experimental.constrained.uitofp.v2f32.v2i64(<2 x i64> %dwords,
124 metadata !"round.dynamic",
125 metadata !"fpexcept.strict") #0
126 store <2 x float> %floats, ptr %ptr
130 attributes #0 = { strictfp }