1 ; Test that vector zexts are done efficently also in case of fewer elements
2 ; than allowed, e.g. <2 x i32>.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
7 define <2 x i16> @fun1(<2 x i8> %val1) {
9 ; CHECK: vuplhb %v24, %v24
11 %z = zext <2 x i8> %val1 to <2 x i16>
15 define <2 x i32> @fun2(<2 x i8> %val1) {
17 ; CHECK: larl %r1, .LCPI1_0
18 ; CHECK-NEXT: vl %v0, 0(%r1), 3
19 ; CHECK-NEXT: vperm %v24, %v0, %v24, %v0
21 %z = zext <2 x i8> %val1 to <2 x i32>
25 define <2 x i64> @fun3(<2 x i8> %val1) {
27 ; CHECK: larl %r1, .LCPI2_0
28 ; CHECK-NEXT: vl %v0, 0(%r1), 3
29 ; CHECK-NEXT: vperm %v24, %v0, %v24, %v0
31 %z = zext <2 x i8> %val1 to <2 x i64>
35 define <2 x i32> @fun4(<2 x i16> %val1) {
37 ; CHECK: vuplhh %v24, %v24
39 %z = zext <2 x i16> %val1 to <2 x i32>
43 define <2 x i64> @fun5(<2 x i16> %val1) {
45 ; CHECK: larl %r1, .LCPI4_0
46 ; CHECK-NEXT: vl %v0, 0(%r1), 3
47 ; CHECK-NEXT: vperm %v24, %v0, %v24, %v0
49 %z = zext <2 x i16> %val1 to <2 x i64>
53 define <2 x i64> @fun6(<2 x i32> %val1) {
55 ; CHECK: vuplhf %v24, %v24
57 %z = zext <2 x i32> %val1 to <2 x i64>
61 define <4 x i16> @fun7(<4 x i8> %val1) {
63 ; CHECK: vuplhb %v24, %v24
65 %z = zext <4 x i8> %val1 to <4 x i16>
69 define <4 x i32> @fun8(<4 x i8> %val1) {
71 ; CHECK: larl %r1, .LCPI7_0
72 ; CHECK-NEXT: vl %v0, 0(%r1), 3
73 ; CHECK-NEXT: vperm %v24, %v0, %v24, %v0
75 %z = zext <4 x i8> %val1 to <4 x i32>
79 define <4 x i32> @fun9(<4 x i16> %val1) {
81 ; CHECK: vuplhh %v24, %v24
83 %z = zext <4 x i16> %val1 to <4 x i32>
87 define <8 x i16> @fun10(<8 x i8> %val1) {
89 ; CHECK: vuplhb %v24, %v24
91 %z = zext <8 x i8> %val1 to <8 x i16>
95 define <2 x i32> @fun11(<2 x i64> %Arg1, <2 x i64> %Arg2) {
98 ; CHECK-NEXT: vceqg %v1, %v24, %v0
99 ; CHECK-NEXT: vceqg %v0, %v26, %v0
100 ; CHECK-NEXT: vo %v0, %v1, %v0
101 ; CHECK-NEXT: vrepig %v1, 1
102 ; CHECK-NEXT: vn %v0, %v0, %v1
103 ; CHECK-NEXT: vpkg %v24, %v0, %v0
104 ; CHECK-NEXT: br %r14
105 %i3 = icmp eq <2 x i64> %Arg1, zeroinitializer
106 %i5 = icmp eq <2 x i64> %Arg2, zeroinitializer
107 %i6 = or <2 x i1> %i3, %i5
108 %i7 = zext <2 x i1> %i6 to <2 x i32>