1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+v \
3 ; RUN: -verify-machineinstrs | FileCheck %s
4 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+v \
5 ; RUN: -verify-machineinstrs | FileCheck %s
7 declare void @llvm.riscv.vsm.nxv1i1(<vscale x 1 x i1>, ptr, iXLen);
9 define void @intrinsic_vsm_v_nxv1i1(<vscale x 1 x i1> %0, ptr %1, iXLen %2) nounwind {
10 ; CHECK-LABEL: intrinsic_vsm_v_nxv1i1:
11 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: vsetvli zero, a1, e8, mf8, ta, ma
13 ; CHECK-NEXT: vsm.v v0, (a0)
16 call void @llvm.riscv.vsm.nxv1i1(<vscale x 1 x i1> %0, ptr %1, iXLen %2)
20 declare void @llvm.riscv.vsm.nxv2i1(<vscale x 2 x i1>, ptr, iXLen);
22 define void @intrinsic_vsm_v_nxv2i1(<vscale x 2 x i1> %0, ptr %1, iXLen %2) nounwind {
23 ; CHECK-LABEL: intrinsic_vsm_v_nxv2i1:
24 ; CHECK: # %bb.0: # %entry
25 ; CHECK-NEXT: vsetvli zero, a1, e8, mf4, ta, ma
26 ; CHECK-NEXT: vsm.v v0, (a0)
29 call void @llvm.riscv.vsm.nxv2i1(<vscale x 2 x i1> %0, ptr %1, iXLen %2)
33 declare void @llvm.riscv.vsm.nxv4i1(<vscale x 4 x i1>, ptr, iXLen);
35 define void @intrinsic_vsm_v_nxv4i1(<vscale x 4 x i1> %0, ptr %1, iXLen %2) nounwind {
36 ; CHECK-LABEL: intrinsic_vsm_v_nxv4i1:
37 ; CHECK: # %bb.0: # %entry
38 ; CHECK-NEXT: vsetvli zero, a1, e8, mf2, ta, ma
39 ; CHECK-NEXT: vsm.v v0, (a0)
42 call void @llvm.riscv.vsm.nxv4i1(<vscale x 4 x i1> %0, ptr %1, iXLen %2)
46 declare void @llvm.riscv.vsm.nxv8i1(<vscale x 8 x i1>, ptr, iXLen);
48 define void @intrinsic_vsm_v_nxv8i1(<vscale x 8 x i1> %0, ptr %1, iXLen %2) nounwind {
49 ; CHECK-LABEL: intrinsic_vsm_v_nxv8i1:
50 ; CHECK: # %bb.0: # %entry
51 ; CHECK-NEXT: vsetvli zero, a1, e8, m1, ta, ma
52 ; CHECK-NEXT: vsm.v v0, (a0)
55 call void @llvm.riscv.vsm.nxv8i1(<vscale x 8 x i1> %0, ptr %1, iXLen %2)
59 declare void @llvm.riscv.vsm.nxv16i1(<vscale x 16 x i1>, ptr, iXLen);
61 define void @intrinsic_vsm_v_nxv16i1(<vscale x 16 x i1> %0, ptr %1, iXLen %2) nounwind {
62 ; CHECK-LABEL: intrinsic_vsm_v_nxv16i1:
63 ; CHECK: # %bb.0: # %entry
64 ; CHECK-NEXT: vsetvli zero, a1, e8, m2, ta, ma
65 ; CHECK-NEXT: vsm.v v0, (a0)
68 call void @llvm.riscv.vsm.nxv16i1(<vscale x 16 x i1> %0, ptr %1, iXLen %2)
72 declare void @llvm.riscv.vsm.nxv32i1(<vscale x 32 x i1>, ptr, iXLen);
74 define void @intrinsic_vsm_v_nxv32i1(<vscale x 32 x i1> %0, ptr %1, iXLen %2) nounwind {
75 ; CHECK-LABEL: intrinsic_vsm_v_nxv32i1:
76 ; CHECK: # %bb.0: # %entry
77 ; CHECK-NEXT: vsetvli zero, a1, e8, m4, ta, ma
78 ; CHECK-NEXT: vsm.v v0, (a0)
81 call void @llvm.riscv.vsm.nxv32i1(<vscale x 32 x i1> %0, ptr %1, iXLen %2)
85 declare void @llvm.riscv.vsm.nxv64i1(<vscale x 64 x i1>, ptr, iXLen);
87 define void @intrinsic_vsm_v_nxv64i1(<vscale x 64 x i1> %0, ptr %1, iXLen %2) nounwind {
88 ; CHECK-LABEL: intrinsic_vsm_v_nxv64i1:
89 ; CHECK: # %bb.0: # %entry
90 ; CHECK-NEXT: vsetvli zero, a1, e8, m8, ta, ma
91 ; CHECK-NEXT: vsm.v v0, (a0)
94 call void @llvm.riscv.vsm.nxv64i1(<vscale x 64 x i1> %0, ptr %1, iXLen %2)
98 declare <vscale x 1 x i1> @llvm.riscv.vmseq.nxv1i16(
103 ; Make sure we can use the vsetvli from the producing instruction.
104 define void @test_vsetvli_i16(<vscale x 1 x i16> %0, <vscale x 1 x i16> %1, ptr %2, iXLen %3) nounwind {
105 ; CHECK-LABEL: test_vsetvli_i16:
106 ; CHECK: # %bb.0: # %entry
107 ; CHECK-NEXT: vsetvli zero, a1, e16, mf4, ta, ma
108 ; CHECK-NEXT: vmseq.vv v8, v8, v9
109 ; CHECK-NEXT: vsm.v v8, (a0)
112 %a = call <vscale x 1 x i1> @llvm.riscv.vmseq.nxv1i16(
113 <vscale x 1 x i16> %0,
114 <vscale x 1 x i16> %1,
116 call void @llvm.riscv.vsm.nxv1i1(<vscale x 1 x i1> %a, ptr %2, iXLen %3)
120 declare <vscale x 1 x i1> @llvm.riscv.vmseq.nxv1i32(
125 define void @test_vsetvli_i32(<vscale x 1 x i32> %0, <vscale x 1 x i32> %1, ptr %2, iXLen %3) nounwind {
126 ; CHECK-LABEL: test_vsetvli_i32:
127 ; CHECK: # %bb.0: # %entry
128 ; CHECK-NEXT: vsetvli zero, a1, e32, mf2, ta, ma
129 ; CHECK-NEXT: vmseq.vv v8, v8, v9
130 ; CHECK-NEXT: vsm.v v8, (a0)
133 %a = call <vscale x 1 x i1> @llvm.riscv.vmseq.nxv1i32(
134 <vscale x 1 x i32> %0,
135 <vscale x 1 x i32> %1,
137 call void @llvm.riscv.vsm.nxv1i1(<vscale x 1 x i1> %a, ptr %2, iXLen %3)