1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV32
3 ; RUN: llc -mtriple=riscv64 -mattr=+v -verify-machineinstrs < %s | FileCheck %s --check-prefixes=CHECK,RV64
5 define void @add_v16i8(ptr %x, ptr %y) {
6 ; CHECK-LABEL: add_v16i8:
8 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
9 ; CHECK-NEXT: vle8.v v8, (a0)
10 ; CHECK-NEXT: vle8.v v9, (a1)
11 ; CHECK-NEXT: vadd.vv v8, v8, v9
12 ; CHECK-NEXT: vse8.v v8, (a0)
14 %a = load <16 x i8>, ptr %x
15 %b = load <16 x i8>, ptr %y
16 %c = add <16 x i8> %a, %b
17 store <16 x i8> %c, ptr %x
21 define void @add_v8i16(ptr %x, ptr %y) {
22 ; CHECK-LABEL: add_v8i16:
24 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
25 ; CHECK-NEXT: vle16.v v8, (a0)
26 ; CHECK-NEXT: vle16.v v9, (a1)
27 ; CHECK-NEXT: vadd.vv v8, v8, v9
28 ; CHECK-NEXT: vse16.v v8, (a0)
30 %a = load <8 x i16>, ptr %x
31 %b = load <8 x i16>, ptr %y
32 %c = add <8 x i16> %a, %b
33 store <8 x i16> %c, ptr %x
37 define void @add_v6i16(ptr %x, ptr %y) {
38 ; CHECK-LABEL: add_v6i16:
40 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
41 ; CHECK-NEXT: vle16.v v8, (a0)
42 ; CHECK-NEXT: vle16.v v9, (a1)
43 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
44 ; CHECK-NEXT: vadd.vv v8, v8, v9
45 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
46 ; CHECK-NEXT: vse16.v v8, (a0)
48 %a = load <6 x i16>, ptr %x
49 %b = load <6 x i16>, ptr %y
50 %c = add <6 x i16> %a, %b
51 store <6 x i16> %c, ptr %x
55 define void @add_v4i32(ptr %x, ptr %y) {
56 ; CHECK-LABEL: add_v4i32:
58 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
59 ; CHECK-NEXT: vle32.v v8, (a0)
60 ; CHECK-NEXT: vle32.v v9, (a1)
61 ; CHECK-NEXT: vadd.vv v8, v8, v9
62 ; CHECK-NEXT: vse32.v v8, (a0)
64 %a = load <4 x i32>, ptr %x
65 %b = load <4 x i32>, ptr %y
66 %c = add <4 x i32> %a, %b
67 store <4 x i32> %c, ptr %x
71 define void @add_v2i64(ptr %x, ptr %y) {
72 ; CHECK-LABEL: add_v2i64:
74 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
75 ; CHECK-NEXT: vle64.v v8, (a0)
76 ; CHECK-NEXT: vle64.v v9, (a1)
77 ; CHECK-NEXT: vadd.vv v8, v8, v9
78 ; CHECK-NEXT: vse64.v v8, (a0)
80 %a = load <2 x i64>, ptr %x
81 %b = load <2 x i64>, ptr %y
82 %c = add <2 x i64> %a, %b
83 store <2 x i64> %c, ptr %x
87 define void @sub_v16i8(ptr %x, ptr %y) {
88 ; CHECK-LABEL: sub_v16i8:
90 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
91 ; CHECK-NEXT: vle8.v v8, (a0)
92 ; CHECK-NEXT: vle8.v v9, (a1)
93 ; CHECK-NEXT: vsub.vv v8, v8, v9
94 ; CHECK-NEXT: vse8.v v8, (a0)
96 %a = load <16 x i8>, ptr %x
97 %b = load <16 x i8>, ptr %y
98 %c = sub <16 x i8> %a, %b
99 store <16 x i8> %c, ptr %x
103 define void @sub_v8i16(ptr %x, ptr %y) {
104 ; CHECK-LABEL: sub_v8i16:
106 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
107 ; CHECK-NEXT: vle16.v v8, (a0)
108 ; CHECK-NEXT: vle16.v v9, (a1)
109 ; CHECK-NEXT: vsub.vv v8, v8, v9
110 ; CHECK-NEXT: vse16.v v8, (a0)
112 %a = load <8 x i16>, ptr %x
113 %b = load <8 x i16>, ptr %y
114 %c = sub <8 x i16> %a, %b
115 store <8 x i16> %c, ptr %x
119 define void @sub_v6i16(ptr %x, ptr %y) {
120 ; CHECK-LABEL: sub_v6i16:
122 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
123 ; CHECK-NEXT: vle16.v v8, (a0)
124 ; CHECK-NEXT: vle16.v v9, (a1)
125 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
126 ; CHECK-NEXT: vsub.vv v8, v8, v9
127 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
128 ; CHECK-NEXT: vse16.v v8, (a0)
130 %a = load <6 x i16>, ptr %x
131 %b = load <6 x i16>, ptr %y
132 %c = sub <6 x i16> %a, %b
133 store <6 x i16> %c, ptr %x
137 define void @sub_v4i32(ptr %x, ptr %y) {
138 ; CHECK-LABEL: sub_v4i32:
140 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
141 ; CHECK-NEXT: vle32.v v8, (a0)
142 ; CHECK-NEXT: vle32.v v9, (a1)
143 ; CHECK-NEXT: vsub.vv v8, v8, v9
144 ; CHECK-NEXT: vse32.v v8, (a0)
146 %a = load <4 x i32>, ptr %x
147 %b = load <4 x i32>, ptr %y
148 %c = sub <4 x i32> %a, %b
149 store <4 x i32> %c, ptr %x
153 define void @sub_v2i64(ptr %x, ptr %y) {
154 ; CHECK-LABEL: sub_v2i64:
156 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
157 ; CHECK-NEXT: vle64.v v8, (a0)
158 ; CHECK-NEXT: vle64.v v9, (a1)
159 ; CHECK-NEXT: vsub.vv v8, v8, v9
160 ; CHECK-NEXT: vse64.v v8, (a0)
162 %a = load <2 x i64>, ptr %x
163 %b = load <2 x i64>, ptr %y
164 %c = sub <2 x i64> %a, %b
165 store <2 x i64> %c, ptr %x
169 define void @mul_v16i8(ptr %x, ptr %y) {
170 ; CHECK-LABEL: mul_v16i8:
172 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
173 ; CHECK-NEXT: vle8.v v8, (a0)
174 ; CHECK-NEXT: vle8.v v9, (a1)
175 ; CHECK-NEXT: vmul.vv v8, v8, v9
176 ; CHECK-NEXT: vse8.v v8, (a0)
178 %a = load <16 x i8>, ptr %x
179 %b = load <16 x i8>, ptr %y
180 %c = mul <16 x i8> %a, %b
181 store <16 x i8> %c, ptr %x
185 define void @mul_v8i16(ptr %x, ptr %y) {
186 ; CHECK-LABEL: mul_v8i16:
188 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
189 ; CHECK-NEXT: vle16.v v8, (a0)
190 ; CHECK-NEXT: vle16.v v9, (a1)
191 ; CHECK-NEXT: vmul.vv v8, v8, v9
192 ; CHECK-NEXT: vse16.v v8, (a0)
194 %a = load <8 x i16>, ptr %x
195 %b = load <8 x i16>, ptr %y
196 %c = mul <8 x i16> %a, %b
197 store <8 x i16> %c, ptr %x
201 define void @mul_v6i16(ptr %x, ptr %y) {
202 ; CHECK-LABEL: mul_v6i16:
204 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
205 ; CHECK-NEXT: vle16.v v8, (a0)
206 ; CHECK-NEXT: vle16.v v9, (a1)
207 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
208 ; CHECK-NEXT: vmul.vv v8, v8, v9
209 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
210 ; CHECK-NEXT: vse16.v v8, (a0)
212 %a = load <6 x i16>, ptr %x
213 %b = load <6 x i16>, ptr %y
214 %c = mul <6 x i16> %a, %b
215 store <6 x i16> %c, ptr %x
219 define void @mul_v4i32(ptr %x, ptr %y) {
220 ; CHECK-LABEL: mul_v4i32:
222 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
223 ; CHECK-NEXT: vle32.v v8, (a0)
224 ; CHECK-NEXT: vle32.v v9, (a1)
225 ; CHECK-NEXT: vmul.vv v8, v8, v9
226 ; CHECK-NEXT: vse32.v v8, (a0)
228 %a = load <4 x i32>, ptr %x
229 %b = load <4 x i32>, ptr %y
230 %c = mul <4 x i32> %a, %b
231 store <4 x i32> %c, ptr %x
235 define void @mul_v2i64(ptr %x, ptr %y) {
236 ; CHECK-LABEL: mul_v2i64:
238 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
239 ; CHECK-NEXT: vle64.v v8, (a0)
240 ; CHECK-NEXT: vle64.v v9, (a1)
241 ; CHECK-NEXT: vmul.vv v8, v8, v9
242 ; CHECK-NEXT: vse64.v v8, (a0)
244 %a = load <2 x i64>, ptr %x
245 %b = load <2 x i64>, ptr %y
246 %c = mul <2 x i64> %a, %b
247 store <2 x i64> %c, ptr %x
251 define void @and_v16i8(ptr %x, ptr %y) {
252 ; CHECK-LABEL: and_v16i8:
254 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
255 ; CHECK-NEXT: vle8.v v8, (a0)
256 ; CHECK-NEXT: vle8.v v9, (a1)
257 ; CHECK-NEXT: vand.vv v8, v8, v9
258 ; CHECK-NEXT: vse8.v v8, (a0)
260 %a = load <16 x i8>, ptr %x
261 %b = load <16 x i8>, ptr %y
262 %c = and <16 x i8> %a, %b
263 store <16 x i8> %c, ptr %x
267 define void @and_v8i16(ptr %x, ptr %y) {
268 ; CHECK-LABEL: and_v8i16:
270 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
271 ; CHECK-NEXT: vle16.v v8, (a0)
272 ; CHECK-NEXT: vle16.v v9, (a1)
273 ; CHECK-NEXT: vand.vv v8, v8, v9
274 ; CHECK-NEXT: vse16.v v8, (a0)
276 %a = load <8 x i16>, ptr %x
277 %b = load <8 x i16>, ptr %y
278 %c = and <8 x i16> %a, %b
279 store <8 x i16> %c, ptr %x
283 define void @and_v6i16(ptr %x, ptr %y) {
284 ; CHECK-LABEL: and_v6i16:
286 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
287 ; CHECK-NEXT: vle16.v v8, (a0)
288 ; CHECK-NEXT: vle16.v v9, (a1)
289 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
290 ; CHECK-NEXT: vand.vv v8, v8, v9
291 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
292 ; CHECK-NEXT: vse16.v v8, (a0)
294 %a = load <6 x i16>, ptr %x
295 %b = load <6 x i16>, ptr %y
296 %c = and <6 x i16> %a, %b
297 store <6 x i16> %c, ptr %x
301 define void @and_v4i32(ptr %x, ptr %y) {
302 ; CHECK-LABEL: and_v4i32:
304 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
305 ; CHECK-NEXT: vle32.v v8, (a0)
306 ; CHECK-NEXT: vle32.v v9, (a1)
307 ; CHECK-NEXT: vand.vv v8, v8, v9
308 ; CHECK-NEXT: vse32.v v8, (a0)
310 %a = load <4 x i32>, ptr %x
311 %b = load <4 x i32>, ptr %y
312 %c = and <4 x i32> %a, %b
313 store <4 x i32> %c, ptr %x
317 define void @and_v2i64(ptr %x, ptr %y) {
318 ; CHECK-LABEL: and_v2i64:
320 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
321 ; CHECK-NEXT: vle64.v v8, (a0)
322 ; CHECK-NEXT: vle64.v v9, (a1)
323 ; CHECK-NEXT: vand.vv v8, v8, v9
324 ; CHECK-NEXT: vse64.v v8, (a0)
326 %a = load <2 x i64>, ptr %x
327 %b = load <2 x i64>, ptr %y
328 %c = and <2 x i64> %a, %b
329 store <2 x i64> %c, ptr %x
333 define void @or_v16i8(ptr %x, ptr %y) {
334 ; CHECK-LABEL: or_v16i8:
336 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
337 ; CHECK-NEXT: vle8.v v8, (a0)
338 ; CHECK-NEXT: vle8.v v9, (a1)
339 ; CHECK-NEXT: vor.vv v8, v8, v9
340 ; CHECK-NEXT: vse8.v v8, (a0)
342 %a = load <16 x i8>, ptr %x
343 %b = load <16 x i8>, ptr %y
344 %c = or <16 x i8> %a, %b
345 store <16 x i8> %c, ptr %x
349 define void @or_v8i16(ptr %x, ptr %y) {
350 ; CHECK-LABEL: or_v8i16:
352 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
353 ; CHECK-NEXT: vle16.v v8, (a0)
354 ; CHECK-NEXT: vle16.v v9, (a1)
355 ; CHECK-NEXT: vor.vv v8, v8, v9
356 ; CHECK-NEXT: vse16.v v8, (a0)
358 %a = load <8 x i16>, ptr %x
359 %b = load <8 x i16>, ptr %y
360 %c = or <8 x i16> %a, %b
361 store <8 x i16> %c, ptr %x
365 define void @or_v6i16(ptr %x, ptr %y) {
366 ; CHECK-LABEL: or_v6i16:
368 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
369 ; CHECK-NEXT: vle16.v v8, (a0)
370 ; CHECK-NEXT: vle16.v v9, (a1)
371 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
372 ; CHECK-NEXT: vor.vv v8, v8, v9
373 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
374 ; CHECK-NEXT: vse16.v v8, (a0)
376 %a = load <6 x i16>, ptr %x
377 %b = load <6 x i16>, ptr %y
378 %c = or <6 x i16> %a, %b
379 store <6 x i16> %c, ptr %x
383 define void @or_v4i32(ptr %x, ptr %y) {
384 ; CHECK-LABEL: or_v4i32:
386 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
387 ; CHECK-NEXT: vle32.v v8, (a0)
388 ; CHECK-NEXT: vle32.v v9, (a1)
389 ; CHECK-NEXT: vor.vv v8, v8, v9
390 ; CHECK-NEXT: vse32.v v8, (a0)
392 %a = load <4 x i32>, ptr %x
393 %b = load <4 x i32>, ptr %y
394 %c = or <4 x i32> %a, %b
395 store <4 x i32> %c, ptr %x
399 define void @or_v2i64(ptr %x, ptr %y) {
400 ; CHECK-LABEL: or_v2i64:
402 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
403 ; CHECK-NEXT: vle64.v v8, (a0)
404 ; CHECK-NEXT: vle64.v v9, (a1)
405 ; CHECK-NEXT: vor.vv v8, v8, v9
406 ; CHECK-NEXT: vse64.v v8, (a0)
408 %a = load <2 x i64>, ptr %x
409 %b = load <2 x i64>, ptr %y
410 %c = or <2 x i64> %a, %b
411 store <2 x i64> %c, ptr %x
415 define void @xor_v16i8(ptr %x, ptr %y) {
416 ; CHECK-LABEL: xor_v16i8:
418 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
419 ; CHECK-NEXT: vle8.v v8, (a0)
420 ; CHECK-NEXT: vle8.v v9, (a1)
421 ; CHECK-NEXT: vxor.vv v8, v8, v9
422 ; CHECK-NEXT: vse8.v v8, (a0)
424 %a = load <16 x i8>, ptr %x
425 %b = load <16 x i8>, ptr %y
426 %c = xor <16 x i8> %a, %b
427 store <16 x i8> %c, ptr %x
431 define void @xor_v8i16(ptr %x, ptr %y) {
432 ; CHECK-LABEL: xor_v8i16:
434 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
435 ; CHECK-NEXT: vle16.v v8, (a0)
436 ; CHECK-NEXT: vle16.v v9, (a1)
437 ; CHECK-NEXT: vxor.vv v8, v8, v9
438 ; CHECK-NEXT: vse16.v v8, (a0)
440 %a = load <8 x i16>, ptr %x
441 %b = load <8 x i16>, ptr %y
442 %c = xor <8 x i16> %a, %b
443 store <8 x i16> %c, ptr %x
447 define void @xor_v6i16(ptr %x, ptr %y) {
448 ; CHECK-LABEL: xor_v6i16:
450 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
451 ; CHECK-NEXT: vle16.v v8, (a0)
452 ; CHECK-NEXT: vle16.v v9, (a1)
453 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
454 ; CHECK-NEXT: vxor.vv v8, v8, v9
455 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
456 ; CHECK-NEXT: vse16.v v8, (a0)
458 %a = load <6 x i16>, ptr %x
459 %b = load <6 x i16>, ptr %y
460 %c = xor <6 x i16> %a, %b
461 store <6 x i16> %c, ptr %x
465 define void @xor_v4i32(ptr %x, ptr %y) {
466 ; CHECK-LABEL: xor_v4i32:
468 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
469 ; CHECK-NEXT: vle32.v v8, (a0)
470 ; CHECK-NEXT: vle32.v v9, (a1)
471 ; CHECK-NEXT: vxor.vv v8, v8, v9
472 ; CHECK-NEXT: vse32.v v8, (a0)
474 %a = load <4 x i32>, ptr %x
475 %b = load <4 x i32>, ptr %y
476 %c = xor <4 x i32> %a, %b
477 store <4 x i32> %c, ptr %x
481 define void @xor_v2i64(ptr %x, ptr %y) {
482 ; CHECK-LABEL: xor_v2i64:
484 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
485 ; CHECK-NEXT: vle64.v v8, (a0)
486 ; CHECK-NEXT: vle64.v v9, (a1)
487 ; CHECK-NEXT: vxor.vv v8, v8, v9
488 ; CHECK-NEXT: vse64.v v8, (a0)
490 %a = load <2 x i64>, ptr %x
491 %b = load <2 x i64>, ptr %y
492 %c = xor <2 x i64> %a, %b
493 store <2 x i64> %c, ptr %x
497 define void @lshr_v16i8(ptr %x, ptr %y) {
498 ; CHECK-LABEL: lshr_v16i8:
500 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
501 ; CHECK-NEXT: vle8.v v8, (a0)
502 ; CHECK-NEXT: vle8.v v9, (a1)
503 ; CHECK-NEXT: vsrl.vv v8, v8, v9
504 ; CHECK-NEXT: vse8.v v8, (a0)
506 %a = load <16 x i8>, ptr %x
507 %b = load <16 x i8>, ptr %y
508 %c = lshr <16 x i8> %a, %b
509 store <16 x i8> %c, ptr %x
513 define void @lshr_v8i16(ptr %x, ptr %y) {
514 ; CHECK-LABEL: lshr_v8i16:
516 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
517 ; CHECK-NEXT: vle16.v v8, (a0)
518 ; CHECK-NEXT: vle16.v v9, (a1)
519 ; CHECK-NEXT: vsrl.vv v8, v8, v9
520 ; CHECK-NEXT: vse16.v v8, (a0)
522 %a = load <8 x i16>, ptr %x
523 %b = load <8 x i16>, ptr %y
524 %c = lshr <8 x i16> %a, %b
525 store <8 x i16> %c, ptr %x
529 define void @lshr_v6i16(ptr %x, ptr %y) {
530 ; CHECK-LABEL: lshr_v6i16:
532 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
533 ; CHECK-NEXT: vle16.v v8, (a0)
534 ; CHECK-NEXT: vle16.v v9, (a1)
535 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
536 ; CHECK-NEXT: vsrl.vv v8, v8, v9
537 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
538 ; CHECK-NEXT: vse16.v v8, (a0)
540 %a = load <6 x i16>, ptr %x
541 %b = load <6 x i16>, ptr %y
542 %c = lshr <6 x i16> %a, %b
543 store <6 x i16> %c, ptr %x
547 define void @lshr_v4i32(ptr %x, ptr %y) {
548 ; CHECK-LABEL: lshr_v4i32:
550 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
551 ; CHECK-NEXT: vle32.v v8, (a0)
552 ; CHECK-NEXT: vle32.v v9, (a1)
553 ; CHECK-NEXT: vsrl.vv v8, v8, v9
554 ; CHECK-NEXT: vse32.v v8, (a0)
556 %a = load <4 x i32>, ptr %x
557 %b = load <4 x i32>, ptr %y
558 %c = lshr <4 x i32> %a, %b
559 store <4 x i32> %c, ptr %x
563 define void @lshr_v2i64(ptr %x, ptr %y) {
564 ; CHECK-LABEL: lshr_v2i64:
566 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
567 ; CHECK-NEXT: vle64.v v8, (a0)
568 ; CHECK-NEXT: vle64.v v9, (a1)
569 ; CHECK-NEXT: vsrl.vv v8, v8, v9
570 ; CHECK-NEXT: vse64.v v8, (a0)
572 %a = load <2 x i64>, ptr %x
573 %b = load <2 x i64>, ptr %y
574 %c = lshr <2 x i64> %a, %b
575 store <2 x i64> %c, ptr %x
579 define void @ashr_v16i8(ptr %x, ptr %y) {
580 ; CHECK-LABEL: ashr_v16i8:
582 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
583 ; CHECK-NEXT: vle8.v v8, (a0)
584 ; CHECK-NEXT: vle8.v v9, (a1)
585 ; CHECK-NEXT: vsra.vv v8, v8, v9
586 ; CHECK-NEXT: vse8.v v8, (a0)
588 %a = load <16 x i8>, ptr %x
589 %b = load <16 x i8>, ptr %y
590 %c = ashr <16 x i8> %a, %b
591 store <16 x i8> %c, ptr %x
595 define void @ashr_v8i16(ptr %x, ptr %y) {
596 ; CHECK-LABEL: ashr_v8i16:
598 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
599 ; CHECK-NEXT: vle16.v v8, (a0)
600 ; CHECK-NEXT: vle16.v v9, (a1)
601 ; CHECK-NEXT: vsra.vv v8, v8, v9
602 ; CHECK-NEXT: vse16.v v8, (a0)
604 %a = load <8 x i16>, ptr %x
605 %b = load <8 x i16>, ptr %y
606 %c = ashr <8 x i16> %a, %b
607 store <8 x i16> %c, ptr %x
611 define void @ashr_v6i16(ptr %x, ptr %y) {
612 ; CHECK-LABEL: ashr_v6i16:
614 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
615 ; CHECK-NEXT: vle16.v v8, (a0)
616 ; CHECK-NEXT: vle16.v v9, (a1)
617 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
618 ; CHECK-NEXT: vsra.vv v8, v8, v9
619 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
620 ; CHECK-NEXT: vse16.v v8, (a0)
622 %a = load <6 x i16>, ptr %x
623 %b = load <6 x i16>, ptr %y
624 %c = ashr <6 x i16> %a, %b
625 store <6 x i16> %c, ptr %x
629 define void @ashr_v4i32(ptr %x, ptr %y) {
630 ; CHECK-LABEL: ashr_v4i32:
632 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
633 ; CHECK-NEXT: vle32.v v8, (a0)
634 ; CHECK-NEXT: vle32.v v9, (a1)
635 ; CHECK-NEXT: vsra.vv v8, v8, v9
636 ; CHECK-NEXT: vse32.v v8, (a0)
638 %a = load <4 x i32>, ptr %x
639 %b = load <4 x i32>, ptr %y
640 %c = ashr <4 x i32> %a, %b
641 store <4 x i32> %c, ptr %x
645 define void @ashr_v2i64(ptr %x, ptr %y) {
646 ; CHECK-LABEL: ashr_v2i64:
648 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
649 ; CHECK-NEXT: vle64.v v8, (a0)
650 ; CHECK-NEXT: vle64.v v9, (a1)
651 ; CHECK-NEXT: vsra.vv v8, v8, v9
652 ; CHECK-NEXT: vse64.v v8, (a0)
654 %a = load <2 x i64>, ptr %x
655 %b = load <2 x i64>, ptr %y
656 %c = ashr <2 x i64> %a, %b
657 store <2 x i64> %c, ptr %x
661 define void @shl_v16i8(ptr %x, ptr %y) {
662 ; CHECK-LABEL: shl_v16i8:
664 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
665 ; CHECK-NEXT: vle8.v v8, (a0)
666 ; CHECK-NEXT: vle8.v v9, (a1)
667 ; CHECK-NEXT: vsll.vv v8, v8, v9
668 ; CHECK-NEXT: vse8.v v8, (a0)
670 %a = load <16 x i8>, ptr %x
671 %b = load <16 x i8>, ptr %y
672 %c = shl <16 x i8> %a, %b
673 store <16 x i8> %c, ptr %x
677 define void @shl_v8i16(ptr %x, ptr %y) {
678 ; CHECK-LABEL: shl_v8i16:
680 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
681 ; CHECK-NEXT: vle16.v v8, (a0)
682 ; CHECK-NEXT: vle16.v v9, (a1)
683 ; CHECK-NEXT: vsll.vv v8, v8, v9
684 ; CHECK-NEXT: vse16.v v8, (a0)
686 %a = load <8 x i16>, ptr %x
687 %b = load <8 x i16>, ptr %y
688 %c = shl <8 x i16> %a, %b
689 store <8 x i16> %c, ptr %x
693 define void @shl_v6i16(ptr %x, ptr %y) {
694 ; CHECK-LABEL: shl_v6i16:
696 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
697 ; CHECK-NEXT: vle16.v v8, (a0)
698 ; CHECK-NEXT: vle16.v v9, (a1)
699 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
700 ; CHECK-NEXT: vsll.vv v8, v8, v9
701 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
702 ; CHECK-NEXT: vse16.v v8, (a0)
704 %a = load <6 x i16>, ptr %x
705 %b = load <6 x i16>, ptr %y
706 %c = shl <6 x i16> %a, %b
707 store <6 x i16> %c, ptr %x
711 define void @shl_v4i32(ptr %x, ptr %y) {
712 ; CHECK-LABEL: shl_v4i32:
714 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
715 ; CHECK-NEXT: vle32.v v8, (a0)
716 ; CHECK-NEXT: vle32.v v9, (a1)
717 ; CHECK-NEXT: vsll.vv v8, v8, v9
718 ; CHECK-NEXT: vse32.v v8, (a0)
720 %a = load <4 x i32>, ptr %x
721 %b = load <4 x i32>, ptr %y
722 %c = shl <4 x i32> %a, %b
723 store <4 x i32> %c, ptr %x
727 define void @shl_v2i64(ptr %x, ptr %y) {
728 ; CHECK-LABEL: shl_v2i64:
730 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
731 ; CHECK-NEXT: vle64.v v8, (a0)
732 ; CHECK-NEXT: vle64.v v9, (a1)
733 ; CHECK-NEXT: vsll.vv v8, v8, v9
734 ; CHECK-NEXT: vse64.v v8, (a0)
736 %a = load <2 x i64>, ptr %x
737 %b = load <2 x i64>, ptr %y
738 %c = shl <2 x i64> %a, %b
739 store <2 x i64> %c, ptr %x
743 define void @sdiv_v16i8(ptr %x, ptr %y) {
744 ; CHECK-LABEL: sdiv_v16i8:
746 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
747 ; CHECK-NEXT: vle8.v v8, (a0)
748 ; CHECK-NEXT: vle8.v v9, (a1)
749 ; CHECK-NEXT: vdiv.vv v8, v8, v9
750 ; CHECK-NEXT: vse8.v v8, (a0)
752 %a = load <16 x i8>, ptr %x
753 %b = load <16 x i8>, ptr %y
754 %c = sdiv <16 x i8> %a, %b
755 store <16 x i8> %c, ptr %x
759 define void @sdiv_v8i16(ptr %x, ptr %y) {
760 ; CHECK-LABEL: sdiv_v8i16:
762 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
763 ; CHECK-NEXT: vle16.v v8, (a0)
764 ; CHECK-NEXT: vle16.v v9, (a1)
765 ; CHECK-NEXT: vdiv.vv v8, v8, v9
766 ; CHECK-NEXT: vse16.v v8, (a0)
768 %a = load <8 x i16>, ptr %x
769 %b = load <8 x i16>, ptr %y
770 %c = sdiv <8 x i16> %a, %b
771 store <8 x i16> %c, ptr %x
775 define void @sdiv_v6i16(ptr %x, ptr %y) {
776 ; CHECK-LABEL: sdiv_v6i16:
778 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
779 ; CHECK-NEXT: vle16.v v8, (a1)
780 ; CHECK-NEXT: vle16.v v9, (a0)
781 ; CHECK-NEXT: vsetivli zero, 2, e16, m1, ta, ma
782 ; CHECK-NEXT: vslidedown.vi v10, v8, 4
783 ; CHECK-NEXT: vslidedown.vi v11, v9, 4
784 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
785 ; CHECK-NEXT: vdiv.vv v10, v11, v10
786 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
787 ; CHECK-NEXT: vdiv.vv v8, v9, v8
788 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
789 ; CHECK-NEXT: vslideup.vi v8, v10, 4
790 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
791 ; CHECK-NEXT: vse16.v v8, (a0)
793 %a = load <6 x i16>, ptr %x
794 %b = load <6 x i16>, ptr %y
795 %c = sdiv <6 x i16> %a, %b
796 store <6 x i16> %c, ptr %x
800 define void @sdiv_v4i32(ptr %x, ptr %y) {
801 ; CHECK-LABEL: sdiv_v4i32:
803 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
804 ; CHECK-NEXT: vle32.v v8, (a0)
805 ; CHECK-NEXT: vle32.v v9, (a1)
806 ; CHECK-NEXT: vdiv.vv v8, v8, v9
807 ; CHECK-NEXT: vse32.v v8, (a0)
809 %a = load <4 x i32>, ptr %x
810 %b = load <4 x i32>, ptr %y
811 %c = sdiv <4 x i32> %a, %b
812 store <4 x i32> %c, ptr %x
816 define void @sdiv_v2i64(ptr %x, ptr %y) {
817 ; CHECK-LABEL: sdiv_v2i64:
819 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
820 ; CHECK-NEXT: vle64.v v8, (a0)
821 ; CHECK-NEXT: vle64.v v9, (a1)
822 ; CHECK-NEXT: vdiv.vv v8, v8, v9
823 ; CHECK-NEXT: vse64.v v8, (a0)
825 %a = load <2 x i64>, ptr %x
826 %b = load <2 x i64>, ptr %y
827 %c = sdiv <2 x i64> %a, %b
828 store <2 x i64> %c, ptr %x
832 define void @srem_v16i8(ptr %x, ptr %y) {
833 ; CHECK-LABEL: srem_v16i8:
835 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
836 ; CHECK-NEXT: vle8.v v8, (a0)
837 ; CHECK-NEXT: vle8.v v9, (a1)
838 ; CHECK-NEXT: vrem.vv v8, v8, v9
839 ; CHECK-NEXT: vse8.v v8, (a0)
841 %a = load <16 x i8>, ptr %x
842 %b = load <16 x i8>, ptr %y
843 %c = srem <16 x i8> %a, %b
844 store <16 x i8> %c, ptr %x
848 define void @srem_v8i16(ptr %x, ptr %y) {
849 ; CHECK-LABEL: srem_v8i16:
851 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
852 ; CHECK-NEXT: vle16.v v8, (a0)
853 ; CHECK-NEXT: vle16.v v9, (a1)
854 ; CHECK-NEXT: vrem.vv v8, v8, v9
855 ; CHECK-NEXT: vse16.v v8, (a0)
857 %a = load <8 x i16>, ptr %x
858 %b = load <8 x i16>, ptr %y
859 %c = srem <8 x i16> %a, %b
860 store <8 x i16> %c, ptr %x
864 define void @srem_v6i16(ptr %x, ptr %y) {
865 ; CHECK-LABEL: srem_v6i16:
867 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
868 ; CHECK-NEXT: vle16.v v8, (a1)
869 ; CHECK-NEXT: vle16.v v9, (a0)
870 ; CHECK-NEXT: vsetivli zero, 2, e16, m1, ta, ma
871 ; CHECK-NEXT: vslidedown.vi v10, v8, 4
872 ; CHECK-NEXT: vslidedown.vi v11, v9, 4
873 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
874 ; CHECK-NEXT: vrem.vv v10, v11, v10
875 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
876 ; CHECK-NEXT: vrem.vv v8, v9, v8
877 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
878 ; CHECK-NEXT: vslideup.vi v8, v10, 4
879 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
880 ; CHECK-NEXT: vse16.v v8, (a0)
882 %a = load <6 x i16>, ptr %x
883 %b = load <6 x i16>, ptr %y
884 %c = srem <6 x i16> %a, %b
885 store <6 x i16> %c, ptr %x
889 define void @srem_v4i32(ptr %x, ptr %y) {
890 ; CHECK-LABEL: srem_v4i32:
892 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
893 ; CHECK-NEXT: vle32.v v8, (a0)
894 ; CHECK-NEXT: vle32.v v9, (a1)
895 ; CHECK-NEXT: vrem.vv v8, v8, v9
896 ; CHECK-NEXT: vse32.v v8, (a0)
898 %a = load <4 x i32>, ptr %x
899 %b = load <4 x i32>, ptr %y
900 %c = srem <4 x i32> %a, %b
901 store <4 x i32> %c, ptr %x
905 define void @srem_v2i64(ptr %x, ptr %y) {
906 ; CHECK-LABEL: srem_v2i64:
908 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
909 ; CHECK-NEXT: vle64.v v8, (a0)
910 ; CHECK-NEXT: vle64.v v9, (a1)
911 ; CHECK-NEXT: vrem.vv v8, v8, v9
912 ; CHECK-NEXT: vse64.v v8, (a0)
914 %a = load <2 x i64>, ptr %x
915 %b = load <2 x i64>, ptr %y
916 %c = srem <2 x i64> %a, %b
917 store <2 x i64> %c, ptr %x
921 define void @udiv_v16i8(ptr %x, ptr %y) {
922 ; CHECK-LABEL: udiv_v16i8:
924 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
925 ; CHECK-NEXT: vle8.v v8, (a0)
926 ; CHECK-NEXT: vle8.v v9, (a1)
927 ; CHECK-NEXT: vdivu.vv v8, v8, v9
928 ; CHECK-NEXT: vse8.v v8, (a0)
930 %a = load <16 x i8>, ptr %x
931 %b = load <16 x i8>, ptr %y
932 %c = udiv <16 x i8> %a, %b
933 store <16 x i8> %c, ptr %x
937 define void @udiv_v8i16(ptr %x, ptr %y) {
938 ; CHECK-LABEL: udiv_v8i16:
940 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
941 ; CHECK-NEXT: vle16.v v8, (a0)
942 ; CHECK-NEXT: vle16.v v9, (a1)
943 ; CHECK-NEXT: vdivu.vv v8, v8, v9
944 ; CHECK-NEXT: vse16.v v8, (a0)
946 %a = load <8 x i16>, ptr %x
947 %b = load <8 x i16>, ptr %y
948 %c = udiv <8 x i16> %a, %b
949 store <8 x i16> %c, ptr %x
953 define void @udiv_v6i16(ptr %x, ptr %y) {
954 ; CHECK-LABEL: udiv_v6i16:
956 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
957 ; CHECK-NEXT: vle16.v v8, (a1)
958 ; CHECK-NEXT: vle16.v v9, (a0)
959 ; CHECK-NEXT: vsetivli zero, 2, e16, m1, ta, ma
960 ; CHECK-NEXT: vslidedown.vi v10, v8, 4
961 ; CHECK-NEXT: vslidedown.vi v11, v9, 4
962 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
963 ; CHECK-NEXT: vdivu.vv v10, v11, v10
964 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
965 ; CHECK-NEXT: vdivu.vv v8, v9, v8
966 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
967 ; CHECK-NEXT: vslideup.vi v8, v10, 4
968 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
969 ; CHECK-NEXT: vse16.v v8, (a0)
971 %a = load <6 x i16>, ptr %x
972 %b = load <6 x i16>, ptr %y
973 %c = udiv <6 x i16> %a, %b
974 store <6 x i16> %c, ptr %x
978 define void @udiv_v4i32(ptr %x, ptr %y) {
979 ; CHECK-LABEL: udiv_v4i32:
981 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
982 ; CHECK-NEXT: vle32.v v8, (a0)
983 ; CHECK-NEXT: vle32.v v9, (a1)
984 ; CHECK-NEXT: vdivu.vv v8, v8, v9
985 ; CHECK-NEXT: vse32.v v8, (a0)
987 %a = load <4 x i32>, ptr %x
988 %b = load <4 x i32>, ptr %y
989 %c = udiv <4 x i32> %a, %b
990 store <4 x i32> %c, ptr %x
994 define void @udiv_v2i64(ptr %x, ptr %y) {
995 ; CHECK-LABEL: udiv_v2i64:
997 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
998 ; CHECK-NEXT: vle64.v v8, (a0)
999 ; CHECK-NEXT: vle64.v v9, (a1)
1000 ; CHECK-NEXT: vdivu.vv v8, v8, v9
1001 ; CHECK-NEXT: vse64.v v8, (a0)
1003 %a = load <2 x i64>, ptr %x
1004 %b = load <2 x i64>, ptr %y
1005 %c = udiv <2 x i64> %a, %b
1006 store <2 x i64> %c, ptr %x
1010 define void @urem_v16i8(ptr %x, ptr %y) {
1011 ; CHECK-LABEL: urem_v16i8:
1013 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1014 ; CHECK-NEXT: vle8.v v8, (a0)
1015 ; CHECK-NEXT: vle8.v v9, (a1)
1016 ; CHECK-NEXT: vremu.vv v8, v8, v9
1017 ; CHECK-NEXT: vse8.v v8, (a0)
1019 %a = load <16 x i8>, ptr %x
1020 %b = load <16 x i8>, ptr %y
1021 %c = urem <16 x i8> %a, %b
1022 store <16 x i8> %c, ptr %x
1026 define void @urem_v8i16(ptr %x, ptr %y) {
1027 ; CHECK-LABEL: urem_v8i16:
1029 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1030 ; CHECK-NEXT: vle16.v v8, (a0)
1031 ; CHECK-NEXT: vle16.v v9, (a1)
1032 ; CHECK-NEXT: vremu.vv v8, v8, v9
1033 ; CHECK-NEXT: vse16.v v8, (a0)
1035 %a = load <8 x i16>, ptr %x
1036 %b = load <8 x i16>, ptr %y
1037 %c = urem <8 x i16> %a, %b
1038 store <8 x i16> %c, ptr %x
1042 define void @urem_v6i16(ptr %x, ptr %y) {
1043 ; CHECK-LABEL: urem_v6i16:
1045 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1046 ; CHECK-NEXT: vle16.v v8, (a1)
1047 ; CHECK-NEXT: vle16.v v9, (a0)
1048 ; CHECK-NEXT: vsetivli zero, 2, e16, m1, ta, ma
1049 ; CHECK-NEXT: vslidedown.vi v10, v8, 4
1050 ; CHECK-NEXT: vslidedown.vi v11, v9, 4
1051 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
1052 ; CHECK-NEXT: vremu.vv v10, v11, v10
1053 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
1054 ; CHECK-NEXT: vremu.vv v8, v9, v8
1055 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1056 ; CHECK-NEXT: vslideup.vi v8, v10, 4
1057 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1058 ; CHECK-NEXT: vse16.v v8, (a0)
1060 %a = load <6 x i16>, ptr %x
1061 %b = load <6 x i16>, ptr %y
1062 %c = urem <6 x i16> %a, %b
1063 store <6 x i16> %c, ptr %x
1067 define void @urem_v4i32(ptr %x, ptr %y) {
1068 ; CHECK-LABEL: urem_v4i32:
1070 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1071 ; CHECK-NEXT: vle32.v v8, (a0)
1072 ; CHECK-NEXT: vle32.v v9, (a1)
1073 ; CHECK-NEXT: vremu.vv v8, v8, v9
1074 ; CHECK-NEXT: vse32.v v8, (a0)
1076 %a = load <4 x i32>, ptr %x
1077 %b = load <4 x i32>, ptr %y
1078 %c = urem <4 x i32> %a, %b
1079 store <4 x i32> %c, ptr %x
1083 define void @urem_v2i64(ptr %x, ptr %y) {
1084 ; CHECK-LABEL: urem_v2i64:
1086 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1087 ; CHECK-NEXT: vle64.v v8, (a0)
1088 ; CHECK-NEXT: vle64.v v9, (a1)
1089 ; CHECK-NEXT: vremu.vv v8, v8, v9
1090 ; CHECK-NEXT: vse64.v v8, (a0)
1092 %a = load <2 x i64>, ptr %x
1093 %b = load <2 x i64>, ptr %y
1094 %c = urem <2 x i64> %a, %b
1095 store <2 x i64> %c, ptr %x
1099 define void @mulhu_v16i8(ptr %x) {
1100 ; CHECK-LABEL: mulhu_v16i8:
1102 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
1103 ; CHECK-NEXT: vle8.v v9, (a0)
1104 ; CHECK-NEXT: lui a1, 3
1105 ; CHECK-NEXT: addi a1, a1, -2044
1106 ; CHECK-NEXT: vmv.s.x v0, a1
1107 ; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, ma
1108 ; CHECK-NEXT: vmv.v.i v10, 0
1109 ; CHECK-NEXT: lui a1, 1
1110 ; CHECK-NEXT: addi a2, a1, 32
1111 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, ma
1112 ; CHECK-NEXT: vmv.s.x v8, a2
1113 ; CHECK-NEXT: lui a2, %hi(.LCPI65_0)
1114 ; CHECK-NEXT: addi a2, a2, %lo(.LCPI65_0)
1115 ; CHECK-NEXT: vle8.v v11, (a2)
1116 ; CHECK-NEXT: li a2, -128
1117 ; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, ma
1118 ; CHECK-NEXT: vmerge.vxm v12, v10, a2, v0
1119 ; CHECK-NEXT: vmv1r.v v0, v8
1120 ; CHECK-NEXT: vmerge.vim v8, v10, 1, v0
1121 ; CHECK-NEXT: vsrl.vv v8, v9, v8
1122 ; CHECK-NEXT: vmulhu.vv v8, v8, v11
1123 ; CHECK-NEXT: vsub.vv v9, v9, v8
1124 ; CHECK-NEXT: vmulhu.vv v9, v9, v12
1125 ; CHECK-NEXT: vadd.vv v9, v9, v8
1126 ; CHECK-NEXT: li a2, 513
1127 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, ma
1128 ; CHECK-NEXT: vmv.s.x v0, a2
1129 ; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, ma
1130 ; CHECK-NEXT: vmv.v.i v8, 4
1131 ; CHECK-NEXT: vmerge.vim v10, v8, 1, v0
1132 ; CHECK-NEXT: addi a1, a1, 78
1133 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, ma
1134 ; CHECK-NEXT: vmv.s.x v0, a1
1135 ; CHECK-NEXT: lui a1, 8
1136 ; CHECK-NEXT: addi a1, a1, 304
1137 ; CHECK-NEXT: vmv.s.x v8, a1
1138 ; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, ma
1139 ; CHECK-NEXT: vmerge.vim v10, v10, 3, v0
1140 ; CHECK-NEXT: vmv1r.v v0, v8
1141 ; CHECK-NEXT: vmerge.vim v8, v10, 2, v0
1142 ; CHECK-NEXT: vsrl.vv v8, v9, v8
1143 ; CHECK-NEXT: vse8.v v8, (a0)
1145 %a = load <16 x i8>, ptr %x
1146 %b = udiv <16 x i8> %a, <i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25>
1147 store <16 x i8> %b, ptr %x
1151 define void @mulhu_v8i16(ptr %x) {
1152 ; CHECK-LABEL: mulhu_v8i16:
1154 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1155 ; CHECK-NEXT: vle16.v v8, (a0)
1156 ; CHECK-NEXT: vmv.v.i v9, 0
1157 ; CHECK-NEXT: lui a1, 1048568
1158 ; CHECK-NEXT: vmv.v.i v10, 0
1159 ; CHECK-NEXT: vsetvli zero, zero, e16, m1, tu, ma
1160 ; CHECK-NEXT: vmv.s.x v10, a1
1161 ; CHECK-NEXT: lui a1, %hi(.LCPI66_0)
1162 ; CHECK-NEXT: addi a1, a1, %lo(.LCPI66_0)
1163 ; CHECK-NEXT: vsetvli zero, zero, e16, m1, ta, ma
1164 ; CHECK-NEXT: vle16.v v11, (a1)
1165 ; CHECK-NEXT: vmv.v.i v12, 1
1166 ; CHECK-NEXT: vsetivli zero, 7, e16, m1, tu, ma
1167 ; CHECK-NEXT: vslideup.vi v9, v12, 6
1168 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1169 ; CHECK-NEXT: vsrl.vv v9, v8, v9
1170 ; CHECK-NEXT: vmulhu.vv v9, v9, v11
1171 ; CHECK-NEXT: vsub.vv v8, v8, v9
1172 ; CHECK-NEXT: vmulhu.vv v8, v8, v10
1173 ; CHECK-NEXT: vadd.vv v8, v8, v9
1174 ; CHECK-NEXT: li a1, 33
1175 ; CHECK-NEXT: vmv.s.x v0, a1
1176 ; CHECK-NEXT: vmv.v.i v9, 3
1177 ; CHECK-NEXT: vmerge.vim v9, v9, 2, v0
1178 ; CHECK-NEXT: vsetivli zero, 7, e16, m1, tu, ma
1179 ; CHECK-NEXT: vslideup.vi v9, v12, 6
1180 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1181 ; CHECK-NEXT: vsrl.vv v8, v8, v9
1182 ; CHECK-NEXT: vse16.v v8, (a0)
1184 %a = load <8 x i16>, ptr %x
1185 %b = udiv <8 x i16> %a, <i16 7, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>
1186 store <8 x i16> %b, ptr %x
1190 define void @mulhu_v6i16(ptr %x) {
1191 ; CHECK-LABEL: mulhu_v6i16:
1193 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1194 ; CHECK-NEXT: vle16.v v8, (a0)
1195 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
1196 ; CHECK-NEXT: vid.v v9
1197 ; CHECK-NEXT: vadd.vi v9, v9, 12
1198 ; CHECK-NEXT: vsetivli zero, 2, e16, m1, ta, ma
1199 ; CHECK-NEXT: vslidedown.vi v10, v8, 4
1200 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
1201 ; CHECK-NEXT: vdivu.vv v9, v10, v9
1202 ; CHECK-NEXT: lui a1, 45217
1203 ; CHECK-NEXT: addi a1, a1, -1785
1204 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1205 ; CHECK-NEXT: vmv.s.x v10, a1
1206 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
1207 ; CHECK-NEXT: vsext.vf2 v11, v10
1208 ; CHECK-NEXT: vdivu.vv v8, v8, v11
1209 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1210 ; CHECK-NEXT: vslideup.vi v8, v9, 4
1211 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1212 ; CHECK-NEXT: vse16.v v8, (a0)
1214 %a = load <6 x i16>, ptr %x
1215 %b = udiv <6 x i16> %a, <i16 7, i16 9, i16 10, i16 11, i16 12, i16 13>
1216 store <6 x i16> %b, ptr %x
1220 define void @mulhu_v4i32(ptr %x) {
1221 ; CHECK-LABEL: mulhu_v4i32:
1223 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1224 ; CHECK-NEXT: vle32.v v8, (a0)
1225 ; CHECK-NEXT: lui a1, %hi(.LCPI68_0)
1226 ; CHECK-NEXT: addi a1, a1, %lo(.LCPI68_0)
1227 ; CHECK-NEXT: vle32.v v9, (a1)
1228 ; CHECK-NEXT: lui a1, 524288
1229 ; CHECK-NEXT: vmv.s.x v10, a1
1230 ; CHECK-NEXT: vmv.v.i v11, 0
1231 ; CHECK-NEXT: vsetivli zero, 3, e32, m1, tu, ma
1232 ; CHECK-NEXT: vslideup.vi v11, v10, 2
1233 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1234 ; CHECK-NEXT: vmulhu.vv v9, v8, v9
1235 ; CHECK-NEXT: vsub.vv v8, v8, v9
1236 ; CHECK-NEXT: vmulhu.vv v8, v8, v11
1237 ; CHECK-NEXT: vadd.vv v8, v8, v9
1238 ; CHECK-NEXT: lui a1, 4128
1239 ; CHECK-NEXT: addi a1, a1, 514
1240 ; CHECK-NEXT: vmv.s.x v9, a1
1241 ; CHECK-NEXT: vsext.vf4 v10, v9
1242 ; CHECK-NEXT: vsrl.vv v8, v8, v10
1243 ; CHECK-NEXT: vse32.v v8, (a0)
1245 %a = load <4 x i32>, ptr %x
1246 %b = udiv <4 x i32> %a, <i32 5, i32 6, i32 7, i32 9>
1247 store <4 x i32> %b, ptr %x
1251 define void @mulhu_v2i64(ptr %x) {
1252 ; RV32-LABEL: mulhu_v2i64:
1254 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1255 ; RV32-NEXT: vle64.v v8, (a0)
1256 ; RV32-NEXT: lui a1, %hi(.LCPI69_0)
1257 ; RV32-NEXT: addi a1, a1, %lo(.LCPI69_0)
1258 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1259 ; RV32-NEXT: vle32.v v9, (a1)
1260 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1261 ; RV32-NEXT: vmulhu.vv v8, v8, v9
1262 ; RV32-NEXT: lui a1, 32
1263 ; RV32-NEXT: addi a1, a1, 1
1264 ; RV32-NEXT: vmv.s.x v9, a1
1265 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1266 ; RV32-NEXT: vsext.vf4 v10, v9
1267 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1268 ; RV32-NEXT: vsrl.vv v8, v8, v10
1269 ; RV32-NEXT: vse64.v v8, (a0)
1272 ; RV64-LABEL: mulhu_v2i64:
1274 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1275 ; RV64-NEXT: vle64.v v8, (a0)
1276 ; RV64-NEXT: lui a1, 838861
1277 ; RV64-NEXT: addiw a1, a1, -819
1278 ; RV64-NEXT: slli a2, a1, 32
1279 ; RV64-NEXT: add a1, a1, a2
1280 ; RV64-NEXT: vmv.v.x v9, a1
1281 ; RV64-NEXT: lui a1, 699051
1282 ; RV64-NEXT: addiw a1, a1, -1365
1283 ; RV64-NEXT: slli a2, a1, 32
1284 ; RV64-NEXT: add a1, a1, a2
1285 ; RV64-NEXT: vsetvli zero, zero, e64, m1, tu, ma
1286 ; RV64-NEXT: vmv.s.x v9, a1
1287 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, ma
1288 ; RV64-NEXT: vmulhu.vv v8, v8, v9
1289 ; RV64-NEXT: vid.v v9
1290 ; RV64-NEXT: vadd.vi v9, v9, 1
1291 ; RV64-NEXT: vsrl.vv v8, v8, v9
1292 ; RV64-NEXT: vse64.v v8, (a0)
1294 %a = load <2 x i64>, ptr %x
1295 %b = udiv <2 x i64> %a, <i64 3, i64 5>
1296 store <2 x i64> %b, ptr %x
1300 define void @mulhs_v16i8(ptr %x) {
1301 ; CHECK-LABEL: mulhs_v16i8:
1303 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1304 ; CHECK-NEXT: vle8.v v8, (a0)
1305 ; CHECK-NEXT: li a1, -123
1306 ; CHECK-NEXT: vmv.v.x v9, a1
1307 ; CHECK-NEXT: lui a1, 5
1308 ; CHECK-NEXT: addi a1, a1, -1452
1309 ; CHECK-NEXT: vsetvli zero, zero, e16, m2, ta, ma
1310 ; CHECK-NEXT: vmv.s.x v0, a1
1311 ; CHECK-NEXT: li a1, 57
1312 ; CHECK-NEXT: vsetvli zero, zero, e8, m1, ta, ma
1313 ; CHECK-NEXT: vmerge.vxm v9, v9, a1, v0
1314 ; CHECK-NEXT: vmulhu.vv v8, v8, v9
1315 ; CHECK-NEXT: vmv.v.i v9, 7
1316 ; CHECK-NEXT: vmerge.vim v9, v9, 1, v0
1317 ; CHECK-NEXT: vsrl.vv v8, v8, v9
1318 ; CHECK-NEXT: vse8.v v8, (a0)
1320 %a = load <16 x i8>, ptr %x
1321 %b = udiv <16 x i8> %a, <i8 -9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 -9, i8 9, i8 -9>
1322 store <16 x i8> %b, ptr %x
1326 define void @mulhs_v8i16(ptr %x) {
1327 ; CHECK-LABEL: mulhs_v8i16:
1329 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1330 ; CHECK-NEXT: vle16.v v8, (a0)
1331 ; CHECK-NEXT: lui a1, 5
1332 ; CHECK-NEXT: addi a1, a1, -1755
1333 ; CHECK-NEXT: vmv.v.x v9, a1
1334 ; CHECK-NEXT: li a1, 105
1335 ; CHECK-NEXT: vmv.s.x v0, a1
1336 ; CHECK-NEXT: lui a1, 1048571
1337 ; CHECK-NEXT: addi a1, a1, 1755
1338 ; CHECK-NEXT: vmerge.vxm v9, v9, a1, v0
1339 ; CHECK-NEXT: vmulh.vv v8, v8, v9
1340 ; CHECK-NEXT: vsra.vi v8, v8, 1
1341 ; CHECK-NEXT: vsrl.vi v9, v8, 15
1342 ; CHECK-NEXT: vadd.vv v8, v8, v9
1343 ; CHECK-NEXT: vse16.v v8, (a0)
1345 %a = load <8 x i16>, ptr %x
1346 %b = sdiv <8 x i16> %a, <i16 -7, i16 7, i16 7, i16 -7, i16 7, i16 -7, i16 -7, i16 7>
1347 store <8 x i16> %b, ptr %x
1351 define void @mulhs_v6i16(ptr %x) {
1352 ; CHECK-LABEL: mulhs_v6i16:
1354 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1355 ; CHECK-NEXT: vle16.v v8, (a0)
1356 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
1357 ; CHECK-NEXT: vmv.v.i v9, 7
1358 ; CHECK-NEXT: vid.v v10
1359 ; CHECK-NEXT: li a1, -14
1360 ; CHECK-NEXT: vmadd.vx v10, a1, v9
1361 ; CHECK-NEXT: vsetivli zero, 2, e16, m1, ta, ma
1362 ; CHECK-NEXT: vslidedown.vi v9, v8, 4
1363 ; CHECK-NEXT: vsetivli zero, 2, e16, mf4, ta, ma
1364 ; CHECK-NEXT: vdiv.vv v9, v9, v10
1365 ; CHECK-NEXT: lui a1, 1020016
1366 ; CHECK-NEXT: addi a1, a1, 2041
1367 ; CHECK-NEXT: vsetvli zero, zero, e32, mf2, ta, ma
1368 ; CHECK-NEXT: vmv.s.x v10, a1
1369 ; CHECK-NEXT: vsetivli zero, 4, e16, mf2, ta, ma
1370 ; CHECK-NEXT: vsext.vf2 v11, v10
1371 ; CHECK-NEXT: vdiv.vv v8, v8, v11
1372 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1373 ; CHECK-NEXT: vslideup.vi v8, v9, 4
1374 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1375 ; CHECK-NEXT: vse16.v v8, (a0)
1377 %a = load <6 x i16>, ptr %x
1378 %b = sdiv <6 x i16> %a, <i16 -7, i16 7, i16 7, i16 -7, i16 7, i16 -7>
1379 store <6 x i16> %b, ptr %x
1383 define void @mulhs_v4i32(ptr %x) {
1384 ; RV32-LABEL: mulhs_v4i32:
1386 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1387 ; RV32-NEXT: vle32.v v8, (a0)
1388 ; RV32-NEXT: lui a1, 419430
1389 ; RV32-NEXT: addi a1, a1, 1639
1390 ; RV32-NEXT: vmv.v.x v9, a1
1391 ; RV32-NEXT: vmv.v.i v0, 5
1392 ; RV32-NEXT: lui a1, 629146
1393 ; RV32-NEXT: addi a1, a1, -1639
1394 ; RV32-NEXT: vmerge.vxm v9, v9, a1, v0
1395 ; RV32-NEXT: vmulh.vv v8, v8, v9
1396 ; RV32-NEXT: vsrl.vi v9, v8, 31
1397 ; RV32-NEXT: vsra.vi v8, v8, 1
1398 ; RV32-NEXT: vadd.vv v8, v8, v9
1399 ; RV32-NEXT: vse32.v v8, (a0)
1402 ; RV64-LABEL: mulhs_v4i32:
1404 ; RV64-NEXT: lui a1, %hi(.LCPI73_0)
1405 ; RV64-NEXT: ld a1, %lo(.LCPI73_0)(a1)
1406 ; RV64-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1407 ; RV64-NEXT: vle32.v v8, (a0)
1408 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1409 ; RV64-NEXT: vmv.v.x v9, a1
1410 ; RV64-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1411 ; RV64-NEXT: vmulh.vv v8, v8, v9
1412 ; RV64-NEXT: vsra.vi v8, v8, 1
1413 ; RV64-NEXT: vsrl.vi v9, v8, 31
1414 ; RV64-NEXT: vadd.vv v8, v8, v9
1415 ; RV64-NEXT: vse32.v v8, (a0)
1417 %a = load <4 x i32>, ptr %x
1418 %b = sdiv <4 x i32> %a, <i32 -5, i32 5, i32 -5, i32 5>
1419 store <4 x i32> %b, ptr %x
1423 define void @mulhs_v2i64(ptr %x) {
1424 ; RV32-LABEL: mulhs_v2i64:
1426 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1427 ; RV32-NEXT: vle64.v v8, (a0)
1428 ; RV32-NEXT: lui a1, 349525
1429 ; RV32-NEXT: addi a2, a1, 1365
1430 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1431 ; RV32-NEXT: vmv.v.x v9, a2
1432 ; RV32-NEXT: addi a1, a1, 1366
1433 ; RV32-NEXT: vsetvli zero, zero, e32, m1, tu, ma
1434 ; RV32-NEXT: vmv.s.x v9, a1
1435 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1436 ; RV32-NEXT: vmulh.vv v9, v8, v9
1437 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1438 ; RV32-NEXT: vid.v v10
1439 ; RV32-NEXT: vsrl.vi v10, v10, 1
1440 ; RV32-NEXT: vrsub.vi v10, v10, 0
1441 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1442 ; RV32-NEXT: vmadd.vv v10, v8, v9
1443 ; RV32-NEXT: li a1, 63
1444 ; RV32-NEXT: vsrl.vx v8, v10, a1
1445 ; RV32-NEXT: lui a1, 16
1446 ; RV32-NEXT: vmv.s.x v9, a1
1447 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1448 ; RV32-NEXT: vsext.vf4 v11, v9
1449 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1450 ; RV32-NEXT: vsra.vv v9, v10, v11
1451 ; RV32-NEXT: vadd.vv v8, v9, v8
1452 ; RV32-NEXT: vse64.v v8, (a0)
1455 ; RV64-LABEL: mulhs_v2i64:
1457 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1458 ; RV64-NEXT: vle64.v v8, (a0)
1459 ; RV64-NEXT: lui a1, 349525
1460 ; RV64-NEXT: addiw a1, a1, 1365
1461 ; RV64-NEXT: lui a2, %hi(.LCPI74_0)
1462 ; RV64-NEXT: ld a2, %lo(.LCPI74_0)(a2)
1463 ; RV64-NEXT: slli a3, a1, 32
1464 ; RV64-NEXT: add a1, a1, a3
1465 ; RV64-NEXT: vmv.v.x v9, a1
1466 ; RV64-NEXT: vsetvli zero, zero, e64, m1, tu, ma
1467 ; RV64-NEXT: vmv.s.x v9, a2
1468 ; RV64-NEXT: vsetvli zero, zero, e64, m1, ta, ma
1469 ; RV64-NEXT: vmulh.vv v9, v8, v9
1470 ; RV64-NEXT: vid.v v10
1471 ; RV64-NEXT: vrsub.vi v11, v10, 0
1472 ; RV64-NEXT: vmadd.vv v11, v8, v9
1473 ; RV64-NEXT: li a1, 63
1474 ; RV64-NEXT: vsrl.vx v8, v11, a1
1475 ; RV64-NEXT: vsra.vv v9, v11, v10
1476 ; RV64-NEXT: vadd.vv v8, v9, v8
1477 ; RV64-NEXT: vse64.v v8, (a0)
1479 %a = load <2 x i64>, ptr %x
1480 %b = sdiv <2 x i64> %a, <i64 3, i64 -3>
1481 store <2 x i64> %b, ptr %x
1485 define void @smin_v16i8(ptr %x, ptr %y) {
1486 ; CHECK-LABEL: smin_v16i8:
1488 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1489 ; CHECK-NEXT: vle8.v v8, (a0)
1490 ; CHECK-NEXT: vle8.v v9, (a1)
1491 ; CHECK-NEXT: vmin.vv v8, v8, v9
1492 ; CHECK-NEXT: vse8.v v8, (a0)
1494 %a = load <16 x i8>, ptr %x
1495 %b = load <16 x i8>, ptr %y
1496 %cc = icmp slt <16 x i8> %a, %b
1497 %c = select <16 x i1> %cc, <16 x i8> %a, <16 x i8> %b
1498 store <16 x i8> %c, ptr %x
1502 define void @smin_v8i16(ptr %x, ptr %y) {
1503 ; CHECK-LABEL: smin_v8i16:
1505 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1506 ; CHECK-NEXT: vle16.v v8, (a0)
1507 ; CHECK-NEXT: vle16.v v9, (a1)
1508 ; CHECK-NEXT: vmin.vv v8, v8, v9
1509 ; CHECK-NEXT: vse16.v v8, (a0)
1511 %a = load <8 x i16>, ptr %x
1512 %b = load <8 x i16>, ptr %y
1513 %cc = icmp slt <8 x i16> %a, %b
1514 %c = select <8 x i1> %cc, <8 x i16> %a, <8 x i16> %b
1515 store <8 x i16> %c, ptr %x
1519 define void @smin_v6i16(ptr %x, ptr %y) {
1520 ; CHECK-LABEL: smin_v6i16:
1522 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1523 ; CHECK-NEXT: vle16.v v8, (a0)
1524 ; CHECK-NEXT: vle16.v v9, (a1)
1525 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1526 ; CHECK-NEXT: vmin.vv v8, v8, v9
1527 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1528 ; CHECK-NEXT: vse16.v v8, (a0)
1530 %a = load <6 x i16>, ptr %x
1531 %b = load <6 x i16>, ptr %y
1532 %cc = icmp slt <6 x i16> %a, %b
1533 %c = select <6 x i1> %cc, <6 x i16> %a, <6 x i16> %b
1534 store <6 x i16> %c, ptr %x
1538 define void @smin_v4i32(ptr %x, ptr %y) {
1539 ; CHECK-LABEL: smin_v4i32:
1541 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1542 ; CHECK-NEXT: vle32.v v8, (a0)
1543 ; CHECK-NEXT: vle32.v v9, (a1)
1544 ; CHECK-NEXT: vmin.vv v8, v8, v9
1545 ; CHECK-NEXT: vse32.v v8, (a0)
1547 %a = load <4 x i32>, ptr %x
1548 %b = load <4 x i32>, ptr %y
1549 %cc = icmp slt <4 x i32> %a, %b
1550 %c = select <4 x i1> %cc, <4 x i32> %a, <4 x i32> %b
1551 store <4 x i32> %c, ptr %x
1555 define void @smin_v2i64(ptr %x, ptr %y) {
1556 ; CHECK-LABEL: smin_v2i64:
1558 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1559 ; CHECK-NEXT: vle64.v v8, (a0)
1560 ; CHECK-NEXT: vle64.v v9, (a1)
1561 ; CHECK-NEXT: vmin.vv v8, v8, v9
1562 ; CHECK-NEXT: vse64.v v8, (a0)
1564 %a = load <2 x i64>, ptr %x
1565 %b = load <2 x i64>, ptr %y
1566 %cc = icmp slt <2 x i64> %a, %b
1567 %c = select <2 x i1> %cc, <2 x i64> %a, <2 x i64> %b
1568 store <2 x i64> %c, ptr %x
1572 define void @smin_vx_v16i8(ptr %x, i8 %y) {
1573 ; CHECK-LABEL: smin_vx_v16i8:
1575 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1576 ; CHECK-NEXT: vle8.v v8, (a0)
1577 ; CHECK-NEXT: vmin.vx v8, v8, a1
1578 ; CHECK-NEXT: vse8.v v8, (a0)
1580 %a = load <16 x i8>, ptr %x
1581 %b = insertelement <16 x i8> poison, i8 %y, i32 0
1582 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
1583 %d = call <16 x i8> @llvm.smin.v16i8(<16 x i8> %a, <16 x i8> %c)
1584 store <16 x i8> %d, ptr %x
1587 declare <16 x i8> @llvm.smin.v16i8(<16 x i8>, <16 x i8>)
1589 define void @smin_vx_v8i16(ptr %x, i16 %y) {
1590 ; CHECK-LABEL: smin_vx_v8i16:
1592 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1593 ; CHECK-NEXT: vle16.v v8, (a0)
1594 ; CHECK-NEXT: vmin.vx v8, v8, a1
1595 ; CHECK-NEXT: vse16.v v8, (a0)
1597 %a = load <8 x i16>, ptr %x
1598 %b = insertelement <8 x i16> poison, i16 %y, i32 0
1599 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
1600 %d = call <8 x i16> @llvm.smin.v8i16(<8 x i16> %a, <8 x i16> %c)
1601 store <8 x i16> %d, ptr %x
1604 declare <8 x i16> @llvm.smin.v8i16(<8 x i16>, <8 x i16>)
1606 define void @smin_vx_v6i16(ptr %x, i16 %y) {
1607 ; CHECK-LABEL: smin_vx_v6i16:
1609 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1610 ; CHECK-NEXT: vle16.v v8, (a0)
1611 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1612 ; CHECK-NEXT: vmin.vx v8, v8, a1
1613 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1614 ; CHECK-NEXT: vse16.v v8, (a0)
1616 %a = load <6 x i16>, ptr %x
1617 %b = insertelement <6 x i16> poison, i16 %y, i32 0
1618 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
1619 %d = call <6 x i16> @llvm.smin.v6i16(<6 x i16> %a, <6 x i16> %c)
1620 store <6 x i16> %d, ptr %x
1623 declare <6 x i16> @llvm.smin.v6i16(<6 x i16>, <6 x i16>)
1625 define void @smin_vx_v4i32(ptr %x, i32 %y) {
1626 ; CHECK-LABEL: smin_vx_v4i32:
1628 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1629 ; CHECK-NEXT: vle32.v v8, (a0)
1630 ; CHECK-NEXT: vmin.vx v8, v8, a1
1631 ; CHECK-NEXT: vse32.v v8, (a0)
1633 %a = load <4 x i32>, ptr %x
1634 %b = insertelement <4 x i32> poison, i32 %y, i32 0
1635 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
1636 %d = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %a, <4 x i32> %c)
1637 store <4 x i32> %d, ptr %x
1640 declare <4 x i32> @llvm.smin.v4i32(<4 x i32>, <4 x i32>)
1642 define void @smin_xv_v16i8(ptr %x, i8 %y) {
1643 ; CHECK-LABEL: smin_xv_v16i8:
1645 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1646 ; CHECK-NEXT: vle8.v v8, (a0)
1647 ; CHECK-NEXT: vmin.vx v8, v8, a1
1648 ; CHECK-NEXT: vse8.v v8, (a0)
1650 %a = load <16 x i8>, ptr %x
1651 %b = insertelement <16 x i8> poison, i8 %y, i32 0
1652 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
1653 %d = call <16 x i8> @llvm.smin.v16i8(<16 x i8> %c, <16 x i8> %a)
1654 store <16 x i8> %d, ptr %x
1658 define void @smin_xv_v8i16(ptr %x, i16 %y) {
1659 ; CHECK-LABEL: smin_xv_v8i16:
1661 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1662 ; CHECK-NEXT: vle16.v v8, (a0)
1663 ; CHECK-NEXT: vmin.vx v8, v8, a1
1664 ; CHECK-NEXT: vse16.v v8, (a0)
1666 %a = load <8 x i16>, ptr %x
1667 %b = insertelement <8 x i16> poison, i16 %y, i32 0
1668 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
1669 %d = call <8 x i16> @llvm.smin.v8i16(<8 x i16> %c, <8 x i16> %a)
1670 store <8 x i16> %d, ptr %x
1674 define void @smin_xv_v6i16(ptr %x, i16 %y) {
1675 ; CHECK-LABEL: smin_xv_v6i16:
1677 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1678 ; CHECK-NEXT: vle16.v v8, (a0)
1679 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1680 ; CHECK-NEXT: vmin.vx v8, v8, a1
1681 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1682 ; CHECK-NEXT: vse16.v v8, (a0)
1684 %a = load <6 x i16>, ptr %x
1685 %b = insertelement <6 x i16> poison, i16 %y, i32 0
1686 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
1687 %d = call <6 x i16> @llvm.smin.v6i16(<6 x i16> %c, <6 x i16> %a)
1688 store <6 x i16> %d, ptr %x
1692 define void @smin_xv_v4i32(ptr %x, i32 %y) {
1693 ; CHECK-LABEL: smin_xv_v4i32:
1695 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1696 ; CHECK-NEXT: vle32.v v8, (a0)
1697 ; CHECK-NEXT: vmin.vx v8, v8, a1
1698 ; CHECK-NEXT: vse32.v v8, (a0)
1700 %a = load <4 x i32>, ptr %x
1701 %b = insertelement <4 x i32> poison, i32 %y, i32 0
1702 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
1703 %d = call <4 x i32> @llvm.smin.v4i32(<4 x i32> %c, <4 x i32> %a)
1704 store <4 x i32> %d, ptr %x
1708 define void @smax_v16i8(ptr %x, ptr %y) {
1709 ; CHECK-LABEL: smax_v16i8:
1711 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1712 ; CHECK-NEXT: vle8.v v8, (a0)
1713 ; CHECK-NEXT: vle8.v v9, (a1)
1714 ; CHECK-NEXT: vmax.vv v8, v8, v9
1715 ; CHECK-NEXT: vse8.v v8, (a0)
1717 %a = load <16 x i8>, ptr %x
1718 %b = load <16 x i8>, ptr %y
1719 %cc = icmp sgt <16 x i8> %a, %b
1720 %c = select <16 x i1> %cc, <16 x i8> %a, <16 x i8> %b
1721 store <16 x i8> %c, ptr %x
1725 define void @smax_v8i16(ptr %x, ptr %y) {
1726 ; CHECK-LABEL: smax_v8i16:
1728 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1729 ; CHECK-NEXT: vle16.v v8, (a0)
1730 ; CHECK-NEXT: vle16.v v9, (a1)
1731 ; CHECK-NEXT: vmax.vv v8, v8, v9
1732 ; CHECK-NEXT: vse16.v v8, (a0)
1734 %a = load <8 x i16>, ptr %x
1735 %b = load <8 x i16>, ptr %y
1736 %cc = icmp sgt <8 x i16> %a, %b
1737 %c = select <8 x i1> %cc, <8 x i16> %a, <8 x i16> %b
1738 store <8 x i16> %c, ptr %x
1742 define void @smax_v6i16(ptr %x, ptr %y) {
1743 ; CHECK-LABEL: smax_v6i16:
1745 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1746 ; CHECK-NEXT: vle16.v v8, (a0)
1747 ; CHECK-NEXT: vle16.v v9, (a1)
1748 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1749 ; CHECK-NEXT: vmax.vv v8, v8, v9
1750 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1751 ; CHECK-NEXT: vse16.v v8, (a0)
1753 %a = load <6 x i16>, ptr %x
1754 %b = load <6 x i16>, ptr %y
1755 %cc = icmp sgt <6 x i16> %a, %b
1756 %c = select <6 x i1> %cc, <6 x i16> %a, <6 x i16> %b
1757 store <6 x i16> %c, ptr %x
1761 define void @smax_v4i32(ptr %x, ptr %y) {
1762 ; CHECK-LABEL: smax_v4i32:
1764 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1765 ; CHECK-NEXT: vle32.v v8, (a0)
1766 ; CHECK-NEXT: vle32.v v9, (a1)
1767 ; CHECK-NEXT: vmax.vv v8, v8, v9
1768 ; CHECK-NEXT: vse32.v v8, (a0)
1770 %a = load <4 x i32>, ptr %x
1771 %b = load <4 x i32>, ptr %y
1772 %cc = icmp sgt <4 x i32> %a, %b
1773 %c = select <4 x i1> %cc, <4 x i32> %a, <4 x i32> %b
1774 store <4 x i32> %c, ptr %x
1778 define void @smax_v2i64(ptr %x, ptr %y) {
1779 ; CHECK-LABEL: smax_v2i64:
1781 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
1782 ; CHECK-NEXT: vle64.v v8, (a0)
1783 ; CHECK-NEXT: vle64.v v9, (a1)
1784 ; CHECK-NEXT: vmax.vv v8, v8, v9
1785 ; CHECK-NEXT: vse64.v v8, (a0)
1787 %a = load <2 x i64>, ptr %x
1788 %b = load <2 x i64>, ptr %y
1789 %cc = icmp sgt <2 x i64> %a, %b
1790 %c = select <2 x i1> %cc, <2 x i64> %a, <2 x i64> %b
1791 store <2 x i64> %c, ptr %x
1795 define void @smax_vx_v16i8(ptr %x, i8 %y) {
1796 ; CHECK-LABEL: smax_vx_v16i8:
1798 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1799 ; CHECK-NEXT: vle8.v v8, (a0)
1800 ; CHECK-NEXT: vmax.vx v8, v8, a1
1801 ; CHECK-NEXT: vse8.v v8, (a0)
1803 %a = load <16 x i8>, ptr %x
1804 %b = insertelement <16 x i8> poison, i8 %y, i32 0
1805 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
1806 %d = call <16 x i8> @llvm.smax.v16i8(<16 x i8> %a, <16 x i8> %c)
1807 store <16 x i8> %d, ptr %x
1810 declare <16 x i8> @llvm.smax.v16i8(<16 x i8>, <16 x i8>)
1812 define void @smax_vx_v8i16(ptr %x, i16 %y) {
1813 ; CHECK-LABEL: smax_vx_v8i16:
1815 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1816 ; CHECK-NEXT: vle16.v v8, (a0)
1817 ; CHECK-NEXT: vmax.vx v8, v8, a1
1818 ; CHECK-NEXT: vse16.v v8, (a0)
1820 %a = load <8 x i16>, ptr %x
1821 %b = insertelement <8 x i16> poison, i16 %y, i32 0
1822 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
1823 %d = call <8 x i16> @llvm.smax.v8i16(<8 x i16> %a, <8 x i16> %c)
1824 store <8 x i16> %d, ptr %x
1827 declare <8 x i16> @llvm.smax.v8i16(<8 x i16>, <8 x i16>)
1829 define void @smax_vx_v6i16(ptr %x, i16 %y) {
1830 ; CHECK-LABEL: smax_vx_v6i16:
1832 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1833 ; CHECK-NEXT: vle16.v v8, (a0)
1834 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1835 ; CHECK-NEXT: vmax.vx v8, v8, a1
1836 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1837 ; CHECK-NEXT: vse16.v v8, (a0)
1839 %a = load <6 x i16>, ptr %x
1840 %b = insertelement <6 x i16> poison, i16 %y, i32 0
1841 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
1842 %d = call <6 x i16> @llvm.smax.v6i16(<6 x i16> %a, <6 x i16> %c)
1843 store <6 x i16> %d, ptr %x
1846 declare <6 x i16> @llvm.smax.v6i16(<6 x i16>, <6 x i16>)
1848 define void @smax_vx_v4i32(ptr %x, i32 %y) {
1849 ; CHECK-LABEL: smax_vx_v4i32:
1851 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1852 ; CHECK-NEXT: vle32.v v8, (a0)
1853 ; CHECK-NEXT: vmax.vx v8, v8, a1
1854 ; CHECK-NEXT: vse32.v v8, (a0)
1856 %a = load <4 x i32>, ptr %x
1857 %b = insertelement <4 x i32> poison, i32 %y, i32 0
1858 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
1859 %d = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %a, <4 x i32> %c)
1860 store <4 x i32> %d, ptr %x
1863 declare <4 x i32> @llvm.smax.v4i32(<4 x i32>, <4 x i32>)
1865 define void @smax_xv_v16i8(ptr %x, i8 %y) {
1866 ; CHECK-LABEL: smax_xv_v16i8:
1868 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1869 ; CHECK-NEXT: vle8.v v8, (a0)
1870 ; CHECK-NEXT: vmax.vx v8, v8, a1
1871 ; CHECK-NEXT: vse8.v v8, (a0)
1873 %a = load <16 x i8>, ptr %x
1874 %b = insertelement <16 x i8> poison, i8 %y, i32 0
1875 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
1876 %d = call <16 x i8> @llvm.smax.v16i8(<16 x i8> %c, <16 x i8> %a)
1877 store <16 x i8> %d, ptr %x
1881 define void @smax_xv_v8i16(ptr %x, i16 %y) {
1882 ; CHECK-LABEL: smax_xv_v8i16:
1884 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1885 ; CHECK-NEXT: vle16.v v8, (a0)
1886 ; CHECK-NEXT: vmax.vx v8, v8, a1
1887 ; CHECK-NEXT: vse16.v v8, (a0)
1889 %a = load <8 x i16>, ptr %x
1890 %b = insertelement <8 x i16> poison, i16 %y, i32 0
1891 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
1892 %d = call <8 x i16> @llvm.smax.v8i16(<8 x i16> %c, <8 x i16> %a)
1893 store <8 x i16> %d, ptr %x
1897 define void @smax_xv_v6i16(ptr %x, i16 %y) {
1898 ; CHECK-LABEL: smax_xv_v6i16:
1900 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1901 ; CHECK-NEXT: vle16.v v8, (a0)
1902 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1903 ; CHECK-NEXT: vmax.vx v8, v8, a1
1904 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1905 ; CHECK-NEXT: vse16.v v8, (a0)
1907 %a = load <6 x i16>, ptr %x
1908 %b = insertelement <6 x i16> poison, i16 %y, i32 0
1909 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
1910 %d = call <6 x i16> @llvm.smax.v6i16(<6 x i16> %c, <6 x i16> %a)
1911 store <6 x i16> %d, ptr %x
1915 define void @smax_xv_v4i32(ptr %x, i32 %y) {
1916 ; CHECK-LABEL: smax_xv_v4i32:
1918 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1919 ; CHECK-NEXT: vle32.v v8, (a0)
1920 ; CHECK-NEXT: vmax.vx v8, v8, a1
1921 ; CHECK-NEXT: vse32.v v8, (a0)
1923 %a = load <4 x i32>, ptr %x
1924 %b = insertelement <4 x i32> poison, i32 %y, i32 0
1925 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
1926 %d = call <4 x i32> @llvm.smax.v4i32(<4 x i32> %c, <4 x i32> %a)
1927 store <4 x i32> %d, ptr %x
1931 define void @umin_v16i8(ptr %x, ptr %y) {
1932 ; CHECK-LABEL: umin_v16i8:
1934 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
1935 ; CHECK-NEXT: vle8.v v8, (a0)
1936 ; CHECK-NEXT: vle8.v v9, (a1)
1937 ; CHECK-NEXT: vminu.vv v8, v8, v9
1938 ; CHECK-NEXT: vse8.v v8, (a0)
1940 %a = load <16 x i8>, ptr %x
1941 %b = load <16 x i8>, ptr %y
1942 %cc = icmp ult <16 x i8> %a, %b
1943 %c = select <16 x i1> %cc, <16 x i8> %a, <16 x i8> %b
1944 store <16 x i8> %c, ptr %x
1948 define void @umin_v8i16(ptr %x, ptr %y) {
1949 ; CHECK-LABEL: umin_v8i16:
1951 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1952 ; CHECK-NEXT: vle16.v v8, (a0)
1953 ; CHECK-NEXT: vle16.v v9, (a1)
1954 ; CHECK-NEXT: vminu.vv v8, v8, v9
1955 ; CHECK-NEXT: vse16.v v8, (a0)
1957 %a = load <8 x i16>, ptr %x
1958 %b = load <8 x i16>, ptr %y
1959 %cc = icmp ult <8 x i16> %a, %b
1960 %c = select <8 x i1> %cc, <8 x i16> %a, <8 x i16> %b
1961 store <8 x i16> %c, ptr %x
1965 define void @umin_v6i16(ptr %x, ptr %y) {
1966 ; CHECK-LABEL: umin_v6i16:
1968 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1969 ; CHECK-NEXT: vle16.v v8, (a0)
1970 ; CHECK-NEXT: vle16.v v9, (a1)
1971 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
1972 ; CHECK-NEXT: vminu.vv v8, v8, v9
1973 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
1974 ; CHECK-NEXT: vse16.v v8, (a0)
1976 %a = load <6 x i16>, ptr %x
1977 %b = load <6 x i16>, ptr %y
1978 %cc = icmp ult <6 x i16> %a, %b
1979 %c = select <6 x i1> %cc, <6 x i16> %a, <6 x i16> %b
1980 store <6 x i16> %c, ptr %x
1984 define void @umin_v4i32(ptr %x, ptr %y) {
1985 ; CHECK-LABEL: umin_v4i32:
1987 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
1988 ; CHECK-NEXT: vle32.v v8, (a0)
1989 ; CHECK-NEXT: vle32.v v9, (a1)
1990 ; CHECK-NEXT: vminu.vv v8, v8, v9
1991 ; CHECK-NEXT: vse32.v v8, (a0)
1993 %a = load <4 x i32>, ptr %x
1994 %b = load <4 x i32>, ptr %y
1995 %cc = icmp ult <4 x i32> %a, %b
1996 %c = select <4 x i1> %cc, <4 x i32> %a, <4 x i32> %b
1997 store <4 x i32> %c, ptr %x
2001 define void @umin_v2i64(ptr %x, ptr %y) {
2002 ; CHECK-LABEL: umin_v2i64:
2004 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
2005 ; CHECK-NEXT: vle64.v v8, (a0)
2006 ; CHECK-NEXT: vle64.v v9, (a1)
2007 ; CHECK-NEXT: vminu.vv v8, v8, v9
2008 ; CHECK-NEXT: vse64.v v8, (a0)
2010 %a = load <2 x i64>, ptr %x
2011 %b = load <2 x i64>, ptr %y
2012 %cc = icmp ult <2 x i64> %a, %b
2013 %c = select <2 x i1> %cc, <2 x i64> %a, <2 x i64> %b
2014 store <2 x i64> %c, ptr %x
2018 define void @umin_vx_v16i8(ptr %x, i8 %y) {
2019 ; CHECK-LABEL: umin_vx_v16i8:
2021 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
2022 ; CHECK-NEXT: vle8.v v8, (a0)
2023 ; CHECK-NEXT: vminu.vx v8, v8, a1
2024 ; CHECK-NEXT: vse8.v v8, (a0)
2026 %a = load <16 x i8>, ptr %x
2027 %b = insertelement <16 x i8> poison, i8 %y, i32 0
2028 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
2029 %d = call <16 x i8> @llvm.umin.v16i8(<16 x i8> %a, <16 x i8> %c)
2030 store <16 x i8> %d, ptr %x
2033 declare <16 x i8> @llvm.umin.v16i8(<16 x i8>, <16 x i8>)
2035 define void @umin_vx_v8i16(ptr %x, i16 %y) {
2036 ; CHECK-LABEL: umin_vx_v8i16:
2038 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2039 ; CHECK-NEXT: vle16.v v8, (a0)
2040 ; CHECK-NEXT: vminu.vx v8, v8, a1
2041 ; CHECK-NEXT: vse16.v v8, (a0)
2043 %a = load <8 x i16>, ptr %x
2044 %b = insertelement <8 x i16> poison, i16 %y, i32 0
2045 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
2046 %d = call <8 x i16> @llvm.umin.v8i16(<8 x i16> %a, <8 x i16> %c)
2047 store <8 x i16> %d, ptr %x
2050 declare <8 x i16> @llvm.umin.v8i16(<8 x i16>, <8 x i16>)
2052 define void @umin_vx_v6i16(ptr %x, i16 %y) {
2053 ; CHECK-LABEL: umin_vx_v6i16:
2055 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2056 ; CHECK-NEXT: vle16.v v8, (a0)
2057 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2058 ; CHECK-NEXT: vminu.vx v8, v8, a1
2059 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2060 ; CHECK-NEXT: vse16.v v8, (a0)
2062 %a = load <6 x i16>, ptr %x
2063 %b = insertelement <6 x i16> poison, i16 %y, i32 0
2064 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
2065 %d = call <6 x i16> @llvm.umin.v6i16(<6 x i16> %a, <6 x i16> %c)
2066 store <6 x i16> %d, ptr %x
2069 declare <6 x i16> @llvm.umin.v6i16(<6 x i16>, <6 x i16>)
2071 define void @umin_vx_v4i32(ptr %x, i32 %y) {
2072 ; CHECK-LABEL: umin_vx_v4i32:
2074 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
2075 ; CHECK-NEXT: vle32.v v8, (a0)
2076 ; CHECK-NEXT: vminu.vx v8, v8, a1
2077 ; CHECK-NEXT: vse32.v v8, (a0)
2079 %a = load <4 x i32>, ptr %x
2080 %b = insertelement <4 x i32> poison, i32 %y, i32 0
2081 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
2082 %d = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %a, <4 x i32> %c)
2083 store <4 x i32> %d, ptr %x
2086 declare <4 x i32> @llvm.umin.v4i32(<4 x i32>, <4 x i32>)
2088 define void @umin_xv_v16i8(ptr %x, i8 %y) {
2089 ; CHECK-LABEL: umin_xv_v16i8:
2091 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
2092 ; CHECK-NEXT: vle8.v v8, (a0)
2093 ; CHECK-NEXT: vminu.vx v8, v8, a1
2094 ; CHECK-NEXT: vse8.v v8, (a0)
2096 %a = load <16 x i8>, ptr %x
2097 %b = insertelement <16 x i8> poison, i8 %y, i32 0
2098 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
2099 %d = call <16 x i8> @llvm.umin.v16i8(<16 x i8> %c, <16 x i8> %a)
2100 store <16 x i8> %d, ptr %x
2104 define void @umin_xv_v8i16(ptr %x, i16 %y) {
2105 ; CHECK-LABEL: umin_xv_v8i16:
2107 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2108 ; CHECK-NEXT: vle16.v v8, (a0)
2109 ; CHECK-NEXT: vminu.vx v8, v8, a1
2110 ; CHECK-NEXT: vse16.v v8, (a0)
2112 %a = load <8 x i16>, ptr %x
2113 %b = insertelement <8 x i16> poison, i16 %y, i32 0
2114 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
2115 %d = call <8 x i16> @llvm.umin.v8i16(<8 x i16> %c, <8 x i16> %a)
2116 store <8 x i16> %d, ptr %x
2120 define void @umin_xv_v6i16(ptr %x, i16 %y) {
2121 ; CHECK-LABEL: umin_xv_v6i16:
2123 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2124 ; CHECK-NEXT: vle16.v v8, (a0)
2125 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2126 ; CHECK-NEXT: vminu.vx v8, v8, a1
2127 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2128 ; CHECK-NEXT: vse16.v v8, (a0)
2130 %a = load <6 x i16>, ptr %x
2131 %b = insertelement <6 x i16> poison, i16 %y, i32 0
2132 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
2133 %d = call <6 x i16> @llvm.umin.v6i16(<6 x i16> %c, <6 x i16> %a)
2134 store <6 x i16> %d, ptr %x
2138 define void @umin_xv_v4i32(ptr %x, i32 %y) {
2139 ; CHECK-LABEL: umin_xv_v4i32:
2141 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
2142 ; CHECK-NEXT: vle32.v v8, (a0)
2143 ; CHECK-NEXT: vminu.vx v8, v8, a1
2144 ; CHECK-NEXT: vse32.v v8, (a0)
2146 %a = load <4 x i32>, ptr %x
2147 %b = insertelement <4 x i32> poison, i32 %y, i32 0
2148 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
2149 %d = call <4 x i32> @llvm.umin.v4i32(<4 x i32> %c, <4 x i32> %a)
2150 store <4 x i32> %d, ptr %x
2154 define void @umax_v16i8(ptr %x, ptr %y) {
2155 ; CHECK-LABEL: umax_v16i8:
2157 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
2158 ; CHECK-NEXT: vle8.v v8, (a0)
2159 ; CHECK-NEXT: vle8.v v9, (a1)
2160 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
2161 ; CHECK-NEXT: vse8.v v8, (a0)
2163 %a = load <16 x i8>, ptr %x
2164 %b = load <16 x i8>, ptr %y
2165 %cc = icmp ugt <16 x i8> %a, %b
2166 %c = select <16 x i1> %cc, <16 x i8> %a, <16 x i8> %b
2167 store <16 x i8> %c, ptr %x
2171 define void @umax_v8i16(ptr %x, ptr %y) {
2172 ; CHECK-LABEL: umax_v8i16:
2174 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2175 ; CHECK-NEXT: vle16.v v8, (a0)
2176 ; CHECK-NEXT: vle16.v v9, (a1)
2177 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
2178 ; CHECK-NEXT: vse16.v v8, (a0)
2180 %a = load <8 x i16>, ptr %x
2181 %b = load <8 x i16>, ptr %y
2182 %cc = icmp ugt <8 x i16> %a, %b
2183 %c = select <8 x i1> %cc, <8 x i16> %a, <8 x i16> %b
2184 store <8 x i16> %c, ptr %x
2188 define void @umax_v6i16(ptr %x, ptr %y) {
2189 ; CHECK-LABEL: umax_v6i16:
2191 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2192 ; CHECK-NEXT: vle16.v v8, (a0)
2193 ; CHECK-NEXT: vle16.v v9, (a1)
2194 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2195 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
2196 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2197 ; CHECK-NEXT: vse16.v v8, (a0)
2199 %a = load <6 x i16>, ptr %x
2200 %b = load <6 x i16>, ptr %y
2201 %cc = icmp ugt <6 x i16> %a, %b
2202 %c = select <6 x i1> %cc, <6 x i16> %a, <6 x i16> %b
2203 store <6 x i16> %c, ptr %x
2207 define void @umax_v4i32(ptr %x, ptr %y) {
2208 ; CHECK-LABEL: umax_v4i32:
2210 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
2211 ; CHECK-NEXT: vle32.v v8, (a0)
2212 ; CHECK-NEXT: vle32.v v9, (a1)
2213 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
2214 ; CHECK-NEXT: vse32.v v8, (a0)
2216 %a = load <4 x i32>, ptr %x
2217 %b = load <4 x i32>, ptr %y
2218 %cc = icmp ugt <4 x i32> %a, %b
2219 %c = select <4 x i1> %cc, <4 x i32> %a, <4 x i32> %b
2220 store <4 x i32> %c, ptr %x
2224 define void @umax_v2i64(ptr %x, ptr %y) {
2225 ; CHECK-LABEL: umax_v2i64:
2227 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
2228 ; CHECK-NEXT: vle64.v v8, (a0)
2229 ; CHECK-NEXT: vle64.v v9, (a1)
2230 ; CHECK-NEXT: vmaxu.vv v8, v8, v9
2231 ; CHECK-NEXT: vse64.v v8, (a0)
2233 %a = load <2 x i64>, ptr %x
2234 %b = load <2 x i64>, ptr %y
2235 %cc = icmp ugt <2 x i64> %a, %b
2236 %c = select <2 x i1> %cc, <2 x i64> %a, <2 x i64> %b
2237 store <2 x i64> %c, ptr %x
2241 define void @umax_vx_v16i8(ptr %x, i8 %y) {
2242 ; CHECK-LABEL: umax_vx_v16i8:
2244 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
2245 ; CHECK-NEXT: vle8.v v8, (a0)
2246 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2247 ; CHECK-NEXT: vse8.v v8, (a0)
2249 %a = load <16 x i8>, ptr %x
2250 %b = insertelement <16 x i8> poison, i8 %y, i32 0
2251 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
2252 %d = call <16 x i8> @llvm.umax.v16i8(<16 x i8> %a, <16 x i8> %c)
2253 store <16 x i8> %d, ptr %x
2256 declare <16 x i8> @llvm.umax.v16i8(<16 x i8>, <16 x i8>)
2258 define void @umax_vx_v8i16(ptr %x, i16 %y) {
2259 ; CHECK-LABEL: umax_vx_v8i16:
2261 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2262 ; CHECK-NEXT: vle16.v v8, (a0)
2263 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2264 ; CHECK-NEXT: vse16.v v8, (a0)
2266 %a = load <8 x i16>, ptr %x
2267 %b = insertelement <8 x i16> poison, i16 %y, i32 0
2268 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
2269 %d = call <8 x i16> @llvm.umax.v8i16(<8 x i16> %a, <8 x i16> %c)
2270 store <8 x i16> %d, ptr %x
2273 declare <8 x i16> @llvm.umax.v8i16(<8 x i16>, <8 x i16>)
2275 define void @umax_vx_v6i16(ptr %x, i16 %y) {
2276 ; CHECK-LABEL: umax_vx_v6i16:
2278 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2279 ; CHECK-NEXT: vle16.v v8, (a0)
2280 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2281 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2282 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2283 ; CHECK-NEXT: vse16.v v8, (a0)
2285 %a = load <6 x i16>, ptr %x
2286 %b = insertelement <6 x i16> poison, i16 %y, i32 0
2287 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
2288 %d = call <6 x i16> @llvm.umax.v6i16(<6 x i16> %a, <6 x i16> %c)
2289 store <6 x i16> %d, ptr %x
2292 declare <6 x i16> @llvm.umax.v6i16(<6 x i16>, <6 x i16>)
2294 define void @umax_vx_v4i32(ptr %x, i32 %y) {
2295 ; CHECK-LABEL: umax_vx_v4i32:
2297 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
2298 ; CHECK-NEXT: vle32.v v8, (a0)
2299 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2300 ; CHECK-NEXT: vse32.v v8, (a0)
2302 %a = load <4 x i32>, ptr %x
2303 %b = insertelement <4 x i32> poison, i32 %y, i32 0
2304 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
2305 %d = call <4 x i32> @llvm.umax.v4i32(<4 x i32> %a, <4 x i32> %c)
2306 store <4 x i32> %d, ptr %x
2309 declare <4 x i32> @llvm.umax.v4i32(<4 x i32>, <4 x i32>)
2311 define void @umax_xv_v16i8(ptr %x, i8 %y) {
2312 ; CHECK-LABEL: umax_xv_v16i8:
2314 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
2315 ; CHECK-NEXT: vle8.v v8, (a0)
2316 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2317 ; CHECK-NEXT: vse8.v v8, (a0)
2319 %a = load <16 x i8>, ptr %x
2320 %b = insertelement <16 x i8> poison, i8 %y, i32 0
2321 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
2322 %d = call <16 x i8> @llvm.umax.v16i8(<16 x i8> %c, <16 x i8> %a)
2323 store <16 x i8> %d, ptr %x
2327 define void @umax_xv_v8i16(ptr %x, i16 %y) {
2328 ; CHECK-LABEL: umax_xv_v8i16:
2330 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2331 ; CHECK-NEXT: vle16.v v8, (a0)
2332 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2333 ; CHECK-NEXT: vse16.v v8, (a0)
2335 %a = load <8 x i16>, ptr %x
2336 %b = insertelement <8 x i16> poison, i16 %y, i32 0
2337 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
2338 %d = call <8 x i16> @llvm.umax.v8i16(<8 x i16> %c, <8 x i16> %a)
2339 store <8 x i16> %d, ptr %x
2343 define void @umax_xv_v6i16(ptr %x, i16 %y) {
2344 ; CHECK-LABEL: umax_xv_v6i16:
2346 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2347 ; CHECK-NEXT: vle16.v v8, (a0)
2348 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
2349 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2350 ; CHECK-NEXT: vsetivli zero, 6, e16, m1, ta, ma
2351 ; CHECK-NEXT: vse16.v v8, (a0)
2353 %a = load <6 x i16>, ptr %x
2354 %b = insertelement <6 x i16> poison, i16 %y, i32 0
2355 %c = shufflevector <6 x i16> %b, <6 x i16> poison, <6 x i32> zeroinitializer
2356 %d = call <6 x i16> @llvm.umax.v6i16(<6 x i16> %c, <6 x i16> %a)
2357 store <6 x i16> %d, ptr %x
2361 define void @umax_xv_v4i32(ptr %x, i32 %y) {
2362 ; CHECK-LABEL: umax_xv_v4i32:
2364 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
2365 ; CHECK-NEXT: vle32.v v8, (a0)
2366 ; CHECK-NEXT: vmaxu.vx v8, v8, a1
2367 ; CHECK-NEXT: vse32.v v8, (a0)
2369 %a = load <4 x i32>, ptr %x
2370 %b = insertelement <4 x i32> poison, i32 %y, i32 0
2371 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
2372 %d = call <4 x i32> @llvm.umax.v4i32(<4 x i32> %c, <4 x i32> %a)
2373 store <4 x i32> %d, ptr %x
2377 define void @add_v32i8(ptr %x, ptr %y) {
2378 ; CHECK-LABEL: add_v32i8:
2380 ; CHECK-NEXT: li a2, 32
2381 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2382 ; CHECK-NEXT: vle8.v v8, (a0)
2383 ; CHECK-NEXT: vle8.v v10, (a1)
2384 ; CHECK-NEXT: vadd.vv v8, v8, v10
2385 ; CHECK-NEXT: vse8.v v8, (a0)
2387 %a = load <32 x i8>, ptr %x
2388 %b = load <32 x i8>, ptr %y
2389 %c = add <32 x i8> %a, %b
2390 store <32 x i8> %c, ptr %x
2394 define void @add_v16i16(ptr %x, ptr %y) {
2395 ; CHECK-LABEL: add_v16i16:
2397 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2398 ; CHECK-NEXT: vle16.v v8, (a0)
2399 ; CHECK-NEXT: vle16.v v10, (a1)
2400 ; CHECK-NEXT: vadd.vv v8, v8, v10
2401 ; CHECK-NEXT: vse16.v v8, (a0)
2403 %a = load <16 x i16>, ptr %x
2404 %b = load <16 x i16>, ptr %y
2405 %c = add <16 x i16> %a, %b
2406 store <16 x i16> %c, ptr %x
2410 define void @add_v8i32(ptr %x, ptr %y) {
2411 ; CHECK-LABEL: add_v8i32:
2413 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2414 ; CHECK-NEXT: vle32.v v8, (a0)
2415 ; CHECK-NEXT: vle32.v v10, (a1)
2416 ; CHECK-NEXT: vadd.vv v8, v8, v10
2417 ; CHECK-NEXT: vse32.v v8, (a0)
2419 %a = load <8 x i32>, ptr %x
2420 %b = load <8 x i32>, ptr %y
2421 %c = add <8 x i32> %a, %b
2422 store <8 x i32> %c, ptr %x
2426 define void @add_v6i32(ptr %x, ptr %y) {
2427 ; CHECK-LABEL: add_v6i32:
2429 ; CHECK-NEXT: vsetivli zero, 6, e32, m2, ta, ma
2430 ; CHECK-NEXT: vle32.v v8, (a0)
2431 ; CHECK-NEXT: vle32.v v10, (a1)
2432 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2433 ; CHECK-NEXT: vadd.vv v8, v8, v10
2434 ; CHECK-NEXT: vsetivli zero, 6, e32, m2, ta, ma
2435 ; CHECK-NEXT: vse32.v v8, (a0)
2437 %a = load <6 x i32>, ptr %x
2438 %b = load <6 x i32>, ptr %y
2439 %c = add <6 x i32> %a, %b
2440 store <6 x i32> %c, ptr %x
2444 define void @add_v4i64(ptr %x, ptr %y) {
2445 ; CHECK-LABEL: add_v4i64:
2447 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2448 ; CHECK-NEXT: vle64.v v8, (a0)
2449 ; CHECK-NEXT: vle64.v v10, (a1)
2450 ; CHECK-NEXT: vadd.vv v8, v8, v10
2451 ; CHECK-NEXT: vse64.v v8, (a0)
2453 %a = load <4 x i64>, ptr %x
2454 %b = load <4 x i64>, ptr %y
2455 %c = add <4 x i64> %a, %b
2456 store <4 x i64> %c, ptr %x
2460 define void @sub_v32i8(ptr %x, ptr %y) {
2461 ; CHECK-LABEL: sub_v32i8:
2463 ; CHECK-NEXT: li a2, 32
2464 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2465 ; CHECK-NEXT: vle8.v v8, (a0)
2466 ; CHECK-NEXT: vle8.v v10, (a1)
2467 ; CHECK-NEXT: vsub.vv v8, v8, v10
2468 ; CHECK-NEXT: vse8.v v8, (a0)
2470 %a = load <32 x i8>, ptr %x
2471 %b = load <32 x i8>, ptr %y
2472 %c = sub <32 x i8> %a, %b
2473 store <32 x i8> %c, ptr %x
2477 define void @sub_v16i16(ptr %x, ptr %y) {
2478 ; CHECK-LABEL: sub_v16i16:
2480 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2481 ; CHECK-NEXT: vle16.v v8, (a0)
2482 ; CHECK-NEXT: vle16.v v10, (a1)
2483 ; CHECK-NEXT: vsub.vv v8, v8, v10
2484 ; CHECK-NEXT: vse16.v v8, (a0)
2486 %a = load <16 x i16>, ptr %x
2487 %b = load <16 x i16>, ptr %y
2488 %c = sub <16 x i16> %a, %b
2489 store <16 x i16> %c, ptr %x
2493 define void @sub_v8i32(ptr %x, ptr %y) {
2494 ; CHECK-LABEL: sub_v8i32:
2496 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2497 ; CHECK-NEXT: vle32.v v8, (a0)
2498 ; CHECK-NEXT: vle32.v v10, (a1)
2499 ; CHECK-NEXT: vsub.vv v8, v8, v10
2500 ; CHECK-NEXT: vse32.v v8, (a0)
2502 %a = load <8 x i32>, ptr %x
2503 %b = load <8 x i32>, ptr %y
2504 %c = sub <8 x i32> %a, %b
2505 store <8 x i32> %c, ptr %x
2509 define void @sub_v4i64(ptr %x, ptr %y) {
2510 ; CHECK-LABEL: sub_v4i64:
2512 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2513 ; CHECK-NEXT: vle64.v v8, (a0)
2514 ; CHECK-NEXT: vle64.v v10, (a1)
2515 ; CHECK-NEXT: vsub.vv v8, v8, v10
2516 ; CHECK-NEXT: vse64.v v8, (a0)
2518 %a = load <4 x i64>, ptr %x
2519 %b = load <4 x i64>, ptr %y
2520 %c = sub <4 x i64> %a, %b
2521 store <4 x i64> %c, ptr %x
2525 define void @mul_v32i8(ptr %x, ptr %y) {
2526 ; CHECK-LABEL: mul_v32i8:
2528 ; CHECK-NEXT: li a2, 32
2529 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2530 ; CHECK-NEXT: vle8.v v8, (a0)
2531 ; CHECK-NEXT: vle8.v v10, (a1)
2532 ; CHECK-NEXT: vmul.vv v8, v8, v10
2533 ; CHECK-NEXT: vse8.v v8, (a0)
2535 %a = load <32 x i8>, ptr %x
2536 %b = load <32 x i8>, ptr %y
2537 %c = mul <32 x i8> %a, %b
2538 store <32 x i8> %c, ptr %x
2542 define void @mul_v16i16(ptr %x, ptr %y) {
2543 ; CHECK-LABEL: mul_v16i16:
2545 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2546 ; CHECK-NEXT: vle16.v v8, (a0)
2547 ; CHECK-NEXT: vle16.v v10, (a1)
2548 ; CHECK-NEXT: vmul.vv v8, v8, v10
2549 ; CHECK-NEXT: vse16.v v8, (a0)
2551 %a = load <16 x i16>, ptr %x
2552 %b = load <16 x i16>, ptr %y
2553 %c = mul <16 x i16> %a, %b
2554 store <16 x i16> %c, ptr %x
2558 define void @mul_v8i32(ptr %x, ptr %y) {
2559 ; CHECK-LABEL: mul_v8i32:
2561 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2562 ; CHECK-NEXT: vle32.v v8, (a0)
2563 ; CHECK-NEXT: vle32.v v10, (a1)
2564 ; CHECK-NEXT: vmul.vv v8, v8, v10
2565 ; CHECK-NEXT: vse32.v v8, (a0)
2567 %a = load <8 x i32>, ptr %x
2568 %b = load <8 x i32>, ptr %y
2569 %c = mul <8 x i32> %a, %b
2570 store <8 x i32> %c, ptr %x
2574 define void @mul_v4i64(ptr %x, ptr %y) {
2575 ; CHECK-LABEL: mul_v4i64:
2577 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2578 ; CHECK-NEXT: vle64.v v8, (a0)
2579 ; CHECK-NEXT: vle64.v v10, (a1)
2580 ; CHECK-NEXT: vmul.vv v8, v8, v10
2581 ; CHECK-NEXT: vse64.v v8, (a0)
2583 %a = load <4 x i64>, ptr %x
2584 %b = load <4 x i64>, ptr %y
2585 %c = mul <4 x i64> %a, %b
2586 store <4 x i64> %c, ptr %x
2590 define void @and_v32i8(ptr %x, ptr %y) {
2591 ; CHECK-LABEL: and_v32i8:
2593 ; CHECK-NEXT: li a2, 32
2594 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2595 ; CHECK-NEXT: vle8.v v8, (a0)
2596 ; CHECK-NEXT: vle8.v v10, (a1)
2597 ; CHECK-NEXT: vand.vv v8, v8, v10
2598 ; CHECK-NEXT: vse8.v v8, (a0)
2600 %a = load <32 x i8>, ptr %x
2601 %b = load <32 x i8>, ptr %y
2602 %c = and <32 x i8> %a, %b
2603 store <32 x i8> %c, ptr %x
2607 define void @and_v16i16(ptr %x, ptr %y) {
2608 ; CHECK-LABEL: and_v16i16:
2610 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2611 ; CHECK-NEXT: vle16.v v8, (a0)
2612 ; CHECK-NEXT: vle16.v v10, (a1)
2613 ; CHECK-NEXT: vand.vv v8, v8, v10
2614 ; CHECK-NEXT: vse16.v v8, (a0)
2616 %a = load <16 x i16>, ptr %x
2617 %b = load <16 x i16>, ptr %y
2618 %c = and <16 x i16> %a, %b
2619 store <16 x i16> %c, ptr %x
2623 define void @and_v8i32(ptr %x, ptr %y) {
2624 ; CHECK-LABEL: and_v8i32:
2626 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2627 ; CHECK-NEXT: vle32.v v8, (a0)
2628 ; CHECK-NEXT: vle32.v v10, (a1)
2629 ; CHECK-NEXT: vand.vv v8, v8, v10
2630 ; CHECK-NEXT: vse32.v v8, (a0)
2632 %a = load <8 x i32>, ptr %x
2633 %b = load <8 x i32>, ptr %y
2634 %c = and <8 x i32> %a, %b
2635 store <8 x i32> %c, ptr %x
2639 define void @and_v4i64(ptr %x, ptr %y) {
2640 ; CHECK-LABEL: and_v4i64:
2642 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2643 ; CHECK-NEXT: vle64.v v8, (a0)
2644 ; CHECK-NEXT: vle64.v v10, (a1)
2645 ; CHECK-NEXT: vand.vv v8, v8, v10
2646 ; CHECK-NEXT: vse64.v v8, (a0)
2648 %a = load <4 x i64>, ptr %x
2649 %b = load <4 x i64>, ptr %y
2650 %c = and <4 x i64> %a, %b
2651 store <4 x i64> %c, ptr %x
2655 define void @or_v32i8(ptr %x, ptr %y) {
2656 ; CHECK-LABEL: or_v32i8:
2658 ; CHECK-NEXT: li a2, 32
2659 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2660 ; CHECK-NEXT: vle8.v v8, (a0)
2661 ; CHECK-NEXT: vle8.v v10, (a1)
2662 ; CHECK-NEXT: vor.vv v8, v8, v10
2663 ; CHECK-NEXT: vse8.v v8, (a0)
2665 %a = load <32 x i8>, ptr %x
2666 %b = load <32 x i8>, ptr %y
2667 %c = or <32 x i8> %a, %b
2668 store <32 x i8> %c, ptr %x
2672 define void @or_v16i16(ptr %x, ptr %y) {
2673 ; CHECK-LABEL: or_v16i16:
2675 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2676 ; CHECK-NEXT: vle16.v v8, (a0)
2677 ; CHECK-NEXT: vle16.v v10, (a1)
2678 ; CHECK-NEXT: vor.vv v8, v8, v10
2679 ; CHECK-NEXT: vse16.v v8, (a0)
2681 %a = load <16 x i16>, ptr %x
2682 %b = load <16 x i16>, ptr %y
2683 %c = or <16 x i16> %a, %b
2684 store <16 x i16> %c, ptr %x
2688 define void @or_v8i32(ptr %x, ptr %y) {
2689 ; CHECK-LABEL: or_v8i32:
2691 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2692 ; CHECK-NEXT: vle32.v v8, (a0)
2693 ; CHECK-NEXT: vle32.v v10, (a1)
2694 ; CHECK-NEXT: vor.vv v8, v8, v10
2695 ; CHECK-NEXT: vse32.v v8, (a0)
2697 %a = load <8 x i32>, ptr %x
2698 %b = load <8 x i32>, ptr %y
2699 %c = or <8 x i32> %a, %b
2700 store <8 x i32> %c, ptr %x
2704 define void @or_v4i64(ptr %x, ptr %y) {
2705 ; CHECK-LABEL: or_v4i64:
2707 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2708 ; CHECK-NEXT: vle64.v v8, (a0)
2709 ; CHECK-NEXT: vle64.v v10, (a1)
2710 ; CHECK-NEXT: vor.vv v8, v8, v10
2711 ; CHECK-NEXT: vse64.v v8, (a0)
2713 %a = load <4 x i64>, ptr %x
2714 %b = load <4 x i64>, ptr %y
2715 %c = or <4 x i64> %a, %b
2716 store <4 x i64> %c, ptr %x
2720 define void @xor_v32i8(ptr %x, ptr %y) {
2721 ; CHECK-LABEL: xor_v32i8:
2723 ; CHECK-NEXT: li a2, 32
2724 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2725 ; CHECK-NEXT: vle8.v v8, (a0)
2726 ; CHECK-NEXT: vle8.v v10, (a1)
2727 ; CHECK-NEXT: vxor.vv v8, v8, v10
2728 ; CHECK-NEXT: vse8.v v8, (a0)
2730 %a = load <32 x i8>, ptr %x
2731 %b = load <32 x i8>, ptr %y
2732 %c = xor <32 x i8> %a, %b
2733 store <32 x i8> %c, ptr %x
2737 define void @xor_v16i16(ptr %x, ptr %y) {
2738 ; CHECK-LABEL: xor_v16i16:
2740 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2741 ; CHECK-NEXT: vle16.v v8, (a0)
2742 ; CHECK-NEXT: vle16.v v10, (a1)
2743 ; CHECK-NEXT: vxor.vv v8, v8, v10
2744 ; CHECK-NEXT: vse16.v v8, (a0)
2746 %a = load <16 x i16>, ptr %x
2747 %b = load <16 x i16>, ptr %y
2748 %c = xor <16 x i16> %a, %b
2749 store <16 x i16> %c, ptr %x
2753 define void @xor_v8i32(ptr %x, ptr %y) {
2754 ; CHECK-LABEL: xor_v8i32:
2756 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2757 ; CHECK-NEXT: vle32.v v8, (a0)
2758 ; CHECK-NEXT: vle32.v v10, (a1)
2759 ; CHECK-NEXT: vxor.vv v8, v8, v10
2760 ; CHECK-NEXT: vse32.v v8, (a0)
2762 %a = load <8 x i32>, ptr %x
2763 %b = load <8 x i32>, ptr %y
2764 %c = xor <8 x i32> %a, %b
2765 store <8 x i32> %c, ptr %x
2769 define void @xor_v4i64(ptr %x, ptr %y) {
2770 ; CHECK-LABEL: xor_v4i64:
2772 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2773 ; CHECK-NEXT: vle64.v v8, (a0)
2774 ; CHECK-NEXT: vle64.v v10, (a1)
2775 ; CHECK-NEXT: vxor.vv v8, v8, v10
2776 ; CHECK-NEXT: vse64.v v8, (a0)
2778 %a = load <4 x i64>, ptr %x
2779 %b = load <4 x i64>, ptr %y
2780 %c = xor <4 x i64> %a, %b
2781 store <4 x i64> %c, ptr %x
2785 define void @lshr_v32i8(ptr %x, ptr %y) {
2786 ; CHECK-LABEL: lshr_v32i8:
2788 ; CHECK-NEXT: li a2, 32
2789 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2790 ; CHECK-NEXT: vle8.v v8, (a0)
2791 ; CHECK-NEXT: vle8.v v10, (a1)
2792 ; CHECK-NEXT: vsrl.vv v8, v8, v10
2793 ; CHECK-NEXT: vse8.v v8, (a0)
2795 %a = load <32 x i8>, ptr %x
2796 %b = load <32 x i8>, ptr %y
2797 %c = lshr <32 x i8> %a, %b
2798 store <32 x i8> %c, ptr %x
2802 define void @lshr_v16i16(ptr %x, ptr %y) {
2803 ; CHECK-LABEL: lshr_v16i16:
2805 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2806 ; CHECK-NEXT: vle16.v v8, (a0)
2807 ; CHECK-NEXT: vle16.v v10, (a1)
2808 ; CHECK-NEXT: vsrl.vv v8, v8, v10
2809 ; CHECK-NEXT: vse16.v v8, (a0)
2811 %a = load <16 x i16>, ptr %x
2812 %b = load <16 x i16>, ptr %y
2813 %c = lshr <16 x i16> %a, %b
2814 store <16 x i16> %c, ptr %x
2818 define void @lshr_v8i32(ptr %x, ptr %y) {
2819 ; CHECK-LABEL: lshr_v8i32:
2821 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2822 ; CHECK-NEXT: vle32.v v8, (a0)
2823 ; CHECK-NEXT: vle32.v v10, (a1)
2824 ; CHECK-NEXT: vsrl.vv v8, v8, v10
2825 ; CHECK-NEXT: vse32.v v8, (a0)
2827 %a = load <8 x i32>, ptr %x
2828 %b = load <8 x i32>, ptr %y
2829 %c = lshr <8 x i32> %a, %b
2830 store <8 x i32> %c, ptr %x
2834 define void @lshr_v4i64(ptr %x, ptr %y) {
2835 ; CHECK-LABEL: lshr_v4i64:
2837 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2838 ; CHECK-NEXT: vle64.v v8, (a0)
2839 ; CHECK-NEXT: vle64.v v10, (a1)
2840 ; CHECK-NEXT: vsrl.vv v8, v8, v10
2841 ; CHECK-NEXT: vse64.v v8, (a0)
2843 %a = load <4 x i64>, ptr %x
2844 %b = load <4 x i64>, ptr %y
2845 %c = lshr <4 x i64> %a, %b
2846 store <4 x i64> %c, ptr %x
2850 define void @ashr_v32i8(ptr %x, ptr %y) {
2851 ; CHECK-LABEL: ashr_v32i8:
2853 ; CHECK-NEXT: li a2, 32
2854 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2855 ; CHECK-NEXT: vle8.v v8, (a0)
2856 ; CHECK-NEXT: vle8.v v10, (a1)
2857 ; CHECK-NEXT: vsra.vv v8, v8, v10
2858 ; CHECK-NEXT: vse8.v v8, (a0)
2860 %a = load <32 x i8>, ptr %x
2861 %b = load <32 x i8>, ptr %y
2862 %c = ashr <32 x i8> %a, %b
2863 store <32 x i8> %c, ptr %x
2867 define void @ashr_v16i16(ptr %x, ptr %y) {
2868 ; CHECK-LABEL: ashr_v16i16:
2870 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2871 ; CHECK-NEXT: vle16.v v8, (a0)
2872 ; CHECK-NEXT: vle16.v v10, (a1)
2873 ; CHECK-NEXT: vsra.vv v8, v8, v10
2874 ; CHECK-NEXT: vse16.v v8, (a0)
2876 %a = load <16 x i16>, ptr %x
2877 %b = load <16 x i16>, ptr %y
2878 %c = ashr <16 x i16> %a, %b
2879 store <16 x i16> %c, ptr %x
2883 define void @ashr_v8i32(ptr %x, ptr %y) {
2884 ; CHECK-LABEL: ashr_v8i32:
2886 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2887 ; CHECK-NEXT: vle32.v v8, (a0)
2888 ; CHECK-NEXT: vle32.v v10, (a1)
2889 ; CHECK-NEXT: vsra.vv v8, v8, v10
2890 ; CHECK-NEXT: vse32.v v8, (a0)
2892 %a = load <8 x i32>, ptr %x
2893 %b = load <8 x i32>, ptr %y
2894 %c = ashr <8 x i32> %a, %b
2895 store <8 x i32> %c, ptr %x
2899 define void @ashr_v4i64(ptr %x, ptr %y) {
2900 ; CHECK-LABEL: ashr_v4i64:
2902 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2903 ; CHECK-NEXT: vle64.v v8, (a0)
2904 ; CHECK-NEXT: vle64.v v10, (a1)
2905 ; CHECK-NEXT: vsra.vv v8, v8, v10
2906 ; CHECK-NEXT: vse64.v v8, (a0)
2908 %a = load <4 x i64>, ptr %x
2909 %b = load <4 x i64>, ptr %y
2910 %c = ashr <4 x i64> %a, %b
2911 store <4 x i64> %c, ptr %x
2915 define void @shl_v32i8(ptr %x, ptr %y) {
2916 ; CHECK-LABEL: shl_v32i8:
2918 ; CHECK-NEXT: li a2, 32
2919 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2920 ; CHECK-NEXT: vle8.v v8, (a0)
2921 ; CHECK-NEXT: vle8.v v10, (a1)
2922 ; CHECK-NEXT: vsll.vv v8, v8, v10
2923 ; CHECK-NEXT: vse8.v v8, (a0)
2925 %a = load <32 x i8>, ptr %x
2926 %b = load <32 x i8>, ptr %y
2927 %c = shl <32 x i8> %a, %b
2928 store <32 x i8> %c, ptr %x
2932 define void @shl_v16i16(ptr %x, ptr %y) {
2933 ; CHECK-LABEL: shl_v16i16:
2935 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
2936 ; CHECK-NEXT: vle16.v v8, (a0)
2937 ; CHECK-NEXT: vle16.v v10, (a1)
2938 ; CHECK-NEXT: vsll.vv v8, v8, v10
2939 ; CHECK-NEXT: vse16.v v8, (a0)
2941 %a = load <16 x i16>, ptr %x
2942 %b = load <16 x i16>, ptr %y
2943 %c = shl <16 x i16> %a, %b
2944 store <16 x i16> %c, ptr %x
2948 define void @shl_v8i32(ptr %x, ptr %y) {
2949 ; CHECK-LABEL: shl_v8i32:
2951 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
2952 ; CHECK-NEXT: vle32.v v8, (a0)
2953 ; CHECK-NEXT: vle32.v v10, (a1)
2954 ; CHECK-NEXT: vsll.vv v8, v8, v10
2955 ; CHECK-NEXT: vse32.v v8, (a0)
2957 %a = load <8 x i32>, ptr %x
2958 %b = load <8 x i32>, ptr %y
2959 %c = shl <8 x i32> %a, %b
2960 store <8 x i32> %c, ptr %x
2964 define void @shl_v4i64(ptr %x, ptr %y) {
2965 ; CHECK-LABEL: shl_v4i64:
2967 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
2968 ; CHECK-NEXT: vle64.v v8, (a0)
2969 ; CHECK-NEXT: vle64.v v10, (a1)
2970 ; CHECK-NEXT: vsll.vv v8, v8, v10
2971 ; CHECK-NEXT: vse64.v v8, (a0)
2973 %a = load <4 x i64>, ptr %x
2974 %b = load <4 x i64>, ptr %y
2975 %c = shl <4 x i64> %a, %b
2976 store <4 x i64> %c, ptr %x
2980 define void @sdiv_v32i8(ptr %x, ptr %y) {
2981 ; CHECK-LABEL: sdiv_v32i8:
2983 ; CHECK-NEXT: li a2, 32
2984 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
2985 ; CHECK-NEXT: vle8.v v8, (a0)
2986 ; CHECK-NEXT: vle8.v v10, (a1)
2987 ; CHECK-NEXT: vdiv.vv v8, v8, v10
2988 ; CHECK-NEXT: vse8.v v8, (a0)
2990 %a = load <32 x i8>, ptr %x
2991 %b = load <32 x i8>, ptr %y
2992 %c = sdiv <32 x i8> %a, %b
2993 store <32 x i8> %c, ptr %x
2997 define void @sdiv_v16i16(ptr %x, ptr %y) {
2998 ; CHECK-LABEL: sdiv_v16i16:
3000 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3001 ; CHECK-NEXT: vle16.v v8, (a0)
3002 ; CHECK-NEXT: vle16.v v10, (a1)
3003 ; CHECK-NEXT: vdiv.vv v8, v8, v10
3004 ; CHECK-NEXT: vse16.v v8, (a0)
3006 %a = load <16 x i16>, ptr %x
3007 %b = load <16 x i16>, ptr %y
3008 %c = sdiv <16 x i16> %a, %b
3009 store <16 x i16> %c, ptr %x
3013 define void @sdiv_v8i32(ptr %x, ptr %y) {
3014 ; CHECK-LABEL: sdiv_v8i32:
3016 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3017 ; CHECK-NEXT: vle32.v v8, (a0)
3018 ; CHECK-NEXT: vle32.v v10, (a1)
3019 ; CHECK-NEXT: vdiv.vv v8, v8, v10
3020 ; CHECK-NEXT: vse32.v v8, (a0)
3022 %a = load <8 x i32>, ptr %x
3023 %b = load <8 x i32>, ptr %y
3024 %c = sdiv <8 x i32> %a, %b
3025 store <8 x i32> %c, ptr %x
3029 define void @sdiv_v4i64(ptr %x, ptr %y) {
3030 ; CHECK-LABEL: sdiv_v4i64:
3032 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3033 ; CHECK-NEXT: vle64.v v8, (a0)
3034 ; CHECK-NEXT: vle64.v v10, (a1)
3035 ; CHECK-NEXT: vdiv.vv v8, v8, v10
3036 ; CHECK-NEXT: vse64.v v8, (a0)
3038 %a = load <4 x i64>, ptr %x
3039 %b = load <4 x i64>, ptr %y
3040 %c = sdiv <4 x i64> %a, %b
3041 store <4 x i64> %c, ptr %x
3045 define void @srem_v32i8(ptr %x, ptr %y) {
3046 ; CHECK-LABEL: srem_v32i8:
3048 ; CHECK-NEXT: li a2, 32
3049 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
3050 ; CHECK-NEXT: vle8.v v8, (a0)
3051 ; CHECK-NEXT: vle8.v v10, (a1)
3052 ; CHECK-NEXT: vrem.vv v8, v8, v10
3053 ; CHECK-NEXT: vse8.v v8, (a0)
3055 %a = load <32 x i8>, ptr %x
3056 %b = load <32 x i8>, ptr %y
3057 %c = srem <32 x i8> %a, %b
3058 store <32 x i8> %c, ptr %x
3062 define void @srem_v16i16(ptr %x, ptr %y) {
3063 ; CHECK-LABEL: srem_v16i16:
3065 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3066 ; CHECK-NEXT: vle16.v v8, (a0)
3067 ; CHECK-NEXT: vle16.v v10, (a1)
3068 ; CHECK-NEXT: vrem.vv v8, v8, v10
3069 ; CHECK-NEXT: vse16.v v8, (a0)
3071 %a = load <16 x i16>, ptr %x
3072 %b = load <16 x i16>, ptr %y
3073 %c = srem <16 x i16> %a, %b
3074 store <16 x i16> %c, ptr %x
3078 define void @srem_v8i32(ptr %x, ptr %y) {
3079 ; CHECK-LABEL: srem_v8i32:
3081 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3082 ; CHECK-NEXT: vle32.v v8, (a0)
3083 ; CHECK-NEXT: vle32.v v10, (a1)
3084 ; CHECK-NEXT: vrem.vv v8, v8, v10
3085 ; CHECK-NEXT: vse32.v v8, (a0)
3087 %a = load <8 x i32>, ptr %x
3088 %b = load <8 x i32>, ptr %y
3089 %c = srem <8 x i32> %a, %b
3090 store <8 x i32> %c, ptr %x
3094 define void @srem_v4i64(ptr %x, ptr %y) {
3095 ; CHECK-LABEL: srem_v4i64:
3097 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3098 ; CHECK-NEXT: vle64.v v8, (a0)
3099 ; CHECK-NEXT: vle64.v v10, (a1)
3100 ; CHECK-NEXT: vrem.vv v8, v8, v10
3101 ; CHECK-NEXT: vse64.v v8, (a0)
3103 %a = load <4 x i64>, ptr %x
3104 %b = load <4 x i64>, ptr %y
3105 %c = srem <4 x i64> %a, %b
3106 store <4 x i64> %c, ptr %x
3110 define void @udiv_v32i8(ptr %x, ptr %y) {
3111 ; CHECK-LABEL: udiv_v32i8:
3113 ; CHECK-NEXT: li a2, 32
3114 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
3115 ; CHECK-NEXT: vle8.v v8, (a0)
3116 ; CHECK-NEXT: vle8.v v10, (a1)
3117 ; CHECK-NEXT: vdivu.vv v8, v8, v10
3118 ; CHECK-NEXT: vse8.v v8, (a0)
3120 %a = load <32 x i8>, ptr %x
3121 %b = load <32 x i8>, ptr %y
3122 %c = udiv <32 x i8> %a, %b
3123 store <32 x i8> %c, ptr %x
3127 define void @udiv_v16i16(ptr %x, ptr %y) {
3128 ; CHECK-LABEL: udiv_v16i16:
3130 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3131 ; CHECK-NEXT: vle16.v v8, (a0)
3132 ; CHECK-NEXT: vle16.v v10, (a1)
3133 ; CHECK-NEXT: vdivu.vv v8, v8, v10
3134 ; CHECK-NEXT: vse16.v v8, (a0)
3136 %a = load <16 x i16>, ptr %x
3137 %b = load <16 x i16>, ptr %y
3138 %c = udiv <16 x i16> %a, %b
3139 store <16 x i16> %c, ptr %x
3143 define void @udiv_v8i32(ptr %x, ptr %y) {
3144 ; CHECK-LABEL: udiv_v8i32:
3146 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3147 ; CHECK-NEXT: vle32.v v8, (a0)
3148 ; CHECK-NEXT: vle32.v v10, (a1)
3149 ; CHECK-NEXT: vdivu.vv v8, v8, v10
3150 ; CHECK-NEXT: vse32.v v8, (a0)
3152 %a = load <8 x i32>, ptr %x
3153 %b = load <8 x i32>, ptr %y
3154 %c = udiv <8 x i32> %a, %b
3155 store <8 x i32> %c, ptr %x
3159 define void @udiv_v4i64(ptr %x, ptr %y) {
3160 ; CHECK-LABEL: udiv_v4i64:
3162 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3163 ; CHECK-NEXT: vle64.v v8, (a0)
3164 ; CHECK-NEXT: vle64.v v10, (a1)
3165 ; CHECK-NEXT: vdivu.vv v8, v8, v10
3166 ; CHECK-NEXT: vse64.v v8, (a0)
3168 %a = load <4 x i64>, ptr %x
3169 %b = load <4 x i64>, ptr %y
3170 %c = udiv <4 x i64> %a, %b
3171 store <4 x i64> %c, ptr %x
3175 define void @urem_v32i8(ptr %x, ptr %y) {
3176 ; CHECK-LABEL: urem_v32i8:
3178 ; CHECK-NEXT: li a2, 32
3179 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
3180 ; CHECK-NEXT: vle8.v v8, (a0)
3181 ; CHECK-NEXT: vle8.v v10, (a1)
3182 ; CHECK-NEXT: vremu.vv v8, v8, v10
3183 ; CHECK-NEXT: vse8.v v8, (a0)
3185 %a = load <32 x i8>, ptr %x
3186 %b = load <32 x i8>, ptr %y
3187 %c = urem <32 x i8> %a, %b
3188 store <32 x i8> %c, ptr %x
3192 define void @urem_v16i16(ptr %x, ptr %y) {
3193 ; CHECK-LABEL: urem_v16i16:
3195 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3196 ; CHECK-NEXT: vle16.v v8, (a0)
3197 ; CHECK-NEXT: vle16.v v10, (a1)
3198 ; CHECK-NEXT: vremu.vv v8, v8, v10
3199 ; CHECK-NEXT: vse16.v v8, (a0)
3201 %a = load <16 x i16>, ptr %x
3202 %b = load <16 x i16>, ptr %y
3203 %c = urem <16 x i16> %a, %b
3204 store <16 x i16> %c, ptr %x
3208 define void @urem_v8i32(ptr %x, ptr %y) {
3209 ; CHECK-LABEL: urem_v8i32:
3211 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3212 ; CHECK-NEXT: vle32.v v8, (a0)
3213 ; CHECK-NEXT: vle32.v v10, (a1)
3214 ; CHECK-NEXT: vremu.vv v8, v8, v10
3215 ; CHECK-NEXT: vse32.v v8, (a0)
3217 %a = load <8 x i32>, ptr %x
3218 %b = load <8 x i32>, ptr %y
3219 %c = urem <8 x i32> %a, %b
3220 store <8 x i32> %c, ptr %x
3224 define void @urem_v4i64(ptr %x, ptr %y) {
3225 ; CHECK-LABEL: urem_v4i64:
3227 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3228 ; CHECK-NEXT: vle64.v v8, (a0)
3229 ; CHECK-NEXT: vle64.v v10, (a1)
3230 ; CHECK-NEXT: vremu.vv v8, v8, v10
3231 ; CHECK-NEXT: vse64.v v8, (a0)
3233 %a = load <4 x i64>, ptr %x
3234 %b = load <4 x i64>, ptr %y
3235 %c = urem <4 x i64> %a, %b
3236 store <4 x i64> %c, ptr %x
3240 define void @extract_v4i64(ptr %x, ptr %y) {
3241 ; CHECK-LABEL: extract_v4i64:
3243 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3244 ; CHECK-NEXT: vle64.v v8, (a0)
3245 ; CHECK-NEXT: vle64.v v10, (a1)
3246 ; CHECK-NEXT: vadd.vv v8, v8, v10
3247 ; CHECK-NEXT: vse64.v v8, (a0)
3249 %a = load <4 x i64>, ptr %x
3250 %b = load <4 x i64>, ptr %y
3253 %c = add <4 x i64> %a, %b
3254 store <4 x i64> %c, ptr %x
3258 define void @mulhu_v32i8(ptr %x) {
3259 ; CHECK-LABEL: mulhu_v32i8:
3261 ; CHECK-NEXT: li a1, 32
3262 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
3263 ; CHECK-NEXT: vle8.v v10, (a0)
3264 ; CHECK-NEXT: vmv.v.i v12, 0
3265 ; CHECK-NEXT: lui a1, 163907
3266 ; CHECK-NEXT: addi a1, a1, -2044
3267 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
3268 ; CHECK-NEXT: vmv.s.x v0, a1
3269 ; CHECK-NEXT: lui a1, 66049
3270 ; CHECK-NEXT: addi a1, a1, 32
3271 ; CHECK-NEXT: vmv.s.x v8, a1
3272 ; CHECK-NEXT: lui a1, %hi(.LCPI181_0)
3273 ; CHECK-NEXT: addi a1, a1, %lo(.LCPI181_0)
3274 ; CHECK-NEXT: vle8.v v14, (a1)
3275 ; CHECK-NEXT: li a1, -128
3276 ; CHECK-NEXT: vsetvli zero, zero, e8, m2, ta, ma
3277 ; CHECK-NEXT: vmerge.vxm v16, v12, a1, v0
3278 ; CHECK-NEXT: vmv1r.v v0, v8
3279 ; CHECK-NEXT: vmerge.vim v8, v12, 1, v0
3280 ; CHECK-NEXT: vsrl.vv v8, v10, v8
3281 ; CHECK-NEXT: vmulhu.vv v8, v8, v14
3282 ; CHECK-NEXT: vsub.vv v10, v10, v8
3283 ; CHECK-NEXT: vmulhu.vv v10, v10, v16
3284 ; CHECK-NEXT: vadd.vv v10, v10, v8
3285 ; CHECK-NEXT: lui a1, 8208
3286 ; CHECK-NEXT: addi a1, a1, 513
3287 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
3288 ; CHECK-NEXT: vmv.s.x v0, a1
3289 ; CHECK-NEXT: vsetvli zero, zero, e8, m2, ta, ma
3290 ; CHECK-NEXT: vmv.v.i v8, 4
3291 ; CHECK-NEXT: vmerge.vim v12, v8, 1, v0
3292 ; CHECK-NEXT: lui a1, 66785
3293 ; CHECK-NEXT: addi a1, a1, 78
3294 ; CHECK-NEXT: vsetvli zero, zero, e32, m8, ta, ma
3295 ; CHECK-NEXT: vmv.s.x v0, a1
3296 ; CHECK-NEXT: lui a1, 529160
3297 ; CHECK-NEXT: addi a1, a1, 304
3298 ; CHECK-NEXT: vmv.s.x v8, a1
3299 ; CHECK-NEXT: vsetvli zero, zero, e8, m2, ta, ma
3300 ; CHECK-NEXT: vmerge.vim v12, v12, 3, v0
3301 ; CHECK-NEXT: vmv1r.v v0, v8
3302 ; CHECK-NEXT: vmerge.vim v8, v12, 2, v0
3303 ; CHECK-NEXT: vsrl.vv v8, v10, v8
3304 ; CHECK-NEXT: vse8.v v8, (a0)
3306 %a = load <32 x i8>, ptr %x
3307 %b = udiv <32 x i8> %a, <i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25>
3308 store <32 x i8> %b, ptr %x
3312 define void @mulhu_v16i16(ptr %x) {
3313 ; RV32-LABEL: mulhu_v16i16:
3315 ; RV32-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3316 ; RV32-NEXT: vle16.v v10, (a0)
3317 ; RV32-NEXT: li a1, 257
3318 ; RV32-NEXT: vmv.s.x v0, a1
3319 ; RV32-NEXT: vmv.v.i v8, 0
3320 ; RV32-NEXT: lui a1, 1048568
3321 ; RV32-NEXT: vmerge.vxm v12, v8, a1, v0
3322 ; RV32-NEXT: lui a1, 4
3323 ; RV32-NEXT: addi a1, a1, 64
3324 ; RV32-NEXT: vmv.s.x v8, a1
3325 ; RV32-NEXT: vsetvli zero, zero, e8, m1, ta, ma
3326 ; RV32-NEXT: vmv.v.i v9, 0
3327 ; RV32-NEXT: lui a1, %hi(.LCPI182_0)
3328 ; RV32-NEXT: addi a1, a1, %lo(.LCPI182_0)
3329 ; RV32-NEXT: vle16.v v14, (a1)
3330 ; RV32-NEXT: vmv1r.v v0, v8
3331 ; RV32-NEXT: vmerge.vim v9, v9, 1, v0
3332 ; RV32-NEXT: vsetvli zero, zero, e16, m2, ta, ma
3333 ; RV32-NEXT: vsext.vf2 v16, v9
3334 ; RV32-NEXT: vsrl.vv v16, v10, v16
3335 ; RV32-NEXT: vmulhu.vv v14, v16, v14
3336 ; RV32-NEXT: vsub.vv v10, v10, v14
3337 ; RV32-NEXT: vmulhu.vv v10, v10, v12
3338 ; RV32-NEXT: vadd.vv v10, v10, v14
3339 ; RV32-NEXT: lui a1, 2
3340 ; RV32-NEXT: addi a1, a1, 289
3341 ; RV32-NEXT: vmv.s.x v0, a1
3342 ; RV32-NEXT: vsetvli zero, zero, e8, m1, ta, ma
3343 ; RV32-NEXT: vmv.v.i v9, 3
3344 ; RV32-NEXT: vmerge.vim v9, v9, 2, v0
3345 ; RV32-NEXT: vmv1r.v v0, v8
3346 ; RV32-NEXT: vmerge.vim v8, v9, 1, v0
3347 ; RV32-NEXT: vsetvli zero, zero, e16, m2, ta, ma
3348 ; RV32-NEXT: vsext.vf2 v12, v8
3349 ; RV32-NEXT: vsrl.vv v8, v10, v12
3350 ; RV32-NEXT: vse16.v v8, (a0)
3353 ; RV64-LABEL: mulhu_v16i16:
3355 ; RV64-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3356 ; RV64-NEXT: vle16.v v8, (a0)
3357 ; RV64-NEXT: li a1, 257
3358 ; RV64-NEXT: vmv.s.x v0, a1
3359 ; RV64-NEXT: vmv.v.i v10, 0
3360 ; RV64-NEXT: lui a1, 1048568
3361 ; RV64-NEXT: vmerge.vxm v10, v10, a1, v0
3362 ; RV64-NEXT: lui a1, %hi(.LCPI182_0)
3363 ; RV64-NEXT: addi a1, a1, %lo(.LCPI182_0)
3364 ; RV64-NEXT: vle16.v v12, (a1)
3365 ; RV64-NEXT: li a1, 1
3366 ; RV64-NEXT: slli a1, a1, 48
3367 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
3368 ; RV64-NEXT: vmv.v.x v14, a1
3369 ; RV64-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3370 ; RV64-NEXT: vsext.vf2 v16, v14
3371 ; RV64-NEXT: vsrl.vv v14, v8, v16
3372 ; RV64-NEXT: vmulhu.vv v12, v14, v12
3373 ; RV64-NEXT: lui a1, %hi(.LCPI182_1)
3374 ; RV64-NEXT: ld a1, %lo(.LCPI182_1)(a1)
3375 ; RV64-NEXT: vsub.vv v8, v8, v12
3376 ; RV64-NEXT: vmulhu.vv v8, v8, v10
3377 ; RV64-NEXT: vadd.vv v8, v8, v12
3378 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
3379 ; RV64-NEXT: vmv.v.x v10, a1
3380 ; RV64-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3381 ; RV64-NEXT: vsext.vf2 v12, v10
3382 ; RV64-NEXT: vsrl.vv v8, v8, v12
3383 ; RV64-NEXT: vse16.v v8, (a0)
3385 %a = load <16 x i16>, ptr %x
3386 %b = udiv <16 x i16> %a, <i16 7, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15, i16 7, i16 9, i16 10, i16 11, i16 12, i16 13, i16 14, i16 15>
3387 store <16 x i16> %b, ptr %x
3391 define void @mulhu_v8i32(ptr %x) {
3392 ; CHECK-LABEL: mulhu_v8i32:
3394 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3395 ; CHECK-NEXT: vle32.v v8, (a0)
3396 ; CHECK-NEXT: li a1, 68
3397 ; CHECK-NEXT: vmv.s.x v0, a1
3398 ; CHECK-NEXT: lui a1, %hi(.LCPI183_0)
3399 ; CHECK-NEXT: addi a1, a1, %lo(.LCPI183_0)
3400 ; CHECK-NEXT: vle32.v v10, (a1)
3401 ; CHECK-NEXT: vmv.v.i v12, 0
3402 ; CHECK-NEXT: lui a1, 524288
3403 ; CHECK-NEXT: vmerge.vxm v12, v12, a1, v0
3404 ; CHECK-NEXT: vmulhu.vv v10, v8, v10
3405 ; CHECK-NEXT: vsub.vv v8, v8, v10
3406 ; CHECK-NEXT: vmulhu.vv v8, v8, v12
3407 ; CHECK-NEXT: vadd.vv v8, v8, v10
3408 ; CHECK-NEXT: lui a1, 4128
3409 ; CHECK-NEXT: addi a1, a1, 514
3410 ; CHECK-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
3411 ; CHECK-NEXT: vmv.v.x v10, a1
3412 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3413 ; CHECK-NEXT: vsext.vf4 v12, v10
3414 ; CHECK-NEXT: vsrl.vv v8, v8, v12
3415 ; CHECK-NEXT: vse32.v v8, (a0)
3417 %a = load <8 x i32>, ptr %x
3418 %b = udiv <8 x i32> %a, <i32 5, i32 6, i32 7, i32 9, i32 5, i32 6, i32 7, i32 9>
3419 store <8 x i32> %b, ptr %x
3423 define void @mulhu_v4i64(ptr %x) {
3424 ; RV32-LABEL: mulhu_v4i64:
3426 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3427 ; RV32-NEXT: vle64.v v8, (a0)
3428 ; RV32-NEXT: lui a1, %hi(.LCPI184_0)
3429 ; RV32-NEXT: addi a1, a1, %lo(.LCPI184_0)
3430 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3431 ; RV32-NEXT: vle32.v v10, (a1)
3432 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3433 ; RV32-NEXT: vmulhu.vv v10, v8, v10
3434 ; RV32-NEXT: lui a1, 524288
3435 ; RV32-NEXT: vmv.s.x v12, a1
3436 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3437 ; RV32-NEXT: vmv.v.i v14, 0
3438 ; RV32-NEXT: vsetivli zero, 6, e32, m2, tu, ma
3439 ; RV32-NEXT: vslideup.vi v14, v12, 5
3440 ; RV32-NEXT: lui a1, %hi(.LCPI184_1)
3441 ; RV32-NEXT: addi a1, a1, %lo(.LCPI184_1)
3442 ; RV32-NEXT: vsetivli zero, 8, e8, mf2, ta, ma
3443 ; RV32-NEXT: vle8.v v12, (a1)
3444 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3445 ; RV32-NEXT: vsub.vv v8, v8, v10
3446 ; RV32-NEXT: vmulhu.vv v8, v8, v14
3447 ; RV32-NEXT: vadd.vv v8, v8, v10
3448 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3449 ; RV32-NEXT: vsext.vf4 v10, v12
3450 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3451 ; RV32-NEXT: vsrl.vv v8, v8, v10
3452 ; RV32-NEXT: vse64.v v8, (a0)
3455 ; RV64-LABEL: mulhu_v4i64:
3457 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3458 ; RV64-NEXT: vle64.v v8, (a0)
3459 ; RV64-NEXT: lui a1, %hi(.LCPI184_0)
3460 ; RV64-NEXT: addi a1, a1, %lo(.LCPI184_0)
3461 ; RV64-NEXT: vle64.v v10, (a1)
3462 ; RV64-NEXT: vmulhu.vv v10, v8, v10
3463 ; RV64-NEXT: vsub.vv v8, v8, v10
3464 ; RV64-NEXT: li a1, -1
3465 ; RV64-NEXT: slli a1, a1, 63
3466 ; RV64-NEXT: vmv.s.x v12, a1
3467 ; RV64-NEXT: vmv.v.i v14, 0
3468 ; RV64-NEXT: vsetivli zero, 3, e64, m2, tu, ma
3469 ; RV64-NEXT: vslideup.vi v14, v12, 2
3470 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3471 ; RV64-NEXT: vmulhu.vv v8, v8, v14
3472 ; RV64-NEXT: vadd.vv v8, v8, v10
3473 ; RV64-NEXT: lui a1, 12320
3474 ; RV64-NEXT: addi a1, a1, 513
3475 ; RV64-NEXT: vmv.s.x v10, a1
3476 ; RV64-NEXT: vsext.vf8 v12, v10
3477 ; RV64-NEXT: vsrl.vv v8, v8, v12
3478 ; RV64-NEXT: vse64.v v8, (a0)
3480 %a = load <4 x i64>, ptr %x
3481 %b = udiv <4 x i64> %a, <i64 3, i64 5, i64 7, i64 9>
3482 store <4 x i64> %b, ptr %x
3486 define void @mulhs_v32i8(ptr %x) {
3487 ; CHECK-LABEL: mulhs_v32i8:
3489 ; CHECK-NEXT: li a1, 32
3490 ; CHECK-NEXT: vsetvli zero, a1, e32, m8, ta, ma
3491 ; CHECK-NEXT: vle8.v v8, (a0)
3492 ; CHECK-NEXT: lui a1, 304453
3493 ; CHECK-NEXT: addi a1, a1, -1452
3494 ; CHECK-NEXT: vmv.s.x v0, a1
3495 ; CHECK-NEXT: vsetvli zero, zero, e8, m2, ta, ma
3496 ; CHECK-NEXT: vmv.v.i v10, 7
3497 ; CHECK-NEXT: vmerge.vim v10, v10, 1, v0
3498 ; CHECK-NEXT: li a1, -123
3499 ; CHECK-NEXT: vmv.v.x v12, a1
3500 ; CHECK-NEXT: li a1, 57
3501 ; CHECK-NEXT: vmerge.vxm v12, v12, a1, v0
3502 ; CHECK-NEXT: vmulhu.vv v8, v8, v12
3503 ; CHECK-NEXT: vsrl.vv v8, v8, v10
3504 ; CHECK-NEXT: vse8.v v8, (a0)
3506 %a = load <32 x i8>, ptr %x
3507 %b = udiv <32 x i8> %a, <i8 -9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 -9, i8 9, i8 -9, i8 -9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 -9, i8 9, i8 -9, i8 9, i8 -9, i8 -9, i8 9, i8 -9>
3508 store <32 x i8> %b, ptr %x
3512 define void @mulhs_v16i16(ptr %x) {
3513 ; CHECK-LABEL: mulhs_v16i16:
3515 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3516 ; CHECK-NEXT: vle16.v v8, (a0)
3517 ; CHECK-NEXT: lui a1, 5
3518 ; CHECK-NEXT: addi a1, a1, -1755
3519 ; CHECK-NEXT: vmv.v.x v10, a1
3520 ; CHECK-NEXT: lui a1, 7
3521 ; CHECK-NEXT: addi a1, a1, -1687
3522 ; CHECK-NEXT: vmv.s.x v0, a1
3523 ; CHECK-NEXT: lui a1, 1048571
3524 ; CHECK-NEXT: addi a1, a1, 1755
3525 ; CHECK-NEXT: vmerge.vxm v10, v10, a1, v0
3526 ; CHECK-NEXT: vmulh.vv v8, v8, v10
3527 ; CHECK-NEXT: vsra.vi v8, v8, 1
3528 ; CHECK-NEXT: vsrl.vi v10, v8, 15
3529 ; CHECK-NEXT: vadd.vv v8, v8, v10
3530 ; CHECK-NEXT: vse16.v v8, (a0)
3532 %a = load <16 x i16>, ptr %x
3533 %b = sdiv <16 x i16> %a, <i16 -7, i16 7, i16 7, i16 -7, i16 7, i16 -7, i16 -7, i16 7, i16 -7, i16 7, i16 7, i16 -7, i16 7, i16 -7, i16 -7, i16 7>
3534 store <16 x i16> %b, ptr %x
3538 define void @mulhs_v8i32(ptr %x) {
3539 ; RV32-LABEL: mulhs_v8i32:
3541 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3542 ; RV32-NEXT: vle32.v v8, (a0)
3543 ; RV32-NEXT: lui a1, 419430
3544 ; RV32-NEXT: addi a1, a1, 1639
3545 ; RV32-NEXT: vmv.v.x v10, a1
3546 ; RV32-NEXT: li a1, 85
3547 ; RV32-NEXT: vmv.s.x v0, a1
3548 ; RV32-NEXT: lui a1, 629146
3549 ; RV32-NEXT: addi a1, a1, -1639
3550 ; RV32-NEXT: vmerge.vxm v10, v10, a1, v0
3551 ; RV32-NEXT: vmulh.vv v8, v8, v10
3552 ; RV32-NEXT: vsrl.vi v10, v8, 31
3553 ; RV32-NEXT: vsra.vi v8, v8, 1
3554 ; RV32-NEXT: vadd.vv v8, v8, v10
3555 ; RV32-NEXT: vse32.v v8, (a0)
3558 ; RV64-LABEL: mulhs_v8i32:
3560 ; RV64-NEXT: lui a1, %hi(.LCPI187_0)
3561 ; RV64-NEXT: ld a1, %lo(.LCPI187_0)(a1)
3562 ; RV64-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3563 ; RV64-NEXT: vle32.v v8, (a0)
3564 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3565 ; RV64-NEXT: vmv.v.x v10, a1
3566 ; RV64-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3567 ; RV64-NEXT: vmulh.vv v8, v8, v10
3568 ; RV64-NEXT: vsra.vi v8, v8, 1
3569 ; RV64-NEXT: vsrl.vi v10, v8, 31
3570 ; RV64-NEXT: vadd.vv v8, v8, v10
3571 ; RV64-NEXT: vse32.v v8, (a0)
3573 %a = load <8 x i32>, ptr %x
3574 %b = sdiv <8 x i32> %a, <i32 -5, i32 5, i32 -5, i32 5, i32 -5, i32 5, i32 -5, i32 5>
3575 store <8 x i32> %b, ptr %x
3579 define void @mulhs_v4i64(ptr %x) {
3580 ; RV32-LABEL: mulhs_v4i64:
3582 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3583 ; RV32-NEXT: vle64.v v8, (a0)
3584 ; RV32-NEXT: lui a1, 349525
3585 ; RV32-NEXT: addi a2, a1, 1365
3586 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3587 ; RV32-NEXT: vmv.v.x v10, a2
3588 ; RV32-NEXT: li a2, 17
3589 ; RV32-NEXT: vmv.s.x v0, a2
3590 ; RV32-NEXT: addi a1, a1, 1366
3591 ; RV32-NEXT: vmerge.vxm v10, v10, a1, v0
3592 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3593 ; RV32-NEXT: vmulh.vv v10, v8, v10
3594 ; RV32-NEXT: lui a1, 1048560
3595 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
3596 ; RV32-NEXT: vmv.v.x v12, a1
3597 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3598 ; RV32-NEXT: vsext.vf4 v14, v12
3599 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3600 ; RV32-NEXT: vmadd.vv v14, v8, v10
3601 ; RV32-NEXT: li a1, 63
3602 ; RV32-NEXT: vsrl.vx v8, v14, a1
3603 ; RV32-NEXT: lui a1, 16
3604 ; RV32-NEXT: vsetivli zero, 2, e32, mf2, ta, ma
3605 ; RV32-NEXT: vmv.v.x v10, a1
3606 ; RV32-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3607 ; RV32-NEXT: vsext.vf4 v12, v10
3608 ; RV32-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3609 ; RV32-NEXT: vsra.vv v10, v14, v12
3610 ; RV32-NEXT: vadd.vv v8, v10, v8
3611 ; RV32-NEXT: vse64.v v8, (a0)
3614 ; RV64-LABEL: mulhs_v4i64:
3616 ; RV64-NEXT: lui a1, 349525
3617 ; RV64-NEXT: addiw a1, a1, 1365
3618 ; RV64-NEXT: slli a2, a1, 32
3619 ; RV64-NEXT: add a1, a1, a2
3620 ; RV64-NEXT: lui a2, %hi(.LCPI188_0)
3621 ; RV64-NEXT: ld a2, %lo(.LCPI188_0)(a2)
3622 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3623 ; RV64-NEXT: vle64.v v8, (a0)
3624 ; RV64-NEXT: vsetivli zero, 1, e8, mf8, ta, ma
3625 ; RV64-NEXT: vmv.v.i v0, 5
3626 ; RV64-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3627 ; RV64-NEXT: vmv.v.x v10, a1
3628 ; RV64-NEXT: vmerge.vxm v10, v10, a2, v0
3629 ; RV64-NEXT: vmulh.vv v10, v8, v10
3630 ; RV64-NEXT: lui a1, 1044496
3631 ; RV64-NEXT: addi a1, a1, -256
3632 ; RV64-NEXT: vmv.s.x v12, a1
3633 ; RV64-NEXT: vsext.vf8 v14, v12
3634 ; RV64-NEXT: vmadd.vv v14, v8, v10
3635 ; RV64-NEXT: li a1, 63
3636 ; RV64-NEXT: vsrl.vx v8, v14, a1
3637 ; RV64-NEXT: lui a1, 4096
3638 ; RV64-NEXT: addi a1, a1, 256
3639 ; RV64-NEXT: vmv.s.x v10, a1
3640 ; RV64-NEXT: vsext.vf8 v12, v10
3641 ; RV64-NEXT: vsra.vv v10, v14, v12
3642 ; RV64-NEXT: vadd.vv v8, v10, v8
3643 ; RV64-NEXT: vse64.v v8, (a0)
3645 %a = load <4 x i64>, ptr %x
3646 %b = sdiv <4 x i64> %a, <i64 3, i64 -3, i64 3, i64 -3>
3647 store <4 x i64> %b, ptr %x
3651 define void @smin_v32i8(ptr %x, ptr %y) {
3652 ; CHECK-LABEL: smin_v32i8:
3654 ; CHECK-NEXT: li a2, 32
3655 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
3656 ; CHECK-NEXT: vle8.v v8, (a0)
3657 ; CHECK-NEXT: vle8.v v10, (a1)
3658 ; CHECK-NEXT: vmin.vv v8, v8, v10
3659 ; CHECK-NEXT: vse8.v v8, (a0)
3661 %a = load <32 x i8>, ptr %x
3662 %b = load <32 x i8>, ptr %y
3663 %cc = icmp slt <32 x i8> %a, %b
3664 %c = select <32 x i1> %cc, <32 x i8> %a, <32 x i8> %b
3665 store <32 x i8> %c, ptr %x
3669 define void @smin_v16i16(ptr %x, ptr %y) {
3670 ; CHECK-LABEL: smin_v16i16:
3672 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3673 ; CHECK-NEXT: vle16.v v8, (a0)
3674 ; CHECK-NEXT: vle16.v v10, (a1)
3675 ; CHECK-NEXT: vmin.vv v8, v8, v10
3676 ; CHECK-NEXT: vse16.v v8, (a0)
3678 %a = load <16 x i16>, ptr %x
3679 %b = load <16 x i16>, ptr %y
3680 %cc = icmp slt <16 x i16> %a, %b
3681 %c = select <16 x i1> %cc, <16 x i16> %a, <16 x i16> %b
3682 store <16 x i16> %c, ptr %x
3686 define void @smin_v8i32(ptr %x, ptr %y) {
3687 ; CHECK-LABEL: smin_v8i32:
3689 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3690 ; CHECK-NEXT: vle32.v v8, (a0)
3691 ; CHECK-NEXT: vle32.v v10, (a1)
3692 ; CHECK-NEXT: vmin.vv v8, v8, v10
3693 ; CHECK-NEXT: vse32.v v8, (a0)
3695 %a = load <8 x i32>, ptr %x
3696 %b = load <8 x i32>, ptr %y
3697 %cc = icmp slt <8 x i32> %a, %b
3698 %c = select <8 x i1> %cc, <8 x i32> %a, <8 x i32> %b
3699 store <8 x i32> %c, ptr %x
3703 define void @smin_v4i64(ptr %x, ptr %y) {
3704 ; CHECK-LABEL: smin_v4i64:
3706 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3707 ; CHECK-NEXT: vle64.v v8, (a0)
3708 ; CHECK-NEXT: vle64.v v10, (a1)
3709 ; CHECK-NEXT: vmin.vv v8, v8, v10
3710 ; CHECK-NEXT: vse64.v v8, (a0)
3712 %a = load <4 x i64>, ptr %x
3713 %b = load <4 x i64>, ptr %y
3714 %cc = icmp slt <4 x i64> %a, %b
3715 %c = select <4 x i1> %cc, <4 x i64> %a, <4 x i64> %b
3716 store <4 x i64> %c, ptr %x
3720 define void @smax_v32i8(ptr %x, ptr %y) {
3721 ; CHECK-LABEL: smax_v32i8:
3723 ; CHECK-NEXT: li a2, 32
3724 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
3725 ; CHECK-NEXT: vle8.v v8, (a0)
3726 ; CHECK-NEXT: vle8.v v10, (a1)
3727 ; CHECK-NEXT: vmax.vv v8, v8, v10
3728 ; CHECK-NEXT: vse8.v v8, (a0)
3730 %a = load <32 x i8>, ptr %x
3731 %b = load <32 x i8>, ptr %y
3732 %cc = icmp sgt <32 x i8> %a, %b
3733 %c = select <32 x i1> %cc, <32 x i8> %a, <32 x i8> %b
3734 store <32 x i8> %c, ptr %x
3738 define void @smax_v16i16(ptr %x, ptr %y) {
3739 ; CHECK-LABEL: smax_v16i16:
3741 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3742 ; CHECK-NEXT: vle16.v v8, (a0)
3743 ; CHECK-NEXT: vle16.v v10, (a1)
3744 ; CHECK-NEXT: vmax.vv v8, v8, v10
3745 ; CHECK-NEXT: vse16.v v8, (a0)
3747 %a = load <16 x i16>, ptr %x
3748 %b = load <16 x i16>, ptr %y
3749 %cc = icmp sgt <16 x i16> %a, %b
3750 %c = select <16 x i1> %cc, <16 x i16> %a, <16 x i16> %b
3751 store <16 x i16> %c, ptr %x
3755 define void @smax_v8i32(ptr %x, ptr %y) {
3756 ; CHECK-LABEL: smax_v8i32:
3758 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3759 ; CHECK-NEXT: vle32.v v8, (a0)
3760 ; CHECK-NEXT: vle32.v v10, (a1)
3761 ; CHECK-NEXT: vmax.vv v8, v8, v10
3762 ; CHECK-NEXT: vse32.v v8, (a0)
3764 %a = load <8 x i32>, ptr %x
3765 %b = load <8 x i32>, ptr %y
3766 %cc = icmp sgt <8 x i32> %a, %b
3767 %c = select <8 x i1> %cc, <8 x i32> %a, <8 x i32> %b
3768 store <8 x i32> %c, ptr %x
3772 define void @smax_v4i64(ptr %x, ptr %y) {
3773 ; CHECK-LABEL: smax_v4i64:
3775 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3776 ; CHECK-NEXT: vle64.v v8, (a0)
3777 ; CHECK-NEXT: vle64.v v10, (a1)
3778 ; CHECK-NEXT: vmax.vv v8, v8, v10
3779 ; CHECK-NEXT: vse64.v v8, (a0)
3781 %a = load <4 x i64>, ptr %x
3782 %b = load <4 x i64>, ptr %y
3783 %cc = icmp sgt <4 x i64> %a, %b
3784 %c = select <4 x i1> %cc, <4 x i64> %a, <4 x i64> %b
3785 store <4 x i64> %c, ptr %x
3789 define void @umin_v32i8(ptr %x, ptr %y) {
3790 ; CHECK-LABEL: umin_v32i8:
3792 ; CHECK-NEXT: li a2, 32
3793 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
3794 ; CHECK-NEXT: vle8.v v8, (a0)
3795 ; CHECK-NEXT: vle8.v v10, (a1)
3796 ; CHECK-NEXT: vminu.vv v8, v8, v10
3797 ; CHECK-NEXT: vse8.v v8, (a0)
3799 %a = load <32 x i8>, ptr %x
3800 %b = load <32 x i8>, ptr %y
3801 %cc = icmp ult <32 x i8> %a, %b
3802 %c = select <32 x i1> %cc, <32 x i8> %a, <32 x i8> %b
3803 store <32 x i8> %c, ptr %x
3807 define void @umin_v16i16(ptr %x, ptr %y) {
3808 ; CHECK-LABEL: umin_v16i16:
3810 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3811 ; CHECK-NEXT: vle16.v v8, (a0)
3812 ; CHECK-NEXT: vle16.v v10, (a1)
3813 ; CHECK-NEXT: vminu.vv v8, v8, v10
3814 ; CHECK-NEXT: vse16.v v8, (a0)
3816 %a = load <16 x i16>, ptr %x
3817 %b = load <16 x i16>, ptr %y
3818 %cc = icmp ult <16 x i16> %a, %b
3819 %c = select <16 x i1> %cc, <16 x i16> %a, <16 x i16> %b
3820 store <16 x i16> %c, ptr %x
3824 define void @umin_v8i32(ptr %x, ptr %y) {
3825 ; CHECK-LABEL: umin_v8i32:
3827 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3828 ; CHECK-NEXT: vle32.v v8, (a0)
3829 ; CHECK-NEXT: vle32.v v10, (a1)
3830 ; CHECK-NEXT: vminu.vv v8, v8, v10
3831 ; CHECK-NEXT: vse32.v v8, (a0)
3833 %a = load <8 x i32>, ptr %x
3834 %b = load <8 x i32>, ptr %y
3835 %cc = icmp ult <8 x i32> %a, %b
3836 %c = select <8 x i1> %cc, <8 x i32> %a, <8 x i32> %b
3837 store <8 x i32> %c, ptr %x
3841 define void @umin_v4i64(ptr %x, ptr %y) {
3842 ; CHECK-LABEL: umin_v4i64:
3844 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3845 ; CHECK-NEXT: vle64.v v8, (a0)
3846 ; CHECK-NEXT: vle64.v v10, (a1)
3847 ; CHECK-NEXT: vminu.vv v8, v8, v10
3848 ; CHECK-NEXT: vse64.v v8, (a0)
3850 %a = load <4 x i64>, ptr %x
3851 %b = load <4 x i64>, ptr %y
3852 %cc = icmp ult <4 x i64> %a, %b
3853 %c = select <4 x i1> %cc, <4 x i64> %a, <4 x i64> %b
3854 store <4 x i64> %c, ptr %x
3858 define void @umax_v32i8(ptr %x, ptr %y) {
3859 ; CHECK-LABEL: umax_v32i8:
3861 ; CHECK-NEXT: li a2, 32
3862 ; CHECK-NEXT: vsetvli zero, a2, e8, m2, ta, ma
3863 ; CHECK-NEXT: vle8.v v8, (a0)
3864 ; CHECK-NEXT: vle8.v v10, (a1)
3865 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
3866 ; CHECK-NEXT: vse8.v v8, (a0)
3868 %a = load <32 x i8>, ptr %x
3869 %b = load <32 x i8>, ptr %y
3870 %cc = icmp ugt <32 x i8> %a, %b
3871 %c = select <32 x i1> %cc, <32 x i8> %a, <32 x i8> %b
3872 store <32 x i8> %c, ptr %x
3876 define void @umax_v16i16(ptr %x, ptr %y) {
3877 ; CHECK-LABEL: umax_v16i16:
3879 ; CHECK-NEXT: vsetivli zero, 16, e16, m2, ta, ma
3880 ; CHECK-NEXT: vle16.v v8, (a0)
3881 ; CHECK-NEXT: vle16.v v10, (a1)
3882 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
3883 ; CHECK-NEXT: vse16.v v8, (a0)
3885 %a = load <16 x i16>, ptr %x
3886 %b = load <16 x i16>, ptr %y
3887 %cc = icmp ugt <16 x i16> %a, %b
3888 %c = select <16 x i1> %cc, <16 x i16> %a, <16 x i16> %b
3889 store <16 x i16> %c, ptr %x
3893 define void @umax_v8i32(ptr %x, ptr %y) {
3894 ; CHECK-LABEL: umax_v8i32:
3896 ; CHECK-NEXT: vsetivli zero, 8, e32, m2, ta, ma
3897 ; CHECK-NEXT: vle32.v v8, (a0)
3898 ; CHECK-NEXT: vle32.v v10, (a1)
3899 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
3900 ; CHECK-NEXT: vse32.v v8, (a0)
3902 %a = load <8 x i32>, ptr %x
3903 %b = load <8 x i32>, ptr %y
3904 %cc = icmp ugt <8 x i32> %a, %b
3905 %c = select <8 x i1> %cc, <8 x i32> %a, <8 x i32> %b
3906 store <8 x i32> %c, ptr %x
3910 define void @umax_v4i64(ptr %x, ptr %y) {
3911 ; CHECK-LABEL: umax_v4i64:
3913 ; CHECK-NEXT: vsetivli zero, 4, e64, m2, ta, ma
3914 ; CHECK-NEXT: vle64.v v8, (a0)
3915 ; CHECK-NEXT: vle64.v v10, (a1)
3916 ; CHECK-NEXT: vmaxu.vv v8, v8, v10
3917 ; CHECK-NEXT: vse64.v v8, (a0)
3919 %a = load <4 x i64>, ptr %x
3920 %b = load <4 x i64>, ptr %y
3921 %cc = icmp ugt <4 x i64> %a, %b
3922 %c = select <4 x i1> %cc, <4 x i64> %a, <4 x i64> %b
3923 store <4 x i64> %c, ptr %x
3927 define void @add_vi_v16i8(ptr %x) {
3928 ; CHECK-LABEL: add_vi_v16i8:
3930 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
3931 ; CHECK-NEXT: vle8.v v8, (a0)
3932 ; CHECK-NEXT: vadd.vi v8, v8, -1
3933 ; CHECK-NEXT: vse8.v v8, (a0)
3935 %a = load <16 x i8>, ptr %x
3936 %d = add <16 x i8> %a, splat (i8 -1)
3937 store <16 x i8> %d, ptr %x
3941 define void @add_vi_v8i16(ptr %x) {
3942 ; CHECK-LABEL: add_vi_v8i16:
3944 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
3945 ; CHECK-NEXT: vle16.v v8, (a0)
3946 ; CHECK-NEXT: vadd.vi v8, v8, -1
3947 ; CHECK-NEXT: vse16.v v8, (a0)
3949 %a = load <8 x i16>, ptr %x
3950 %d = add <8 x i16> %a, splat (i16 -1)
3951 store <8 x i16> %d, ptr %x
3955 define void @add_vi_v4i32(ptr %x) {
3956 ; CHECK-LABEL: add_vi_v4i32:
3958 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
3959 ; CHECK-NEXT: vle32.v v8, (a0)
3960 ; CHECK-NEXT: vadd.vi v8, v8, -1
3961 ; CHECK-NEXT: vse32.v v8, (a0)
3963 %a = load <4 x i32>, ptr %x
3964 %d = add <4 x i32> %a, splat (i32 -1)
3965 store <4 x i32> %d, ptr %x
3969 define void @add_vi_v2i64(ptr %x) {
3970 ; CHECK-LABEL: add_vi_v2i64:
3972 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
3973 ; CHECK-NEXT: vle64.v v8, (a0)
3974 ; CHECK-NEXT: vadd.vi v8, v8, -1
3975 ; CHECK-NEXT: vse64.v v8, (a0)
3977 %a = load <2 x i64>, ptr %x
3978 %d = add <2 x i64> %a, splat (i64 -1)
3979 store <2 x i64> %d, ptr %x
3983 define void @add_iv_v16i8(ptr %x) {
3984 ; CHECK-LABEL: add_iv_v16i8:
3986 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
3987 ; CHECK-NEXT: vle8.v v8, (a0)
3988 ; CHECK-NEXT: vadd.vi v8, v8, 1
3989 ; CHECK-NEXT: vse8.v v8, (a0)
3991 %a = load <16 x i8>, ptr %x
3992 %d = add <16 x i8> splat (i8 1), %a
3993 store <16 x i8> %d, ptr %x
3997 define void @add_iv_v8i16(ptr %x) {
3998 ; CHECK-LABEL: add_iv_v8i16:
4000 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4001 ; CHECK-NEXT: vle16.v v8, (a0)
4002 ; CHECK-NEXT: vadd.vi v8, v8, 1
4003 ; CHECK-NEXT: vse16.v v8, (a0)
4005 %a = load <8 x i16>, ptr %x
4006 %d = add <8 x i16> splat (i16 1), %a
4007 store <8 x i16> %d, ptr %x
4011 define void @add_iv_v4i32(ptr %x) {
4012 ; CHECK-LABEL: add_iv_v4i32:
4014 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4015 ; CHECK-NEXT: vle32.v v8, (a0)
4016 ; CHECK-NEXT: vadd.vi v8, v8, 1
4017 ; CHECK-NEXT: vse32.v v8, (a0)
4019 %a = load <4 x i32>, ptr %x
4020 %d = add <4 x i32> splat (i32 1), %a
4021 store <4 x i32> %d, ptr %x
4025 define void @add_iv_v2i64(ptr %x) {
4026 ; CHECK-LABEL: add_iv_v2i64:
4028 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4029 ; CHECK-NEXT: vle64.v v8, (a0)
4030 ; CHECK-NEXT: vadd.vi v8, v8, 1
4031 ; CHECK-NEXT: vse64.v v8, (a0)
4033 %a = load <2 x i64>, ptr %x
4034 %d = add <2 x i64> splat (i64 1), %a
4035 store <2 x i64> %d, ptr %x
4039 define void @add_vx_v16i8(ptr %x, i8 %y) {
4040 ; CHECK-LABEL: add_vx_v16i8:
4042 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4043 ; CHECK-NEXT: vle8.v v8, (a0)
4044 ; CHECK-NEXT: vadd.vx v8, v8, a1
4045 ; CHECK-NEXT: vse8.v v8, (a0)
4047 %a = load <16 x i8>, ptr %x
4048 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4049 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4050 %d = add <16 x i8> %a, %c
4051 store <16 x i8> %d, ptr %x
4055 define void @add_vx_v8i16(ptr %x, i16 %y) {
4056 ; CHECK-LABEL: add_vx_v8i16:
4058 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4059 ; CHECK-NEXT: vle16.v v8, (a0)
4060 ; CHECK-NEXT: vadd.vx v8, v8, a1
4061 ; CHECK-NEXT: vse16.v v8, (a0)
4063 %a = load <8 x i16>, ptr %x
4064 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4065 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4066 %d = add <8 x i16> %a, %c
4067 store <8 x i16> %d, ptr %x
4071 define void @add_vx_v4i32(ptr %x, i32 %y) {
4072 ; CHECK-LABEL: add_vx_v4i32:
4074 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4075 ; CHECK-NEXT: vle32.v v8, (a0)
4076 ; CHECK-NEXT: vadd.vx v8, v8, a1
4077 ; CHECK-NEXT: vse32.v v8, (a0)
4079 %a = load <4 x i32>, ptr %x
4080 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4081 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4082 %d = add <4 x i32> %a, %c
4083 store <4 x i32> %d, ptr %x
4087 define void @add_xv_v16i8(ptr %x, i8 %y) {
4088 ; CHECK-LABEL: add_xv_v16i8:
4090 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4091 ; CHECK-NEXT: vle8.v v8, (a0)
4092 ; CHECK-NEXT: vadd.vx v8, v8, a1
4093 ; CHECK-NEXT: vse8.v v8, (a0)
4095 %a = load <16 x i8>, ptr %x
4096 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4097 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4098 %d = add <16 x i8> %c, %a
4099 store <16 x i8> %d, ptr %x
4103 define void @add_xv_v8i16(ptr %x, i16 %y) {
4104 ; CHECK-LABEL: add_xv_v8i16:
4106 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4107 ; CHECK-NEXT: vle16.v v8, (a0)
4108 ; CHECK-NEXT: vadd.vx v8, v8, a1
4109 ; CHECK-NEXT: vse16.v v8, (a0)
4111 %a = load <8 x i16>, ptr %x
4112 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4113 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4114 %d = add <8 x i16> %c, %a
4115 store <8 x i16> %d, ptr %x
4119 define void @add_xv_v4i32(ptr %x, i32 %y) {
4120 ; CHECK-LABEL: add_xv_v4i32:
4122 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4123 ; CHECK-NEXT: vle32.v v8, (a0)
4124 ; CHECK-NEXT: vadd.vx v8, v8, a1
4125 ; CHECK-NEXT: vse32.v v8, (a0)
4127 %a = load <4 x i32>, ptr %x
4128 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4129 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4130 %d = add <4 x i32> %c, %a
4131 store <4 x i32> %d, ptr %x
4135 define void @sub_vi_v16i8(ptr %x) {
4136 ; CHECK-LABEL: sub_vi_v16i8:
4138 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4139 ; CHECK-NEXT: vle8.v v8, (a0)
4140 ; CHECK-NEXT: li a1, -1
4141 ; CHECK-NEXT: vsub.vx v8, v8, a1
4142 ; CHECK-NEXT: vse8.v v8, (a0)
4144 %a = load <16 x i8>, ptr %x
4145 %d = sub <16 x i8> %a, splat (i8 -1)
4146 store <16 x i8> %d, ptr %x
4150 define void @sub_vi_v8i16(ptr %x) {
4151 ; CHECK-LABEL: sub_vi_v8i16:
4153 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4154 ; CHECK-NEXT: vle16.v v8, (a0)
4155 ; CHECK-NEXT: li a1, -1
4156 ; CHECK-NEXT: vsub.vx v8, v8, a1
4157 ; CHECK-NEXT: vse16.v v8, (a0)
4159 %a = load <8 x i16>, ptr %x
4160 %d = sub <8 x i16> %a, splat (i16 -1)
4161 store <8 x i16> %d, ptr %x
4165 define void @sub_vi_v4i32(ptr %x) {
4166 ; CHECK-LABEL: sub_vi_v4i32:
4168 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4169 ; CHECK-NEXT: vle32.v v8, (a0)
4170 ; CHECK-NEXT: li a1, -1
4171 ; CHECK-NEXT: vsub.vx v8, v8, a1
4172 ; CHECK-NEXT: vse32.v v8, (a0)
4174 %a = load <4 x i32>, ptr %x
4175 %d = sub <4 x i32> %a, splat (i32 -1)
4176 store <4 x i32> %d, ptr %x
4180 define void @sub_vi_v2i64(ptr %x) {
4181 ; CHECK-LABEL: sub_vi_v2i64:
4183 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4184 ; CHECK-NEXT: vle64.v v8, (a0)
4185 ; CHECK-NEXT: li a1, -1
4186 ; CHECK-NEXT: vsub.vx v8, v8, a1
4187 ; CHECK-NEXT: vse64.v v8, (a0)
4189 %a = load <2 x i64>, ptr %x
4190 %d = sub <2 x i64> %a, splat (i64 -1)
4191 store <2 x i64> %d, ptr %x
4195 define void @sub_iv_v16i8(ptr %x) {
4196 ; CHECK-LABEL: sub_iv_v16i8:
4198 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4199 ; CHECK-NEXT: vle8.v v8, (a0)
4200 ; CHECK-NEXT: vrsub.vi v8, v8, 1
4201 ; CHECK-NEXT: vse8.v v8, (a0)
4203 %a = load <16 x i8>, ptr %x
4204 %d = sub <16 x i8> splat (i8 1), %a
4205 store <16 x i8> %d, ptr %x
4209 define void @sub_iv_v8i16(ptr %x) {
4210 ; CHECK-LABEL: sub_iv_v8i16:
4212 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4213 ; CHECK-NEXT: vle16.v v8, (a0)
4214 ; CHECK-NEXT: vrsub.vi v8, v8, 1
4215 ; CHECK-NEXT: vse16.v v8, (a0)
4217 %a = load <8 x i16>, ptr %x
4218 %d = sub <8 x i16> splat (i16 1), %a
4219 store <8 x i16> %d, ptr %x
4223 define void @sub_iv_v4i32(ptr %x) {
4224 ; CHECK-LABEL: sub_iv_v4i32:
4226 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4227 ; CHECK-NEXT: vle32.v v8, (a0)
4228 ; CHECK-NEXT: vrsub.vi v8, v8, 1
4229 ; CHECK-NEXT: vse32.v v8, (a0)
4231 %a = load <4 x i32>, ptr %x
4232 %d = sub <4 x i32> splat (i32 1), %a
4233 store <4 x i32> %d, ptr %x
4237 define void @sub_iv_v2i64(ptr %x) {
4238 ; CHECK-LABEL: sub_iv_v2i64:
4240 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4241 ; CHECK-NEXT: vle64.v v8, (a0)
4242 ; CHECK-NEXT: vrsub.vi v8, v8, 1
4243 ; CHECK-NEXT: vse64.v v8, (a0)
4245 %a = load <2 x i64>, ptr %x
4246 %d = sub <2 x i64> splat (i64 1), %a
4247 store <2 x i64> %d, ptr %x
4251 define void @sub_vx_v16i8(ptr %x, i8 %y) {
4252 ; CHECK-LABEL: sub_vx_v16i8:
4254 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4255 ; CHECK-NEXT: vle8.v v8, (a0)
4256 ; CHECK-NEXT: vsub.vx v8, v8, a1
4257 ; CHECK-NEXT: vse8.v v8, (a0)
4259 %a = load <16 x i8>, ptr %x
4260 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4261 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4262 %d = sub <16 x i8> %a, %c
4263 store <16 x i8> %d, ptr %x
4267 define void @sub_vx_v8i16(ptr %x, i16 %y) {
4268 ; CHECK-LABEL: sub_vx_v8i16:
4270 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4271 ; CHECK-NEXT: vle16.v v8, (a0)
4272 ; CHECK-NEXT: vsub.vx v8, v8, a1
4273 ; CHECK-NEXT: vse16.v v8, (a0)
4275 %a = load <8 x i16>, ptr %x
4276 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4277 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4278 %d = sub <8 x i16> %a, %c
4279 store <8 x i16> %d, ptr %x
4283 define void @sub_vx_v4i32(ptr %x, i32 %y) {
4284 ; CHECK-LABEL: sub_vx_v4i32:
4286 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4287 ; CHECK-NEXT: vle32.v v8, (a0)
4288 ; CHECK-NEXT: vsub.vx v8, v8, a1
4289 ; CHECK-NEXT: vse32.v v8, (a0)
4291 %a = load <4 x i32>, ptr %x
4292 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4293 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4294 %d = sub <4 x i32> %a, %c
4295 store <4 x i32> %d, ptr %x
4299 define void @sub_xv_v16i8(ptr %x, i8 %y) {
4300 ; CHECK-LABEL: sub_xv_v16i8:
4302 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4303 ; CHECK-NEXT: vle8.v v8, (a0)
4304 ; CHECK-NEXT: vrsub.vx v8, v8, a1
4305 ; CHECK-NEXT: vse8.v v8, (a0)
4307 %a = load <16 x i8>, ptr %x
4308 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4309 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4310 %d = sub <16 x i8> %c, %a
4311 store <16 x i8> %d, ptr %x
4315 define void @sub_xv_v8i16(ptr %x, i16 %y) {
4316 ; CHECK-LABEL: sub_xv_v8i16:
4318 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4319 ; CHECK-NEXT: vle16.v v8, (a0)
4320 ; CHECK-NEXT: vrsub.vx v8, v8, a1
4321 ; CHECK-NEXT: vse16.v v8, (a0)
4323 %a = load <8 x i16>, ptr %x
4324 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4325 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4326 %d = sub <8 x i16> %c, %a
4327 store <8 x i16> %d, ptr %x
4331 define void @sub_xv_v4i32(ptr %x, i32 %y) {
4332 ; CHECK-LABEL: sub_xv_v4i32:
4334 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4335 ; CHECK-NEXT: vle32.v v8, (a0)
4336 ; CHECK-NEXT: vrsub.vx v8, v8, a1
4337 ; CHECK-NEXT: vse32.v v8, (a0)
4339 %a = load <4 x i32>, ptr %x
4340 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4341 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4342 %d = sub <4 x i32> %c, %a
4343 store <4 x i32> %d, ptr %x
4347 define void @mul_vx_v16i8(ptr %x, i8 %y) {
4348 ; CHECK-LABEL: mul_vx_v16i8:
4350 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4351 ; CHECK-NEXT: vle8.v v8, (a0)
4352 ; CHECK-NEXT: vmul.vx v8, v8, a1
4353 ; CHECK-NEXT: vse8.v v8, (a0)
4355 %a = load <16 x i8>, ptr %x
4356 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4357 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4358 %d = mul <16 x i8> %a, %c
4359 store <16 x i8> %d, ptr %x
4363 define void @mul_vx_v8i16(ptr %x, i16 %y) {
4364 ; CHECK-LABEL: mul_vx_v8i16:
4366 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4367 ; CHECK-NEXT: vle16.v v8, (a0)
4368 ; CHECK-NEXT: vmul.vx v8, v8, a1
4369 ; CHECK-NEXT: vse16.v v8, (a0)
4371 %a = load <8 x i16>, ptr %x
4372 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4373 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4374 %d = mul <8 x i16> %a, %c
4375 store <8 x i16> %d, ptr %x
4379 define void @mul_vx_v4i32(ptr %x, i32 %y) {
4380 ; CHECK-LABEL: mul_vx_v4i32:
4382 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4383 ; CHECK-NEXT: vle32.v v8, (a0)
4384 ; CHECK-NEXT: vmul.vx v8, v8, a1
4385 ; CHECK-NEXT: vse32.v v8, (a0)
4387 %a = load <4 x i32>, ptr %x
4388 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4389 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4390 %d = mul <4 x i32> %a, %c
4391 store <4 x i32> %d, ptr %x
4395 define void @mul_xv_v16i8(ptr %x, i8 %y) {
4396 ; CHECK-LABEL: mul_xv_v16i8:
4398 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4399 ; CHECK-NEXT: vle8.v v8, (a0)
4400 ; CHECK-NEXT: vmul.vx v8, v8, a1
4401 ; CHECK-NEXT: vse8.v v8, (a0)
4403 %a = load <16 x i8>, ptr %x
4404 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4405 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4406 %d = mul <16 x i8> %c, %a
4407 store <16 x i8> %d, ptr %x
4411 define void @mul_xv_v8i16(ptr %x, i16 %y) {
4412 ; CHECK-LABEL: mul_xv_v8i16:
4414 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4415 ; CHECK-NEXT: vle16.v v8, (a0)
4416 ; CHECK-NEXT: vmul.vx v8, v8, a1
4417 ; CHECK-NEXT: vse16.v v8, (a0)
4419 %a = load <8 x i16>, ptr %x
4420 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4421 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4422 %d = mul <8 x i16> %c, %a
4423 store <8 x i16> %d, ptr %x
4427 define void @mul_xv_v4i32(ptr %x, i32 %y) {
4428 ; CHECK-LABEL: mul_xv_v4i32:
4430 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4431 ; CHECK-NEXT: vle32.v v8, (a0)
4432 ; CHECK-NEXT: vmul.vx v8, v8, a1
4433 ; CHECK-NEXT: vse32.v v8, (a0)
4435 %a = load <4 x i32>, ptr %x
4436 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4437 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4438 %d = mul <4 x i32> %c, %a
4439 store <4 x i32> %d, ptr %x
4443 define void @and_vi_v16i8(ptr %x) {
4444 ; CHECK-LABEL: and_vi_v16i8:
4446 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4447 ; CHECK-NEXT: vle8.v v8, (a0)
4448 ; CHECK-NEXT: vand.vi v8, v8, -2
4449 ; CHECK-NEXT: vse8.v v8, (a0)
4451 %a = load <16 x i8>, ptr %x
4452 %d = and <16 x i8> %a, splat (i8 -2)
4453 store <16 x i8> %d, ptr %x
4457 define void @and_vi_v8i16(ptr %x) {
4458 ; CHECK-LABEL: and_vi_v8i16:
4460 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4461 ; CHECK-NEXT: vle16.v v8, (a0)
4462 ; CHECK-NEXT: vand.vi v8, v8, -2
4463 ; CHECK-NEXT: vse16.v v8, (a0)
4465 %a = load <8 x i16>, ptr %x
4466 %d = and <8 x i16> %a, splat (i16 -2)
4467 store <8 x i16> %d, ptr %x
4471 define void @and_vi_v4i32(ptr %x) {
4472 ; CHECK-LABEL: and_vi_v4i32:
4474 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4475 ; CHECK-NEXT: vle32.v v8, (a0)
4476 ; CHECK-NEXT: vand.vi v8, v8, -2
4477 ; CHECK-NEXT: vse32.v v8, (a0)
4479 %a = load <4 x i32>, ptr %x
4480 %d = and <4 x i32> %a, splat (i32 -2)
4481 store <4 x i32> %d, ptr %x
4485 define void @and_vi_v2i64(ptr %x) {
4486 ; CHECK-LABEL: and_vi_v2i64:
4488 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4489 ; CHECK-NEXT: vle64.v v8, (a0)
4490 ; CHECK-NEXT: vand.vi v8, v8, -2
4491 ; CHECK-NEXT: vse64.v v8, (a0)
4493 %a = load <2 x i64>, ptr %x
4494 %d = and <2 x i64> %a, splat (i64 -2)
4495 store <2 x i64> %d, ptr %x
4499 define void @and_iv_v16i8(ptr %x) {
4500 ; CHECK-LABEL: and_iv_v16i8:
4502 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4503 ; CHECK-NEXT: vle8.v v8, (a0)
4504 ; CHECK-NEXT: vand.vi v8, v8, 1
4505 ; CHECK-NEXT: vse8.v v8, (a0)
4507 %a = load <16 x i8>, ptr %x
4508 %d = and <16 x i8> splat (i8 1), %a
4509 store <16 x i8> %d, ptr %x
4513 define void @and_iv_v8i16(ptr %x) {
4514 ; CHECK-LABEL: and_iv_v8i16:
4516 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4517 ; CHECK-NEXT: vle16.v v8, (a0)
4518 ; CHECK-NEXT: vand.vi v8, v8, 1
4519 ; CHECK-NEXT: vse16.v v8, (a0)
4521 %a = load <8 x i16>, ptr %x
4522 %d = and <8 x i16> splat (i16 1), %a
4523 store <8 x i16> %d, ptr %x
4527 define void @and_iv_v4i32(ptr %x) {
4528 ; CHECK-LABEL: and_iv_v4i32:
4530 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4531 ; CHECK-NEXT: vle32.v v8, (a0)
4532 ; CHECK-NEXT: vand.vi v8, v8, 1
4533 ; CHECK-NEXT: vse32.v v8, (a0)
4535 %a = load <4 x i32>, ptr %x
4536 %d = and <4 x i32> splat (i32 1), %a
4537 store <4 x i32> %d, ptr %x
4541 define void @and_iv_v2i64(ptr %x) {
4542 ; CHECK-LABEL: and_iv_v2i64:
4544 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4545 ; CHECK-NEXT: vle64.v v8, (a0)
4546 ; CHECK-NEXT: vand.vi v8, v8, 1
4547 ; CHECK-NEXT: vse64.v v8, (a0)
4549 %a = load <2 x i64>, ptr %x
4550 %d = and <2 x i64> splat (i64 1), %a
4551 store <2 x i64> %d, ptr %x
4555 define void @and_vx_v16i8(ptr %x, i8 %y) {
4556 ; CHECK-LABEL: and_vx_v16i8:
4558 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4559 ; CHECK-NEXT: vle8.v v8, (a0)
4560 ; CHECK-NEXT: vand.vx v8, v8, a1
4561 ; CHECK-NEXT: vse8.v v8, (a0)
4563 %a = load <16 x i8>, ptr %x
4564 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4565 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4566 %d = and <16 x i8> %a, %c
4567 store <16 x i8> %d, ptr %x
4571 define void @and_vx_v8i16(ptr %x, i16 %y) {
4572 ; CHECK-LABEL: and_vx_v8i16:
4574 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4575 ; CHECK-NEXT: vle16.v v8, (a0)
4576 ; CHECK-NEXT: vand.vx v8, v8, a1
4577 ; CHECK-NEXT: vse16.v v8, (a0)
4579 %a = load <8 x i16>, ptr %x
4580 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4581 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4582 %d = and <8 x i16> %a, %c
4583 store <8 x i16> %d, ptr %x
4587 define void @and_vx_v4i32(ptr %x, i32 %y) {
4588 ; CHECK-LABEL: and_vx_v4i32:
4590 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4591 ; CHECK-NEXT: vle32.v v8, (a0)
4592 ; CHECK-NEXT: vand.vx v8, v8, a1
4593 ; CHECK-NEXT: vse32.v v8, (a0)
4595 %a = load <4 x i32>, ptr %x
4596 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4597 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4598 %d = and <4 x i32> %a, %c
4599 store <4 x i32> %d, ptr %x
4603 define void @and_xv_v16i8(ptr %x, i8 %y) {
4604 ; CHECK-LABEL: and_xv_v16i8:
4606 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4607 ; CHECK-NEXT: vle8.v v8, (a0)
4608 ; CHECK-NEXT: vand.vx v8, v8, a1
4609 ; CHECK-NEXT: vse8.v v8, (a0)
4611 %a = load <16 x i8>, ptr %x
4612 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4613 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4614 %d = and <16 x i8> %c, %a
4615 store <16 x i8> %d, ptr %x
4619 define void @and_xv_v8i16(ptr %x, i16 %y) {
4620 ; CHECK-LABEL: and_xv_v8i16:
4622 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4623 ; CHECK-NEXT: vle16.v v8, (a0)
4624 ; CHECK-NEXT: vand.vx v8, v8, a1
4625 ; CHECK-NEXT: vse16.v v8, (a0)
4627 %a = load <8 x i16>, ptr %x
4628 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4629 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4630 %d = and <8 x i16> %c, %a
4631 store <8 x i16> %d, ptr %x
4635 define void @and_xv_v4i32(ptr %x, i32 %y) {
4636 ; CHECK-LABEL: and_xv_v4i32:
4638 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4639 ; CHECK-NEXT: vle32.v v8, (a0)
4640 ; CHECK-NEXT: vand.vx v8, v8, a1
4641 ; CHECK-NEXT: vse32.v v8, (a0)
4643 %a = load <4 x i32>, ptr %x
4644 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4645 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4646 %d = and <4 x i32> %c, %a
4647 store <4 x i32> %d, ptr %x
4651 define void @or_vi_v16i8(ptr %x) {
4652 ; CHECK-LABEL: or_vi_v16i8:
4654 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4655 ; CHECK-NEXT: vle8.v v8, (a0)
4656 ; CHECK-NEXT: vor.vi v8, v8, -2
4657 ; CHECK-NEXT: vse8.v v8, (a0)
4659 %a = load <16 x i8>, ptr %x
4660 %d = or <16 x i8> %a, splat (i8 -2)
4661 store <16 x i8> %d, ptr %x
4665 define void @or_vi_v8i16(ptr %x) {
4666 ; CHECK-LABEL: or_vi_v8i16:
4668 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4669 ; CHECK-NEXT: vle16.v v8, (a0)
4670 ; CHECK-NEXT: vor.vi v8, v8, -2
4671 ; CHECK-NEXT: vse16.v v8, (a0)
4673 %a = load <8 x i16>, ptr %x
4674 %d = or <8 x i16> %a, splat (i16 -2)
4675 store <8 x i16> %d, ptr %x
4679 define void @or_vi_v4i32(ptr %x) {
4680 ; CHECK-LABEL: or_vi_v4i32:
4682 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4683 ; CHECK-NEXT: vle32.v v8, (a0)
4684 ; CHECK-NEXT: vor.vi v8, v8, -2
4685 ; CHECK-NEXT: vse32.v v8, (a0)
4687 %a = load <4 x i32>, ptr %x
4688 %d = or <4 x i32> %a, splat (i32 -2)
4689 store <4 x i32> %d, ptr %x
4693 define void @or_vi_v2i64(ptr %x) {
4694 ; CHECK-LABEL: or_vi_v2i64:
4696 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4697 ; CHECK-NEXT: vle64.v v8, (a0)
4698 ; CHECK-NEXT: vor.vi v8, v8, -2
4699 ; CHECK-NEXT: vse64.v v8, (a0)
4701 %a = load <2 x i64>, ptr %x
4702 %d = or <2 x i64> %a, splat (i64 -2)
4703 store <2 x i64> %d, ptr %x
4707 define void @or_iv_v16i8(ptr %x) {
4708 ; CHECK-LABEL: or_iv_v16i8:
4710 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4711 ; CHECK-NEXT: vle8.v v8, (a0)
4712 ; CHECK-NEXT: vor.vi v8, v8, 1
4713 ; CHECK-NEXT: vse8.v v8, (a0)
4715 %a = load <16 x i8>, ptr %x
4716 %d = or <16 x i8> splat (i8 1), %a
4717 store <16 x i8> %d, ptr %x
4721 define void @or_iv_v8i16(ptr %x) {
4722 ; CHECK-LABEL: or_iv_v8i16:
4724 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4725 ; CHECK-NEXT: vle16.v v8, (a0)
4726 ; CHECK-NEXT: vor.vi v8, v8, 1
4727 ; CHECK-NEXT: vse16.v v8, (a0)
4729 %a = load <8 x i16>, ptr %x
4730 %d = or <8 x i16> splat (i16 1), %a
4731 store <8 x i16> %d, ptr %x
4735 define void @or_iv_v4i32(ptr %x) {
4736 ; CHECK-LABEL: or_iv_v4i32:
4738 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4739 ; CHECK-NEXT: vle32.v v8, (a0)
4740 ; CHECK-NEXT: vor.vi v8, v8, 1
4741 ; CHECK-NEXT: vse32.v v8, (a0)
4743 %a = load <4 x i32>, ptr %x
4744 %d = or <4 x i32> splat (i32 1), %a
4745 store <4 x i32> %d, ptr %x
4749 define void @or_iv_v2i64(ptr %x) {
4750 ; CHECK-LABEL: or_iv_v2i64:
4752 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4753 ; CHECK-NEXT: vle64.v v8, (a0)
4754 ; CHECK-NEXT: vor.vi v8, v8, 1
4755 ; CHECK-NEXT: vse64.v v8, (a0)
4757 %a = load <2 x i64>, ptr %x
4758 %d = or <2 x i64> splat (i64 1), %a
4759 store <2 x i64> %d, ptr %x
4763 define void @or_vx_v16i8(ptr %x, i8 %y) {
4764 ; CHECK-LABEL: or_vx_v16i8:
4766 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4767 ; CHECK-NEXT: vle8.v v8, (a0)
4768 ; CHECK-NEXT: vor.vx v8, v8, a1
4769 ; CHECK-NEXT: vse8.v v8, (a0)
4771 %a = load <16 x i8>, ptr %x
4772 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4773 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4774 %d = or <16 x i8> %a, %c
4775 store <16 x i8> %d, ptr %x
4779 define void @or_vx_v8i16(ptr %x, i16 %y) {
4780 ; CHECK-LABEL: or_vx_v8i16:
4782 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4783 ; CHECK-NEXT: vle16.v v8, (a0)
4784 ; CHECK-NEXT: vor.vx v8, v8, a1
4785 ; CHECK-NEXT: vse16.v v8, (a0)
4787 %a = load <8 x i16>, ptr %x
4788 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4789 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4790 %d = or <8 x i16> %a, %c
4791 store <8 x i16> %d, ptr %x
4795 define void @or_vx_v4i32(ptr %x, i32 %y) {
4796 ; CHECK-LABEL: or_vx_v4i32:
4798 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4799 ; CHECK-NEXT: vle32.v v8, (a0)
4800 ; CHECK-NEXT: vor.vx v8, v8, a1
4801 ; CHECK-NEXT: vse32.v v8, (a0)
4803 %a = load <4 x i32>, ptr %x
4804 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4805 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4806 %d = or <4 x i32> %a, %c
4807 store <4 x i32> %d, ptr %x
4811 define void @or_xv_v16i8(ptr %x, i8 %y) {
4812 ; CHECK-LABEL: or_xv_v16i8:
4814 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4815 ; CHECK-NEXT: vle8.v v8, (a0)
4816 ; CHECK-NEXT: vor.vx v8, v8, a1
4817 ; CHECK-NEXT: vse8.v v8, (a0)
4819 %a = load <16 x i8>, ptr %x
4820 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4821 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4822 %d = or <16 x i8> %c, %a
4823 store <16 x i8> %d, ptr %x
4827 define void @or_xv_v8i16(ptr %x, i16 %y) {
4828 ; CHECK-LABEL: or_xv_v8i16:
4830 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4831 ; CHECK-NEXT: vle16.v v8, (a0)
4832 ; CHECK-NEXT: vor.vx v8, v8, a1
4833 ; CHECK-NEXT: vse16.v v8, (a0)
4835 %a = load <8 x i16>, ptr %x
4836 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4837 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4838 %d = or <8 x i16> %c, %a
4839 store <8 x i16> %d, ptr %x
4843 define void @or_xv_v4i32(ptr %x, i32 %y) {
4844 ; CHECK-LABEL: or_xv_v4i32:
4846 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4847 ; CHECK-NEXT: vle32.v v8, (a0)
4848 ; CHECK-NEXT: vor.vx v8, v8, a1
4849 ; CHECK-NEXT: vse32.v v8, (a0)
4851 %a = load <4 x i32>, ptr %x
4852 %b = insertelement <4 x i32> poison, i32 %y, i32 0
4853 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
4854 %d = or <4 x i32> %c, %a
4855 store <4 x i32> %d, ptr %x
4859 define void @xor_vi_v16i8(ptr %x) {
4860 ; CHECK-LABEL: xor_vi_v16i8:
4862 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4863 ; CHECK-NEXT: vle8.v v8, (a0)
4864 ; CHECK-NEXT: vnot.v v8, v8
4865 ; CHECK-NEXT: vse8.v v8, (a0)
4867 %a = load <16 x i8>, ptr %x
4868 %d = xor <16 x i8> %a, splat (i8 -1)
4869 store <16 x i8> %d, ptr %x
4873 define void @xor_vi_v8i16(ptr %x) {
4874 ; CHECK-LABEL: xor_vi_v8i16:
4876 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4877 ; CHECK-NEXT: vle16.v v8, (a0)
4878 ; CHECK-NEXT: vnot.v v8, v8
4879 ; CHECK-NEXT: vse16.v v8, (a0)
4881 %a = load <8 x i16>, ptr %x
4882 %d = xor <8 x i16> %a, splat (i16 -1)
4883 store <8 x i16> %d, ptr %x
4887 define void @xor_vi_v4i32(ptr %x) {
4888 ; CHECK-LABEL: xor_vi_v4i32:
4890 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4891 ; CHECK-NEXT: vle32.v v8, (a0)
4892 ; CHECK-NEXT: vnot.v v8, v8
4893 ; CHECK-NEXT: vse32.v v8, (a0)
4895 %a = load <4 x i32>, ptr %x
4896 %d = xor <4 x i32> %a, splat (i32 -1)
4897 store <4 x i32> %d, ptr %x
4901 define void @xor_vi_v2i64(ptr %x) {
4902 ; CHECK-LABEL: xor_vi_v2i64:
4904 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4905 ; CHECK-NEXT: vle64.v v8, (a0)
4906 ; CHECK-NEXT: vnot.v v8, v8
4907 ; CHECK-NEXT: vse64.v v8, (a0)
4909 %a = load <2 x i64>, ptr %x
4910 %d = xor <2 x i64> %a, splat (i64 -1)
4911 store <2 x i64> %d, ptr %x
4915 define void @xor_iv_v16i8(ptr %x) {
4916 ; CHECK-LABEL: xor_iv_v16i8:
4918 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4919 ; CHECK-NEXT: vle8.v v8, (a0)
4920 ; CHECK-NEXT: vxor.vi v8, v8, 1
4921 ; CHECK-NEXT: vse8.v v8, (a0)
4923 %a = load <16 x i8>, ptr %x
4924 %d = xor <16 x i8> splat (i8 1), %a
4925 store <16 x i8> %d, ptr %x
4929 define void @xor_iv_v8i16(ptr %x) {
4930 ; CHECK-LABEL: xor_iv_v8i16:
4932 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4933 ; CHECK-NEXT: vle16.v v8, (a0)
4934 ; CHECK-NEXT: vxor.vi v8, v8, 1
4935 ; CHECK-NEXT: vse16.v v8, (a0)
4937 %a = load <8 x i16>, ptr %x
4938 %d = xor <8 x i16> splat (i16 1), %a
4939 store <8 x i16> %d, ptr %x
4943 define void @xor_iv_v4i32(ptr %x) {
4944 ; CHECK-LABEL: xor_iv_v4i32:
4946 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
4947 ; CHECK-NEXT: vle32.v v8, (a0)
4948 ; CHECK-NEXT: vxor.vi v8, v8, 1
4949 ; CHECK-NEXT: vse32.v v8, (a0)
4951 %a = load <4 x i32>, ptr %x
4952 %d = xor <4 x i32> splat (i32 1), %a
4953 store <4 x i32> %d, ptr %x
4957 define void @xor_iv_v2i64(ptr %x) {
4958 ; CHECK-LABEL: xor_iv_v2i64:
4960 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
4961 ; CHECK-NEXT: vle64.v v8, (a0)
4962 ; CHECK-NEXT: vxor.vi v8, v8, 1
4963 ; CHECK-NEXT: vse64.v v8, (a0)
4965 %a = load <2 x i64>, ptr %x
4966 %d = xor <2 x i64> splat (i64 1), %a
4967 store <2 x i64> %d, ptr %x
4971 define void @xor_vx_v16i8(ptr %x, i8 %y) {
4972 ; CHECK-LABEL: xor_vx_v16i8:
4974 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
4975 ; CHECK-NEXT: vle8.v v8, (a0)
4976 ; CHECK-NEXT: vxor.vx v8, v8, a1
4977 ; CHECK-NEXT: vse8.v v8, (a0)
4979 %a = load <16 x i8>, ptr %x
4980 %b = insertelement <16 x i8> poison, i8 %y, i32 0
4981 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
4982 %d = xor <16 x i8> %a, %c
4983 store <16 x i8> %d, ptr %x
4987 define void @xor_vx_v8i16(ptr %x, i16 %y) {
4988 ; CHECK-LABEL: xor_vx_v8i16:
4990 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
4991 ; CHECK-NEXT: vle16.v v8, (a0)
4992 ; CHECK-NEXT: vxor.vx v8, v8, a1
4993 ; CHECK-NEXT: vse16.v v8, (a0)
4995 %a = load <8 x i16>, ptr %x
4996 %b = insertelement <8 x i16> poison, i16 %y, i32 0
4997 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
4998 %d = xor <8 x i16> %a, %c
4999 store <8 x i16> %d, ptr %x
5003 define void @xor_vx_v4i32(ptr %x, i32 %y) {
5004 ; CHECK-LABEL: xor_vx_v4i32:
5006 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5007 ; CHECK-NEXT: vle32.v v8, (a0)
5008 ; CHECK-NEXT: vxor.vx v8, v8, a1
5009 ; CHECK-NEXT: vse32.v v8, (a0)
5011 %a = load <4 x i32>, ptr %x
5012 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5013 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5014 %d = xor <4 x i32> %a, %c
5015 store <4 x i32> %d, ptr %x
5019 define void @xor_xv_v16i8(ptr %x, i8 %y) {
5020 ; CHECK-LABEL: xor_xv_v16i8:
5022 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5023 ; CHECK-NEXT: vle8.v v8, (a0)
5024 ; CHECK-NEXT: vxor.vx v8, v8, a1
5025 ; CHECK-NEXT: vse8.v v8, (a0)
5027 %a = load <16 x i8>, ptr %x
5028 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5029 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5030 %d = xor <16 x i8> %c, %a
5031 store <16 x i8> %d, ptr %x
5035 define void @xor_xv_v8i16(ptr %x, i16 %y) {
5036 ; CHECK-LABEL: xor_xv_v8i16:
5038 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5039 ; CHECK-NEXT: vle16.v v8, (a0)
5040 ; CHECK-NEXT: vxor.vx v8, v8, a1
5041 ; CHECK-NEXT: vse16.v v8, (a0)
5043 %a = load <8 x i16>, ptr %x
5044 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5045 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5046 %d = xor <8 x i16> %c, %a
5047 store <8 x i16> %d, ptr %x
5051 define void @xor_xv_v4i32(ptr %x, i32 %y) {
5052 ; CHECK-LABEL: xor_xv_v4i32:
5054 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5055 ; CHECK-NEXT: vle32.v v8, (a0)
5056 ; CHECK-NEXT: vxor.vx v8, v8, a1
5057 ; CHECK-NEXT: vse32.v v8, (a0)
5059 %a = load <4 x i32>, ptr %x
5060 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5061 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5062 %d = xor <4 x i32> %c, %a
5063 store <4 x i32> %d, ptr %x
5067 define void @lshr_vi_v16i8(ptr %x) {
5068 ; CHECK-LABEL: lshr_vi_v16i8:
5070 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5071 ; CHECK-NEXT: vle8.v v8, (a0)
5072 ; CHECK-NEXT: vsrl.vi v8, v8, 7
5073 ; CHECK-NEXT: vse8.v v8, (a0)
5075 %a = load <16 x i8>, ptr %x
5076 %d = lshr <16 x i8> %a, splat (i8 7)
5077 store <16 x i8> %d, ptr %x
5081 define void @lshr_vi_v8i16(ptr %x) {
5082 ; CHECK-LABEL: lshr_vi_v8i16:
5084 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5085 ; CHECK-NEXT: vle16.v v8, (a0)
5086 ; CHECK-NEXT: vsrl.vi v8, v8, 15
5087 ; CHECK-NEXT: vse16.v v8, (a0)
5089 %a = load <8 x i16>, ptr %x
5090 %d = lshr <8 x i16> %a, splat (i16 15)
5091 store <8 x i16> %d, ptr %x
5095 define void @lshr_vi_v4i32(ptr %x) {
5096 ; CHECK-LABEL: lshr_vi_v4i32:
5098 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5099 ; CHECK-NEXT: vle32.v v8, (a0)
5100 ; CHECK-NEXT: vsrl.vi v8, v8, 31
5101 ; CHECK-NEXT: vse32.v v8, (a0)
5103 %a = load <4 x i32>, ptr %x
5104 %d = lshr <4 x i32> %a, splat (i32 31)
5105 store <4 x i32> %d, ptr %x
5109 define void @lshr_vi_v2i64(ptr %x) {
5110 ; CHECK-LABEL: lshr_vi_v2i64:
5112 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5113 ; CHECK-NEXT: vle64.v v8, (a0)
5114 ; CHECK-NEXT: vsrl.vi v8, v8, 31
5115 ; CHECK-NEXT: vse64.v v8, (a0)
5117 %a = load <2 x i64>, ptr %x
5118 %d = lshr <2 x i64> %a, splat (i64 31)
5119 store <2 x i64> %d, ptr %x
5123 define void @lshr_vx_v16i8(ptr %x, i8 %y) {
5124 ; CHECK-LABEL: lshr_vx_v16i8:
5126 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5127 ; CHECK-NEXT: vle8.v v8, (a0)
5128 ; CHECK-NEXT: vsrl.vx v8, v8, a1
5129 ; CHECK-NEXT: vse8.v v8, (a0)
5131 %a = load <16 x i8>, ptr %x
5132 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5133 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5134 %d = lshr <16 x i8> %a, %c
5135 store <16 x i8> %d, ptr %x
5139 define void @lshr_vx_v8i16(ptr %x, i16 %y) {
5140 ; CHECK-LABEL: lshr_vx_v8i16:
5142 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5143 ; CHECK-NEXT: vle16.v v8, (a0)
5144 ; CHECK-NEXT: vsrl.vx v8, v8, a1
5145 ; CHECK-NEXT: vse16.v v8, (a0)
5147 %a = load <8 x i16>, ptr %x
5148 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5149 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5150 %d = lshr <8 x i16> %a, %c
5151 store <8 x i16> %d, ptr %x
5155 define void @lshr_vx_v4i32(ptr %x, i32 %y) {
5156 ; CHECK-LABEL: lshr_vx_v4i32:
5158 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5159 ; CHECK-NEXT: vle32.v v8, (a0)
5160 ; CHECK-NEXT: vsrl.vx v8, v8, a1
5161 ; CHECK-NEXT: vse32.v v8, (a0)
5163 %a = load <4 x i32>, ptr %x
5164 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5165 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5166 %d = lshr <4 x i32> %a, %c
5167 store <4 x i32> %d, ptr %x
5171 define void @ashr_vi_v16i8(ptr %x) {
5172 ; CHECK-LABEL: ashr_vi_v16i8:
5174 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5175 ; CHECK-NEXT: vle8.v v8, (a0)
5176 ; CHECK-NEXT: vsra.vi v8, v8, 7
5177 ; CHECK-NEXT: vse8.v v8, (a0)
5179 %a = load <16 x i8>, ptr %x
5180 %d = ashr <16 x i8> %a, splat (i8 7)
5181 store <16 x i8> %d, ptr %x
5185 define void @ashr_vi_v8i16(ptr %x) {
5186 ; CHECK-LABEL: ashr_vi_v8i16:
5188 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5189 ; CHECK-NEXT: vle16.v v8, (a0)
5190 ; CHECK-NEXT: vsra.vi v8, v8, 15
5191 ; CHECK-NEXT: vse16.v v8, (a0)
5193 %a = load <8 x i16>, ptr %x
5194 %d = ashr <8 x i16> %a, splat (i16 15)
5195 store <8 x i16> %d, ptr %x
5199 define void @ashr_vi_v4i32(ptr %x) {
5200 ; CHECK-LABEL: ashr_vi_v4i32:
5202 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5203 ; CHECK-NEXT: vle32.v v8, (a0)
5204 ; CHECK-NEXT: vsra.vi v8, v8, 31
5205 ; CHECK-NEXT: vse32.v v8, (a0)
5207 %a = load <4 x i32>, ptr %x
5208 %d = ashr <4 x i32> %a, splat (i32 31)
5209 store <4 x i32> %d, ptr %x
5213 define void @ashr_vi_v2i64(ptr %x) {
5214 ; CHECK-LABEL: ashr_vi_v2i64:
5216 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5217 ; CHECK-NEXT: vle64.v v8, (a0)
5218 ; CHECK-NEXT: vsra.vi v8, v8, 31
5219 ; CHECK-NEXT: vse64.v v8, (a0)
5221 %a = load <2 x i64>, ptr %x
5222 %d = ashr <2 x i64> %a, splat (i64 31)
5223 store <2 x i64> %d, ptr %x
5227 define void @ashr_vx_v16i8(ptr %x, i8 %y) {
5228 ; CHECK-LABEL: ashr_vx_v16i8:
5230 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5231 ; CHECK-NEXT: vle8.v v8, (a0)
5232 ; CHECK-NEXT: vsra.vx v8, v8, a1
5233 ; CHECK-NEXT: vse8.v v8, (a0)
5235 %a = load <16 x i8>, ptr %x
5236 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5237 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5238 %d = ashr <16 x i8> %a, %c
5239 store <16 x i8> %d, ptr %x
5243 define void @ashr_vx_v8i16(ptr %x, i16 %y) {
5244 ; CHECK-LABEL: ashr_vx_v8i16:
5246 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5247 ; CHECK-NEXT: vle16.v v8, (a0)
5248 ; CHECK-NEXT: vsra.vx v8, v8, a1
5249 ; CHECK-NEXT: vse16.v v8, (a0)
5251 %a = load <8 x i16>, ptr %x
5252 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5253 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5254 %d = ashr <8 x i16> %a, %c
5255 store <8 x i16> %d, ptr %x
5259 define void @ashr_vx_v4i32(ptr %x, i32 %y) {
5260 ; CHECK-LABEL: ashr_vx_v4i32:
5262 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5263 ; CHECK-NEXT: vle32.v v8, (a0)
5264 ; CHECK-NEXT: vsra.vx v8, v8, a1
5265 ; CHECK-NEXT: vse32.v v8, (a0)
5267 %a = load <4 x i32>, ptr %x
5268 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5269 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5270 %d = ashr <4 x i32> %a, %c
5271 store <4 x i32> %d, ptr %x
5275 define void @shl_vi_v16i8(ptr %x) {
5276 ; CHECK-LABEL: shl_vi_v16i8:
5278 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5279 ; CHECK-NEXT: vle8.v v8, (a0)
5280 ; CHECK-NEXT: vsll.vi v8, v8, 7
5281 ; CHECK-NEXT: vse8.v v8, (a0)
5283 %a = load <16 x i8>, ptr %x
5284 %d = shl <16 x i8> %a, splat (i8 7)
5285 store <16 x i8> %d, ptr %x
5289 define void @shl_vi_v8i16(ptr %x) {
5290 ; CHECK-LABEL: shl_vi_v8i16:
5292 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5293 ; CHECK-NEXT: vle16.v v8, (a0)
5294 ; CHECK-NEXT: vsll.vi v8, v8, 15
5295 ; CHECK-NEXT: vse16.v v8, (a0)
5297 %a = load <8 x i16>, ptr %x
5298 %d = shl <8 x i16> %a, splat (i16 15)
5299 store <8 x i16> %d, ptr %x
5303 define void @shl_vi_v4i32(ptr %x) {
5304 ; CHECK-LABEL: shl_vi_v4i32:
5306 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5307 ; CHECK-NEXT: vle32.v v8, (a0)
5308 ; CHECK-NEXT: vsll.vi v8, v8, 31
5309 ; CHECK-NEXT: vse32.v v8, (a0)
5311 %a = load <4 x i32>, ptr %x
5312 %d = shl <4 x i32> %a, splat (i32 31)
5313 store <4 x i32> %d, ptr %x
5317 define void @shl_vi_v2i64(ptr %x) {
5318 ; CHECK-LABEL: shl_vi_v2i64:
5320 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5321 ; CHECK-NEXT: vle64.v v8, (a0)
5322 ; CHECK-NEXT: vsll.vi v8, v8, 31
5323 ; CHECK-NEXT: vse64.v v8, (a0)
5325 %a = load <2 x i64>, ptr %x
5326 %d = shl <2 x i64> %a, splat (i64 31)
5327 store <2 x i64> %d, ptr %x
5331 define void @shl_vx_v16i8(ptr %x, i8 %y) {
5332 ; CHECK-LABEL: shl_vx_v16i8:
5334 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5335 ; CHECK-NEXT: vle8.v v8, (a0)
5336 ; CHECK-NEXT: vsll.vx v8, v8, a1
5337 ; CHECK-NEXT: vse8.v v8, (a0)
5339 %a = load <16 x i8>, ptr %x
5340 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5341 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5342 %d = shl <16 x i8> %a, %c
5343 store <16 x i8> %d, ptr %x
5347 define void @shl_vx_v8i16(ptr %x, i16 %y) {
5348 ; CHECK-LABEL: shl_vx_v8i16:
5350 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5351 ; CHECK-NEXT: vle16.v v8, (a0)
5352 ; CHECK-NEXT: vsll.vx v8, v8, a1
5353 ; CHECK-NEXT: vse16.v v8, (a0)
5355 %a = load <8 x i16>, ptr %x
5356 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5357 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5358 %d = shl <8 x i16> %a, %c
5359 store <8 x i16> %d, ptr %x
5363 define void @shl_vx_v4i32(ptr %x, i32 %y) {
5364 ; CHECK-LABEL: shl_vx_v4i32:
5366 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5367 ; CHECK-NEXT: vle32.v v8, (a0)
5368 ; CHECK-NEXT: vsll.vx v8, v8, a1
5369 ; CHECK-NEXT: vse32.v v8, (a0)
5371 %a = load <4 x i32>, ptr %x
5372 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5373 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5374 %d = shl <4 x i32> %a, %c
5375 store <4 x i32> %d, ptr %x
5379 define void @sdiv_vx_v16i8(ptr %x, i8 %y) {
5380 ; CHECK-LABEL: sdiv_vx_v16i8:
5382 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5383 ; CHECK-NEXT: vle8.v v8, (a0)
5384 ; CHECK-NEXT: vdiv.vx v8, v8, a1
5385 ; CHECK-NEXT: vse8.v v8, (a0)
5387 %a = load <16 x i8>, ptr %x
5388 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5389 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5390 %d = sdiv <16 x i8> %a, %c
5391 store <16 x i8> %d, ptr %x
5395 define void @sdiv_vx_v8i16(ptr %x, i16 %y) {
5396 ; CHECK-LABEL: sdiv_vx_v8i16:
5398 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5399 ; CHECK-NEXT: vle16.v v8, (a0)
5400 ; CHECK-NEXT: vdiv.vx v8, v8, a1
5401 ; CHECK-NEXT: vse16.v v8, (a0)
5403 %a = load <8 x i16>, ptr %x
5404 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5405 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5406 %d = sdiv <8 x i16> %a, %c
5407 store <8 x i16> %d, ptr %x
5411 define void @sdiv_vx_v4i32(ptr %x, i32 %y) {
5412 ; CHECK-LABEL: sdiv_vx_v4i32:
5414 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5415 ; CHECK-NEXT: vle32.v v8, (a0)
5416 ; CHECK-NEXT: vdiv.vx v8, v8, a1
5417 ; CHECK-NEXT: vse32.v v8, (a0)
5419 %a = load <4 x i32>, ptr %x
5420 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5421 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5422 %d = sdiv <4 x i32> %a, %c
5423 store <4 x i32> %d, ptr %x
5427 define void @srem_vx_v16i8(ptr %x, i8 %y) {
5428 ; CHECK-LABEL: srem_vx_v16i8:
5430 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5431 ; CHECK-NEXT: vle8.v v8, (a0)
5432 ; CHECK-NEXT: vrem.vx v8, v8, a1
5433 ; CHECK-NEXT: vse8.v v8, (a0)
5435 %a = load <16 x i8>, ptr %x
5436 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5437 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5438 %d = srem <16 x i8> %a, %c
5439 store <16 x i8> %d, ptr %x
5443 define void @srem_vx_v8i16(ptr %x, i16 %y) {
5444 ; CHECK-LABEL: srem_vx_v8i16:
5446 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5447 ; CHECK-NEXT: vle16.v v8, (a0)
5448 ; CHECK-NEXT: vrem.vx v8, v8, a1
5449 ; CHECK-NEXT: vse16.v v8, (a0)
5451 %a = load <8 x i16>, ptr %x
5452 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5453 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5454 %d = srem <8 x i16> %a, %c
5455 store <8 x i16> %d, ptr %x
5459 define void @srem_vx_v4i32(ptr %x, i32 %y) {
5460 ; CHECK-LABEL: srem_vx_v4i32:
5462 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5463 ; CHECK-NEXT: vle32.v v8, (a0)
5464 ; CHECK-NEXT: vrem.vx v8, v8, a1
5465 ; CHECK-NEXT: vse32.v v8, (a0)
5467 %a = load <4 x i32>, ptr %x
5468 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5469 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5470 %d = srem <4 x i32> %a, %c
5471 store <4 x i32> %d, ptr %x
5475 define void @udiv_vx_v16i8(ptr %x, i8 %y) {
5476 ; CHECK-LABEL: udiv_vx_v16i8:
5478 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5479 ; CHECK-NEXT: vle8.v v8, (a0)
5480 ; CHECK-NEXT: vdivu.vx v8, v8, a1
5481 ; CHECK-NEXT: vse8.v v8, (a0)
5483 %a = load <16 x i8>, ptr %x
5484 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5485 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5486 %d = udiv <16 x i8> %a, %c
5487 store <16 x i8> %d, ptr %x
5491 define void @udiv_vx_v8i16(ptr %x, i16 %y) {
5492 ; CHECK-LABEL: udiv_vx_v8i16:
5494 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5495 ; CHECK-NEXT: vle16.v v8, (a0)
5496 ; CHECK-NEXT: vdivu.vx v8, v8, a1
5497 ; CHECK-NEXT: vse16.v v8, (a0)
5499 %a = load <8 x i16>, ptr %x
5500 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5501 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5502 %d = udiv <8 x i16> %a, %c
5503 store <8 x i16> %d, ptr %x
5507 define void @udiv_vx_v4i32(ptr %x, i32 %y) {
5508 ; CHECK-LABEL: udiv_vx_v4i32:
5510 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5511 ; CHECK-NEXT: vle32.v v8, (a0)
5512 ; CHECK-NEXT: vdivu.vx v8, v8, a1
5513 ; CHECK-NEXT: vse32.v v8, (a0)
5515 %a = load <4 x i32>, ptr %x
5516 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5517 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5518 %d = udiv <4 x i32> %a, %c
5519 store <4 x i32> %d, ptr %x
5523 define void @urem_vx_v16i8(ptr %x, i8 %y) {
5524 ; CHECK-LABEL: urem_vx_v16i8:
5526 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5527 ; CHECK-NEXT: vle8.v v8, (a0)
5528 ; CHECK-NEXT: vremu.vx v8, v8, a1
5529 ; CHECK-NEXT: vse8.v v8, (a0)
5531 %a = load <16 x i8>, ptr %x
5532 %b = insertelement <16 x i8> poison, i8 %y, i32 0
5533 %c = shufflevector <16 x i8> %b, <16 x i8> poison, <16 x i32> zeroinitializer
5534 %d = urem <16 x i8> %a, %c
5535 store <16 x i8> %d, ptr %x
5539 define void @urem_vx_v8i16(ptr %x, i16 %y) {
5540 ; CHECK-LABEL: urem_vx_v8i16:
5542 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5543 ; CHECK-NEXT: vle16.v v8, (a0)
5544 ; CHECK-NEXT: vremu.vx v8, v8, a1
5545 ; CHECK-NEXT: vse16.v v8, (a0)
5547 %a = load <8 x i16>, ptr %x
5548 %b = insertelement <8 x i16> poison, i16 %y, i32 0
5549 %c = shufflevector <8 x i16> %b, <8 x i16> poison, <8 x i32> zeroinitializer
5550 %d = urem <8 x i16> %a, %c
5551 store <8 x i16> %d, ptr %x
5555 define void @urem_vx_v4i32(ptr %x, i32 %y) {
5556 ; CHECK-LABEL: urem_vx_v4i32:
5558 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5559 ; CHECK-NEXT: vle32.v v8, (a0)
5560 ; CHECK-NEXT: vremu.vx v8, v8, a1
5561 ; CHECK-NEXT: vse32.v v8, (a0)
5563 %a = load <4 x i32>, ptr %x
5564 %b = insertelement <4 x i32> poison, i32 %y, i32 0
5565 %c = shufflevector <4 x i32> %b, <4 x i32> poison, <4 x i32> zeroinitializer
5566 %d = urem <4 x i32> %a, %c
5567 store <4 x i32> %d, ptr %x
5571 define void @mulhu_vx_v16i8(ptr %x) {
5572 ; CHECK-LABEL: mulhu_vx_v16i8:
5574 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5575 ; CHECK-NEXT: vle8.v v8, (a0)
5576 ; CHECK-NEXT: li a1, 57
5577 ; CHECK-NEXT: vmulhu.vx v8, v8, a1
5578 ; CHECK-NEXT: vsrl.vi v8, v8, 1
5579 ; CHECK-NEXT: vse8.v v8, (a0)
5581 %a = load <16 x i8>, ptr %x
5582 %b = udiv <16 x i8> %a, <i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9, i8 9>
5583 store <16 x i8> %b, ptr %x
5587 define void @mulhu_vx_v8i16(ptr %x) {
5588 ; CHECK-LABEL: mulhu_vx_v8i16:
5590 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5591 ; CHECK-NEXT: vle16.v v8, (a0)
5592 ; CHECK-NEXT: lui a1, 2
5593 ; CHECK-NEXT: addi a1, a1, 1171
5594 ; CHECK-NEXT: vmulhu.vx v9, v8, a1
5595 ; CHECK-NEXT: vsub.vv v8, v8, v9
5596 ; CHECK-NEXT: vsrl.vi v8, v8, 1
5597 ; CHECK-NEXT: vadd.vv v8, v8, v9
5598 ; CHECK-NEXT: vsrl.vi v8, v8, 2
5599 ; CHECK-NEXT: vse16.v v8, (a0)
5601 %a = load <8 x i16>, ptr %x
5602 %b = udiv <8 x i16> %a, <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>
5603 store <8 x i16> %b, ptr %x
5607 define void @mulhu_vx_v4i32(ptr %x) {
5608 ; CHECK-LABEL: mulhu_vx_v4i32:
5610 ; CHECK-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5611 ; CHECK-NEXT: vle32.v v8, (a0)
5612 ; CHECK-NEXT: lui a1, 838861
5613 ; CHECK-NEXT: addi a1, a1, -819
5614 ; CHECK-NEXT: vmulhu.vx v8, v8, a1
5615 ; CHECK-NEXT: vsrl.vi v8, v8, 2
5616 ; CHECK-NEXT: vse32.v v8, (a0)
5618 %a = load <4 x i32>, ptr %x
5619 %b = udiv <4 x i32> %a, <i32 5, i32 5, i32 5, i32 5>
5620 store <4 x i32> %b, ptr %x
5624 define void @mulhu_vx_v2i64(ptr %x) {
5625 ; RV32-LABEL: mulhu_vx_v2i64:
5627 ; RV32-NEXT: addi sp, sp, -16
5628 ; RV32-NEXT: .cfi_def_cfa_offset 16
5629 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5630 ; RV32-NEXT: vle64.v v8, (a0)
5631 ; RV32-NEXT: lui a1, 699051
5632 ; RV32-NEXT: addi a2, a1, -1366
5633 ; RV32-NEXT: sw a2, 12(sp)
5634 ; RV32-NEXT: addi a1, a1, -1365
5635 ; RV32-NEXT: sw a1, 8(sp)
5636 ; RV32-NEXT: addi a1, sp, 8
5637 ; RV32-NEXT: vlse64.v v9, (a1), zero
5638 ; RV32-NEXT: vmulhu.vv v8, v8, v9
5639 ; RV32-NEXT: vsrl.vi v8, v8, 1
5640 ; RV32-NEXT: vse64.v v8, (a0)
5641 ; RV32-NEXT: addi sp, sp, 16
5644 ; RV64-LABEL: mulhu_vx_v2i64:
5646 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5647 ; RV64-NEXT: vle64.v v8, (a0)
5648 ; RV64-NEXT: lui a1, 699051
5649 ; RV64-NEXT: addiw a1, a1, -1365
5650 ; RV64-NEXT: slli a2, a1, 32
5651 ; RV64-NEXT: add a1, a1, a2
5652 ; RV64-NEXT: vmulhu.vx v8, v8, a1
5653 ; RV64-NEXT: vsrl.vi v8, v8, 1
5654 ; RV64-NEXT: vse64.v v8, (a0)
5656 %a = load <2 x i64>, ptr %x
5657 %b = udiv <2 x i64> %a, <i64 3, i64 3>
5658 store <2 x i64> %b, ptr %x
5662 define void @mulhs_vx_v16i8(ptr %x) {
5663 ; CHECK-LABEL: mulhs_vx_v16i8:
5665 ; CHECK-NEXT: vsetivli zero, 16, e8, m1, ta, ma
5666 ; CHECK-NEXT: vle8.v v8, (a0)
5667 ; CHECK-NEXT: li a1, -123
5668 ; CHECK-NEXT: vmulhu.vx v8, v8, a1
5669 ; CHECK-NEXT: vsrl.vi v8, v8, 7
5670 ; CHECK-NEXT: vse8.v v8, (a0)
5672 %a = load <16 x i8>, ptr %x
5673 %b = udiv <16 x i8> %a, <i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9, i8 -9>
5674 store <16 x i8> %b, ptr %x
5678 define void @mulhs_vx_v8i16(ptr %x) {
5679 ; CHECK-LABEL: mulhs_vx_v8i16:
5681 ; CHECK-NEXT: vsetivli zero, 8, e16, m1, ta, ma
5682 ; CHECK-NEXT: vle16.v v8, (a0)
5683 ; CHECK-NEXT: lui a1, 5
5684 ; CHECK-NEXT: addi a1, a1, -1755
5685 ; CHECK-NEXT: vmulh.vx v8, v8, a1
5686 ; CHECK-NEXT: vsra.vi v8, v8, 1
5687 ; CHECK-NEXT: vsrl.vi v9, v8, 15
5688 ; CHECK-NEXT: vadd.vv v8, v8, v9
5689 ; CHECK-NEXT: vse16.v v8, (a0)
5691 %a = load <8 x i16>, ptr %x
5692 %b = sdiv <8 x i16> %a, <i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7, i16 7>
5693 store <8 x i16> %b, ptr %x
5697 define void @mulhs_vx_v4i32(ptr %x) {
5698 ; RV32-LABEL: mulhs_vx_v4i32:
5700 ; RV32-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5701 ; RV32-NEXT: vle32.v v8, (a0)
5702 ; RV32-NEXT: lui a1, 629146
5703 ; RV32-NEXT: addi a1, a1, -1639
5704 ; RV32-NEXT: vmulh.vx v8, v8, a1
5705 ; RV32-NEXT: vsrl.vi v9, v8, 31
5706 ; RV32-NEXT: vsra.vi v8, v8, 1
5707 ; RV32-NEXT: vadd.vv v8, v8, v9
5708 ; RV32-NEXT: vse32.v v8, (a0)
5711 ; RV64-LABEL: mulhs_vx_v4i32:
5713 ; RV64-NEXT: vsetivli zero, 4, e32, m1, ta, ma
5714 ; RV64-NEXT: vle32.v v8, (a0)
5715 ; RV64-NEXT: lui a1, 629146
5716 ; RV64-NEXT: addi a1, a1, -1639
5717 ; RV64-NEXT: vmulh.vx v8, v8, a1
5718 ; RV64-NEXT: vsra.vi v8, v8, 1
5719 ; RV64-NEXT: vsrl.vi v9, v8, 31
5720 ; RV64-NEXT: vadd.vv v8, v8, v9
5721 ; RV64-NEXT: vse32.v v8, (a0)
5723 %a = load <4 x i32>, ptr %x
5724 %b = sdiv <4 x i32> %a, <i32 -5, i32 -5, i32 -5, i32 -5>
5725 store <4 x i32> %b, ptr %x
5729 define void @mulhs_vx_v2i64(ptr %x) {
5730 ; RV32-LABEL: mulhs_vx_v2i64:
5732 ; RV32-NEXT: addi sp, sp, -16
5733 ; RV32-NEXT: .cfi_def_cfa_offset 16
5734 ; RV32-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5735 ; RV32-NEXT: vle64.v v8, (a0)
5736 ; RV32-NEXT: lui a1, 349525
5737 ; RV32-NEXT: addi a2, a1, 1365
5738 ; RV32-NEXT: sw a2, 12(sp)
5739 ; RV32-NEXT: addi a1, a1, 1366
5740 ; RV32-NEXT: sw a1, 8(sp)
5741 ; RV32-NEXT: addi a1, sp, 8
5742 ; RV32-NEXT: vlse64.v v9, (a1), zero
5743 ; RV32-NEXT: vmulh.vv v8, v8, v9
5744 ; RV32-NEXT: li a1, 63
5745 ; RV32-NEXT: vsrl.vx v9, v8, a1
5746 ; RV32-NEXT: vadd.vv v8, v8, v9
5747 ; RV32-NEXT: vse64.v v8, (a0)
5748 ; RV32-NEXT: addi sp, sp, 16
5751 ; RV64-LABEL: mulhs_vx_v2i64:
5753 ; RV64-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5754 ; RV64-NEXT: vle64.v v8, (a0)
5755 ; RV64-NEXT: lui a1, %hi(.LCPI321_0)
5756 ; RV64-NEXT: ld a1, %lo(.LCPI321_0)(a1)
5757 ; RV64-NEXT: vmulh.vx v8, v8, a1
5758 ; RV64-NEXT: li a1, 63
5759 ; RV64-NEXT: vsrl.vx v9, v8, a1
5760 ; RV64-NEXT: vadd.vv v8, v8, v9
5761 ; RV64-NEXT: vse64.v v8, (a0)
5763 %a = load <2 x i64>, ptr %x
5764 %b = sdiv <2 x i64> %a, <i64 3, i64 3>
5765 store <2 x i64> %b, ptr %x
5769 define void @madd_vv_v2i64(ptr %x, <2 x i64> %y) {
5770 ; CHECK-LABEL: madd_vv_v2i64:
5772 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5773 ; CHECK-NEXT: vle64.v v9, (a0)
5774 ; CHECK-NEXT: vmadd.vv v9, v8, v8
5775 ; CHECK-NEXT: vse64.v v9, (a0)
5777 %a = load <2 x i64>, ptr %x
5778 %b = add <2 x i64> %a, <i64 1, i64 1>
5779 %c = mul <2 x i64> %b, %y
5780 store <2 x i64> %c, ptr %x
5784 define void @madd_vv_v2i64_2(ptr %x, <2 x i64> %y) {
5785 ; CHECK-LABEL: madd_vv_v2i64_2:
5787 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5788 ; CHECK-NEXT: vle64.v v9, (a0)
5789 ; CHECK-NEXT: vmadd.vv v9, v8, v8
5790 ; CHECK-NEXT: vse64.v v9, (a0)
5792 %a = load <2 x i64>, ptr %x
5793 %b = add <2 x i64> %a, <i64 1, i64 1>
5794 %c = mul <2 x i64> %y, %b
5795 store <2 x i64> %c, ptr %x
5799 define void @msub_vv_v2i64(ptr %x, <2 x i64> %y) {
5800 ; CHECK-LABEL: msub_vv_v2i64:
5802 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5803 ; CHECK-NEXT: vle64.v v9, (a0)
5804 ; CHECK-NEXT: vnmsub.vv v9, v8, v8
5805 ; CHECK-NEXT: vse64.v v9, (a0)
5807 %a = load <2 x i64>, ptr %x
5808 %b = sub <2 x i64> <i64 1, i64 1>, %a
5809 %c = mul <2 x i64> %b, %y
5810 store <2 x i64> %c, ptr %x
5814 define void @msub_vv_v2i64_2(ptr %x, <2 x i64> %y) {
5815 ; CHECK-LABEL: msub_vv_v2i64_2:
5817 ; CHECK-NEXT: vsetivli zero, 2, e64, m1, ta, ma
5818 ; CHECK-NEXT: vle64.v v9, (a0)
5819 ; CHECK-NEXT: vnmsub.vv v9, v8, v8
5820 ; CHECK-NEXT: vse64.v v9, (a0)
5822 %a = load <2 x i64>, ptr %x
5823 %b = sub <2 x i64> <i64 1, i64 1>, %a
5824 %c = mul <2 x i64> %y, %b
5825 store <2 x i64> %c, ptr %x