1 ; Test strict conversions between integer and float elements.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; FIXME: llvm.experimental.constrained.[su]itofp does not yet exist
7 declare <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double>, metadata)
8 declare <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double>, 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)
13 declare <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f32(<2 x float>, metadata)
14 declare <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f32(<2 x float>, metadata)
16 ; Test conversion of f64s to signed i64s.
17 define <2 x i64> @f1(<2 x double> %doubles) #0 {
19 ; CHECK: vcgdb %v24, %v24, 0, 5
21 %dwords = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double> %doubles,
22 metadata !"fpexcept.strict") #0
26 ; Test conversion of f64s to unsigned i64s.
27 define <2 x i64> @f2(<2 x double> %doubles) #0 {
29 ; CHECK: vclgdb %v24, %v24, 0, 5
31 %dwords = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double> %doubles,
32 metadata !"fpexcept.strict") #0
36 ; Test conversion of f64s to signed i32s, which must compile.
37 define void @f5(<2 x double> %doubles, <2 x i32> *%ptr) #0 {
38 %words = call <2 x i32> @llvm.experimental.constrained.fptosi.v2i32.v2f64(<2 x double> %doubles,
39 metadata !"fpexcept.strict") #0
40 store <2 x i32> %words, <2 x i32> *%ptr
44 ; Test conversion of f64s to unsigned i32s, which must compile.
45 define void @f6(<2 x double> %doubles, <2 x i32> *%ptr) #0 {
46 %words = call <2 x i32> @llvm.experimental.constrained.fptoui.v2i32.v2f64(<2 x double> %doubles,
47 metadata !"fpexcept.strict") #0
48 store <2 x i32> %words, <2 x i32> *%ptr
52 ; Test conversion of f32s to signed i64s, which must compile.
53 define <2 x i64> @f9(<2 x float> *%ptr) #0 {
54 %floats = load <2 x float>, <2 x float> *%ptr
55 %dwords = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f32(<2 x float> %floats,
56 metadata !"fpexcept.strict") #0
60 ; Test conversion of f32s to unsigned i64s, which must compile.
61 define <2 x i64> @f10(<2 x float> *%ptr) #0 {
62 %floats = load <2 x float>, <2 x float> *%ptr
63 %dwords = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f32(<2 x float> %floats,
64 metadata !"fpexcept.strict") #0
68 attributes #0 = { strictfp }