3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; Test v16i8 splat of the first element.
6 define <16 x i8> @f1(<16 x i8> %val) {
8 ; CHECK: vrepb %v24, %v24, 0
10 %ret = shufflevector <16 x i8> %val, <16 x i8> undef,
11 <16 x i32> zeroinitializer
15 ; Test v16i8 splat of the last element.
16 define <16 x i8> @f2(<16 x i8> %val) {
18 ; CHECK: vrepb %v24, %v24, 15
20 %ret = shufflevector <16 x i8> %val, <16 x i8> undef,
21 <16 x i32> <i32 15, i32 15, i32 15, i32 15,
22 i32 15, i32 15, i32 15, i32 15,
23 i32 15, i32 15, i32 15, i32 15,
24 i32 15, i32 15, i32 15, i32 15>
28 ; Test v16i8 splat of an arbitrary element, using the second operand of
30 define <16 x i8> @f3(<16 x i8> %val) {
32 ; CHECK: vrepb %v24, %v24, 4
34 %ret = shufflevector <16 x i8> undef, <16 x i8> %val,
35 <16 x i32> <i32 20, i32 20, i32 20, i32 20,
36 i32 20, i32 20, i32 20, i32 20,
37 i32 20, i32 20, i32 20, i32 20,
38 i32 20, i32 20, i32 20, i32 20>
42 ; Test v8i16 splat of the first element.
43 define <8 x i16> @f4(<8 x i16> %val) {
45 ; CHECK: vreph %v24, %v24, 0
47 %ret = shufflevector <8 x i16> %val, <8 x i16> undef,
48 <8 x i32> zeroinitializer
52 ; Test v8i16 splat of the last element.
53 define <8 x i16> @f5(<8 x i16> %val) {
55 ; CHECK: vreph %v24, %v24, 7
57 %ret = shufflevector <8 x i16> %val, <8 x i16> undef,
58 <8 x i32> <i32 7, i32 7, i32 7, i32 7,
59 i32 7, i32 7, i32 7, i32 7>
63 ; Test v8i16 splat of an arbitrary element, using the second operand of
65 define <8 x i16> @f6(<8 x i16> %val) {
67 ; CHECK: vreph %v24, %v24, 2
69 %ret = shufflevector <8 x i16> undef, <8 x i16> %val,
70 <8 x i32> <i32 10, i32 10, i32 10, i32 10,
71 i32 10, i32 10, i32 10, i32 10>
75 ; Test v4i32 splat of the first element.
76 define <4 x i32> @f7(<4 x i32> %val) {
78 ; CHECK: vrepf %v24, %v24, 0
80 %ret = shufflevector <4 x i32> %val, <4 x i32> undef,
81 <4 x i32> zeroinitializer
85 ; Test v4i32 splat of the last element.
86 define <4 x i32> @f8(<4 x i32> %val) {
88 ; CHECK: vrepf %v24, %v24, 3
90 %ret = shufflevector <4 x i32> %val, <4 x i32> undef,
91 <4 x i32> <i32 3, i32 3, i32 3, i32 3>
95 ; Test v4i32 splat of an arbitrary element, using the second operand of
97 define <4 x i32> @f9(<4 x i32> %val) {
99 ; CHECK: vrepf %v24, %v24, 1
101 %ret = shufflevector <4 x i32> undef, <4 x i32> %val,
102 <4 x i32> <i32 5, i32 5, i32 5, i32 5>
106 ; Test v2i64 splat of the first element.
107 define <2 x i64> @f10(<2 x i64> %val) {
109 ; CHECK: vrepg %v24, %v24, 0
111 %ret = shufflevector <2 x i64> %val, <2 x i64> undef,
112 <2 x i32> zeroinitializer
116 ; Test v2i64 splat of the last element.
117 define <2 x i64> @f11(<2 x i64> %val) {
119 ; CHECK: vrepg %v24, %v24, 1
121 %ret = shufflevector <2 x i64> %val, <2 x i64> undef,
122 <2 x i32> <i32 1, i32 1>
126 ; Test v4f32 splat of the first element.
127 define <4 x float> @f12(<4 x float> %val) {
129 ; CHECK: vrepf %v24, %v24, 0
131 %ret = shufflevector <4 x float> %val, <4 x float> undef,
132 <4 x i32> zeroinitializer
136 ; Test v4f32 splat of the last element.
137 define <4 x float> @f13(<4 x float> %val) {
139 ; CHECK: vrepf %v24, %v24, 3
141 %ret = shufflevector <4 x float> %val, <4 x float> undef,
142 <4 x i32> <i32 3, i32 3, i32 3, i32 3>
146 ; Test v4f32 splat of an arbitrary element, using the second operand of
148 define <4 x float> @f14(<4 x float> %val) {
150 ; CHECK: vrepf %v24, %v24, 1
152 %ret = shufflevector <4 x float> undef, <4 x float> %val,
153 <4 x i32> <i32 5, i32 5, i32 5, i32 5>
157 ; Test v2f64 splat of the first element.
158 define <2 x double> @f15(<2 x double> %val) {
160 ; CHECK: vrepg %v24, %v24, 0
162 %ret = shufflevector <2 x double> %val, <2 x double> undef,
163 <2 x i32> zeroinitializer
164 ret <2 x double> %ret
167 ; Test v2f64 splat of the last element.
168 define <2 x double> @f16(<2 x double> %val) {
170 ; CHECK: vrepg %v24, %v24, 1
172 %ret = shufflevector <2 x double> %val, <2 x double> undef,
173 <2 x i32> <i32 1, i32 1>
174 ret <2 x double> %ret