1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc --mtriple=loongarch64 --mattr=+lasx < %s | FileCheck %s
4 define void @buildvector_v32i8_splat(ptr %dst, i8 %a0) nounwind {
5 ; CHECK-LABEL: buildvector_v32i8_splat:
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: xvreplgr2vr.b $xr0, $a1
8 ; CHECK-NEXT: xvst $xr0, $a0, 0
11 %insert = insertelement <32 x i8> undef, i8 %a0, i8 0
12 %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer
13 store <32 x i8> %splat, ptr %dst
17 define void @buildvector_v16i16_splat(ptr %dst, i16 %a0) nounwind {
18 ; CHECK-LABEL: buildvector_v16i16_splat:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: xvreplgr2vr.h $xr0, $a1
21 ; CHECK-NEXT: xvst $xr0, $a0, 0
24 %insert = insertelement <16 x i16> undef, i16 %a0, i8 0
25 %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer
26 store <16 x i16> %splat, ptr %dst
30 define void @buildvector_v8i32_splat(ptr %dst, i32 %a0) nounwind {
31 ; CHECK-LABEL: buildvector_v8i32_splat:
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: xvreplgr2vr.w $xr0, $a1
34 ; CHECK-NEXT: xvst $xr0, $a0, 0
37 %insert = insertelement <8 x i32> undef, i32 %a0, i8 0
38 %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer
39 store <8 x i32> %splat, ptr %dst
43 define void @buildvector_v4i64_splat(ptr %dst, i64 %a0) nounwind {
44 ; CHECK-LABEL: buildvector_v4i64_splat:
45 ; CHECK: # %bb.0: # %entry
46 ; CHECK-NEXT: xvreplgr2vr.d $xr0, $a1
47 ; CHECK-NEXT: xvst $xr0, $a0, 0
50 %insert = insertelement <4 x i64> undef, i64 %a0, i8 0
51 %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer
52 store <4 x i64> %splat, ptr %dst
56 define void @buildvector_v8f32_splat(ptr %dst, float %a0) nounwind {
57 ; CHECK-LABEL: buildvector_v8f32_splat:
58 ; CHECK: # %bb.0: # %entry
59 ; CHECK-NEXT: # kill: def $f0 killed $f0 def $xr0
60 ; CHECK-NEXT: xvreplve0.w $xr0, $xr0
61 ; CHECK-NEXT: xvst $xr0, $a0, 0
64 %insert = insertelement <8 x float> undef, float %a0, i8 0
65 %splat = shufflevector <8 x float> %insert, <8 x float> undef, <8 x i32> zeroinitializer
66 store <8 x float> %splat, ptr %dst
70 define void @buildvector_v4f64_splat(ptr %dst, double %a0) nounwind {
71 ; CHECK-LABEL: buildvector_v4f64_splat:
72 ; CHECK: # %bb.0: # %entry
73 ; CHECK-NEXT: # kill: def $f0_64 killed $f0_64 def $xr0
74 ; CHECK-NEXT: xvreplve0.d $xr0, $xr0
75 ; CHECK-NEXT: xvst $xr0, $a0, 0
78 %insert = insertelement <4 x double> undef, double %a0, i8 0
79 %splat = shufflevector <4 x double> %insert, <4 x double> undef, <4 x i32> zeroinitializer
80 store <4 x double> %splat, ptr %dst
84 define void @buildvector_v32i8_const_splat(ptr %dst) nounwind {
85 ; CHECK-LABEL: buildvector_v32i8_const_splat:
86 ; CHECK: # %bb.0: # %entry
87 ; CHECK-NEXT: xvrepli.b $xr0, 1
88 ; CHECK-NEXT: xvst $xr0, $a0, 0
91 store <32 x i8> <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>, ptr %dst
95 define void @buildvector_v16i16_const_splat(ptr %dst) nounwind {
96 ; CHECK-LABEL: buildvector_v16i16_const_splat:
97 ; CHECK: # %bb.0: # %entry
98 ; CHECK-NEXT: xvrepli.h $xr0, 1
99 ; CHECK-NEXT: xvst $xr0, $a0, 0
102 store <16 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>, ptr %dst
106 define void @buildvector_v8i32_const_splat(ptr %dst) nounwind {
107 ; CHECK-LABEL: buildvector_v8i32_const_splat:
108 ; CHECK: # %bb.0: # %entry
109 ; CHECK-NEXT: xvrepli.w $xr0, 1
110 ; CHECK-NEXT: xvst $xr0, $a0, 0
113 store <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>, ptr %dst
117 define void @buildvector_v4i64_const_splat(ptr %dst) nounwind {
118 ; CHECK-LABEL: buildvector_v4i64_const_splat:
119 ; CHECK: # %bb.0: # %entry
120 ; CHECK-NEXT: xvrepli.d $xr0, 1
121 ; CHECK-NEXT: xvst $xr0, $a0, 0
124 store <4 x i64> <i64 1, i64 1, i64 1, i64 1>, ptr %dst
128 define void @buildvector_v2f32_const_splat(ptr %dst) nounwind {
129 ; CHECK-LABEL: buildvector_v2f32_const_splat:
130 ; CHECK: # %bb.0: # %entry
131 ; CHECK-NEXT: lu12i.w $a1, 260096
132 ; CHECK-NEXT: xvreplgr2vr.w $xr0, $a1
133 ; CHECK-NEXT: xvst $xr0, $a0, 0
136 store <8 x float> <float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0, float 1.0>, ptr %dst
140 define void @buildvector_v4f64_const_splat(ptr %dst) nounwind {
141 ; CHECK-LABEL: buildvector_v4f64_const_splat:
142 ; CHECK: # %bb.0: # %entry
143 ; CHECK-NEXT: lu52i.d $a1, $zero, 1023
144 ; CHECK-NEXT: xvreplgr2vr.d $xr0, $a1
145 ; CHECK-NEXT: xvst $xr0, $a0, 0
148 store <4 x double> <double 1.0, double 1.0, double 1.0, double 1.0>, ptr %dst
152 define void @buildvector_v32i8_const(ptr %dst) nounwind {
153 ; CHECK-LABEL: buildvector_v32i8_const:
154 ; CHECK: # %bb.0: # %entry
155 ; CHECK-NEXT: pcalau12i $a1, %pc_hi20(.LCPI12_0)
156 ; CHECK-NEXT: addi.d $a1, $a1, %pc_lo12(.LCPI12_0)
157 ; CHECK-NEXT: xvld $xr0, $a1, 0
158 ; CHECK-NEXT: xvst $xr0, $a0, 0
161 store <32 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, ptr %dst
165 define void @buildvector_v16i16_const(ptr %dst) nounwind {
166 ; CHECK-LABEL: buildvector_v16i16_const:
167 ; CHECK: # %bb.0: # %entry
168 ; CHECK-NEXT: pcalau12i $a1, %pc_hi20(.LCPI13_0)
169 ; CHECK-NEXT: addi.d $a1, $a1, %pc_lo12(.LCPI13_0)
170 ; CHECK-NEXT: xvld $xr0, $a1, 0
171 ; CHECK-NEXT: xvst $xr0, $a0, 0
174 store <16 x i16> <i16 0, i16 1, i16 2, i16 3, i16 4, i16 5, i16 6, i16 7, i16 8, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>, ptr %dst
178 define void @buildvector_v8i32_const(ptr %dst) nounwind {
179 ; CHECK-LABEL: buildvector_v8i32_const:
180 ; CHECK: # %bb.0: # %entry
181 ; CHECK-NEXT: pcalau12i $a1, %pc_hi20(.LCPI14_0)
182 ; CHECK-NEXT: addi.d $a1, $a1, %pc_lo12(.LCPI14_0)
183 ; CHECK-NEXT: xvld $xr0, $a1, 0
184 ; CHECK-NEXT: xvst $xr0, $a0, 0
187 store <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>, ptr %dst
191 define void @buildvector_v4i64_const(ptr %dst) nounwind {
192 ; CHECK-LABEL: buildvector_v4i64_const:
193 ; CHECK: # %bb.0: # %entry
194 ; CHECK-NEXT: pcalau12i $a1, %pc_hi20(.LCPI15_0)
195 ; CHECK-NEXT: addi.d $a1, $a1, %pc_lo12(.LCPI15_0)
196 ; CHECK-NEXT: xvld $xr0, $a1, 0
197 ; CHECK-NEXT: xvst $xr0, $a0, 0
200 store <4 x i64> <i64 0, i64 1, i64 2, i64 3>, ptr %dst
204 define void @buildvector_v2f32_const(ptr %dst) nounwind {
205 ; CHECK-LABEL: buildvector_v2f32_const:
206 ; CHECK: # %bb.0: # %entry
207 ; CHECK-NEXT: pcalau12i $a1, %pc_hi20(.LCPI16_0)
208 ; CHECK-NEXT: addi.d $a1, $a1, %pc_lo12(.LCPI16_0)
209 ; CHECK-NEXT: xvld $xr0, $a1, 0
210 ; CHECK-NEXT: xvst $xr0, $a0, 0
213 store <8 x float> <float 0.0, float 1.0, float 2.0, float 3.0, float 4.0, float 5.0, float 6.0, float 7.0>, ptr %dst
217 define void @buildvector_v4f64_const(ptr %dst) nounwind {
218 ; CHECK-LABEL: buildvector_v4f64_const:
219 ; CHECK: # %bb.0: # %entry
220 ; CHECK-NEXT: pcalau12i $a1, %pc_hi20(.LCPI17_0)
221 ; CHECK-NEXT: addi.d $a1, $a1, %pc_lo12(.LCPI17_0)
222 ; CHECK-NEXT: xvld $xr0, $a1, 0
223 ; CHECK-NEXT: xvst $xr0, $a0, 0
226 store <4 x double> <double 0.0, double 1.0, double 2.0, double 3.0>, ptr %dst
230 define void @buildvector_v32i8(ptr %dst, i8 %a0, i8 %a1, i8 %a2, i8 %a3, i8 %a4, i8 %a5, i8 %a6, i8 %a7, i8 %a8, i8 %a9, i8 %a10, i8 %a11, i8 %a12, i8 %a13, i8 %a14, i8 %a15, i8 %a16, i8 %a17, i8 %a18, i8 %a19, i8 %a20, i8 %a21, i8 %a22, i8 %a23, i8 %a24, i8 %a25, i8 %a26, i8 %a27, i8 %a28, i8 %a29, i8 %a30, i8 %a31) nounwind {
231 ; CHECK-LABEL: buildvector_v32i8:
232 ; CHECK: # %bb.0: # %entry
233 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a1, 0
234 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a2, 1
235 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a3, 2
236 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a4, 3
237 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a5, 4
238 ; CHECK-NEXT: ld.b $a1, $sp, 0
239 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a6, 5
240 ; CHECK-NEXT: ld.b $a2, $sp, 8
241 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a7, 6
242 ; CHECK-NEXT: ld.b $a3, $sp, 16
243 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a1, 7
244 ; CHECK-NEXT: ld.b $a1, $sp, 24
245 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a2, 8
246 ; CHECK-NEXT: ld.b $a2, $sp, 32
247 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a3, 9
248 ; CHECK-NEXT: ld.b $a3, $sp, 40
249 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a1, 10
250 ; CHECK-NEXT: ld.b $a1, $sp, 48
251 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a2, 11
252 ; CHECK-NEXT: ld.b $a2, $sp, 56
253 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a3, 12
254 ; CHECK-NEXT: ld.b $a3, $sp, 64
255 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a1, 13
256 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a2, 14
257 ; CHECK-NEXT: ld.b $a1, $sp, 72
258 ; CHECK-NEXT: vinsgr2vr.b $vr0, $a3, 15
259 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
260 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
261 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 0
262 ; CHECK-NEXT: ld.b $a1, $sp, 80
263 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
264 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
265 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
266 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 1
267 ; CHECK-NEXT: ld.b $a1, $sp, 88
268 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
269 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
270 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
271 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 2
272 ; CHECK-NEXT: ld.b $a1, $sp, 96
273 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
274 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
275 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
276 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 3
277 ; CHECK-NEXT: ld.b $a1, $sp, 104
278 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
279 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
280 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
281 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 4
282 ; CHECK-NEXT: ld.b $a1, $sp, 112
283 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
284 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
285 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
286 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 5
287 ; CHECK-NEXT: ld.b $a1, $sp, 120
288 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
289 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
290 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
291 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 6
292 ; CHECK-NEXT: ld.b $a1, $sp, 128
293 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
294 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
295 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
296 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 7
297 ; CHECK-NEXT: ld.b $a1, $sp, 136
298 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
299 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
300 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
301 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 8
302 ; CHECK-NEXT: ld.b $a1, $sp, 144
303 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
304 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
305 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
306 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 9
307 ; CHECK-NEXT: ld.b $a1, $sp, 152
308 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
309 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
310 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
311 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 10
312 ; CHECK-NEXT: ld.b $a1, $sp, 160
313 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
314 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
315 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
316 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 11
317 ; CHECK-NEXT: ld.b $a1, $sp, 168
318 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
319 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
320 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
321 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 12
322 ; CHECK-NEXT: ld.b $a1, $sp, 176
323 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
324 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
325 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
326 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 13
327 ; CHECK-NEXT: ld.b $a1, $sp, 184
328 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
329 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
330 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
331 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 14
332 ; CHECK-NEXT: ld.b $a1, $sp, 192
333 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
334 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
335 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
336 ; CHECK-NEXT: vinsgr2vr.b $vr1, $a1, 15
337 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
338 ; CHECK-NEXT: xvst $xr0, $a0, 0
341 %ins0 = insertelement <32 x i8> undef, i8 %a0, i32 0
342 %ins1 = insertelement <32 x i8> %ins0, i8 %a1, i32 1
343 %ins2 = insertelement <32 x i8> %ins1, i8 %a2, i32 2
344 %ins3 = insertelement <32 x i8> %ins2, i8 %a3, i32 3
345 %ins4 = insertelement <32 x i8> %ins3, i8 %a4, i32 4
346 %ins5 = insertelement <32 x i8> %ins4, i8 %a5, i32 5
347 %ins6 = insertelement <32 x i8> %ins5, i8 %a6, i32 6
348 %ins7 = insertelement <32 x i8> %ins6, i8 %a7, i32 7
349 %ins8 = insertelement <32 x i8> %ins7, i8 %a8, i32 8
350 %ins9 = insertelement <32 x i8> %ins8, i8 %a9, i32 9
351 %ins10 = insertelement <32 x i8> %ins9, i8 %a10, i32 10
352 %ins11 = insertelement <32 x i8> %ins10, i8 %a11, i32 11
353 %ins12 = insertelement <32 x i8> %ins11, i8 %a12, i32 12
354 %ins13 = insertelement <32 x i8> %ins12, i8 %a13, i32 13
355 %ins14 = insertelement <32 x i8> %ins13, i8 %a14, i32 14
356 %ins15 = insertelement <32 x i8> %ins14, i8 %a15, i32 15
357 %ins16 = insertelement <32 x i8> %ins15, i8 %a16, i32 16
358 %ins17 = insertelement <32 x i8> %ins16, i8 %a17, i32 17
359 %ins18 = insertelement <32 x i8> %ins17, i8 %a18, i32 18
360 %ins19 = insertelement <32 x i8> %ins18, i8 %a19, i32 19
361 %ins20 = insertelement <32 x i8> %ins19, i8 %a20, i32 20
362 %ins21 = insertelement <32 x i8> %ins20, i8 %a21, i32 21
363 %ins22 = insertelement <32 x i8> %ins21, i8 %a22, i32 22
364 %ins23 = insertelement <32 x i8> %ins22, i8 %a23, i32 23
365 %ins24 = insertelement <32 x i8> %ins23, i8 %a24, i32 24
366 %ins25 = insertelement <32 x i8> %ins24, i8 %a25, i32 25
367 %ins26 = insertelement <32 x i8> %ins25, i8 %a26, i32 26
368 %ins27 = insertelement <32 x i8> %ins26, i8 %a27, i32 27
369 %ins28 = insertelement <32 x i8> %ins27, i8 %a28, i32 28
370 %ins29 = insertelement <32 x i8> %ins28, i8 %a29, i32 29
371 %ins30 = insertelement <32 x i8> %ins29, i8 %a30, i32 30
372 %ins31 = insertelement <32 x i8> %ins30, i8 %a31, i32 31
373 store <32 x i8> %ins31, ptr %dst
377 define void @buildvector_v16i16(ptr %dst, i16 %a0, i16 %a1, i16 %a2, i16 %a3, i16 %a4, i16 %a5, i16 %a6, i16 %a7, i16 %a8, i16 %a9, i16 %a10, i16 %a11, i16 %a12, i16 %a13, i16 %a14, i16 %a15) nounwind {
378 ; CHECK-LABEL: buildvector_v16i16:
379 ; CHECK: # %bb.0: # %entry
380 ; CHECK-NEXT: ld.h $t0, $sp, 8
381 ; CHECK-NEXT: ld.h $t1, $sp, 0
382 ; CHECK-NEXT: vinsgr2vr.h $vr0, $a1, 0
383 ; CHECK-NEXT: vinsgr2vr.h $vr0, $a2, 1
384 ; CHECK-NEXT: vinsgr2vr.h $vr0, $a3, 2
385 ; CHECK-NEXT: vinsgr2vr.h $vr0, $a4, 3
386 ; CHECK-NEXT: vinsgr2vr.h $vr0, $a5, 4
387 ; CHECK-NEXT: vinsgr2vr.h $vr0, $a6, 5
388 ; CHECK-NEXT: vinsgr2vr.h $vr0, $a7, 6
389 ; CHECK-NEXT: vinsgr2vr.h $vr0, $t1, 7
390 ; CHECK-NEXT: ld.h $a1, $sp, 16
391 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
392 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
393 ; CHECK-NEXT: vinsgr2vr.h $vr1, $t0, 0
394 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
395 ; CHECK-NEXT: ld.h $a2, $sp, 24
396 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
397 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
398 ; CHECK-NEXT: vinsgr2vr.h $vr1, $a1, 1
399 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
400 ; CHECK-NEXT: ld.h $a1, $sp, 32
401 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
402 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
403 ; CHECK-NEXT: vinsgr2vr.h $vr1, $a2, 2
404 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
405 ; CHECK-NEXT: ld.h $a2, $sp, 40
406 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
407 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
408 ; CHECK-NEXT: vinsgr2vr.h $vr1, $a1, 3
409 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
410 ; CHECK-NEXT: ld.h $a1, $sp, 48
411 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
412 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
413 ; CHECK-NEXT: vinsgr2vr.h $vr1, $a2, 4
414 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
415 ; CHECK-NEXT: ld.h $a2, $sp, 56
416 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
417 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
418 ; CHECK-NEXT: vinsgr2vr.h $vr1, $a1, 5
419 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
420 ; CHECK-NEXT: ld.h $a1, $sp, 64
421 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
422 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
423 ; CHECK-NEXT: vinsgr2vr.h $vr1, $a2, 6
424 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
425 ; CHECK-NEXT: xvori.b $xr1, $xr0, 0
426 ; CHECK-NEXT: xvpermi.q $xr1, $xr0, 1
427 ; CHECK-NEXT: vinsgr2vr.h $vr1, $a1, 7
428 ; CHECK-NEXT: xvpermi.q $xr0, $xr1, 2
429 ; CHECK-NEXT: xvst $xr0, $a0, 0
432 %ins0 = insertelement <16 x i16> undef, i16 %a0, i32 0
433 %ins1 = insertelement <16 x i16> %ins0, i16 %a1, i32 1
434 %ins2 = insertelement <16 x i16> %ins1, i16 %a2, i32 2
435 %ins3 = insertelement <16 x i16> %ins2, i16 %a3, i32 3
436 %ins4 = insertelement <16 x i16> %ins3, i16 %a4, i32 4
437 %ins5 = insertelement <16 x i16> %ins4, i16 %a5, i32 5
438 %ins6 = insertelement <16 x i16> %ins5, i16 %a6, i32 6
439 %ins7 = insertelement <16 x i16> %ins6, i16 %a7, i32 7
440 %ins8 = insertelement <16 x i16> %ins7, i16 %a8, i32 8
441 %ins9 = insertelement <16 x i16> %ins8, i16 %a9, i32 9
442 %ins10 = insertelement <16 x i16> %ins9, i16 %a10, i32 10
443 %ins11 = insertelement <16 x i16> %ins10, i16 %a11, i32 11
444 %ins12 = insertelement <16 x i16> %ins11, i16 %a12, i32 12
445 %ins13 = insertelement <16 x i16> %ins12, i16 %a13, i32 13
446 %ins14 = insertelement <16 x i16> %ins13, i16 %a14, i32 14
447 %ins15 = insertelement <16 x i16> %ins14, i16 %a15, i32 15
448 store <16 x i16> %ins15, ptr %dst
452 define void @buildvector_v8i32(ptr %dst, i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6, i32 %a7) nounwind {
453 ; CHECK-LABEL: buildvector_v8i32:
454 ; CHECK: # %bb.0: # %entry
455 ; CHECK-NEXT: ld.w $t0, $sp, 0
456 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 0
457 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a2, 1
458 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a3, 2
459 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a4, 3
460 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a5, 4
461 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a6, 5
462 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a7, 6
463 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $t0, 7
464 ; CHECK-NEXT: xvst $xr0, $a0, 0
467 %ins0 = insertelement <8 x i32> undef, i32 %a0, i32 0
468 %ins1 = insertelement <8 x i32> %ins0, i32 %a1, i32 1
469 %ins2 = insertelement <8 x i32> %ins1, i32 %a2, i32 2
470 %ins3 = insertelement <8 x i32> %ins2, i32 %a3, i32 3
471 %ins4 = insertelement <8 x i32> %ins3, i32 %a4, i32 4
472 %ins5 = insertelement <8 x i32> %ins4, i32 %a5, i32 5
473 %ins6 = insertelement <8 x i32> %ins5, i32 %a6, i32 6
474 %ins7 = insertelement <8 x i32> %ins6, i32 %a7, i32 7
475 store <8 x i32> %ins7, ptr %dst
479 define void @buildvector_v4i64(ptr %dst, i64 %a0, i64 %a1, i64 %a2, i64 %a3) nounwind {
480 ; CHECK-LABEL: buildvector_v4i64:
481 ; CHECK: # %bb.0: # %entry
482 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a1, 0
483 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a2, 1
484 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a3, 2
485 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a4, 3
486 ; CHECK-NEXT: xvst $xr0, $a0, 0
489 %ins0 = insertelement <4 x i64> undef, i64 %a0, i32 0
490 %ins1 = insertelement <4 x i64> %ins0, i64 %a1, i32 1
491 %ins2 = insertelement <4 x i64> %ins1, i64 %a2, i32 2
492 %ins3 = insertelement <4 x i64> %ins2, i64 %a3, i32 3
493 store <4 x i64> %ins3, ptr %dst
497 define void @buildvector_v8f32(ptr %dst, float %a0, float %a1, float %a2, float %a3, float %a4, float %a5, float %a6, float %a7) nounwind {
498 ; CHECK-LABEL: buildvector_v8f32:
499 ; CHECK: # %bb.0: # %entry
500 ; CHECK-NEXT: movfr2gr.s $a1, $fa0
501 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 0
502 ; CHECK-NEXT: movfr2gr.s $a1, $fa1
503 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 1
504 ; CHECK-NEXT: movfr2gr.s $a1, $fa2
505 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 2
506 ; CHECK-NEXT: movfr2gr.s $a1, $fa3
507 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 3
508 ; CHECK-NEXT: movfr2gr.s $a1, $fa4
509 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 4
510 ; CHECK-NEXT: movfr2gr.s $a1, $fa5
511 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 5
512 ; CHECK-NEXT: movfr2gr.s $a1, $fa6
513 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 6
514 ; CHECK-NEXT: movfr2gr.s $a1, $fa7
515 ; CHECK-NEXT: xvinsgr2vr.w $xr0, $a1, 7
516 ; CHECK-NEXT: xvst $xr0, $a0, 0
519 %ins0 = insertelement <8 x float> undef, float %a0, i32 0
520 %ins1 = insertelement <8 x float> %ins0, float %a1, i32 1
521 %ins2 = insertelement <8 x float> %ins1, float %a2, i32 2
522 %ins3 = insertelement <8 x float> %ins2, float %a3, i32 3
523 %ins4 = insertelement <8 x float> %ins3, float %a4, i32 4
524 %ins5 = insertelement <8 x float> %ins4, float %a5, i32 5
525 %ins6 = insertelement <8 x float> %ins5, float %a6, i32 6
526 %ins7 = insertelement <8 x float> %ins6, float %a7, i32 7
527 store <8 x float> %ins7, ptr %dst
531 define void @buildvector_v4f64(ptr %dst, double %a0, double %a1, double %a2, double %a3) nounwind {
532 ; CHECK-LABEL: buildvector_v4f64:
533 ; CHECK: # %bb.0: # %entry
534 ; CHECK-NEXT: movfr2gr.d $a1, $fa0
535 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a1, 0
536 ; CHECK-NEXT: movfr2gr.d $a1, $fa1
537 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a1, 1
538 ; CHECK-NEXT: movfr2gr.d $a1, $fa2
539 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a1, 2
540 ; CHECK-NEXT: movfr2gr.d $a1, $fa3
541 ; CHECK-NEXT: xvinsgr2vr.d $xr0, $a1, 3
542 ; CHECK-NEXT: xvst $xr0, $a0, 0
545 %ins0 = insertelement <4 x double> undef, double %a0, i32 0
546 %ins1 = insertelement <4 x double> %ins0, double %a1, i32 1
547 %ins2 = insertelement <4 x double> %ins1, double %a2, i32 2
548 %ins3 = insertelement <4 x double> %ins2, double %a3, i32 3
549 store <4 x double> %ins3, ptr %dst