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