1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple riscv32 -mattr=+v %s -o - \
3 ; RUN: -verify-machineinstrs | FileCheck %s
4 ; RUN: llc -mtriple riscv64 -mattr=+v %s -o - \
5 ; RUN: -verify-machineinstrs | FileCheck %s
7 define void @vadd_vint32m1(<vscale x 2 x i32> *%pc, <vscale x 2 x i32> *%pa, <vscale x 2 x i32> *%pb) nounwind {
8 ; CHECK-LABEL: vadd_vint32m1:
10 ; CHECK-NEXT: vl1re32.v v8, (a1)
11 ; CHECK-NEXT: vl1re32.v v9, (a2)
12 ; CHECK-NEXT: vsetvli a1, zero, e32, m1, ta, ma
13 ; CHECK-NEXT: vadd.vv v8, v8, v9
14 ; CHECK-NEXT: vs1r.v v8, (a0)
16 %va = load <vscale x 2 x i32>, <vscale x 2 x i32>* %pa
17 %vb = load <vscale x 2 x i32>, <vscale x 2 x i32>* %pb
18 %vc = add <vscale x 2 x i32> %va, %vb
19 store <vscale x 2 x i32> %vc, <vscale x 2 x i32> *%pc
23 define void @vadd_vint32m2(<vscale x 4 x i32> *%pc, <vscale x 4 x i32> *%pa, <vscale x 4 x i32> *%pb) nounwind {
24 ; CHECK-LABEL: vadd_vint32m2:
26 ; CHECK-NEXT: vl2re32.v v8, (a1)
27 ; CHECK-NEXT: vl2re32.v v10, (a2)
28 ; CHECK-NEXT: vsetvli a1, zero, e32, m2, ta, ma
29 ; CHECK-NEXT: vadd.vv v8, v8, v10
30 ; CHECK-NEXT: vs2r.v v8, (a0)
32 %va = load <vscale x 4 x i32>, <vscale x 4 x i32>* %pa
33 %vb = load <vscale x 4 x i32>, <vscale x 4 x i32>* %pb
34 %vc = add <vscale x 4 x i32> %va, %vb
35 store <vscale x 4 x i32> %vc, <vscale x 4 x i32> *%pc
39 define void @vadd_vint32m4(<vscale x 8 x i32> *%pc, <vscale x 8 x i32> *%pa, <vscale x 8 x i32> *%pb) nounwind {
40 ; CHECK-LABEL: vadd_vint32m4:
42 ; CHECK-NEXT: vl4re32.v v8, (a1)
43 ; CHECK-NEXT: vl4re32.v v12, (a2)
44 ; CHECK-NEXT: vsetvli a1, zero, e32, m4, ta, ma
45 ; CHECK-NEXT: vadd.vv v8, v8, v12
46 ; CHECK-NEXT: vs4r.v v8, (a0)
48 %va = load <vscale x 8 x i32>, <vscale x 8 x i32>* %pa
49 %vb = load <vscale x 8 x i32>, <vscale x 8 x i32>* %pb
50 %vc = add <vscale x 8 x i32> %va, %vb
51 store <vscale x 8 x i32> %vc, <vscale x 8 x i32> *%pc
55 define void @vadd_vint32m8(<vscale x 16 x i32> *%pc, <vscale x 16 x i32> *%pa, <vscale x 16 x i32> *%pb) nounwind {
56 ; CHECK-LABEL: vadd_vint32m8:
58 ; CHECK-NEXT: vl8re32.v v8, (a1)
59 ; CHECK-NEXT: vl8re32.v v16, (a2)
60 ; CHECK-NEXT: vsetvli a1, zero, e32, m8, ta, ma
61 ; CHECK-NEXT: vadd.vv v8, v8, v16
62 ; CHECK-NEXT: vs8r.v v8, (a0)
64 %va = load <vscale x 16 x i32>, <vscale x 16 x i32>* %pa
65 %vb = load <vscale x 16 x i32>, <vscale x 16 x i32>* %pb
66 %vc = add <vscale x 16 x i32> %va, %vb
67 store <vscale x 16 x i32> %vc, <vscale x 16 x i32> *%pc
71 define void @vadd_vint32mf2(<vscale x 1 x i32> *%pc, <vscale x 1 x i32> *%pa, <vscale x 1 x i32> *%pb) nounwind {
72 ; CHECK-LABEL: vadd_vint32mf2:
74 ; CHECK-NEXT: vsetvli a3, zero, e32, mf2, ta, ma
75 ; CHECK-NEXT: vle32.v v8, (a1)
76 ; CHECK-NEXT: vle32.v v9, (a2)
77 ; CHECK-NEXT: vadd.vv v8, v8, v9
78 ; CHECK-NEXT: vse32.v v8, (a0)
80 %va = load <vscale x 1 x i32>, <vscale x 1 x i32>* %pa
81 %vb = load <vscale x 1 x i32>, <vscale x 1 x i32>* %pb
82 %vc = add <vscale x 1 x i32> %va, %vb
83 store <vscale x 1 x i32> %vc, <vscale x 1 x i32> *%pc