[MIPS GlobalISel] Select MSA vector generic and builtin add
[llvm-complete.git] / test / CodeGen / SystemZ / vec-strict-conv-01.ll
blob045e2b2344cd68606ba5b52fcc5acd6473246e02
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 {
18 ; CHECK-LABEL: f1:
19 ; CHECK: vcgdb %v24, %v24, 0, 5
20 ; CHECK: br %r14
21   %dwords = call <2 x i64> @llvm.experimental.constrained.fptosi.v2i64.v2f64(<2 x double> %doubles,
22                                                metadata !"fpexcept.strict") #0
23   ret <2 x i64> %dwords
26 ; Test conversion of f64s to unsigned i64s.
27 define <2 x i64> @f2(<2 x double> %doubles) #0 {
28 ; CHECK-LABEL: f2:
29 ; CHECK: vclgdb %v24, %v24, 0, 5
30 ; CHECK: br %r14
31   %dwords = call <2 x i64> @llvm.experimental.constrained.fptoui.v2i64.v2f64(<2 x double> %doubles,
32                                                metadata !"fpexcept.strict") #0
33   ret <2 x i64> %dwords
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
41   ret void
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
49   ret void
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
57   ret <2 x i64> %dwords
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
65   ret <2 x i64> %dwords
68 attributes #0 = { strictfp }