1 ; Test vector replicates, v8i16 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 <8 x i16> @f1() {
8 ; CHECK: vrepib %v24, 1
10 ret <8 x i16> <i16 257, i16 257, i16 257, i16 257,
11 i16 257, i16 257, i16 257, i16 257>
14 ; Test a byte-granularity replicate with an arbitrary value.
15 define <8 x i16> @f2() {
17 ; CHECK: vrepib %v24, -55
19 ret <8 x i16> <i16 51657, i16 51657, i16 51657, i16 51657,
20 i16 51657, i16 51657, i16 51657, i16 51657>
23 ; Test a byte-granularity replicate with the highest useful value.
24 define <8 x i16> @f3() {
26 ; CHECK: vrepib %v24, -2
28 ret <8 x i16> <i16 -258, i16 -258, i16 -258, i16 -258,
29 i16 -258, i16 -258, i16 -258, i16 -258>
32 ; Test a halfword-granularity replicate with the lowest useful value.
33 define <8 x i16> @f4() {
35 ; CHECK: vrepih %v24, 1
37 ret <8 x i16> <i16 1, i16 1, i16 1, i16 1,
38 i16 1, i16 1, i16 1, i16 1>
41 ; Test a halfword-granularity replicate with an arbitrary value.
42 define <8 x i16> @f5() {
44 ; CHECK: vrepih %v24, 25650
46 ret <8 x i16> <i16 25650, i16 25650, i16 25650, i16 25650,
47 i16 25650, i16 25650, i16 25650, i16 25650>
50 ; Test a halfword-granularity replicate with the highest useful value.
51 define <8 x i16> @f6() {
53 ; CHECK: vrepih %v24, -2
55 ret <8 x i16> <i16 65534, i16 65534, i16 65534, i16 65534,
56 i16 65534, i16 65534, i16 65534, i16 65534>
59 ; Test a word-granularity replicate with the lowest useful positive value.
60 define <8 x i16> @f7() {
62 ; CHECK: vrepif %v24, 1
64 ret <8 x i16> <i16 0, i16 1, i16 0, i16 1,
65 i16 0, i16 1, i16 0, i16 1>
68 ; Test a word-granularity replicate with the highest in-range value.
69 define <8 x i16> @f8() {
71 ; CHECK: vrepif %v24, 32767
73 ret <8 x i16> <i16 0, i16 32767, i16 0, i16 32767,
74 i16 0, i16 32767, i16 0, i16 32767>
77 ; Test a word-granularity replicate with the next highest value.
78 ; This cannot use VREPIF.
79 define <8 x i16> @f9() {
83 ret <8 x i16> <i16 0, i16 32768, i16 0, i16 32768,
84 i16 0, i16 32768, i16 0, i16 32768>
87 ; Test a word-granularity replicate with the lowest in-range value.
88 define <8 x i16> @f10() {
90 ; CHECK: vrepif %v24, -32768
92 ret <8 x i16> <i16 -1, i16 -32768, i16 -1, i16 -32768,
93 i16 -1, i16 -32768, i16 -1, i16 -32768>
96 ; Test a word-granularity replicate with the next lowest value.
97 ; This cannot use VREPIF.
98 define <8 x i16> @f11() {
102 ret <8 x i16> <i16 -1, i16 -32769, i16 -1, i16 -32769,
103 i16 -1, i16 -32769, i16 -1, i16 -32769>
106 ; Test a word-granularity replicate with the highest useful negative value.
107 define <8 x i16> @f12() {
109 ; CHECK: vrepif %v24, -2
111 ret <8 x i16> <i16 -1, i16 -2, i16 -1, i16 -2,
112 i16 -1, i16 -2, i16 -1, i16 -2>
115 ; Test a doubleword-granularity replicate with the lowest useful positive
117 define <8 x i16> @f13() {
119 ; CHECK: vrepig %v24, 1
121 ret <8 x i16> <i16 0, i16 0, i16 0, i16 1,
122 i16 0, i16 0, i16 0, i16 1>
125 ; Test a doubleword-granularity replicate with the highest in-range value.
126 define <8 x i16> @f14() {
128 ; CHECK: vrepig %v24, 32767
130 ret <8 x i16> <i16 0, i16 0, i16 0, i16 32767,
131 i16 0, i16 0, i16 0, i16 32767>
134 ; Test a doubleword-granularity replicate with the next highest value.
135 ; This cannot use VREPIG.
136 define <8 x i16> @f15() {
140 ret <8 x i16> <i16 0, i16 0, i16 0, i16 32768,
141 i16 0, i16 0, i16 0, i16 32768>
144 ; Test a doubleword-granularity replicate with the lowest in-range value.
145 define <8 x i16> @f16() {
147 ; CHECK: vrepig %v24, -32768
149 ret <8 x i16> <i16 -1, i16 -1, i16 -1, i16 -32768,
150 i16 -1, i16 -1, i16 -1, i16 -32768>
153 ; Test a doubleword-granularity replicate with the next lowest value.
154 ; This cannot use VREPIG.
155 define <8 x i16> @f17() {
159 ret <8 x i16> <i16 -1, i16 -1, i16 -1, i16 -32769,
160 i16 -1, i16 -1, i16 -1, i16 -32769>
163 ; Test a doubleword-granularity replicate with the highest useful negative
165 define <8 x i16> @f18() {
167 ; CHECK: vrepig %v24, -2
169 ret <8 x i16> <i16 -1, i16 -1, i16 -1, i16 -2,
170 i16 -1, i16 -1, i16 -1, i16 -2>
173 ; Repeat f14 with undefs optimistically treated as 0.
174 define <8 x i16> @f19() {
176 ; CHECK: vrepig %v24, 32767
178 ret <8 x i16> <i16 0, i16 undef, i16 0, i16 32767,
179 i16 undef, i16 0, i16 undef, i16 32767>
182 ; Repeat f18 with undefs optimistically treated as -1.
183 define <8 x i16> @f20() {
185 ; CHECK: vrepig %v24, -2
187 ret <8 x i16> <i16 -1, i16 -1, i16 undef, i16 -2,
188 i16 undef, i16 undef, i16 -1, i16 -2>