1; Test that vector zexts are done efficently with unpack instructions also in
2; case of fewer elements than allowed, e.g. <2 x i32>.
3;
4; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5
6
7define <2 x i16> @fun1(<2 x i8> %val1) {
8; CHECK-LABEL: fun1:
9; CHECK:      	vuplhb	%v24, %v24
10; CHECK-NEXT: 	br	%r14
11  %z = zext <2 x i8> %val1 to <2 x i16>
12  ret <2 x i16> %z
13}
14
15define <2 x i32> @fun2(<2 x i8> %val1) {
16; CHECK-LABEL: fun2:
17; CHECK:      	vuplhb	%v0, %v24
18; CHECK-NEXT: 	vuplhh	%v24, %v0
19; CHECK-NEXT: 	br	%r14
20  %z = zext <2 x i8> %val1 to <2 x i32>
21  ret <2 x i32> %z
22}
23
24define <2 x i64> @fun3(<2 x i8> %val1) {
25; CHECK-LABEL: fun3:
26; CHECK:      	vuplhb	%v0, %v24
27; CHECK-NEXT: 	vuplhh	%v0, %v0
28; CHECK-NEXT: 	vuplhf	%v24, %v0
29; CHECK-NEXT: 	br	%r14
30  %z = zext <2 x i8> %val1 to <2 x i64>
31  ret <2 x i64> %z
32}
33
34define <2 x i32> @fun4(<2 x i16> %val1) {
35; CHECK-LABEL: fun4:
36; CHECK:      	vuplhh	%v24, %v24
37; CHECK-NEXT: 	br	%r14
38  %z = zext <2 x i16> %val1 to <2 x i32>
39  ret <2 x i32> %z
40}
41
42define <2 x i64> @fun5(<2 x i16> %val1) {
43; CHECK-LABEL: fun5:
44; CHECK:      	vuplhh	%v0, %v24
45; CHECK-NEXT: 	vuplhf	%v24, %v0
46; CHECK-NEXT: 	br	%r14
47  %z = zext <2 x i16> %val1 to <2 x i64>
48  ret <2 x i64> %z
49}
50
51define <2 x i64> @fun6(<2 x i32> %val1) {
52; CHECK-LABEL: fun6:
53; CHECK:      	vuplhf	%v24, %v24
54; CHECK-NEXT: 	br	%r14
55  %z = zext <2 x i32> %val1 to <2 x i64>
56  ret <2 x i64> %z
57}
58
59define <4 x i16> @fun7(<4 x i8> %val1) {
60; CHECK-LABEL: fun7:
61; CHECK:      	vuplhb	%v24, %v24
62; CHECK-NEXT: 	br	%r14
63  %z = zext <4 x i8> %val1 to <4 x i16>
64  ret <4 x i16> %z
65}
66
67define <4 x i32> @fun8(<4 x i8> %val1) {
68; CHECK-LABEL: fun8:
69; CHECK:      	vuplhb	%v0, %v24
70; CHECK-NEXT: 	vuplhh	%v24, %v0
71; CHECK-NEXT: 	br	%r14
72  %z = zext <4 x i8> %val1 to <4 x i32>
73  ret <4 x i32> %z
74}
75
76define <4 x i32> @fun9(<4 x i16> %val1) {
77; CHECK-LABEL: fun9:
78; CHECK:      	vuplhh	%v24, %v24
79; CHECK-NEXT: 	br	%r14
80  %z = zext <4 x i16> %val1 to <4 x i32>
81  ret <4 x i32> %z
82}
83
84define <8 x i16> @fun10(<8 x i8> %val1) {
85; CHECK-LABEL: fun10:
86; CHECK:      	vuplhb	%v24, %v24
87; CHECK-NEXT: 	br	%r14
88  %z = zext <8 x i8> %val1 to <8 x i16>
89  ret <8 x i16> %z
90}
91
92