1 ; Test vector replicates, v16i8 version.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
5 ; Test a byte-granularity replicate with the lowest useful value.
6 define <16 x i8> @f1() {
8 ; CHECK: vrepib %v24, 1
10 ret <16 x i8> <i8 1, i8 1, i8 1, i8 1,
11 i8 1, i8 1, i8 1, i8 1,
12 i8 1, i8 1, i8 1, i8 1,
13 i8 1, i8 1, i8 1, i8 1>
16 ; Test a byte-granularity replicate with an arbitrary value.
17 define <16 x i8> @f2() {
19 ; CHECK: vrepib %v24, -55
21 ret <16 x i8> <i8 201, i8 201, i8 201, i8 201,
22 i8 201, i8 201, i8 201, i8 201,
23 i8 201, i8 201, i8 201, i8 201,
24 i8 201, i8 201, i8 201, i8 201>
27 ; Test a byte-granularity replicate with the highest useful value.
28 define <16 x i8> @f3() {
30 ; CHECK: vrepib %v24, -2
32 ret <16 x i8> <i8 254, i8 254, i8 254, i8 254,
33 i8 254, i8 254, i8 254, i8 254,
34 i8 254, i8 254, i8 254, i8 254,
35 i8 254, i8 254, i8 254, i8 254>
38 ; Test a halfword-granularity replicate with the lowest useful value.
39 define <16 x i8> @f4() {
41 ; CHECK: vrepih %v24, 1
43 ret <16 x i8> <i8 0, i8 1, i8 0, i8 1,
44 i8 0, i8 1, i8 0, i8 1,
45 i8 0, i8 1, i8 0, i8 1,
46 i8 0, i8 1, i8 0, i8 1>
49 ; Test a halfword-granularity replicate with an arbitrary value.
50 define <16 x i8> @f5() {
52 ; CHECK: vrepih %v24, 25650
54 ret <16 x i8> <i8 100, i8 50, i8 100, i8 50,
55 i8 100, i8 50, i8 100, i8 50,
56 i8 100, i8 50, i8 100, i8 50,
57 i8 100, i8 50, i8 100, i8 50>
60 ; Test a halfword-granularity replicate with the highest useful value.
61 define <16 x i8> @f6() {
63 ; CHECK: vrepih %v24, -2
65 ret <16 x i8> <i8 255, i8 254, i8 255, i8 254,
66 i8 255, i8 254, i8 255, i8 254,
67 i8 255, i8 254, i8 255, i8 254,
68 i8 255, i8 254, i8 255, i8 254>
71 ; Test a word-granularity replicate with the lowest useful positive value.
72 define <16 x i8> @f7() {
74 ; CHECK: vrepif %v24, 1
76 ret <16 x i8> <i8 0, i8 0, i8 0, i8 1,
77 i8 0, i8 0, i8 0, i8 1,
78 i8 0, i8 0, i8 0, i8 1,
79 i8 0, i8 0, i8 0, i8 1>
82 ; Test a word-granularity replicate with the highest in-range value.
83 define <16 x i8> @f8() {
85 ; CHECK: vrepif %v24, 32767
87 ret <16 x i8> <i8 0, i8 0, i8 127, i8 255,
88 i8 0, i8 0, i8 127, i8 255,
89 i8 0, i8 0, i8 127, i8 255,
90 i8 0, i8 0, i8 127, i8 255>
93 ; Test a word-granularity replicate with the next highest value.
94 ; This cannot use VREPIF.
95 define <16 x i8> @f9() {
99 ret <16 x i8> <i8 0, i8 0, i8 128, i8 0,
100 i8 0, i8 0, i8 128, i8 0,
101 i8 0, i8 0, i8 128, i8 0,
102 i8 0, i8 0, i8 128, i8 0>
105 ; Test a word-granularity replicate with the lowest in-range value.
106 define <16 x i8> @f10() {
108 ; CHECK: vrepif %v24, -32768
110 ret <16 x i8> <i8 255, i8 255, i8 128, i8 0,
111 i8 255, i8 255, i8 128, i8 0,
112 i8 255, i8 255, i8 128, i8 0,
113 i8 255, i8 255, i8 128, i8 0>
116 ; Test a word-granularity replicate with the next lowest value.
117 ; This cannot use VREPIF.
118 define <16 x i8> @f11() {
122 ret <16 x i8> <i8 255, i8 255, i8 127, i8 255,
123 i8 255, i8 255, i8 127, i8 255,
124 i8 255, i8 255, i8 127, i8 255,
125 i8 255, i8 255, i8 127, i8 255>
128 ; Test a word-granularity replicate with the highest useful negative value.
129 define <16 x i8> @f12() {
131 ; CHECK: vrepif %v24, -2
133 ret <16 x i8> <i8 255, i8 255, i8 255, i8 254,
134 i8 255, i8 255, i8 255, i8 254,
135 i8 255, i8 255, i8 255, i8 254,
136 i8 255, i8 255, i8 255, i8 254>
139 ; Test a doubleword-granularity replicate with the lowest useful positive
141 define <16 x i8> @f13() {
143 ; CHECK: vrepig %v24, 1
145 ret <16 x i8> <i8 0, i8 0, i8 0, i8 0,
146 i8 0, i8 0, i8 0, i8 1,
147 i8 0, i8 0, i8 0, i8 0,
148 i8 0, i8 0, i8 0, i8 1>
151 ; Test a doubleword-granularity replicate with the highest in-range value.
152 define <16 x i8> @f14() {
154 ; CHECK: vrepig %v24, 32767
156 ret <16 x i8> <i8 0, i8 0, i8 0, i8 0,
157 i8 0, i8 0, i8 127, i8 255,
158 i8 0, i8 0, i8 0, i8 0,
159 i8 0, i8 0, i8 127, i8 255>
162 ; Test a doubleword-granularity replicate with the next highest value.
163 ; This cannot use VREPIG.
164 define <16 x i8> @f15() {
168 ret <16 x i8> <i8 0, i8 0, i8 0, i8 0,
169 i8 0, i8 0, i8 128, i8 0,
170 i8 0, i8 0, i8 0, i8 0,
171 i8 0, i8 0, i8 128, i8 0>
174 ; Test a doubleword-granularity replicate with the lowest in-range value.
175 define <16 x i8> @f16() {
177 ; CHECK: vrepig %v24, -32768
179 ret <16 x i8> <i8 255, i8 255, i8 255, i8 255,
180 i8 255, i8 255, i8 128, i8 0,
181 i8 255, i8 255, i8 255, i8 255,
182 i8 255, i8 255, i8 128, i8 0>
185 ; Test a doubleword-granularity replicate with the next lowest value.
186 ; This cannot use VREPIG.
187 define <16 x i8> @f17() {
191 ret <16 x i8> <i8 255, i8 255, i8 255, i8 255,
192 i8 255, i8 255, i8 127, i8 255,
193 i8 255, i8 255, i8 255, i8 255,
194 i8 255, i8 255, i8 127, i8 255>
197 ; Test a doubleword-granularity replicate with the highest useful negative
199 define <16 x i8> @f18() {
201 ; CHECK: vrepig %v24, -2
203 ret <16 x i8> <i8 255, i8 255, i8 255, i8 255,
204 i8 255, i8 255, i8 255, i8 254,
205 i8 255, i8 255, i8 255, i8 255,
206 i8 255, i8 255, i8 255, i8 254>
209 ; Repeat f14 with undefs optimistically treated as 0.
210 define <16 x i8> @f19() {
212 ; CHECK: vrepig %v24, 32767
214 ret <16 x i8> <i8 0, i8 undef, i8 0, i8 0,
215 i8 0, i8 0, i8 127, i8 255,
216 i8 undef, i8 0, i8 undef, i8 0,
217 i8 0, i8 0, i8 127, i8 255>
220 ; Repeat f18 with undefs optimistically treated as -1.
221 define <16 x i8> @f20() {
223 ; CHECK: vrepig %v24, -2
225 ret <16 x i8> <i8 undef, i8 255, i8 255, i8 255,
226 i8 255, i8 255, i8 undef, i8 254,
227 i8 255, i8 255, i8 255, i8 undef,
228 i8 255, i8 undef, i8 255, i8 254>