1 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64le-unknown-linux-gnu \
2 ; RUN: -verify-machineinstrs < %s | FileCheck %s
3 ; RUN: llc -mcpu=pwr9 -mtriple=powerpc64-unknown-linux-gnu \
4 ; RUN: -verify-machineinstrs < %s | FileCheck %s --check-prefix=CHECK-BE
6 define <4 x float> @_Z7testInsILj0ELj0EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
8 ; CHECK-LABEL: _Z7testInsILj0ELj0EDv4_fET1_S1_S1_
10 ; CHECK: xxinsertw 34, 0, 12
11 ; CHECK-BE-LABEL: _Z7testInsILj0ELj0EDv4_fET1_S1_S1_
12 ; CHECK-BE: xxsldwi 0, 35, 35, 3
13 ; CHECK-BE: xxinsertw 34, 0, 0
14 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
15 ret <4 x float> %vecins
18 define <4 x float> @_Z7testInsILj0ELj1EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
20 ; CHECK-LABEL: _Z7testInsILj0ELj1EDv4_fET1_S1_S1_
21 ; CHECK: xxsldwi 0, 35, 35, 1
22 ; CHECK: xxinsertw 34, 0, 12
23 ; CHECK-BE-LABEL: _Z7testInsILj0ELj1EDv4_fET1_S1_S1_
24 ; CHECK-BE-NOT: xxsldwi
25 ; CHECK-BE: xxinsertw 34, 35, 0
26 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 5, i32 1, i32 2, i32 3>
27 ret <4 x float> %vecins
30 define <4 x float> @_Z7testInsILj0ELj2EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
32 ; CHECK-LABEL: _Z7testInsILj0ELj2EDv4_fET1_S1_S1_
34 ; CHECK: xxinsertw 34, 35, 12
35 ; CHECK-BE-LABEL: _Z7testInsILj0ELj2EDv4_fET1_S1_S1_
36 ; CHECK-BE: xxsldwi 0, 35, 35, 1
37 ; CHECK-BE: xxinsertw 34, 0, 0
38 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 6, i32 1, i32 2, i32 3>
39 ret <4 x float> %vecins
42 define <4 x float> @_Z7testInsILj0ELj3EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
44 ; CHECK-LABEL: _Z7testInsILj0ELj3EDv4_fET1_S1_S1_
45 ; CHECK: xxsldwi 0, 35, 35, 3
46 ; CHECK: xxinsertw 34, 0, 12
47 ; CHECK-BE-LABEL: _Z7testInsILj0ELj3EDv4_fET1_S1_S1_
48 ; CHECK-BE: xxswapd 0, 35
49 ; CHECK-BE: xxinsertw 34, 0, 0
50 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 7, i32 1, i32 2, i32 3>
51 ret <4 x float> %vecins
54 define <4 x float> @_Z7testInsILj1ELj0EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
56 ; CHECK-LABEL: _Z7testInsILj1ELj0EDv4_fET1_S1_S1_
57 ; CHECK: xxswapd 0, 35
58 ; CHECK: xxinsertw 34, 0, 8
59 ; CHECK-BE-LABEL: _Z7testInsILj1ELj0EDv4_fET1_S1_S1_
60 ; CHECK-BE: xxsldwi 0, 35, 35, 3
61 ; CHECK-BE: xxinsertw 34, 0, 4
62 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 4, i32 2, i32 3>
63 ret <4 x float> %vecins
66 define <4 x float> @_Z7testInsILj1ELj1EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
68 ; CHECK-LABEL: _Z7testInsILj1ELj1EDv4_fET1_S1_S1_
69 ; CHECK: xxsldwi 0, 35, 35, 1
70 ; CHECK: xxinsertw 34, 0, 8
71 ; CHECK-BE-LABEL: _Z7testInsILj1ELj1EDv4_fET1_S1_S1_
72 ; CHECK-BE-NOT: xxsldwi
73 ; CHECK-BE: xxinsertw 34, 35, 4
74 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 5, i32 2, i32 3>
75 ret <4 x float> %vecins
78 define <4 x float> @_Z7testInsILj1ELj2EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
80 ; CHECK-LABEL: _Z7testInsILj1ELj2EDv4_fET1_S1_S1_
82 ; CHECK: xxinsertw 34, 35, 8
83 ; CHECK-BE-LABEL: _Z7testInsILj1ELj2EDv4_fET1_S1_S1_
84 ; CHECK-BE: xxsldwi 0, 35, 35, 1
85 ; CHECK-BE: xxinsertw 34, 0, 4
86 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 6, i32 2, i32 3>
87 ret <4 x float> %vecins
90 define <4 x float> @_Z7testInsILj1ELj3EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
92 ; CHECK-LABEL: _Z7testInsILj1ELj3EDv4_fET1_S1_S1_
93 ; CHECK: xxsldwi 0, 35, 35, 3
94 ; CHECK: xxinsertw 34, 0, 8
95 ; CHECK-BE-LABEL: _Z7testInsILj1ELj3EDv4_fET1_S1_S1_
96 ; CHECK-BE: xxswapd 0, 35
97 ; CHECK-BE: xxinsertw 34, 0, 4
98 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 7, i32 2, i32 3>
99 ret <4 x float> %vecins
102 define <4 x float> @_Z7testInsILj2ELj0EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
104 ; CHECK-LABEL: _Z7testInsILj2ELj0EDv4_fET1_S1_S1_
105 ; CHECK: xxswapd 0, 35
106 ; CHECK: xxinsertw 34, 0, 4
107 ; CHECK-BE-LABEL: _Z7testInsILj2ELj0EDv4_fET1_S1_S1_
108 ; CHECK-BE: xxsldwi 0, 35, 35, 3
109 ; CHECK-BE: xxinsertw 34, 0, 8
110 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 3>
111 ret <4 x float> %vecins
114 define <4 x float> @_Z7testInsILj2ELj1EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
116 ; CHECK-LABEL: _Z7testInsILj2ELj1EDv4_fET1_S1_S1_
117 ; CHECK: xxsldwi 0, 35, 35, 1
118 ; CHECK: xxinsertw 34, 0, 4
119 ; CHECK-BE-LABEL: _Z7testInsILj2ELj1EDv4_fET1_S1_S1_
120 ; CHECK-BE-NOT: xxsldwi
121 ; CHECK-BE: xxinsertw 34, 35, 8
122 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 5, i32 3>
123 ret <4 x float> %vecins
126 define <4 x float> @_Z7testInsILj2ELj2EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
128 ; CHECK-LABEL: _Z7testInsILj2ELj2EDv4_fET1_S1_S1_
130 ; CHECK: xxinsertw 34, 35, 4
131 ; CHECK-BE-LABEL: _Z7testInsILj2ELj2EDv4_fET1_S1_S1_
132 ; CHECK-BE: xxsldwi 0, 35, 35, 1
133 ; CHECK-BE: xxinsertw 34, 0, 8
134 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 6, i32 3>
135 ret <4 x float> %vecins
138 define <4 x float> @_Z7testInsILj2ELj3EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
140 ; CHECK-LABEL: _Z7testInsILj2ELj3EDv4_fET1_S1_S1_
141 ; CHECK: xxsldwi 0, 35, 35, 3
142 ; CHECK: xxinsertw 34, 0, 4
143 ; CHECK-BE-LABEL: _Z7testInsILj2ELj3EDv4_fET1_S1_S1_
144 ; CHECK-BE: xxswapd 0, 35
145 ; CHECK-BE: xxinsertw 34, 0, 8
146 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 7, i32 3>
147 ret <4 x float> %vecins
150 define <4 x float> @_Z7testInsILj3ELj0EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
152 ; CHECK-LABEL: _Z7testInsILj3ELj0EDv4_fET1_S1_S1_
153 ; CHECK: xxswapd 0, 35
154 ; CHECK: xxinsertw 34, 0, 0
155 ; CHECK-BE-LABEL: _Z7testInsILj3ELj0EDv4_fET1_S1_S1_
156 ; CHECK-BE: xxsldwi 0, 35, 35, 3
157 ; CHECK-BE: xxinsertw 34, 0, 12
158 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
159 ret <4 x float> %vecins
162 define <4 x float> @_Z7testInsILj3ELj1EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
164 ; CHECK-LABEL: _Z7testInsILj3ELj1EDv4_fET1_S1_S1_
165 ; CHECK: xxsldwi 0, 35, 35, 1
166 ; CHECK: xxinsertw 34, 0, 0
167 ; CHECK-BE-LABEL: _Z7testInsILj3ELj1EDv4_fET1_S1_S1_
168 ; CHECK-BE-NOT: xxsldwi
169 ; CHECK-BE: xxinsertw 34, 35, 12
170 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 5>
171 ret <4 x float> %vecins
174 define <4 x float> @_Z7testInsILj3ELj2EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
176 ; CHECK-LABEL: _Z7testInsILj3ELj2EDv4_fET1_S1_S1_
178 ; CHECK: xxinsertw 34, 35, 0
179 ; CHECK-BE-LABEL: _Z7testInsILj3ELj2EDv4_fET1_S1_S1_
180 ; CHECK-BE: xxsldwi 0, 35, 35, 1
181 ; CHECK-BE: xxinsertw 34, 0, 12
182 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 6>
183 ret <4 x float> %vecins
186 define <4 x float> @_Z7testInsILj3ELj3EDv4_fET1_S1_S1_(<4 x float> %a, <4 x float> %b) {
188 ; CHECK-LABEL: _Z7testInsILj3ELj3EDv4_fET1_S1_S1_
189 ; CHECK: xxsldwi 0, 35, 35, 3
190 ; CHECK: xxinsertw 34, 0, 0
191 ; CHECK-BE-LABEL: _Z7testInsILj3ELj3EDv4_fET1_S1_S1_
192 ; CHECK-BE: xxswapd 0, 35
193 ; CHECK-BE: xxinsertw 34, 0, 12
194 %vecins = shufflevector <4 x float> %a, <4 x float> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
195 ret <4 x float> %vecins
198 define <4 x i32> @_Z7testInsILj0ELj0EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
200 ; CHECK-LABEL: _Z7testInsILj0ELj0EDv4_jET1_S1_S1_
201 ; CHECK: xxswapd 0, 35
202 ; CHECK: xxinsertw 34, 0, 12
203 ; CHECK-BE-LABEL: _Z7testInsILj0ELj0EDv4_jET1_S1_S1_
204 ; CHECK-BE: xxsldwi 0, 35, 35, 3
205 ; CHECK-BE: xxinsertw 34, 0, 0
206 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
207 ret <4 x i32> %vecins
210 define <4 x i32> @_Z7testInsILj0ELj1EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
212 ; CHECK-LABEL: _Z7testInsILj0ELj1EDv4_jET1_S1_S1_
213 ; CHECK: xxsldwi 0, 35, 35, 1
214 ; CHECK: xxinsertw 34, 0, 12
215 ; CHECK-BE-LABEL: _Z7testInsILj0ELj1EDv4_jET1_S1_S1_
216 ; CHECK-BE-NOT: xxsldwi
217 ; CHECK-BE: xxinsertw 34, 35, 0
218 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 5, i32 1, i32 2, i32 3>
219 ret <4 x i32> %vecins
222 define <4 x i32> @_Z7testInsILj0ELj2EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
224 ; CHECK-LABEL: _Z7testInsILj0ELj2EDv4_jET1_S1_S1_
226 ; CHECK: xxinsertw 34, 35, 12
227 ; CHECK-BE-LABEL: _Z7testInsILj0ELj2EDv4_jET1_S1_S1_
228 ; CHECK-BE: xxsldwi 0, 35, 35, 1
229 ; CHECK-BE: xxinsertw 34, 0, 0
230 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 6, i32 1, i32 2, i32 3>
231 ret <4 x i32> %vecins
234 define <4 x i32> @_Z7testInsILj0ELj3EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
236 ; CHECK-LABEL: _Z7testInsILj0ELj3EDv4_jET1_S1_S1_
237 ; CHECK: xxsldwi 0, 35, 35, 3
238 ; CHECK: xxinsertw 34, 0, 12
239 ; CHECK-BE-LABEL: _Z7testInsILj0ELj3EDv4_jET1_S1_S1_
240 ; CHECK-BE: xxswapd 0, 35
241 ; CHECK-BE: xxinsertw 34, 0, 0
242 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 7, i32 1, i32 2, i32 3>
243 ret <4 x i32> %vecins
246 define <4 x i32> @_Z7testInsILj1ELj0EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
248 ; CHECK-LABEL: _Z7testInsILj1ELj0EDv4_jET1_S1_S1_
249 ; CHECK: xxswapd 0, 35
250 ; CHECK: xxinsertw 34, 0, 8
251 ; CHECK-BE-LABEL: _Z7testInsILj1ELj0EDv4_jET1_S1_S1_
252 ; CHECK-BE: xxsldwi 0, 35, 35, 3
253 ; CHECK-BE: xxinsertw 34, 0, 4
254 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 4, i32 2, i32 3>
255 ret <4 x i32> %vecins
258 define <4 x i32> @_Z7testInsILj1ELj1EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
260 ; CHECK-LABEL: _Z7testInsILj1ELj1EDv4_jET1_S1_S1_
261 ; CHECK: xxsldwi 0, 35, 35, 1
262 ; CHECK: xxinsertw 34, 0, 8
263 ; CHECK-BE-LABEL: _Z7testInsILj1ELj1EDv4_jET1_S1_S1_
264 ; CHECK-BE-NOT: xxsldwi
265 ; CHECK-BE: xxinsertw 34, 35, 4
266 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 5, i32 2, i32 3>
267 ret <4 x i32> %vecins
270 define <4 x i32> @_Z7testInsILj1ELj2EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
272 ; CHECK-LABEL: _Z7testInsILj1ELj2EDv4_jET1_S1_S1_
274 ; CHECK: xxinsertw 34, 35, 8
275 ; CHECK-BE-LABEL: _Z7testInsILj1ELj2EDv4_jET1_S1_S1_
276 ; CHECK-BE: xxsldwi 0, 35, 35, 1
277 ; CHECK-BE: xxinsertw 34, 0, 4
278 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 6, i32 2, i32 3>
279 ret <4 x i32> %vecins
282 define <4 x i32> @_Z7testInsILj1ELj3EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
284 ; CHECK-LABEL: _Z7testInsILj1ELj3EDv4_jET1_S1_S1_
285 ; CHECK: xxsldwi 0, 35, 35, 3
286 ; CHECK: xxinsertw 34, 0, 8
287 ; CHECK-BE-LABEL: _Z7testInsILj1ELj3EDv4_jET1_S1_S1_
288 ; CHECK-BE: xxswapd 0, 35
289 ; CHECK-BE: xxinsertw 34, 0, 4
290 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 7, i32 2, i32 3>
291 ret <4 x i32> %vecins
294 define <4 x i32> @_Z7testInsILj2ELj0EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
296 ; CHECK-LABEL: _Z7testInsILj2ELj0EDv4_jET1_S1_S1_
297 ; CHECK: xxswapd 0, 35
298 ; CHECK: xxinsertw 34, 0, 4
299 ; CHECK-BE-LABEL: _Z7testInsILj2ELj0EDv4_jET1_S1_S1_
300 ; CHECK-BE: xxsldwi 0, 35, 35, 3
301 ; CHECK-BE: xxinsertw 34, 0, 8
302 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 4, i32 3>
303 ret <4 x i32> %vecins
306 define <4 x i32> @_Z7testInsILj2ELj1EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
308 ; CHECK-LABEL: _Z7testInsILj2ELj1EDv4_jET1_S1_S1_
309 ; CHECK: xxsldwi 0, 35, 35, 1
310 ; CHECK: xxinsertw 34, 0, 4
311 ; CHECK-BE-LABEL: _Z7testInsILj2ELj1EDv4_jET1_S1_S1_
312 ; CHECK-BE-NOT: xxsldwi
313 ; CHECK-BE: xxinsertw 34, 35, 8
314 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 5, i32 3>
315 ret <4 x i32> %vecins
318 define <4 x i32> @_Z7testInsILj2ELj2EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
320 ; CHECK-LABEL: _Z7testInsILj2ELj2EDv4_jET1_S1_S1_
322 ; CHECK: xxinsertw 34, 35, 4
323 ; CHECK-BE-LABEL: _Z7testInsILj2ELj2EDv4_jET1_S1_S1_
324 ; CHECK-BE: xxsldwi 0, 35, 35, 1
325 ; CHECK-BE: xxinsertw 34, 0, 8
326 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 6, i32 3>
327 ret <4 x i32> %vecins
330 define <4 x i32> @_Z7testInsILj2ELj3EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
332 ; CHECK-LABEL: _Z7testInsILj2ELj3EDv4_jET1_S1_S1_
333 ; CHECK: xxsldwi 0, 35, 35, 3
334 ; CHECK: xxinsertw 34, 0, 4
335 ; CHECK-BE-LABEL: _Z7testInsILj2ELj3EDv4_jET1_S1_S1_
336 ; CHECK-BE: xxswapd 0, 35
337 ; CHECK-BE: xxinsertw 34, 0, 8
338 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 7, i32 3>
339 ret <4 x i32> %vecins
342 define <4 x i32> @_Z7testInsILj3ELj0EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
344 ; CHECK-LABEL: _Z7testInsILj3ELj0EDv4_jET1_S1_S1_
345 ; CHECK: xxswapd 0, 35
346 ; CHECK: xxinsertw 34, 0, 0
347 ; CHECK-BE-LABEL: _Z7testInsILj3ELj0EDv4_jET1_S1_S1_
348 ; CHECK-BE: xxsldwi 0, 35, 35, 3
349 ; CHECK-BE: xxinsertw 34, 0, 12
350 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
351 ret <4 x i32> %vecins
354 define <4 x i32> @_Z7testInsILj3ELj1EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
356 ; CHECK-LABEL: _Z7testInsILj3ELj1EDv4_jET1_S1_S1_
357 ; CHECK: xxsldwi 0, 35, 35, 1
358 ; CHECK: xxinsertw 34, 0, 0
359 ; CHECK-BE-LABEL: _Z7testInsILj3ELj1EDv4_jET1_S1_S1_
360 ; CHECK-BE-NOT: xxsldwi
361 ; CHECK-BE: xxinsertw 34, 35, 12
362 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 5>
363 ret <4 x i32> %vecins
366 define <4 x i32> @_Z7testInsILj3ELj2EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
368 ; CHECK-LABEL: _Z7testInsILj3ELj2EDv4_jET1_S1_S1_
370 ; CHECK: xxinsertw 34, 35, 0
371 ; CHECK-BE-LABEL: _Z7testInsILj3ELj2EDv4_jET1_S1_S1_
372 ; CHECK-BE: xxsldwi 0, 35, 35, 1
373 ; CHECK-BE: xxinsertw 34, 0, 12
374 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 6>
375 ret <4 x i32> %vecins
378 define <4 x i32> @_Z7testInsILj3ELj3EDv4_jET1_S1_S1_(<4 x i32> %a, <4 x i32> %b) {
380 ; CHECK-LABEL: _Z7testInsILj3ELj3EDv4_jET1_S1_S1_
381 ; CHECK: xxsldwi 0, 35, 35, 3
382 ; CHECK: xxinsertw 34, 0, 0
383 ; CHECK-BE-LABEL: _Z7testInsILj3ELj3EDv4_jET1_S1_S1_
384 ; CHECK-BE: xxswapd 0, 35
385 ; CHECK-BE: xxinsertw 34, 0, 12
386 %vecins = shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
387 ret <4 x i32> %vecins
390 define float @_Z13testUiToFpExtILj0EEfDv4_j(<4 x i32> %a) {
392 ; CHECK-LABEL: _Z13testUiToFpExtILj0EEfDv4_j
393 ; CHECK: xxextractuw 0, 34, 12
394 ; CHECK: xscvuxdsp 1, 0
395 ; CHECK-BE-LABEL: _Z13testUiToFpExtILj0EEfDv4_j
396 ; CHECK-BE: xxextractuw 0, 34, 0
397 ; CHECK-BE: xscvuxdsp 1, 0
398 %vecext = extractelement <4 x i32> %a, i32 0
399 %conv = uitofp i32 %vecext to float
403 define float @_Z13testUiToFpExtILj1EEfDv4_j(<4 x i32> %a) {
405 ; CHECK-LABEL: _Z13testUiToFpExtILj1EEfDv4_j
406 ; CHECK: xxextractuw 0, 34, 8
407 ; CHECK: xscvuxdsp 1, 0
408 ; CHECK-BE-LABEL: _Z13testUiToFpExtILj1EEfDv4_j
409 ; CHECK-BE: xxextractuw 0, 34, 4
410 ; CHECK-BE: xscvuxdsp 1, 0
411 %vecext = extractelement <4 x i32> %a, i32 1
412 %conv = uitofp i32 %vecext to float
416 define float @_Z13testUiToFpExtILj2EEfDv4_j(<4 x i32> %a) {
418 ; CHECK-LABEL: _Z13testUiToFpExtILj2EEfDv4_j
419 ; CHECK: xxextractuw 0, 34, 4
420 ; CHECK: xscvuxdsp 1, 0
421 ; CHECK-BE-LABEL: _Z13testUiToFpExtILj2EEfDv4_j
422 ; CHECK-BE: xxextractuw 0, 34, 8
423 ; CHECK-BE: xscvuxdsp 1, 0
424 %vecext = extractelement <4 x i32> %a, i32 2
425 %conv = uitofp i32 %vecext to float
429 define float @_Z13testUiToFpExtILj3EEfDv4_j(<4 x i32> %a) {
431 ; CHECK-LABEL: _Z13testUiToFpExtILj3EEfDv4_j
432 ; CHECK: xxextractuw 0, 34, 0
433 ; CHECK: xscvuxdsp 1, 0
434 ; CHECK-BE-LABEL: _Z13testUiToFpExtILj3EEfDv4_j
435 ; CHECK-BE: xxextractuw 0, 34, 12
436 ; CHECK-BE: xscvuxdsp 1, 0
437 %vecext = extractelement <4 x i32> %a, i32 3
438 %conv = uitofp i32 %vecext to float
442 ; Verify we generate optimal code for unsigned vector int elem extract followed
443 ; by conversion to double
445 define double @conv2dlbTestui0(<4 x i32> %a) {
447 ; CHECK-LABEL: conv2dlbTestui0
448 ; CHECK: xxextractuw [[SW:[0-9]+]], 34, 12
449 ; CHECK: xscvuxddp 1, [[SW]]
450 ; CHECK-BE-LABEL: conv2dlbTestui0
451 ; CHECK-BE: xxextractuw [[CP:[0-9]+]], 34, 0
452 ; CHECK-BE: xscvuxddp 1, [[CP]]
453 %0 = extractelement <4 x i32> %a, i32 0
454 %1 = uitofp i32 %0 to double
458 define double @conv2dlbTestui1(<4 x i32> %a) {
460 ; CHECK-LABEL: conv2dlbTestui1
461 ; CHECK: xxextractuw [[SW:[0-9]+]], 34, 8
462 ; CHECK: xscvuxddp 1, [[SW]]
463 ; CHECK-BE-LABEL: conv2dlbTestui1
464 ; CHECK-BE: xxextractuw [[CP:[0-9]+]], 34, 4
465 ; CHECK-BE: xscvuxddp 1, [[CP]]
466 %0 = extractelement <4 x i32> %a, i32 1
467 %1 = uitofp i32 %0 to double
471 define double @conv2dlbTestui2(<4 x i32> %a) {
473 ; CHECK-LABEL: conv2dlbTestui2
474 ; CHECK: xxextractuw [[SW:[0-9]+]], 34, 4
475 ; CHECK: xscvuxddp 1, [[SW]]
476 ; CHECK-BE-LABEL: conv2dlbTestui2
477 ; CHECK-BE: xxextractuw [[CP:[0-9]+]], 34, 8
478 ; CHECK-BE: xscvuxddp 1, [[CP]]
479 %0 = extractelement <4 x i32> %a, i32 2
480 %1 = uitofp i32 %0 to double
484 define double @conv2dlbTestui3(<4 x i32> %a) {
486 ; CHECK-LABEL: conv2dlbTestui3
487 ; CHECK: xxextractuw [[SW:[0-9]+]], 34, 0
488 ; CHECK: xscvuxddp 1, [[SW]]
489 ; CHECK-BE-LABEL: conv2dlbTestui3
490 ; CHECK-BE: xxextractuw [[CP:[0-9]+]], 34, 12
491 ; CHECK-BE: xscvuxddp 1, [[CP]]
492 %0 = extractelement <4 x i32> %a, i32 3
493 %1 = uitofp i32 %0 to double
497 ; verify we don't crash for variable elem extract
498 define double @conv2dlbTestuiVar(<4 x i32> %a, i32 zeroext %elem) {
500 %vecext = extractelement <4 x i32> %a, i32 %elem
501 %conv = uitofp i32 %vecext to double
505 define <4 x float> @_Z10testInsEltILj0EDv4_ffET0_S1_T1_(<4 x float> %a, float %b) {
507 ; CHECK-LABEL: _Z10testInsEltILj0EDv4_ffET0_S1_T1_
508 ; CHECK: xscvdpspn 0, 1
509 ; CHECK: xxinsertw 34, 0, 12
510 ; CHECK-BE-LABEL: _Z10testInsEltILj0EDv4_ffET0_S1_T1_
511 ; CHECK-BE: xscvdpspn 0, 1
512 ; CHECK-BE: xxinsertw 34, 0, 0
513 %vecins = insertelement <4 x float> %a, float %b, i32 0
514 ret <4 x float> %vecins
517 define <4 x float> @_Z10testInsEltILj1EDv4_ffET0_S1_T1_(<4 x float> %a, float %b) {
519 ; CHECK-LABEL: _Z10testInsEltILj1EDv4_ffET0_S1_T1_
520 ; CHECK: xscvdpspn 0, 1
521 ; CHECK: xxinsertw 34, 0, 8
522 ; CHECK-BE-LABEL: _Z10testInsEltILj1EDv4_ffET0_S1_T1_
523 ; CHECK-BE: xscvdpspn 0, 1
524 ; CHECK-BE: xxinsertw 34, 0, 4
525 %vecins = insertelement <4 x float> %a, float %b, i32 1
526 ret <4 x float> %vecins
529 define <4 x float> @_Z10testInsEltILj2EDv4_ffET0_S1_T1_(<4 x float> %a, float %b) {
531 ; CHECK-LABEL: _Z10testInsEltILj2EDv4_ffET0_S1_T1_
532 ; CHECK: xscvdpspn 0, 1
533 ; CHECK: xxinsertw 34, 0, 4
534 ; CHECK-BE-LABEL: _Z10testInsEltILj2EDv4_ffET0_S1_T1_
535 ; CHECK-BE: xscvdpspn 0, 1
536 ; CHECK-BE: xxinsertw 34, 0, 8
537 %vecins = insertelement <4 x float> %a, float %b, i32 2
538 ret <4 x float> %vecins
541 define <4 x float> @_Z10testInsEltILj3EDv4_ffET0_S1_T1_(<4 x float> %a, float %b) {
543 ; CHECK-LABEL: _Z10testInsEltILj3EDv4_ffET0_S1_T1_
544 ; CHECK: xscvdpspn 0, 1
545 ; CHECK: xxinsertw 34, 0, 0
546 ; CHECK-BE-LABEL: _Z10testInsEltILj3EDv4_ffET0_S1_T1_
547 ; CHECK-BE: xscvdpspn 0, 1
548 ; CHECK-BE: xxinsertw 34, 0, 12
549 %vecins = insertelement <4 x float> %a, float %b, i32 3
550 ret <4 x float> %vecins
553 define <4 x i32> @_Z10testInsEltILj0EDv4_jjET0_S1_T1_(<4 x i32> %a, i32 zeroext %b) {
555 ; CHECK-LABEL: _Z10testInsEltILj0EDv4_jjET0_S1_T1_
556 ; CHECK: mtfprwz 0, 5
557 ; CHECK: xxinsertw 34, 0, 12
558 ; CHECK-BE-LABEL: _Z10testInsEltILj0EDv4_jjET0_S1_T1_
559 ; CHECK-BE: mtfprwz 0, 5
560 ; CHECK-BE: xxinsertw 34, 0, 0
561 %vecins = insertelement <4 x i32> %a, i32 %b, i32 0
562 ret <4 x i32> %vecins
565 define <4 x i32> @_Z10testInsEltILj1EDv4_jjET0_S1_T1_(<4 x i32> %a, i32 zeroext %b) {
567 ; CHECK-LABEL: _Z10testInsEltILj1EDv4_jjET0_S1_T1_
568 ; CHECK: mtfprwz 0, 5
569 ; CHECK: xxinsertw 34, 0, 8
570 ; CHECK-BE-LABEL: _Z10testInsEltILj1EDv4_jjET0_S1_T1_
571 ; CHECK-BE: mtfprwz 0, 5
572 ; CHECK-BE: xxinsertw 34, 0, 4
573 %vecins = insertelement <4 x i32> %a, i32 %b, i32 1
574 ret <4 x i32> %vecins
577 define <4 x i32> @_Z10testInsEltILj2EDv4_jjET0_S1_T1_(<4 x i32> %a, i32 zeroext %b) {
579 ; CHECK-LABEL: _Z10testInsEltILj2EDv4_jjET0_S1_T1_
580 ; CHECK: mtfprwz 0, 5
581 ; CHECK: xxinsertw 34, 0, 4
582 ; CHECK-BE-LABEL: _Z10testInsEltILj2EDv4_jjET0_S1_T1_
583 ; CHECK-BE: mtfprwz 0, 5
584 ; CHECK-BE: xxinsertw 34, 0, 8
585 %vecins = insertelement <4 x i32> %a, i32 %b, i32 2
586 ret <4 x i32> %vecins
589 define <4 x i32> @_Z10testInsEltILj3EDv4_jjET0_S1_T1_(<4 x i32> %a, i32 zeroext %b) {
591 ; CHECK-LABEL: _Z10testInsEltILj3EDv4_jjET0_S1_T1_
592 ; CHECK: mtfprwz 0, 5
593 ; CHECK: xxinsertw 34, 0, 0
594 ; CHECK-BE-LABEL: _Z10testInsEltILj3EDv4_jjET0_S1_T1_
595 ; CHECK-BE: mtfprwz 0, 5
596 ; CHECK-BE: xxinsertw 34, 0, 12
597 %vecins = insertelement <4 x i32> %a, i32 %b, i32 3
598 ret <4 x i32> %vecins
601 define <4 x float> @_Z7testInsILj0ELj0EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
603 ; CHECK-LABEL: _Z7testInsILj0ELj0EDv4_fET1_S1_S1_
604 ; CHECK: xxswapd 0, 35
605 ; CHECK: xxinsertw 34, 0, 12
606 ; CHECK-BE-LABEL: _Z7testInsILj0ELj0EDv4_fET1_S1_S1_
607 ; CHECK-BE: xxsldwi 0, 35, 35, 3
608 ; CHECK-BE: xxinsertw 34, 0, 0
609 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
610 ret <4 x float> %vecins
613 define <4 x float> @_Z7testInsILj0ELj1EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
615 ; CHECK-LABEL: _Z7testInsILj0ELj1EDv4_fET1_S1_S1_
616 ; CHECK: xxsldwi 0, 35, 35, 1
617 ; CHECK: xxinsertw 34, 0, 12
618 ; CHECK-BE-LABEL: _Z7testInsILj0ELj1EDv4_fET1_S1_S1_
619 ; CHECK-BE-NOT: xxsldwi
620 ; CHECK-BE: xxinsertw 34, 35, 0
621 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 1, i32 5, i32 6, i32 7>
622 ret <4 x float> %vecins
625 define <4 x float> @_Z7testInsILj0ELj2EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
627 ; CHECK-LABEL: _Z7testInsILj0ELj2EDv4_fET1_S1_S1_
629 ; CHECK: xxinsertw 34, 35, 12
630 ; CHECK-BE-LABEL: _Z7testInsILj0ELj2EDv4_fET1_S1_S1_
631 ; CHECK-BE: xxsldwi 0, 35, 35, 1
632 ; CHECK-BE: xxinsertw 34, 0, 0
633 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 2, i32 5, i32 6, i32 7>
634 ret <4 x float> %vecins
637 define <4 x float> @_Z7testInsILj0ELj3EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
639 ; CHECK-LABEL: _Z7testInsILj0ELj3EDv4_fET1_S1_S1_
640 ; CHECK: xxsldwi 0, 35, 35, 3
641 ; CHECK: xxinsertw 34, 0, 12
642 ; CHECK-BE-LABEL: _Z7testInsILj0ELj3EDv4_fET1_S1_S1_
643 ; CHECK-BE: xxswapd 0, 35
644 ; CHECK-BE: xxinsertw 34, 0, 0
645 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 3, i32 5, i32 6, i32 7>
646 ret <4 x float> %vecins
649 define <4 x float> @_Z7testInsILj1ELj0EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
651 ; CHECK-LABEL: _Z7testInsILj1ELj0EDv4_fET1_S1_S1_
652 ; CHECK: xxswapd 0, 35
653 ; CHECK: xxinsertw 34, 0, 8
654 ; CHECK-BE-LABEL: _Z7testInsILj1ELj0EDv4_fET1_S1_S1_
655 ; CHECK-BE: xxsldwi 0, 35, 35, 3
656 ; CHECK-BE: xxinsertw 34, 0, 4
657 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 0, i32 6, i32 7>
658 ret <4 x float> %vecins
661 define <4 x float> @_Z7testInsILj1ELj1EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
663 ; CHECK-LABEL: _Z7testInsILj1ELj1EDv4_fET1_S1_S1_
664 ; CHECK: xxsldwi 0, 35, 35, 1
665 ; CHECK: xxinsertw 34, 0, 8
666 ; CHECK-BE-LABEL: _Z7testInsILj1ELj1EDv4_fET1_S1_S1_
667 ; CHECK-BE-NOT: xxsldwi
668 ; CHECK-BE: xxinsertw 34, 35, 4
669 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 1, i32 6, i32 7>
670 ret <4 x float> %vecins
673 define <4 x float> @_Z7testInsILj1ELj2EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
675 ; CHECK-LABEL: _Z7testInsILj1ELj2EDv4_fET1_S1_S1_
677 ; CHECK: xxinsertw 34, 35, 8
678 ; CHECK-BE-LABEL: _Z7testInsILj1ELj2EDv4_fET1_S1_S1_
679 ; CHECK-BE: xxsldwi 0, 35, 35, 1
680 ; CHECK-BE: xxinsertw 34, 0, 4
681 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 2, i32 6, i32 7>
682 ret <4 x float> %vecins
685 define <4 x float> @_Z7testInsILj1ELj3EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
687 ; CHECK-LABEL: _Z7testInsILj1ELj3EDv4_fET1_S1_S1_
688 ; CHECK: xxsldwi 0, 35, 35, 3
689 ; CHECK: xxinsertw 34, 0, 8
690 ; CHECK-BE-LABEL: _Z7testInsILj1ELj3EDv4_fET1_S1_S1_
691 ; CHECK-BE: xxswapd 0, 35
692 ; CHECK-BE: xxinsertw 34, 0, 4
693 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 3, i32 6, i32 7>
694 ret <4 x float> %vecins
697 define <4 x float> @_Z7testInsILj2ELj0EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
699 ; CHECK-LABEL: _Z7testInsILj2ELj0EDv4_fET1_S1_S1_
700 ; CHECK: xxswapd 0, 35
701 ; CHECK: xxinsertw 34, 0, 4
702 ; CHECK-BE-LABEL: _Z7testInsILj2ELj0EDv4_fET1_S1_S1_
703 ; CHECK-BE: xxsldwi 0, 35, 35, 3
704 ; CHECK-BE: xxinsertw 34, 0, 8
705 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 0, i32 7>
706 ret <4 x float> %vecins
709 define <4 x float> @_Z7testInsILj2ELj1EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
711 ; CHECK-LABEL: _Z7testInsILj2ELj1EDv4_fET1_S1_S1_
712 ; CHECK: xxsldwi 0, 35, 35, 1
713 ; CHECK: xxinsertw 34, 0, 4
714 ; CHECK-BE-LABEL: _Z7testInsILj2ELj1EDv4_fET1_S1_S1_
715 ; CHECK-BE-NOT: xxsldwi
716 ; CHECK-BE: xxinsertw 34, 35, 8
717 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 1, i32 7>
718 ret <4 x float> %vecins
721 define <4 x float> @_Z7testInsILj2ELj2EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
723 ; CHECK-LABEL: _Z7testInsILj2ELj2EDv4_fET1_S1_S1_
725 ; CHECK: xxinsertw 34, 35, 4
726 ; CHECK-BE-LABEL: _Z7testInsILj2ELj2EDv4_fET1_S1_S1_
727 ; CHECK-BE: xxsldwi 0, 35, 35, 1
728 ; CHECK-BE: xxinsertw 34, 0, 8
729 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 2, i32 7>
730 ret <4 x float> %vecins
733 define <4 x float> @_Z7testInsILj2ELj3EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
735 ; CHECK-LABEL: _Z7testInsILj2ELj3EDv4_fET1_S1_S1_
736 ; CHECK: xxsldwi 0, 35, 35, 3
737 ; CHECK: xxinsertw 34, 0, 4
738 ; CHECK-BE-LABEL: _Z7testInsILj2ELj3EDv4_fET1_S1_S1_
739 ; CHECK-BE: xxswapd 0, 35
740 ; CHECK-BE: xxinsertw 34, 0, 8
741 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 3, i32 7>
742 ret <4 x float> %vecins
745 define <4 x float> @_Z7testInsILj3ELj0EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
747 ; CHECK-LABEL: _Z7testInsILj3ELj0EDv4_fET1_S1_S1_
748 ; CHECK: xxswapd 0, 35
749 ; CHECK: xxinsertw 34, 0, 0
750 ; CHECK-BE-LABEL: _Z7testInsILj3ELj0EDv4_fET1_S1_S1_
751 ; CHECK-BE: xxsldwi 0, 35, 35, 3
752 ; CHECK-BE: xxinsertw 34, 0, 12
753 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 0>
754 ret <4 x float> %vecins
757 define <4 x float> @_Z7testInsILj3ELj1EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
759 ; CHECK-LABEL: _Z7testInsILj3ELj1EDv4_fET1_S1_S1_
760 ; CHECK: xxsldwi 0, 35, 35, 1
761 ; CHECK: xxinsertw 34, 0, 0
762 ; CHECK-BE-LABEL: _Z7testInsILj3ELj1EDv4_fET1_S1_S1_
763 ; CHECK-BE-NOT: xxsldwi
764 ; CHECK-BE: xxinsertw 34, 35, 12
765 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 1>
766 ret <4 x float> %vecins
769 define <4 x float> @_Z7testInsILj3ELj2EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
771 ; CHECK-LABEL: _Z7testInsILj3ELj2EDv4_fET1_S1_S1_
773 ; CHECK: xxinsertw 34, 35, 0
774 ; CHECK-BE-LABEL: _Z7testInsILj3ELj2EDv4_fET1_S1_S1_
775 ; CHECK-BE: xxsldwi 0, 35, 35, 1
776 ; CHECK-BE: xxinsertw 34, 0, 12
777 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 2>
778 ret <4 x float> %vecins
781 define <4 x float> @_Z7testInsILj3ELj3EDv4_fET1_S1_S1_r(<4 x float> %a, <4 x float> %b) {
783 ; CHECK-LABEL: _Z7testInsILj3ELj3EDv4_fET1_S1_S1_
784 ; CHECK: xxsldwi 0, 35, 35, 3
785 ; CHECK: xxinsertw 34, 0, 0
786 ; CHECK-BE-LABEL: _Z7testInsILj3ELj3EDv4_fET1_S1_S1_
787 ; CHECK-BE: xxswapd 0, 35
788 ; CHECK-BE: xxinsertw 34, 0, 12
789 %vecins = shufflevector <4 x float> %b, <4 x float> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 3>
790 ret <4 x float> %vecins
793 define <4 x i32> @_Z7testInsILj0ELj0EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
795 ; CHECK-LABEL: _Z7testInsILj0ELj0EDv4_jET1_S1_S1_
796 ; CHECK: xxswapd 0, 35
797 ; CHECK: xxinsertw 34, 0, 12
798 ; CHECK-BE-LABEL: _Z7testInsILj0ELj0EDv4_jET1_S1_S1_
799 ; CHECK-BE: xxsldwi 0, 35, 35, 3
800 ; CHECK-BE: xxinsertw 34, 0, 0
801 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 0, i32 5, i32 6, i32 7>
802 ret <4 x i32> %vecins
805 define <4 x i32> @_Z7testInsILj0ELj1EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
807 ; CHECK-LABEL: _Z7testInsILj0ELj1EDv4_jET1_S1_S1_
808 ; CHECK: xxsldwi 0, 35, 35, 1
809 ; CHECK: xxinsertw 34, 0, 12
810 ; CHECK-BE-LABEL: _Z7testInsILj0ELj1EDv4_jET1_S1_S1_
811 ; CHECK-BE-NOT: xxsldwi
812 ; CHECK-BE: xxinsertw 34, 35, 0
813 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 1, i32 5, i32 6, i32 7>
814 ret <4 x i32> %vecins
817 define <4 x i32> @_Z7testInsILj0ELj2EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
819 ; CHECK-LABEL: _Z7testInsILj0ELj2EDv4_jET1_S1_S1_
821 ; CHECK: xxinsertw 34, 35, 12
822 ; CHECK-BE-LABEL: _Z7testInsILj0ELj2EDv4_jET1_S1_S1_
823 ; CHECK-BE: xxsldwi 0, 35, 35, 1
824 ; CHECK-BE: xxinsertw 34, 0, 0
825 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 2, i32 5, i32 6, i32 7>
826 ret <4 x i32> %vecins
829 define <4 x i32> @_Z7testInsILj0ELj3EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
831 ; CHECK-LABEL: _Z7testInsILj0ELj3EDv4_jET1_S1_S1_
832 ; CHECK: xxsldwi 0, 35, 35, 3
833 ; CHECK: xxinsertw 34, 0, 12
834 ; CHECK-BE-LABEL: _Z7testInsILj0ELj3EDv4_jET1_S1_S1_
835 ; CHECK-BE: xxswapd 0, 35
836 ; CHECK-BE: xxinsertw 34, 0, 0
837 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 3, i32 5, i32 6, i32 7>
838 ret <4 x i32> %vecins
841 define <4 x i32> @_Z7testInsILj1ELj0EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
843 ; CHECK-LABEL: _Z7testInsILj1ELj0EDv4_jET1_S1_S1_
844 ; CHECK: xxswapd 0, 35
845 ; CHECK: xxinsertw 34, 0, 8
846 ; CHECK-BE-LABEL: _Z7testInsILj1ELj0EDv4_jET1_S1_S1_
847 ; CHECK-BE: xxsldwi 0, 35, 35, 3
848 ; CHECK-BE: xxinsertw 34, 0, 4
849 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 0, i32 6, i32 7>
850 ret <4 x i32> %vecins
853 define <4 x i32> @_Z7testInsILj1ELj1EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
855 ; CHECK-LABEL: _Z7testInsILj1ELj1EDv4_jET1_S1_S1_
856 ; CHECK: xxsldwi 0, 35, 35, 1
857 ; CHECK: xxinsertw 34, 0, 8
858 ; CHECK-BE-LABEL: _Z7testInsILj1ELj1EDv4_jET1_S1_S1_
859 ; CHECK-BE-NOT: xxsldwi
860 ; CHECK-BE: xxinsertw 34, 35, 4
861 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 1, i32 6, i32 7>
862 ret <4 x i32> %vecins
865 define <4 x i32> @_Z7testInsILj1ELj2EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
867 ; CHECK-LABEL: _Z7testInsILj1ELj2EDv4_jET1_S1_S1_
869 ; CHECK: xxinsertw 34, 35, 8
870 ; CHECK-BE-LABEL: _Z7testInsILj1ELj2EDv4_jET1_S1_S1_
871 ; CHECK-BE: xxsldwi 0, 35, 35, 1
872 ; CHECK-BE: xxinsertw 34, 0, 4
873 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 2, i32 6, i32 7>
874 ret <4 x i32> %vecins
877 define <4 x i32> @_Z7testInsILj1ELj3EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
879 ; CHECK-LABEL: _Z7testInsILj1ELj3EDv4_jET1_S1_S1_
880 ; CHECK: xxsldwi 0, 35, 35, 3
881 ; CHECK: xxinsertw 34, 0, 8
882 ; CHECK-BE-LABEL: _Z7testInsILj1ELj3EDv4_jET1_S1_S1_
883 ; CHECK-BE: xxswapd 0, 35
884 ; CHECK-BE: xxinsertw 34, 0, 4
885 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 3, i32 6, i32 7>
886 ret <4 x i32> %vecins
889 define <4 x i32> @_Z7testInsILj2ELj0EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
891 ; CHECK-LABEL: _Z7testInsILj2ELj0EDv4_jET1_S1_S1_
892 ; CHECK: xxswapd 0, 35
893 ; CHECK: xxinsertw 34, 0, 4
894 ; CHECK-BE-LABEL: _Z7testInsILj2ELj0EDv4_jET1_S1_S1_
895 ; CHECK-BE: xxsldwi 0, 35, 35, 3
896 ; CHECK-BE: xxinsertw 34, 0, 8
897 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 0, i32 7>
898 ret <4 x i32> %vecins
901 define <4 x i32> @_Z7testInsILj2ELj1EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
903 ; CHECK-LABEL: _Z7testInsILj2ELj1EDv4_jET1_S1_S1_
904 ; CHECK: xxsldwi 0, 35, 35, 1
905 ; CHECK: xxinsertw 34, 0, 4
906 ; CHECK-BE-LABEL: _Z7testInsILj2ELj1EDv4_jET1_S1_S1_
907 ; CHECK-BE-NOT: xxsldwi
908 ; CHECK-BE: xxinsertw 34, 35, 8
909 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 1, i32 7>
910 ret <4 x i32> %vecins
913 define <4 x i32> @_Z7testInsILj2ELj2EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
915 ; CHECK-LABEL: _Z7testInsILj2ELj2EDv4_jET1_S1_S1_
917 ; CHECK: xxinsertw 34, 35, 4
918 ; CHECK-BE-LABEL: _Z7testInsILj2ELj2EDv4_jET1_S1_S1_
919 ; CHECK-BE: xxsldwi 0, 35, 35, 1
920 ; CHECK-BE: xxinsertw 34, 0, 8
921 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 2, i32 7>
922 ret <4 x i32> %vecins
925 define <4 x i32> @_Z7testInsILj2ELj3EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
927 ; CHECK-LABEL: _Z7testInsILj2ELj3EDv4_jET1_S1_S1_
928 ; CHECK: xxsldwi 0, 35, 35, 3
929 ; CHECK: xxinsertw 34, 0, 4
930 ; CHECK-BE-LABEL: _Z7testInsILj2ELj3EDv4_jET1_S1_S1_
931 ; CHECK-BE: xxswapd 0, 35
932 ; CHECK-BE: xxinsertw 34, 0, 8
933 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 3, i32 7>
934 ret <4 x i32> %vecins
937 define <4 x i32> @_Z7testInsILj3ELj0EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
939 ; CHECK-LABEL: _Z7testInsILj3ELj0EDv4_jET1_S1_S1_
940 ; CHECK: xxswapd 0, 35
941 ; CHECK: xxinsertw 34, 0, 0
942 ; CHECK-BE-LABEL: _Z7testInsILj3ELj0EDv4_jET1_S1_S1_
943 ; CHECK-BE: xxsldwi 0, 35, 35, 3
944 ; CHECK-BE: xxinsertw 34, 0, 12
945 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 0>
946 ret <4 x i32> %vecins
949 define <4 x i32> @_Z7testInsILj3ELj1EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
951 ; CHECK-LABEL: _Z7testInsILj3ELj1EDv4_jET1_S1_S1_
952 ; CHECK: xxsldwi 0, 35, 35, 1
953 ; CHECK: xxinsertw 34, 0, 0
954 ; CHECK-BE-LABEL: _Z7testInsILj3ELj1EDv4_jET1_S1_S1_
955 ; CHECK-BE-NOT: xxsldwi
956 ; CHECK-BE: xxinsertw 34, 35, 12
957 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 1>
958 ret <4 x i32> %vecins
961 define <4 x i32> @_Z7testInsILj3ELj2EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
963 ; CHECK-LABEL: _Z7testInsILj3ELj2EDv4_jET1_S1_S1_
965 ; CHECK: xxinsertw 34, 35, 0
966 ; CHECK-BE-LABEL: _Z7testInsILj3ELj2EDv4_jET1_S1_S1_
967 ; CHECK-BE: xxsldwi 0, 35, 35, 1
968 ; CHECK-BE: xxinsertw 34, 0, 12
969 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 2>
970 ret <4 x i32> %vecins
973 define <4 x i32> @_Z7testInsILj3ELj3EDv4_jET1_S1_S1_r(<4 x i32> %a, <4 x i32> %b) {
975 ; CHECK-LABEL: _Z7testInsILj3ELj3EDv4_jET1_S1_S1_
976 ; CHECK: xxsldwi 0, 35, 35, 3
977 ; CHECK: xxinsertw 34, 0, 0
978 ; CHECK-BE-LABEL: _Z7testInsILj3ELj3EDv4_jET1_S1_S1_
979 ; CHECK-BE: xxswapd 0, 35
980 ; CHECK-BE: xxinsertw 34, 0, 12
981 %vecins = shufflevector <4 x i32> %b, <4 x i32> %a, <4 x i32> <i32 4, i32 5, i32 6, i32 3>
982 ret <4 x i32> %vecins
984 define <4 x float> @testSameVecEl0BE(<4 x float> %a) {
986 ; CHECK-BE-LABEL: testSameVecEl0BE
987 ; CHECK-BE: xxinsertw 34, 34, 0
988 %vecins = shufflevector <4 x float> %a, <4 x float> %a, <4 x i32> <i32 5, i32 1, i32 2, i32 3>
989 ret <4 x float> %vecins
991 define <4 x float> @testSameVecEl2BE(<4 x float> %a) {
993 ; CHECK-BE-LABEL: testSameVecEl2BE
994 ; CHECK-BE: xxinsertw 34, 34, 8
995 %vecins = shufflevector <4 x float> %a, <4 x float> %a, <4 x i32> <i32 0, i32 1, i32 5, i32 3>
996 ret <4 x float> %vecins
998 define <4 x float> @testSameVecEl3BE(<4 x float> %a) {
1000 ; CHECK-BE-LABEL: testSameVecEl3BE
1001 ; CHECK-BE: xxinsertw 34, 34, 12
1002 %vecins = shufflevector <4 x float> %a, <4 x float> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 5>
1003 ret <4 x float> %vecins
1005 define <4 x float> @testSameVecEl0LE(<4 x float> %a) {
1007 ; CHECK-LABEL: testSameVecEl0LE
1008 ; CHECK: xxinsertw 34, 34, 12
1009 %vecins = shufflevector <4 x float> %a, <4 x float> %a, <4 x i32> <i32 6, i32 1, i32 2, i32 3>
1010 ret <4 x float> %vecins
1012 define <4 x float> @testSameVecEl1LE(<4 x float> %a) {
1014 ; CHECK-LABEL: testSameVecEl1LE
1015 ; CHECK: xxinsertw 34, 34, 8
1016 %vecins = shufflevector <4 x float> %a, <4 x float> %a, <4 x i32> <i32 0, i32 6, i32 2, i32 3>
1017 ret <4 x float> %vecins
1019 define <4 x float> @testSameVecEl3LE(<4 x float> %a) {
1021 ; CHECK-LABEL: testSameVecEl3LE
1022 ; CHECK: xxinsertw 34, 34, 0
1023 %vecins = shufflevector <4 x float> %a, <4 x float> %a, <4 x i32> <i32 0, i32 1, i32 2, i32 6>
1024 ret <4 x float> %vecins
1026 define <4 x float> @insertVarF(<4 x float> %a, float %f, i32 %el) {
1028 ; CHECK-LABEL: insertVarF
1031 ; CHECK-BE-LABEL: insertVarF
1032 ; CHECK-BE: stfsx 1,
1034 %vecins = insertelement <4 x float> %a, float %f, i32 %el
1035 ret <4 x float> %vecins
1037 define <4 x i32> @insertVarI(<4 x i32> %a, i32 %i, i32 %el) {
1039 ; CHECK-LABEL: insertVarI
1042 ; CHECK-BE-LABEL: insertVarI
1045 %vecins = insertelement <4 x i32> %a, i32 %i, i32 %el
1046 ret <4 x i32> %vecins
1048 define <4 x i32> @intrinsicInsertTest(<4 x i32> %a, <2 x i64> %b) {
1050 ; CHECK-LABEL:intrinsicInsertTest
1051 ; CHECK: xxinsertw 34, 35, 3
1053 %ans = tail call <4 x i32> @llvm.ppc.vsx.xxinsertw(<4 x i32> %a, <2 x i64> %b, i32 3)
1056 declare <4 x i32> @llvm.ppc.vsx.xxinsertw(<4 x i32>, <2 x i64>, i32)
1057 define <2 x i64> @intrinsicExtractTest(<2 x i64> %a) {
1059 ; CHECK-LABEL: intrinsicExtractTest
1060 ; CHECK: xxextractuw 34, 34, 5
1062 %ans = tail call <2 x i64> @llvm.ppc.vsx.xxextractuw(<2 x i64> %a, i32 5)
1065 declare <2 x i64> @llvm.ppc.vsx.xxextractuw(<2 x i64>, i32)