1 ; Test conversions between integer and float elements.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; Test conversion of f64s to signed i64s.
6 define <2 x i64> @f1(<2 x double> %doubles) {
8 ; CHECK: vcgdb %v24, %v24, 0, 5
10 %dwords = fptosi <2 x double> %doubles to <2 x i64>
14 ; Test conversion of f64s to unsigned i64s.
15 define <2 x i64> @f2(<2 x double> %doubles) {
17 ; CHECK: vclgdb %v24, %v24, 0, 5
19 %dwords = fptoui <2 x double> %doubles to <2 x i64>
23 ; Test conversion of signed i64s to f64s.
24 define <2 x double> @f3(<2 x i64> %dwords) {
26 ; CHECK: vcdgb %v24, %v24, 0, 0
28 %doubles = sitofp <2 x i64> %dwords to <2 x double>
29 ret <2 x double> %doubles
32 ; Test conversion of unsigned i64s to f64s.
33 define <2 x double> @f4(<2 x i64> %dwords) {
35 ; CHECK: vcdlgb %v24, %v24, 0, 0
37 %doubles = uitofp <2 x i64> %dwords to <2 x double>
38 ret <2 x double> %doubles
41 ; Test conversion of f64s to signed i32s, which must compile.
42 define void @f5(<2 x double> %doubles, ptr %ptr) {
43 %words = fptosi <2 x double> %doubles to <2 x i32>
44 store <2 x i32> %words, ptr %ptr
48 ; Test conversion of f64s to unsigned i32s, which must compile.
49 define void @f6(<2 x double> %doubles, ptr %ptr) {
50 %words = fptoui <2 x double> %doubles to <2 x i32>
51 store <2 x i32> %words, ptr %ptr
55 ; Test conversion of signed i32s to f64s, which must compile.
56 define <2 x double> @f7(ptr %ptr) {
57 %words = load <2 x i32>, ptr %ptr
58 %doubles = sitofp <2 x i32> %words to <2 x double>
59 ret <2 x double> %doubles
62 ; Test conversion of unsigned i32s to f64s, which must compile.
63 define <2 x double> @f8(ptr %ptr) {
64 %words = load <2 x i32>, ptr %ptr
65 %doubles = uitofp <2 x i32> %words to <2 x double>
66 ret <2 x double> %doubles
69 ; Test conversion of f32s to signed i64s, which must compile.
70 define <2 x i64> @f9(ptr %ptr) {
71 %floats = load <2 x float>, ptr %ptr
72 %dwords = fptosi <2 x float> %floats to <2 x i64>
76 ; Test conversion of f32s to unsigned i64s, which must compile.
77 define <2 x i64> @f10(ptr %ptr) {
78 %floats = load <2 x float>, ptr %ptr
79 %dwords = fptoui <2 x float> %floats to <2 x i64>
83 ; Test conversion of signed i64s to f32, which must compile.
84 define void @f11(<2 x i64> %dwords, ptr %ptr) {
85 %floats = sitofp <2 x i64> %dwords to <2 x float>
86 store <2 x float> %floats, ptr %ptr
90 ; Test conversion of unsigned i64s to f32, which must compile.
91 define void @f12(<2 x i64> %dwords, ptr %ptr) {
92 %floats = uitofp <2 x i64> %dwords to <2 x float>
93 store <2 x float> %floats, ptr %ptr