1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=mips -mattr=+msa,+fp64,+mips32r2 < %s | FileCheck %s --check-prefixes=CHECK,MIPS
3 ; RUN: llc -march=mipsel -mattr=+msa,+fp64,+mips32r2 < %s | FileCheck %s --check-prefixes=CHECK,MIPSEL
5 define void @and_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
6 ; CHECK-LABEL: and_v16i8:
8 ; CHECK-NEXT: ld.b $w0, 0($6)
9 ; CHECK-NEXT: ld.b $w1, 0($5)
10 ; CHECK-NEXT: and.v $w0, $w1, $w0
12 ; CHECK-NEXT: st.b $w0, 0($4)
13 %1 = load <16 x i8>, <16 x i8>* %a
14 %2 = load <16 x i8>, <16 x i8>* %b
15 %3 = and <16 x i8> %1, %2
16 store <16 x i8> %3, <16 x i8>* %c
20 define void @and_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
21 ; CHECK-LABEL: and_v8i16:
23 ; CHECK-NEXT: ld.h $w0, 0($6)
24 ; CHECK-NEXT: ld.h $w1, 0($5)
25 ; CHECK-NEXT: and.v $w0, $w1, $w0
27 ; CHECK-NEXT: st.h $w0, 0($4)
28 %1 = load <8 x i16>, <8 x i16>* %a
29 %2 = load <8 x i16>, <8 x i16>* %b
30 %3 = and <8 x i16> %1, %2
31 store <8 x i16> %3, <8 x i16>* %c
35 define void @and_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
36 ; CHECK-LABEL: and_v4i32:
38 ; CHECK-NEXT: ld.w $w0, 0($6)
39 ; CHECK-NEXT: ld.w $w1, 0($5)
40 ; CHECK-NEXT: and.v $w0, $w1, $w0
42 ; CHECK-NEXT: st.w $w0, 0($4)
43 %1 = load <4 x i32>, <4 x i32>* %a
44 %2 = load <4 x i32>, <4 x i32>* %b
45 %3 = and <4 x i32> %1, %2
46 store <4 x i32> %3, <4 x i32>* %c
50 define void @and_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
51 ; CHECK-LABEL: and_v2i64:
53 ; CHECK-NEXT: ld.d $w0, 0($6)
54 ; CHECK-NEXT: ld.d $w1, 0($5)
55 ; CHECK-NEXT: and.v $w0, $w1, $w0
57 ; CHECK-NEXT: st.d $w0, 0($4)
58 %1 = load <2 x i64>, <2 x i64>* %a
59 %2 = load <2 x i64>, <2 x i64>* %b
60 %3 = and <2 x i64> %1, %2
61 store <2 x i64> %3, <2 x i64>* %c
65 define void @and_v16i8_i(<16 x i8>* %c, <16 x i8>* %a) nounwind {
66 ; CHECK-LABEL: and_v16i8_i:
68 ; CHECK-NEXT: ld.b $w0, 0($5)
69 ; CHECK-NEXT: andi.b $w0, $w0, 1
71 ; CHECK-NEXT: st.b $w0, 0($4)
72 %1 = load <16 x i8>, <16 x i8>* %a
73 %2 = and <16 x 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>
74 store <16 x i8> %2, <16 x i8>* %c
78 define void @and_v8i16_i(<8 x i16>* %c, <8 x i16>* %a) nounwind {
79 ; CHECK-LABEL: and_v8i16_i:
81 ; CHECK-NEXT: ld.h $w0, 0($5)
82 ; CHECK-NEXT: ldi.h $w1, 1
83 ; CHECK-NEXT: and.v $w0, $w0, $w1
85 ; CHECK-NEXT: st.h $w0, 0($4)
86 %1 = load <8 x i16>, <8 x i16>* %a
87 %2 = and <8 x i16> %1, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
88 store <8 x i16> %2, <8 x i16>* %c
92 define void @and_v4i32_i(<4 x i32>* %c, <4 x i32>* %a) nounwind {
93 ; CHECK-LABEL: and_v4i32_i:
95 ; CHECK-NEXT: ld.w $w0, 0($5)
96 ; CHECK-NEXT: ldi.w $w1, 1
97 ; CHECK-NEXT: and.v $w0, $w0, $w1
99 ; CHECK-NEXT: st.w $w0, 0($4)
100 %1 = load <4 x i32>, <4 x i32>* %a
101 %2 = and <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1>
102 store <4 x i32> %2, <4 x i32>* %c
106 define void @and_v2i64_i(<2 x i64>* %c, <2 x i64>* %a) nounwind {
107 ; MIPS-LABEL: and_v2i64_i:
109 ; MIPS-NEXT: ldi.d $w0, 1
110 ; MIPS-NEXT: shf.w $w0, $w0, 177
111 ; MIPS-NEXT: ld.d $w1, 0($5)
112 ; MIPS-NEXT: and.v $w0, $w1, $w0
114 ; MIPS-NEXT: st.d $w0, 0($4)
116 ; MIPSEL-LABEL: and_v2i64_i:
118 ; MIPSEL-NEXT: ldi.d $w0, 1
119 ; MIPSEL-NEXT: ld.d $w1, 0($5)
120 ; MIPSEL-NEXT: and.v $w0, $w1, $w0
121 ; MIPSEL-NEXT: jr $ra
122 ; MIPSEL-NEXT: st.d $w0, 0($4)
123 %1 = load <2 x i64>, <2 x i64>* %a
124 %2 = and <2 x i64> %1, <i64 1, i64 1>
125 store <2 x i64> %2, <2 x i64>* %c
129 define void @or_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
130 ; CHECK-LABEL: or_v16i8:
132 ; CHECK-NEXT: ld.b $w0, 0($6)
133 ; CHECK-NEXT: ld.b $w1, 0($5)
134 ; CHECK-NEXT: or.v $w0, $w1, $w0
136 ; CHECK-NEXT: st.b $w0, 0($4)
137 %1 = load <16 x i8>, <16 x i8>* %a
138 %2 = load <16 x i8>, <16 x i8>* %b
139 %3 = or <16 x i8> %1, %2
140 store <16 x i8> %3, <16 x i8>* %c
144 define void @or_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
145 ; CHECK-LABEL: or_v8i16:
147 ; CHECK-NEXT: ld.h $w0, 0($6)
148 ; CHECK-NEXT: ld.h $w1, 0($5)
149 ; CHECK-NEXT: or.v $w0, $w1, $w0
151 ; CHECK-NEXT: st.h $w0, 0($4)
152 %1 = load <8 x i16>, <8 x i16>* %a
153 %2 = load <8 x i16>, <8 x i16>* %b
154 %3 = or <8 x i16> %1, %2
155 store <8 x i16> %3, <8 x i16>* %c
159 define void @or_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
160 ; CHECK-LABEL: or_v4i32:
162 ; CHECK-NEXT: ld.w $w0, 0($6)
163 ; CHECK-NEXT: ld.w $w1, 0($5)
164 ; CHECK-NEXT: or.v $w0, $w1, $w0
166 ; CHECK-NEXT: st.w $w0, 0($4)
167 %1 = load <4 x i32>, <4 x i32>* %a
168 %2 = load <4 x i32>, <4 x i32>* %b
169 %3 = or <4 x i32> %1, %2
170 store <4 x i32> %3, <4 x i32>* %c
174 define void @or_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
175 ; CHECK-LABEL: or_v2i64:
177 ; CHECK-NEXT: ld.d $w0, 0($6)
178 ; CHECK-NEXT: ld.d $w1, 0($5)
179 ; CHECK-NEXT: or.v $w0, $w1, $w0
181 ; CHECK-NEXT: st.d $w0, 0($4)
182 %1 = load <2 x i64>, <2 x i64>* %a
183 %2 = load <2 x i64>, <2 x i64>* %b
184 %3 = or <2 x i64> %1, %2
185 store <2 x i64> %3, <2 x i64>* %c
189 define void @or_v16i8_i(<16 x i8>* %c, <16 x i8>* %a) nounwind {
190 ; CHECK-LABEL: or_v16i8_i:
192 ; CHECK-NEXT: ld.b $w0, 0($5)
193 ; CHECK-NEXT: ori.b $w0, $w0, 3
195 ; CHECK-NEXT: st.b $w0, 0($4)
196 %1 = load <16 x i8>, <16 x i8>* %a
197 %2 = or <16 x i8> %1, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
198 store <16 x i8> %2, <16 x i8>* %c
202 define void @or_v8i16_i(<8 x i16>* %c, <8 x i16>* %a) nounwind {
203 ; CHECK-LABEL: or_v8i16_i:
205 ; CHECK-NEXT: ld.h $w0, 0($5)
206 ; CHECK-NEXT: ldi.h $w1, 3
207 ; CHECK-NEXT: or.v $w0, $w0, $w1
209 ; CHECK-NEXT: st.h $w0, 0($4)
210 %1 = load <8 x i16>, <8 x i16>* %a
211 %2 = or <8 x i16> %1, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
212 store <8 x i16> %2, <8 x i16>* %c
216 define void @or_v4i32_i(<4 x i32>* %c, <4 x i32>* %a) nounwind {
217 ; CHECK-LABEL: or_v4i32_i:
219 ; CHECK-NEXT: ld.w $w0, 0($5)
220 ; CHECK-NEXT: ldi.w $w1, 3
221 ; CHECK-NEXT: or.v $w0, $w0, $w1
223 ; CHECK-NEXT: st.w $w0, 0($4)
224 %1 = load <4 x i32>, <4 x i32>* %a
225 %2 = or <4 x i32> %1, <i32 3, i32 3, i32 3, i32 3>
226 store <4 x i32> %2, <4 x i32>* %c
230 define void @or_v2i64_i(<2 x i64>* %c, <2 x i64>* %a) nounwind {
231 ; MIPS-LABEL: or_v2i64_i:
233 ; MIPS-NEXT: ldi.d $w0, 3
234 ; MIPS-NEXT: shf.w $w0, $w0, 177
235 ; MIPS-NEXT: ld.d $w1, 0($5)
236 ; MIPS-NEXT: or.v $w0, $w1, $w0
238 ; MIPS-NEXT: st.d $w0, 0($4)
240 ; MIPSEL-LABEL: or_v2i64_i:
242 ; MIPSEL-NEXT: ldi.d $w0, 3
243 ; MIPSEL-NEXT: ld.d $w1, 0($5)
244 ; MIPSEL-NEXT: or.v $w0, $w1, $w0
245 ; MIPSEL-NEXT: jr $ra
246 ; MIPSEL-NEXT: st.d $w0, 0($4)
247 %1 = load <2 x i64>, <2 x i64>* %a
248 %2 = or <2 x i64> %1, <i64 3, i64 3>
249 store <2 x i64> %2, <2 x i64>* %c
253 define void @nor_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
254 ; CHECK-LABEL: nor_v16i8:
256 ; CHECK-NEXT: ld.b $w0, 0($6)
257 ; CHECK-NEXT: ld.b $w1, 0($5)
258 ; CHECK-NEXT: nor.v $w0, $w1, $w0
260 ; CHECK-NEXT: st.b $w0, 0($4)
261 %1 = load <16 x i8>, <16 x i8>* %a
262 %2 = load <16 x i8>, <16 x i8>* %b
263 %3 = or <16 x i8> %1, %2
264 %4 = xor <16 x i8> %3, <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>
265 store <16 x i8> %4, <16 x i8>* %c
269 define void @nor_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
270 ; CHECK-LABEL: nor_v8i16:
272 ; CHECK-NEXT: ld.h $w0, 0($6)
273 ; CHECK-NEXT: ld.h $w1, 0($5)
274 ; CHECK-NEXT: nor.v $w0, $w1, $w0
276 ; CHECK-NEXT: st.h $w0, 0($4)
277 %1 = load <8 x i16>, <8 x i16>* %a
278 %2 = load <8 x i16>, <8 x i16>* %b
279 %3 = or <8 x i16> %1, %2
280 %4 = xor <8 x i16> %3, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
281 store <8 x i16> %4, <8 x i16>* %c
285 define void @nor_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
286 ; CHECK-LABEL: nor_v4i32:
288 ; CHECK-NEXT: ld.w $w0, 0($6)
289 ; CHECK-NEXT: ld.w $w1, 0($5)
290 ; CHECK-NEXT: nor.v $w0, $w1, $w0
292 ; CHECK-NEXT: st.w $w0, 0($4)
293 %1 = load <4 x i32>, <4 x i32>* %a
294 %2 = load <4 x i32>, <4 x i32>* %b
295 %3 = or <4 x i32> %1, %2
296 %4 = xor <4 x i32> %3, <i32 -1, i32 -1, i32 -1, i32 -1>
297 store <4 x i32> %4, <4 x i32>* %c
301 define void @nor_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
302 ; CHECK-LABEL: nor_v2i64:
304 ; CHECK-NEXT: ld.d $w0, 0($6)
305 ; CHECK-NEXT: ld.d $w1, 0($5)
306 ; CHECK-NEXT: nor.v $w0, $w1, $w0
308 ; CHECK-NEXT: st.d $w0, 0($4)
309 %1 = load <2 x i64>, <2 x i64>* %a
310 %2 = load <2 x i64>, <2 x i64>* %b
311 %3 = or <2 x i64> %1, %2
312 %4 = xor <2 x i64> %3, <i64 -1, i64 -1>
313 store <2 x i64> %4, <2 x i64>* %c
317 define void @nor_v16i8_i(<16 x i8>* %c, <16 x i8>* %a) nounwind {
318 ; CHECK-LABEL: nor_v16i8_i:
320 ; CHECK-NEXT: ld.b $w0, 0($5)
321 ; CHECK-NEXT: nori.b $w0, $w0, 1
323 ; CHECK-NEXT: st.b $w0, 0($4)
324 %1 = load <16 x i8>, <16 x i8>* %a
325 %2 = or <16 x 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>
326 %3 = xor <16 x i8> %2, <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>
327 store <16 x i8> %3, <16 x i8>* %c
331 define void @nor_v8i16_i(<8 x i16>* %c, <8 x i16>* %a) nounwind {
332 ; CHECK-LABEL: nor_v8i16_i:
334 ; CHECK-NEXT: ld.h $w0, 0($5)
335 ; CHECK-NEXT: ldi.h $w1, 1
336 ; CHECK-NEXT: nor.v $w0, $w0, $w1
338 ; CHECK-NEXT: st.h $w0, 0($4)
339 %1 = load <8 x i16>, <8 x i16>* %a
340 %2 = or <8 x i16> %1, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
341 %3 = xor <8 x i16> %2, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
342 store <8 x i16> %3, <8 x i16>* %c
346 define void @nor_v4i32_i(<4 x i32>* %c, <4 x i32>* %a) nounwind {
347 ; CHECK-LABEL: nor_v4i32_i:
349 ; CHECK-NEXT: ld.w $w0, 0($5)
350 ; CHECK-NEXT: ldi.w $w1, 1
351 ; CHECK-NEXT: nor.v $w0, $w0, $w1
353 ; CHECK-NEXT: st.w $w0, 0($4)
354 %1 = load <4 x i32>, <4 x i32>* %a
355 %2 = or <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1>
356 %3 = xor <4 x i32> %2, <i32 -1, i32 -1, i32 -1, i32 -1>
357 store <4 x i32> %3, <4 x i32>* %c
361 define void @nor_v2i64_i(<2 x i64>* %c, <2 x i64>* %a) nounwind {
362 ; MIPS-LABEL: nor_v2i64_i:
364 ; MIPS-NEXT: ldi.d $w0, 1
365 ; MIPS-NEXT: shf.w $w0, $w0, 177
366 ; MIPS-NEXT: ld.d $w1, 0($5)
367 ; MIPS-NEXT: nor.v $w0, $w1, $w0
369 ; MIPS-NEXT: st.d $w0, 0($4)
371 ; MIPSEL-LABEL: nor_v2i64_i:
373 ; MIPSEL-NEXT: ldi.d $w0, 1
374 ; MIPSEL-NEXT: ld.d $w1, 0($5)
375 ; MIPSEL-NEXT: nor.v $w0, $w1, $w0
376 ; MIPSEL-NEXT: jr $ra
377 ; MIPSEL-NEXT: st.d $w0, 0($4)
378 %1 = load <2 x i64>, <2 x i64>* %a
379 %2 = or <2 x i64> %1, <i64 1, i64 1>
380 %3 = xor <2 x i64> %2, <i64 -1, i64 -1>
381 store <2 x i64> %3, <2 x i64>* %c
385 define void @xor_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
386 ; CHECK-LABEL: xor_v16i8:
388 ; CHECK-NEXT: ld.b $w0, 0($6)
389 ; CHECK-NEXT: ld.b $w1, 0($5)
390 ; CHECK-NEXT: xor.v $w0, $w1, $w0
392 ; CHECK-NEXT: st.b $w0, 0($4)
393 %1 = load <16 x i8>, <16 x i8>* %a
394 %2 = load <16 x i8>, <16 x i8>* %b
395 %3 = xor <16 x i8> %1, %2
396 store <16 x i8> %3, <16 x i8>* %c
400 define void @xor_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
401 ; CHECK-LABEL: xor_v8i16:
403 ; CHECK-NEXT: ld.h $w0, 0($6)
404 ; CHECK-NEXT: ld.h $w1, 0($5)
405 ; CHECK-NEXT: xor.v $w0, $w1, $w0
407 ; CHECK-NEXT: st.h $w0, 0($4)
408 %1 = load <8 x i16>, <8 x i16>* %a
409 %2 = load <8 x i16>, <8 x i16>* %b
410 %3 = xor <8 x i16> %1, %2
411 store <8 x i16> %3, <8 x i16>* %c
415 define void @xor_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
416 ; CHECK-LABEL: xor_v4i32:
418 ; CHECK-NEXT: ld.w $w0, 0($6)
419 ; CHECK-NEXT: ld.w $w1, 0($5)
420 ; CHECK-NEXT: xor.v $w0, $w1, $w0
422 ; CHECK-NEXT: st.w $w0, 0($4)
423 %1 = load <4 x i32>, <4 x i32>* %a
424 %2 = load <4 x i32>, <4 x i32>* %b
425 %3 = xor <4 x i32> %1, %2
426 store <4 x i32> %3, <4 x i32>* %c
430 define void @xor_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
431 ; CHECK-LABEL: xor_v2i64:
433 ; CHECK-NEXT: ld.d $w0, 0($6)
434 ; CHECK-NEXT: ld.d $w1, 0($5)
435 ; CHECK-NEXT: xor.v $w0, $w1, $w0
437 ; CHECK-NEXT: st.d $w0, 0($4)
438 %1 = load <2 x i64>, <2 x i64>* %a
439 %2 = load <2 x i64>, <2 x i64>* %b
440 %3 = xor <2 x i64> %1, %2
441 store <2 x i64> %3, <2 x i64>* %c
445 define void @xor_v16i8_i(<16 x i8>* %c, <16 x i8>* %a) nounwind {
446 ; CHECK-LABEL: xor_v16i8_i:
448 ; CHECK-NEXT: ld.b $w0, 0($5)
449 ; CHECK-NEXT: xori.b $w0, $w0, 3
451 ; CHECK-NEXT: st.b $w0, 0($4)
452 %1 = load <16 x i8>, <16 x i8>* %a
453 %2 = xor <16 x i8> %1, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
454 store <16 x i8> %2, <16 x i8>* %c
458 define void @xor_v8i16_i(<8 x i16>* %c, <8 x i16>* %a) nounwind {
459 ; CHECK-LABEL: xor_v8i16_i:
461 ; CHECK-NEXT: ld.h $w0, 0($5)
462 ; CHECK-NEXT: ldi.h $w1, 3
463 ; CHECK-NEXT: xor.v $w0, $w0, $w1
465 ; CHECK-NEXT: st.h $w0, 0($4)
466 %1 = load <8 x i16>, <8 x i16>* %a
467 %2 = xor <8 x i16> %1, <i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3, i16 3>
468 store <8 x i16> %2, <8 x i16>* %c
472 define void @xor_v4i32_i(<4 x i32>* %c, <4 x i32>* %a) nounwind {
473 ; CHECK-LABEL: xor_v4i32_i:
475 ; CHECK-NEXT: ld.w $w0, 0($5)
476 ; CHECK-NEXT: ldi.w $w1, 3
477 ; CHECK-NEXT: xor.v $w0, $w0, $w1
479 ; CHECK-NEXT: st.w $w0, 0($4)
480 %1 = load <4 x i32>, <4 x i32>* %a
481 %2 = xor <4 x i32> %1, <i32 3, i32 3, i32 3, i32 3>
482 store <4 x i32> %2, <4 x i32>* %c
486 define void @xor_v2i64_i(<2 x i64>* %c, <2 x i64>* %a) nounwind {
487 ; MIPS-LABEL: xor_v2i64_i:
489 ; MIPS-NEXT: ldi.d $w0, 3
490 ; MIPS-NEXT: shf.w $w0, $w0, 177
491 ; MIPS-NEXT: ld.d $w1, 0($5)
492 ; MIPS-NEXT: xor.v $w0, $w1, $w0
494 ; MIPS-NEXT: st.d $w0, 0($4)
496 ; MIPSEL-LABEL: xor_v2i64_i:
498 ; MIPSEL-NEXT: ldi.d $w0, 3
499 ; MIPSEL-NEXT: ld.d $w1, 0($5)
500 ; MIPSEL-NEXT: xor.v $w0, $w1, $w0
501 ; MIPSEL-NEXT: jr $ra
502 ; MIPSEL-NEXT: st.d $w0, 0($4)
503 %1 = load <2 x i64>, <2 x i64>* %a
504 %2 = xor <2 x i64> %1, <i64 3, i64 3>
505 store <2 x i64> %2, <2 x i64>* %c
509 define void @sll_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
510 ; CHECK-LABEL: sll_v16i8:
512 ; CHECK-NEXT: ld.b $w0, 0($6)
513 ; CHECK-NEXT: ld.b $w1, 0($5)
514 ; CHECK-NEXT: sll.b $w0, $w1, $w0
516 ; CHECK-NEXT: st.b $w0, 0($4)
517 %1 = load <16 x i8>, <16 x i8>* %a
518 %2 = load <16 x i8>, <16 x i8>* %b
519 %3 = shl <16 x i8> %1, %2
520 store <16 x i8> %3, <16 x i8>* %c
524 define void @sll_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
525 ; CHECK-LABEL: sll_v8i16:
527 ; CHECK-NEXT: ld.h $w0, 0($6)
528 ; CHECK-NEXT: ld.h $w1, 0($5)
529 ; CHECK-NEXT: sll.h $w0, $w1, $w0
531 ; CHECK-NEXT: st.h $w0, 0($4)
532 %1 = load <8 x i16>, <8 x i16>* %a
533 %2 = load <8 x i16>, <8 x i16>* %b
534 %3 = shl <8 x i16> %1, %2
535 store <8 x i16> %3, <8 x i16>* %c
539 define void @sll_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
540 ; CHECK-LABEL: sll_v4i32:
542 ; CHECK-NEXT: ld.w $w0, 0($6)
543 ; CHECK-NEXT: ld.w $w1, 0($5)
544 ; CHECK-NEXT: sll.w $w0, $w1, $w0
546 ; CHECK-NEXT: st.w $w0, 0($4)
547 %1 = load <4 x i32>, <4 x i32>* %a
548 %2 = load <4 x i32>, <4 x i32>* %b
549 %3 = shl <4 x i32> %1, %2
550 store <4 x i32> %3, <4 x i32>* %c
554 define void @sll_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
555 ; CHECK-LABEL: sll_v2i64:
557 ; CHECK-NEXT: ld.d $w0, 0($6)
558 ; CHECK-NEXT: ld.d $w1, 0($5)
559 ; CHECK-NEXT: sll.d $w0, $w1, $w0
561 ; CHECK-NEXT: st.d $w0, 0($4)
562 %1 = load <2 x i64>, <2 x i64>* %a
563 %2 = load <2 x i64>, <2 x i64>* %b
564 %3 = shl <2 x i64> %1, %2
565 store <2 x i64> %3, <2 x i64>* %c
569 define void @sll_v16i8_i(<16 x i8>* %c, <16 x i8>* %a) nounwind {
570 ; CHECK-LABEL: sll_v16i8_i:
572 ; CHECK-NEXT: ld.b $w0, 0($5)
573 ; CHECK-NEXT: slli.b $w0, $w0, 1
575 ; CHECK-NEXT: st.b $w0, 0($4)
576 %1 = load <16 x i8>, <16 x i8>* %a
577 %2 = shl <16 x 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>
578 store <16 x i8> %2, <16 x i8>* %c
582 define void @sll_v8i16_i(<8 x i16>* %c, <8 x i16>* %a) nounwind {
583 ; CHECK-LABEL: sll_v8i16_i:
585 ; CHECK-NEXT: ld.h $w0, 0($5)
586 ; CHECK-NEXT: slli.h $w0, $w0, 1
588 ; CHECK-NEXT: st.h $w0, 0($4)
589 %1 = load <8 x i16>, <8 x i16>* %a
590 %2 = shl <8 x i16> %1, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
591 store <8 x i16> %2, <8 x i16>* %c
595 define void @sll_v4i32_i(<4 x i32>* %c, <4 x i32>* %a) nounwind {
596 ; CHECK-LABEL: sll_v4i32_i:
598 ; CHECK-NEXT: ld.w $w0, 0($5)
599 ; CHECK-NEXT: slli.w $w0, $w0, 1
601 ; CHECK-NEXT: st.w $w0, 0($4)
602 %1 = load <4 x i32>, <4 x i32>* %a
603 %2 = shl <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1>
604 store <4 x i32> %2, <4 x i32>* %c
608 define void @sll_v2i64_i(<2 x i64>* %c, <2 x i64>* %a) nounwind {
609 ; CHECK-LABEL: sll_v2i64_i:
611 ; CHECK-NEXT: ld.d $w0, 0($5)
612 ; CHECK-NEXT: slli.d $w0, $w0, 1
614 ; CHECK-NEXT: st.d $w0, 0($4)
615 %1 = load <2 x i64>, <2 x i64>* %a
616 %2 = shl <2 x i64> %1, <i64 1, i64 1>
617 store <2 x i64> %2, <2 x i64>* %c
621 define void @sra_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
622 ; CHECK-LABEL: sra_v16i8:
624 ; CHECK-NEXT: ld.b $w0, 0($6)
625 ; CHECK-NEXT: ld.b $w1, 0($5)
626 ; CHECK-NEXT: sra.b $w0, $w1, $w0
628 ; CHECK-NEXT: st.b $w0, 0($4)
629 %1 = load <16 x i8>, <16 x i8>* %a
630 %2 = load <16 x i8>, <16 x i8>* %b
631 %3 = ashr <16 x i8> %1, %2
632 store <16 x i8> %3, <16 x i8>* %c
636 define void @sra_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
637 ; CHECK-LABEL: sra_v8i16:
639 ; CHECK-NEXT: ld.h $w0, 0($6)
640 ; CHECK-NEXT: ld.h $w1, 0($5)
641 ; CHECK-NEXT: sra.h $w0, $w1, $w0
643 ; CHECK-NEXT: st.h $w0, 0($4)
644 %1 = load <8 x i16>, <8 x i16>* %a
645 %2 = load <8 x i16>, <8 x i16>* %b
646 %3 = ashr <8 x i16> %1, %2
647 store <8 x i16> %3, <8 x i16>* %c
651 define void @sra_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
652 ; CHECK-LABEL: sra_v4i32:
654 ; CHECK-NEXT: ld.w $w0, 0($6)
655 ; CHECK-NEXT: ld.w $w1, 0($5)
656 ; CHECK-NEXT: sra.w $w0, $w1, $w0
658 ; CHECK-NEXT: st.w $w0, 0($4)
659 %1 = load <4 x i32>, <4 x i32>* %a
660 %2 = load <4 x i32>, <4 x i32>* %b
661 %3 = ashr <4 x i32> %1, %2
662 store <4 x i32> %3, <4 x i32>* %c
666 define void @sra_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
667 ; CHECK-LABEL: sra_v2i64:
669 ; CHECK-NEXT: ld.d $w0, 0($6)
670 ; CHECK-NEXT: ld.d $w1, 0($5)
671 ; CHECK-NEXT: sra.d $w0, $w1, $w0
673 ; CHECK-NEXT: st.d $w0, 0($4)
674 %1 = load <2 x i64>, <2 x i64>* %a
675 %2 = load <2 x i64>, <2 x i64>* %b
676 %3 = ashr <2 x i64> %1, %2
677 store <2 x i64> %3, <2 x i64>* %c
681 define void @sra_v16i8_i(<16 x i8>* %c, <16 x i8>* %a) nounwind {
682 ; CHECK-LABEL: sra_v16i8_i:
684 ; CHECK-NEXT: ld.b $w0, 0($5)
685 ; CHECK-NEXT: srai.b $w0, $w0, 1
687 ; CHECK-NEXT: st.b $w0, 0($4)
688 %1 = load <16 x i8>, <16 x i8>* %a
689 %2 = ashr <16 x 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>
690 store <16 x i8> %2, <16 x i8>* %c
694 define void @sra_v8i16_i(<8 x i16>* %c, <8 x i16>* %a) nounwind {
695 ; CHECK-LABEL: sra_v8i16_i:
697 ; CHECK-NEXT: ld.h $w0, 0($5)
698 ; CHECK-NEXT: srai.h $w0, $w0, 1
700 ; CHECK-NEXT: st.h $w0, 0($4)
701 %1 = load <8 x i16>, <8 x i16>* %a
702 %2 = ashr <8 x i16> %1, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
703 store <8 x i16> %2, <8 x i16>* %c
707 define void @sra_v4i32_i(<4 x i32>* %c, <4 x i32>* %a) nounwind {
708 ; CHECK-LABEL: sra_v4i32_i:
710 ; CHECK-NEXT: ld.w $w0, 0($5)
711 ; CHECK-NEXT: srai.w $w0, $w0, 1
713 ; CHECK-NEXT: st.w $w0, 0($4)
714 %1 = load <4 x i32>, <4 x i32>* %a
715 %2 = ashr <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1>
716 store <4 x i32> %2, <4 x i32>* %c
720 define void @sra_v2i64_i(<2 x i64>* %c, <2 x i64>* %a) nounwind {
721 ; CHECK-LABEL: sra_v2i64_i:
723 ; CHECK-NEXT: ld.d $w0, 0($5)
724 ; CHECK-NEXT: srai.d $w0, $w0, 1
726 ; CHECK-NEXT: st.d $w0, 0($4)
727 %1 = load <2 x i64>, <2 x i64>* %a
728 %2 = ashr <2 x i64> %1, <i64 1, i64 1>
729 store <2 x i64> %2, <2 x i64>* %c
733 define void @srl_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
734 ; CHECK-LABEL: srl_v16i8:
736 ; CHECK-NEXT: ld.b $w0, 0($6)
737 ; CHECK-NEXT: ld.b $w1, 0($5)
738 ; CHECK-NEXT: srl.b $w0, $w1, $w0
740 ; CHECK-NEXT: st.b $w0, 0($4)
741 %1 = load <16 x i8>, <16 x i8>* %a
742 %2 = load <16 x i8>, <16 x i8>* %b
743 %3 = lshr <16 x i8> %1, %2
744 store <16 x i8> %3, <16 x i8>* %c
748 define void @srl_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
749 ; CHECK-LABEL: srl_v8i16:
751 ; CHECK-NEXT: ld.h $w0, 0($6)
752 ; CHECK-NEXT: ld.h $w1, 0($5)
753 ; CHECK-NEXT: srl.h $w0, $w1, $w0
755 ; CHECK-NEXT: st.h $w0, 0($4)
756 %1 = load <8 x i16>, <8 x i16>* %a
757 %2 = load <8 x i16>, <8 x i16>* %b
758 %3 = lshr <8 x i16> %1, %2
759 store <8 x i16> %3, <8 x i16>* %c
763 define void @srl_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
764 ; CHECK-LABEL: srl_v4i32:
766 ; CHECK-NEXT: ld.w $w0, 0($6)
767 ; CHECK-NEXT: ld.w $w1, 0($5)
768 ; CHECK-NEXT: srl.w $w0, $w1, $w0
770 ; CHECK-NEXT: st.w $w0, 0($4)
771 %1 = load <4 x i32>, <4 x i32>* %a
772 %2 = load <4 x i32>, <4 x i32>* %b
773 %3 = lshr <4 x i32> %1, %2
774 store <4 x i32> %3, <4 x i32>* %c
778 define void @srl_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
779 ; CHECK-LABEL: srl_v2i64:
781 ; CHECK-NEXT: ld.d $w0, 0($6)
782 ; CHECK-NEXT: ld.d $w1, 0($5)
783 ; CHECK-NEXT: srl.d $w0, $w1, $w0
785 ; CHECK-NEXT: st.d $w0, 0($4)
786 %1 = load <2 x i64>, <2 x i64>* %a
787 %2 = load <2 x i64>, <2 x i64>* %b
788 %3 = lshr <2 x i64> %1, %2
789 store <2 x i64> %3, <2 x i64>* %c
793 define void @srl_v16i8_i(<16 x i8>* %c, <16 x i8>* %a) nounwind {
794 ; CHECK-LABEL: srl_v16i8_i:
796 ; CHECK-NEXT: ld.b $w0, 0($5)
797 ; CHECK-NEXT: srli.b $w0, $w0, 1
799 ; CHECK-NEXT: st.b $w0, 0($4)
800 %1 = load <16 x i8>, <16 x i8>* %a
801 %2 = lshr <16 x 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>
802 store <16 x i8> %2, <16 x i8>* %c
806 define void @srl_v8i16_i(<8 x i16>* %c, <8 x i16>* %a) nounwind {
807 ; CHECK-LABEL: srl_v8i16_i:
809 ; CHECK-NEXT: ld.h $w0, 0($5)
810 ; CHECK-NEXT: srli.h $w0, $w0, 1
812 ; CHECK-NEXT: st.h $w0, 0($4)
813 %1 = load <8 x i16>, <8 x i16>* %a
814 %2 = lshr <8 x i16> %1, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>
815 store <8 x i16> %2, <8 x i16>* %c
819 define void @srl_v4i32_i(<4 x i32>* %c, <4 x i32>* %a) nounwind {
820 ; CHECK-LABEL: srl_v4i32_i:
822 ; CHECK-NEXT: ld.w $w0, 0($5)
823 ; CHECK-NEXT: srli.w $w0, $w0, 1
825 ; CHECK-NEXT: st.w $w0, 0($4)
826 %1 = load <4 x i32>, <4 x i32>* %a
827 %2 = lshr <4 x i32> %1, <i32 1, i32 1, i32 1, i32 1>
828 store <4 x i32> %2, <4 x i32>* %c
832 define void @srl_v2i64_i(<2 x i64>* %c, <2 x i64>* %a) nounwind {
833 ; CHECK-LABEL: srl_v2i64_i:
835 ; CHECK-NEXT: ld.d $w0, 0($5)
836 ; CHECK-NEXT: srli.d $w0, $w0, 1
838 ; CHECK-NEXT: st.d $w0, 0($4)
839 %1 = load <2 x i64>, <2 x i64>* %a
840 %2 = lshr <2 x i64> %1, <i64 1, i64 1>
841 store <2 x i64> %2, <2 x i64>* %c
845 define void @ctpop_v16i8(<16 x i8>* %c, <16 x i8>* %a) nounwind {
846 ; CHECK-LABEL: ctpop_v16i8:
848 ; CHECK-NEXT: ld.b $w0, 0($5)
849 ; CHECK-NEXT: pcnt.b $w0, $w0
851 ; CHECK-NEXT: st.b $w0, 0($4)
852 %1 = load <16 x i8>, <16 x i8>* %a
853 %2 = tail call <16 x i8> @llvm.ctpop.v16i8 (<16 x i8> %1)
854 store <16 x i8> %2, <16 x i8>* %c
858 define void @ctpop_v8i16(<8 x i16>* %c, <8 x i16>* %a) nounwind {
859 ; CHECK-LABEL: ctpop_v8i16:
861 ; CHECK-NEXT: ld.h $w0, 0($5)
862 ; CHECK-NEXT: pcnt.h $w0, $w0
864 ; CHECK-NEXT: st.h $w0, 0($4)
865 %1 = load <8 x i16>, <8 x i16>* %a
866 %2 = tail call <8 x i16> @llvm.ctpop.v8i16 (<8 x i16> %1)
867 store <8 x i16> %2, <8 x i16>* %c
871 define void @ctpop_v4i32(<4 x i32>* %c, <4 x i32>* %a) nounwind {
872 ; CHECK-LABEL: ctpop_v4i32:
874 ; CHECK-NEXT: ld.w $w0, 0($5)
875 ; CHECK-NEXT: pcnt.w $w0, $w0
877 ; CHECK-NEXT: st.w $w0, 0($4)
878 %1 = load <4 x i32>, <4 x i32>* %a
879 %2 = tail call <4 x i32> @llvm.ctpop.v4i32 (<4 x i32> %1)
880 store <4 x i32> %2, <4 x i32>* %c
884 define void @ctpop_v2i64(<2 x i64>* %c, <2 x i64>* %a) nounwind {
885 ; CHECK-LABEL: ctpop_v2i64:
887 ; CHECK-NEXT: ld.d $w0, 0($5)
888 ; CHECK-NEXT: pcnt.d $w0, $w0
890 ; CHECK-NEXT: st.d $w0, 0($4)
891 %1 = load <2 x i64>, <2 x i64>* %a
892 %2 = tail call <2 x i64> @llvm.ctpop.v2i64 (<2 x i64> %1)
893 store <2 x i64> %2, <2 x i64>* %c
897 define void @ctlz_v16i8(<16 x i8>* %c, <16 x i8>* %a) nounwind {
898 ; CHECK-LABEL: ctlz_v16i8:
900 ; CHECK-NEXT: ld.b $w0, 0($5)
901 ; CHECK-NEXT: nlzc.b $w0, $w0
903 ; CHECK-NEXT: st.b $w0, 0($4)
904 %1 = load <16 x i8>, <16 x i8>* %a
905 %2 = tail call <16 x i8> @llvm.ctlz.v16i8 (<16 x i8> %1)
906 store <16 x i8> %2, <16 x i8>* %c
910 define void @ctlz_v8i16(<8 x i16>* %c, <8 x i16>* %a) nounwind {
911 ; CHECK-LABEL: ctlz_v8i16:
913 ; CHECK-NEXT: ld.h $w0, 0($5)
914 ; CHECK-NEXT: nlzc.h $w0, $w0
916 ; CHECK-NEXT: st.h $w0, 0($4)
917 %1 = load <8 x i16>, <8 x i16>* %a
918 %2 = tail call <8 x i16> @llvm.ctlz.v8i16 (<8 x i16> %1)
919 store <8 x i16> %2, <8 x i16>* %c
923 define void @ctlz_v4i32(<4 x i32>* %c, <4 x i32>* %a) nounwind {
924 ; CHECK-LABEL: ctlz_v4i32:
926 ; CHECK-NEXT: ld.w $w0, 0($5)
927 ; CHECK-NEXT: nlzc.w $w0, $w0
929 ; CHECK-NEXT: st.w $w0, 0($4)
930 %1 = load <4 x i32>, <4 x i32>* %a
931 %2 = tail call <4 x i32> @llvm.ctlz.v4i32 (<4 x i32> %1)
932 store <4 x i32> %2, <4 x i32>* %c
936 define void @ctlz_v2i64(<2 x i64>* %c, <2 x i64>* %a) nounwind {
937 ; CHECK-LABEL: ctlz_v2i64:
939 ; CHECK-NEXT: ld.d $w0, 0($5)
940 ; CHECK-NEXT: nlzc.d $w0, $w0
942 ; CHECK-NEXT: st.d $w0, 0($4)
943 %1 = load <2 x i64>, <2 x i64>* %a
944 %2 = tail call <2 x i64> @llvm.ctlz.v2i64 (<2 x i64> %1)
945 store <2 x i64> %2, <2 x i64>* %c
949 define void @bsel_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b, <16 x i8>* %m) nounwind {
950 ; CHECK-LABEL: bsel_v16i8:
952 ; CHECK-NEXT: ld.b $w0, 0($7)
953 ; CHECK-NEXT: ld.b $w1, 0($5)
954 ; CHECK-NEXT: ld.b $w2, 0($6)
955 ; CHECK-NEXT: bmnz.v $w2, $w1, $w0
957 ; CHECK-NEXT: st.b $w2, 0($4)
958 %1 = load <16 x i8>, <16 x i8>* %a
959 %2 = load <16 x i8>, <16 x i8>* %b
960 %3 = load <16 x i8>, <16 x i8>* %m
961 %4 = xor <16 x i8> %3, <i8 -1, i8 -1, i8 -1, i8 -1,
962 i8 -1, i8 -1, i8 -1, i8 -1,
963 i8 -1, i8 -1, i8 -1, i8 -1,
964 i8 -1, i8 -1, i8 -1, i8 -1>
965 %5 = and <16 x i8> %1, %3
966 %6 = and <16 x i8> %2, %4
967 %7 = or <16 x i8> %5, %6
968 ; bmnz is the same operation
969 ; (vselect Mask, IfSet, IfClr) -> (BMNZ IfClr, IfSet, Mask)
970 store <16 x i8> %7, <16 x i8>* %c
974 define void @bsel_v16i8_i(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %m) nounwind {
975 ; CHECK-LABEL: bsel_v16i8_i:
977 ; CHECK-NEXT: ld.b $w0, 0($5)
978 ; CHECK-NEXT: ld.b $w1, 0($6)
979 ; CHECK-NEXT: bseli.b $w1, $w0, 6
981 ; CHECK-NEXT: st.b $w1, 0($4)
982 %1 = load <16 x i8>, <16 x i8>* %a
983 %2 = load <16 x i8>, <16 x i8>* %m
984 %3 = xor <16 x i8> %2, <i8 -1, i8 -1, i8 -1, i8 -1,
985 i8 -1, i8 -1, i8 -1, i8 -1,
986 i8 -1, i8 -1, i8 -1, i8 -1,
987 i8 -1, i8 -1, i8 -1, i8 -1>
988 %4 = and <16 x i8> %1, %3
989 %5 = and <16 x i8> <i8 6, i8 6, i8 6, i8 6,
990 i8 6, i8 6, i8 6, i8 6,
991 i8 6, i8 6, i8 6, i8 6,
992 i8 6, i8 6, i8 6, i8 6>, %2
993 %6 = or <16 x i8> %4, %5
994 store <16 x i8> %6, <16 x i8>* %c
998 define void @bsel_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
999 ; CHECK-LABEL: bsel_v8i16:
1001 ; CHECK-NEXT: ld.h $w0, 0($5)
1002 ; CHECK-NEXT: ld.h $w1, 0($6)
1003 ; CHECK-NEXT: ldi.h $w2, 6
1004 ; CHECK-NEXT: bsel.v $w2, $w1, $w0
1005 ; CHECK-NEXT: jr $ra
1006 ; CHECK-NEXT: st.h $w2, 0($4)
1007 %1 = load <8 x i16>, <8 x i16>* %a
1008 %2 = load <8 x i16>, <8 x i16>* %b
1009 %3 = and <8 x i16> %1, <i16 6, i16 6, i16 6, i16 6,
1010 i16 6, i16 6, i16 6, i16 6>
1011 %4 = and <8 x i16> %2, <i16 65529, i16 65529, i16 65529, i16 65529,
1012 i16 65529, i16 65529, i16 65529, i16 65529>
1013 %5 = or <8 x i16> %3, %4
1014 store <8 x i16> %5, <8 x i16>* %c
1018 define void @bsel_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
1019 ; CHECK-LABEL: bsel_v4i32:
1021 ; CHECK-NEXT: ld.w $w0, 0($5)
1022 ; CHECK-NEXT: ld.w $w1, 0($6)
1023 ; CHECK-NEXT: ldi.w $w2, 6
1024 ; CHECK-NEXT: bsel.v $w2, $w1, $w0
1025 ; CHECK-NEXT: jr $ra
1026 ; CHECK-NEXT: st.w $w2, 0($4)
1027 %1 = load <4 x i32>, <4 x i32>* %a
1028 %2 = load <4 x i32>, <4 x i32>* %b
1029 %3 = and <4 x i32> %1, <i32 6, i32 6, i32 6, i32 6>
1030 %4 = and <4 x i32> %2, <i32 4294967289, i32 4294967289, i32 4294967289, i32 4294967289>
1031 %5 = or <4 x i32> %3, %4
1032 store <4 x i32> %5, <4 x i32>* %c
1036 define void @bsel_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
1037 ; MIPS-LABEL: bsel_v2i64:
1039 ; MIPS-NEXT: ldi.d $w0, 6
1040 ; MIPS-NEXT: shf.w $w0, $w0, 177
1041 ; MIPS-NEXT: ld.d $w1, 0($5)
1042 ; MIPS-NEXT: ld.d $w2, 0($6)
1043 ; MIPS-NEXT: bsel.v $w0, $w2, $w1
1045 ; MIPS-NEXT: st.d $w0, 0($4)
1047 ; MIPSEL-LABEL: bsel_v2i64:
1049 ; MIPSEL-NEXT: ldi.d $w0, 6
1050 ; MIPSEL-NEXT: ld.d $w1, 0($5)
1051 ; MIPSEL-NEXT: ld.d $w2, 0($6)
1052 ; MIPSEL-NEXT: bsel.v $w0, $w2, $w1
1053 ; MIPSEL-NEXT: jr $ra
1054 ; MIPSEL-NEXT: st.d $w0, 0($4)
1055 %1 = load <2 x i64>, <2 x i64>* %a
1056 %2 = load <2 x i64>, <2 x i64>* %b
1057 %3 = and <2 x i64> %1, <i64 6, i64 6>
1058 %4 = and <2 x i64> %2, <i64 18446744073709551609, i64 18446744073709551609>
1059 %5 = or <2 x i64> %3, %4
1060 store <2 x i64> %5, <2 x i64>* %c
1064 define void @binsl_v16i8_i(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
1065 ; CHECK-LABEL: binsl_v16i8_i:
1067 ; CHECK-NEXT: ld.b $w0, 0($5)
1068 ; CHECK-NEXT: ld.b $w1, 0($6)
1069 ; CHECK-NEXT: binsli.b $w1, $w0, 1
1070 ; CHECK-NEXT: jr $ra
1071 ; CHECK-NEXT: st.b $w1, 0($4)
1072 %1 = load <16 x i8>, <16 x i8>* %a
1073 %2 = load <16 x i8>, <16 x i8>* %b
1074 %3 = and <16 x i8> %1, <i8 192, i8 192, i8 192, i8 192,
1075 i8 192, i8 192, i8 192, i8 192,
1076 i8 192, i8 192, i8 192, i8 192,
1077 i8 192, i8 192, i8 192, i8 192>
1078 %4 = and <16 x i8> %2, <i8 63, i8 63, i8 63, i8 63,
1079 i8 63, i8 63, i8 63, i8 63,
1080 i8 63, i8 63, i8 63, i8 63,
1081 i8 63, i8 63, i8 63, i8 63>
1082 %5 = or <16 x i8> %3, %4
1083 store <16 x i8> %5, <16 x i8>* %c
1087 define void @binsl_v8i16_i(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
1088 ; CHECK-LABEL: binsl_v8i16_i:
1090 ; CHECK-NEXT: ld.h $w0, 0($5)
1091 ; CHECK-NEXT: ld.h $w1, 0($6)
1092 ; CHECK-NEXT: binsli.h $w1, $w0, 1
1093 ; CHECK-NEXT: jr $ra
1094 ; CHECK-NEXT: st.h $w1, 0($4)
1095 %1 = load <8 x i16>, <8 x i16>* %a
1096 %2 = load <8 x i16>, <8 x i16>* %b
1097 %3 = and <8 x i16> %1, <i16 49152, i16 49152, i16 49152, i16 49152,
1098 i16 49152, i16 49152, i16 49152, i16 49152>
1099 %4 = and <8 x i16> %2, <i16 16383, i16 16383, i16 16383, i16 16383,
1100 i16 16383, i16 16383, i16 16383, i16 16383>
1101 %5 = or <8 x i16> %3, %4
1102 store <8 x i16> %5, <8 x i16>* %c
1106 define void @binsl_v4i32_i(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
1107 ; CHECK-LABEL: binsl_v4i32_i:
1109 ; CHECK-NEXT: ld.w $w0, 0($5)
1110 ; CHECK-NEXT: ld.w $w1, 0($6)
1111 ; CHECK-NEXT: binsli.w $w1, $w0, 1
1112 ; CHECK-NEXT: jr $ra
1113 ; CHECK-NEXT: st.w $w1, 0($4)
1114 %1 = load <4 x i32>, <4 x i32>* %a
1115 %2 = load <4 x i32>, <4 x i32>* %b
1116 %3 = and <4 x i32> %1, <i32 3221225472, i32 3221225472, i32 3221225472, i32 3221225472>
1117 %4 = and <4 x i32> %2, <i32 1073741823, i32 1073741823, i32 1073741823, i32 1073741823>
1118 %5 = or <4 x i32> %3, %4
1119 store <4 x i32> %5, <4 x i32>* %c
1123 define void @binsl_v2i64_i(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
1124 ; CHECK-LABEL: binsl_v2i64_i:
1126 ; CHECK-NEXT: ld.d $w0, 0($5)
1127 ; CHECK-NEXT: ld.d $w1, 0($6)
1128 ; CHECK-NEXT: binsli.d $w1, $w0, 60
1129 ; CHECK-NEXT: jr $ra
1130 ; CHECK-NEXT: st.d $w1, 0($4)
1131 %1 = load <2 x i64>, <2 x i64>* %a
1132 %2 = load <2 x i64>, <2 x i64>* %b
1133 %3 = and <2 x i64> %1, <i64 18446744073709551608, i64 18446744073709551608>
1134 %4 = and <2 x i64> %2, <i64 7, i64 7>
1135 %5 = or <2 x i64> %3, %4
1136 ; TODO: We use a particularly wide mask here to work around a legalization
1137 ; issue. If the mask doesn't fit within a 10-bit immediate, it gets
1138 ; legalized into a constant pool. We should add a test to cover the
1139 ; other cases once they correctly select binsli.d.
1140 store <2 x i64> %5, <2 x i64>* %c
1144 define void @binsr_v16i8_i(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
1145 ; CHECK-LABEL: binsr_v16i8_i:
1147 ; CHECK-NEXT: ld.b $w0, 0($5)
1148 ; CHECK-NEXT: ld.b $w1, 0($6)
1149 ; CHECK-NEXT: binsri.b $w1, $w0, 1
1150 ; CHECK-NEXT: jr $ra
1151 ; CHECK-NEXT: st.b $w1, 0($4)
1152 %1 = load <16 x i8>, <16 x i8>* %a
1153 %2 = load <16 x i8>, <16 x i8>* %b
1154 %3 = and <16 x i8> %1, <i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3,
1155 i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3, i8 3>
1156 %4 = and <16 x i8> %2, <i8 252, i8 252, i8 252, i8 252,
1157 i8 252, i8 252, i8 252, i8 252,
1158 i8 252, i8 252, i8 252, i8 252,
1159 i8 252, i8 252, i8 252, i8 252>
1160 %5 = or <16 x i8> %3, %4
1161 store <16 x i8> %5, <16 x i8>* %c
1165 define void @binsr_v8i16_i(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
1166 ; CHECK-LABEL: binsr_v8i16_i:
1168 ; CHECK-NEXT: ld.h $w0, 0($5)
1169 ; CHECK-NEXT: ld.h $w1, 0($6)
1170 ; CHECK-NEXT: binsri.h $w1, $w0, 1
1171 ; CHECK-NEXT: jr $ra
1172 ; CHECK-NEXT: st.h $w1, 0($4)
1173 %1 = load <8 x i16>, <8 x i16>* %a
1174 %2 = load <8 x i16>, <8 x i16>* %b
1175 %3 = and <8 x i16> %1, <i16 3, i16 3, i16 3, i16 3,
1176 i16 3, i16 3, i16 3, i16 3>
1177 %4 = and <8 x i16> %2, <i16 65532, i16 65532, i16 65532, i16 65532,
1178 i16 65532, i16 65532, i16 65532, i16 65532>
1179 %5 = or <8 x i16> %3, %4
1180 store <8 x i16> %5, <8 x i16>* %c
1184 define void @binsr_v4i32_i(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
1185 ; CHECK-LABEL: binsr_v4i32_i:
1187 ; CHECK-NEXT: ld.w $w0, 0($5)
1188 ; CHECK-NEXT: ld.w $w1, 0($6)
1189 ; CHECK-NEXT: binsri.w $w1, $w0, 1
1190 ; CHECK-NEXT: jr $ra
1191 ; CHECK-NEXT: st.w $w1, 0($4)
1192 %1 = load <4 x i32>, <4 x i32>* %a
1193 %2 = load <4 x i32>, <4 x i32>* %b
1194 %3 = and <4 x i32> %1, <i32 3, i32 3, i32 3, i32 3>
1195 %4 = and <4 x i32> %2, <i32 4294967292, i32 4294967292, i32 4294967292, i32 4294967292>
1196 %5 = or <4 x i32> %3, %4
1197 store <4 x i32> %5, <4 x i32>* %c
1201 define void @binsr_v2i64_i(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
1202 ; CHECK-LABEL: binsr_v2i64_i:
1204 ; CHECK-NEXT: ld.d $w0, 0($5)
1205 ; CHECK-NEXT: ld.d $w1, 0($6)
1206 ; CHECK-NEXT: binsri.d $w1, $w0, 1
1207 ; CHECK-NEXT: jr $ra
1208 ; CHECK-NEXT: st.d $w1, 0($4)
1209 %1 = load <2 x i64>, <2 x i64>* %a
1210 %2 = load <2 x i64>, <2 x i64>* %b
1211 %3 = and <2 x i64> %1, <i64 3, i64 3>
1212 %4 = and <2 x i64> %2, <i64 18446744073709551612, i64 18446744073709551612>
1213 %5 = or <2 x i64> %3, %4
1214 store <2 x i64> %5, <2 x i64>* %c
1218 define void @bclr_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
1219 ; CHECK-LABEL: bclr_v16i8:
1221 ; CHECK-NEXT: ld.b $w0, 0($6)
1222 ; CHECK-NEXT: ld.b $w1, 0($5)
1223 ; CHECK-NEXT: bclr.b $w0, $w1, $w0
1224 ; CHECK-NEXT: jr $ra
1225 ; CHECK-NEXT: st.b $w0, 0($4)
1226 %1 = load <16 x i8>, <16 x i8>* %a
1227 %2 = load <16 x i8>, <16 x i8>* %b
1228 %3 = shl <16 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>, %2
1229 %4 = xor <16 x i8> %3, <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>
1230 %5 = and <16 x i8> %1, %4
1231 store <16 x i8> %5, <16 x i8>* %c
1235 define void @bclr_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
1236 ; CHECK-LABEL: bclr_v8i16:
1238 ; CHECK-NEXT: ld.h $w0, 0($6)
1239 ; CHECK-NEXT: ld.h $w1, 0($5)
1240 ; CHECK-NEXT: bclr.h $w0, $w1, $w0
1241 ; CHECK-NEXT: jr $ra
1242 ; CHECK-NEXT: st.h $w0, 0($4)
1243 %1 = load <8 x i16>, <8 x i16>* %a
1244 %2 = load <8 x i16>, <8 x i16>* %b
1245 %3 = shl <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>, %2
1246 %4 = xor <8 x i16> %3, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
1247 %5 = and <8 x i16> %1, %4
1248 store <8 x i16> %5, <8 x i16>* %c
1252 define void @bclr_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
1253 ; CHECK-LABEL: bclr_v4i32:
1255 ; CHECK-NEXT: ld.w $w0, 0($6)
1256 ; CHECK-NEXT: ld.w $w1, 0($5)
1257 ; CHECK-NEXT: bclr.w $w0, $w1, $w0
1258 ; CHECK-NEXT: jr $ra
1259 ; CHECK-NEXT: st.w $w0, 0($4)
1260 %1 = load <4 x i32>, <4 x i32>* %a
1261 %2 = load <4 x i32>, <4 x i32>* %b
1262 %3 = shl <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %2
1263 %4 = xor <4 x i32> %3, <i32 -1, i32 -1, i32 -1, i32 -1>
1264 %5 = and <4 x i32> %1, %4
1265 store <4 x i32> %5, <4 x i32>* %c
1269 define void @bclr_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
1270 ; CHECK-LABEL: bclr_v2i64:
1272 ; CHECK-NEXT: ld.d $w0, 0($6)
1273 ; CHECK-NEXT: ld.d $w1, 0($5)
1274 ; CHECK-NEXT: bclr.d $w0, $w1, $w0
1275 ; CHECK-NEXT: jr $ra
1276 ; CHECK-NEXT: st.d $w0, 0($4)
1277 %1 = load <2 x i64>, <2 x i64>* %a
1278 %2 = load <2 x i64>, <2 x i64>* %b
1279 %3 = shl <2 x i64> <i64 1, i64 1>, %2
1280 %4 = xor <2 x i64> %3, <i64 -1, i64 -1>
1281 %5 = and <2 x i64> %1, %4
1282 store <2 x i64> %5, <2 x i64>* %c
1286 define void @bset_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
1287 ; CHECK-LABEL: bset_v16i8:
1289 ; CHECK-NEXT: ld.b $w0, 0($6)
1290 ; CHECK-NEXT: ld.b $w1, 0($5)
1291 ; CHECK-NEXT: bset.b $w0, $w1, $w0
1292 ; CHECK-NEXT: jr $ra
1293 ; CHECK-NEXT: st.b $w0, 0($4)
1294 %1 = load <16 x i8>, <16 x i8>* %a
1295 %2 = load <16 x i8>, <16 x i8>* %b
1296 %3 = shl <16 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>, %2
1297 %4 = or <16 x i8> %1, %3
1298 store <16 x i8> %4, <16 x i8>* %c
1302 define void @bset_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
1303 ; CHECK-LABEL: bset_v8i16:
1305 ; CHECK-NEXT: ld.h $w0, 0($6)
1306 ; CHECK-NEXT: ld.h $w1, 0($5)
1307 ; CHECK-NEXT: bset.h $w0, $w1, $w0
1308 ; CHECK-NEXT: jr $ra
1309 ; CHECK-NEXT: st.h $w0, 0($4)
1310 %1 = load <8 x i16>, <8 x i16>* %a
1311 %2 = load <8 x i16>, <8 x i16>* %b
1312 %3 = shl <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>, %2
1313 %4 = or <8 x i16> %1, %3
1314 store <8 x i16> %4, <8 x i16>* %c
1318 define void @bset_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
1319 ; CHECK-LABEL: bset_v4i32:
1321 ; CHECK-NEXT: ld.w $w0, 0($6)
1322 ; CHECK-NEXT: ld.w $w1, 0($5)
1323 ; CHECK-NEXT: bset.w $w0, $w1, $w0
1324 ; CHECK-NEXT: jr $ra
1325 ; CHECK-NEXT: st.w $w0, 0($4)
1326 %1 = load <4 x i32>, <4 x i32>* %a
1327 %2 = load <4 x i32>, <4 x i32>* %b
1328 %3 = shl <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %2
1329 %4 = or <4 x i32> %1, %3
1330 store <4 x i32> %4, <4 x i32>* %c
1334 define void @bset_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
1335 ; CHECK-LABEL: bset_v2i64:
1337 ; CHECK-NEXT: ld.d $w0, 0($6)
1338 ; CHECK-NEXT: ld.d $w1, 0($5)
1339 ; CHECK-NEXT: bset.d $w0, $w1, $w0
1340 ; CHECK-NEXT: jr $ra
1341 ; CHECK-NEXT: st.d $w0, 0($4)
1342 %1 = load <2 x i64>, <2 x i64>* %a
1343 %2 = load <2 x i64>, <2 x i64>* %b
1344 %3 = shl <2 x i64> <i64 1, i64 1>, %2
1345 %4 = or <2 x i64> %1, %3
1346 store <2 x i64> %4, <2 x i64>* %c
1350 define void @bneg_v16i8(<16 x i8>* %c, <16 x i8>* %a, <16 x i8>* %b) nounwind {
1351 ; CHECK-LABEL: bneg_v16i8:
1353 ; CHECK-NEXT: ld.b $w0, 0($6)
1354 ; CHECK-NEXT: ld.b $w1, 0($5)
1355 ; CHECK-NEXT: bneg.b $w0, $w1, $w0
1356 ; CHECK-NEXT: jr $ra
1357 ; CHECK-NEXT: st.b $w0, 0($4)
1358 %1 = load <16 x i8>, <16 x i8>* %a
1359 %2 = load <16 x i8>, <16 x i8>* %b
1360 %3 = shl <16 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>, %2
1361 %4 = xor <16 x i8> %1, %3
1362 store <16 x i8> %4, <16 x i8>* %c
1366 define void @bneg_v8i16(<8 x i16>* %c, <8 x i16>* %a, <8 x i16>* %b) nounwind {
1367 ; CHECK-LABEL: bneg_v8i16:
1369 ; CHECK-NEXT: ld.h $w0, 0($6)
1370 ; CHECK-NEXT: ld.h $w1, 0($5)
1371 ; CHECK-NEXT: bneg.h $w0, $w1, $w0
1372 ; CHECK-NEXT: jr $ra
1373 ; CHECK-NEXT: st.h $w0, 0($4)
1374 %1 = load <8 x i16>, <8 x i16>* %a
1375 %2 = load <8 x i16>, <8 x i16>* %b
1376 %3 = shl <8 x i16> <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1>, %2
1377 %4 = xor <8 x i16> %1, %3
1378 store <8 x i16> %4, <8 x i16>* %c
1382 define void @bneg_v4i32(<4 x i32>* %c, <4 x i32>* %a, <4 x i32>* %b) nounwind {
1383 ; CHECK-LABEL: bneg_v4i32:
1385 ; CHECK-NEXT: ld.w $w0, 0($6)
1386 ; CHECK-NEXT: ld.w $w1, 0($5)
1387 ; CHECK-NEXT: bneg.w $w0, $w1, $w0
1388 ; CHECK-NEXT: jr $ra
1389 ; CHECK-NEXT: st.w $w0, 0($4)
1390 %1 = load <4 x i32>, <4 x i32>* %a
1391 %2 = load <4 x i32>, <4 x i32>* %b
1392 %3 = shl <4 x i32> <i32 1, i32 1, i32 1, i32 1>, %2
1393 %4 = xor <4 x i32> %1, %3
1394 store <4 x i32> %4, <4 x i32>* %c
1398 define void @bneg_v2i64(<2 x i64>* %c, <2 x i64>* %a, <2 x i64>* %b) nounwind {
1399 ; CHECK-LABEL: bneg_v2i64:
1401 ; CHECK-NEXT: ld.d $w0, 0($6)
1402 ; CHECK-NEXT: ld.d $w1, 0($5)
1403 ; CHECK-NEXT: bneg.d $w0, $w1, $w0
1404 ; CHECK-NEXT: jr $ra
1405 ; CHECK-NEXT: st.d $w0, 0($4)
1406 %1 = load <2 x i64>, <2 x i64>* %a
1407 %2 = load <2 x i64>, <2 x i64>* %b
1408 %3 = shl <2 x i64> <i64 1, i64 1>, %2
1409 %4 = xor <2 x i64> %1, %3
1410 store <2 x i64> %4, <2 x i64>* %c
1414 define void @bclri_v16i8(<16 x i8>* %c, <16 x i8>* %a) nounwind {
1415 ; CHECK-LABEL: bclri_v16i8:
1417 ; CHECK-NEXT: ld.b $w0, 0($5)
1418 ; CHECK-NEXT: andi.b $w0, $w0, 247
1419 ; CHECK-NEXT: jr $ra
1420 ; CHECK-NEXT: st.b $w0, 0($4)
1421 %1 = load <16 x i8>, <16 x i8>* %a
1422 %2 = xor <16 x i8> <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>,
1423 <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>
1424 %3 = and <16 x i8> %1, %2
1425 ; bclri.b and andi.b are exactly equivalent.
1426 store <16 x i8> %3, <16 x i8>* %c
1430 define void @bclri_v8i16(<8 x i16>* %c, <8 x i16>* %a) nounwind {
1431 ; CHECK-LABEL: bclri_v8i16:
1433 ; CHECK-NEXT: ld.h $w0, 0($5)
1434 ; CHECK-NEXT: bclri.h $w0, $w0, 3
1435 ; CHECK-NEXT: jr $ra
1436 ; CHECK-NEXT: st.h $w0, 0($4)
1437 %1 = load <8 x i16>, <8 x i16>* %a
1438 %2 = xor <8 x i16> <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>,
1439 <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
1440 %3 = and <8 x i16> %1, %2
1441 store <8 x i16> %3, <8 x i16>* %c
1445 define void @bclri_v4i32(<4 x i32>* %c, <4 x i32>* %a) nounwind {
1446 ; CHECK-LABEL: bclri_v4i32:
1448 ; CHECK-NEXT: ld.w $w0, 0($5)
1449 ; CHECK-NEXT: bclri.w $w0, $w0, 3
1450 ; CHECK-NEXT: jr $ra
1451 ; CHECK-NEXT: st.w $w0, 0($4)
1452 %1 = load <4 x i32>, <4 x i32>* %a
1453 %2 = xor <4 x i32> <i32 8, i32 8, i32 8, i32 8>,
1454 <i32 -1, i32 -1, i32 -1, i32 -1>
1455 %3 = and <4 x i32> %1, %2
1456 store <4 x i32> %3, <4 x i32>* %c
1460 define void @bclri_v2i64(<2 x i64>* %c, <2 x i64>* %a) nounwind {
1461 ; CHECK-LABEL: bclri_v2i64:
1463 ; CHECK-NEXT: ld.d $w0, 0($5)
1464 ; CHECK-NEXT: bclri.d $w0, $w0, 3
1465 ; CHECK-NEXT: jr $ra
1466 ; CHECK-NEXT: st.d $w0, 0($4)
1467 %1 = load <2 x i64>, <2 x i64>* %a
1468 %2 = xor <2 x i64> <i64 8, i64 8>,
1470 %3 = and <2 x i64> %1, %2
1471 store <2 x i64> %3, <2 x i64>* %c
1475 define void @bseti_v16i8(<16 x i8>* %c, <16 x i8>* %a) nounwind {
1476 ; CHECK-LABEL: bseti_v16i8:
1478 ; CHECK-NEXT: ld.b $w0, 0($5)
1479 ; CHECK-NEXT: bseti.b $w0, $w0, 3
1480 ; CHECK-NEXT: jr $ra
1481 ; CHECK-NEXT: st.b $w0, 0($4)
1482 %1 = load <16 x i8>, <16 x i8>* %a
1483 %2 = or <16 x i8> %1, <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>
1484 store <16 x i8> %2, <16 x i8>* %c
1488 define void @bseti_v8i16(<8 x i16>* %c, <8 x i16>* %a) nounwind {
1489 ; CHECK-LABEL: bseti_v8i16:
1491 ; CHECK-NEXT: ld.h $w0, 0($5)
1492 ; CHECK-NEXT: bseti.h $w0, $w0, 3
1493 ; CHECK-NEXT: jr $ra
1494 ; CHECK-NEXT: st.h $w0, 0($4)
1495 %1 = load <8 x i16>, <8 x i16>* %a
1496 %2 = or <8 x i16> %1, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
1497 store <8 x i16> %2, <8 x i16>* %c
1501 define void @bseti_v4i32(<4 x i32>* %c, <4 x i32>* %a) nounwind {
1502 ; CHECK-LABEL: bseti_v4i32:
1504 ; CHECK-NEXT: ld.w $w0, 0($5)
1505 ; CHECK-NEXT: bseti.w $w0, $w0, 3
1506 ; CHECK-NEXT: jr $ra
1507 ; CHECK-NEXT: st.w $w0, 0($4)
1508 %1 = load <4 x i32>, <4 x i32>* %a
1509 %2 = or <4 x i32> %1, <i32 8, i32 8, i32 8, i32 8>
1510 store <4 x i32> %2, <4 x i32>* %c
1514 define void @bseti_v2i64(<2 x i64>* %c, <2 x i64>* %a) nounwind {
1515 ; CHECK-LABEL: bseti_v2i64:
1517 ; CHECK-NEXT: ld.d $w0, 0($5)
1518 ; CHECK-NEXT: bseti.d $w0, $w0, 3
1519 ; CHECK-NEXT: jr $ra
1520 ; CHECK-NEXT: st.d $w0, 0($4)
1521 %1 = load <2 x i64>, <2 x i64>* %a
1522 %2 = or <2 x i64> %1, <i64 8, i64 8>
1523 store <2 x i64> %2, <2 x i64>* %c
1527 define void @bnegi_v16i8(<16 x i8>* %c, <16 x i8>* %a) nounwind {
1528 ; CHECK-LABEL: bnegi_v16i8:
1530 ; CHECK-NEXT: ld.b $w0, 0($5)
1531 ; CHECK-NEXT: bnegi.b $w0, $w0, 3
1532 ; CHECK-NEXT: jr $ra
1533 ; CHECK-NEXT: st.b $w0, 0($4)
1534 %1 = load <16 x i8>, <16 x i8>* %a
1535 %2 = xor <16 x i8> %1, <i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8, i8 8>
1536 store <16 x i8> %2, <16 x i8>* %c
1540 define void @bnegi_v8i16(<8 x i16>* %c, <8 x i16>* %a) nounwind {
1541 ; CHECK-LABEL: bnegi_v8i16:
1543 ; CHECK-NEXT: ld.h $w0, 0($5)
1544 ; CHECK-NEXT: bnegi.h $w0, $w0, 3
1545 ; CHECK-NEXT: jr $ra
1546 ; CHECK-NEXT: st.h $w0, 0($4)
1547 %1 = load <8 x i16>, <8 x i16>* %a
1548 %2 = xor <8 x i16> %1, <i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8, i16 8>
1549 store <8 x i16> %2, <8 x i16>* %c
1553 define void @bnegi_v4i32(<4 x i32>* %c, <4 x i32>* %a) nounwind {
1554 ; CHECK-LABEL: bnegi_v4i32:
1556 ; CHECK-NEXT: ld.w $w0, 0($5)
1557 ; CHECK-NEXT: bnegi.w $w0, $w0, 3
1558 ; CHECK-NEXT: jr $ra
1559 ; CHECK-NEXT: st.w $w0, 0($4)
1560 %1 = load <4 x i32>, <4 x i32>* %a
1561 %2 = xor <4 x i32> %1, <i32 8, i32 8, i32 8, i32 8>
1562 store <4 x i32> %2, <4 x i32>* %c
1566 define void @bnegi_v2i64(<2 x i64>* %c, <2 x i64>* %a) nounwind {
1567 ; CHECK-LABEL: bnegi_v2i64:
1569 ; CHECK-NEXT: ld.d $w0, 0($5)
1570 ; CHECK-NEXT: bnegi.d $w0, $w0, 3
1571 ; CHECK-NEXT: jr $ra
1572 ; CHECK-NEXT: st.d $w0, 0($4)
1573 %1 = load <2 x i64>, <2 x i64>* %a
1574 %2 = xor <2 x i64> %1, <i64 8, i64 8>
1575 store <2 x i64> %2, <2 x i64>* %c
1579 declare <16 x i8> @llvm.ctpop.v16i8(<16 x i8> %val)
1580 declare <8 x i16> @llvm.ctpop.v8i16(<8 x i16> %val)
1581 declare <4 x i32> @llvm.ctpop.v4i32(<4 x i32> %val)
1582 declare <2 x i64> @llvm.ctpop.v2i64(<2 x i64> %val)
1583 declare <16 x i8> @llvm.ctlz.v16i8(<16 x i8> %val)
1584 declare <8 x i16> @llvm.ctlz.v8i16(<8 x i16> %val)
1585 declare <4 x i32> @llvm.ctlz.v4i32(<4 x i32> %val)
1586 declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64> %val)