Skip to content

Commit 7fb1dc0

Browse files
authored
[RISCV] Support ZVqdot Codegen and C intrinsics (#154915)
spec: https://github.com/riscv/riscv-dot-product/tree/main Node: we pack 4 int8/uint8 element in rs1 to a uint32.
1 parent 3436701 commit 7fb1dc0

File tree

35 files changed

+6634
-0
lines changed

35 files changed

+6634
-0
lines changed

clang/include/clang/Basic/riscv_vector.td

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,3 +1939,25 @@ let UnMaskedPolicyScheme = HasPolicyOperand, HasMasked = false in {
19391939
defm vsm3me : RVVOutOp1BuiltinSet<"vsm3me", "i", [["vv", "Uv", "UvUvUv"]]>;
19401940
}
19411941
}
1942+
1943+
// Zvqdotq
1944+
multiclass RVVVQDOTQBuiltinSet<list<list<string>> suffixes_prototypes> {
1945+
let UnMaskedPolicyScheme = HasPolicyOperand,
1946+
HasMaskedOffOperand = false,
1947+
OverloadedName = NAME,
1948+
Log2LMUL = [-1, 0, 1, 2, 3] in {
1949+
defm NAME : RVVOutOp1Op2BuiltinSet<NAME, "i", suffixes_prototypes>;
1950+
}
1951+
}
1952+
1953+
// Only SEW=32 is defined for zvqdotq so far, and since inputs are in fact four
1954+
// 8-bit integer bundles, we use unsigned type to represent all of them
1955+
let RequiredFeatures = ["zvqdotq"] in {
1956+
defm vqdot : RVVVQDOTQBuiltinSet<[["vv", "v", "vv(FixedSEW:8)v(FixedSEW:8)v"],
1957+
["vx", "v", "vv(FixedSEW:8)vUe"]]>;
1958+
defm vqdotu : RVVVQDOTQBuiltinSet<[["vv", "Uv", "UvUv(FixedSEW:8)Uv(FixedSEW:8)Uv"],
1959+
["vx", "Uv", "UvUv(FixedSEW:8)UvUe"]]>;
1960+
defm vqdotsu : RVVVQDOTQBuiltinSet<[["vv", "v", "vv(FixedSEW:8)v(FixedSEW:8)Uv"],
1961+
["vx", "v", "vv(FixedSEW:8)vUe"]]>;
1962+
defm vqdotus : RVVVQDOTQBuiltinSet<[["vx", "v", "vv(FixedSEW:8)UvUe"]]>;
1963+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
2+
// REQUIRES: riscv-registered-target
3+
// RUN: %clang_cc1 -triple riscv64 -target-feature +v -target-feature +experimental-zvqdotq -disable-O0-optnone \
4+
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \
5+
// RUN: FileCheck --check-prefix=CHECK-RV64 %s
6+
7+
#include <sifive_vector.h>
8+
9+
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x i32> @test_vqdot_vv_i32mf2(
10+
// CHECK-RV64-SAME: <vscale x 1 x i32> [[VD:%.*]], <vscale x 4 x i8> [[VS2:%.*]], <vscale x 4 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] {
11+
// CHECK-RV64-NEXT: entry:
12+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i32> @llvm.riscv.vqdot.nxv1i32.nxv4i8.nxv4i8.i64(<vscale x 1 x i32> [[VD]], <vscale x 4 x i8> [[VS2]], <vscale x 4 x i8> [[VS1]], i64 [[VL]], i64 3)
13+
// CHECK-RV64-NEXT: ret <vscale x 1 x i32> [[TMP0]]
14+
//
15+
vint32mf2_t test_vqdot_vv_i32mf2(vint32mf2_t vd, vint8mf2_t vs2, vint8mf2_t vs1,
16+
size_t vl) {
17+
return __riscv_vqdot_vv_i32mf2(vd, vs2, vs1, vl);
18+
}
19+
20+
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x i32> @test_vqdot_vv_i32m1(
21+
// CHECK-RV64-SAME: <vscale x 2 x i32> [[VD:%.*]], <vscale x 8 x i8> [[VS2:%.*]], <vscale x 8 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
22+
// CHECK-RV64-NEXT: entry:
23+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i32> @llvm.riscv.vqdot.nxv2i32.nxv8i8.nxv8i8.i64(<vscale x 2 x i32> [[VD]], <vscale x 8 x i8> [[VS2]], <vscale x 8 x i8> [[VS1]], i64 [[VL]], i64 3)
24+
// CHECK-RV64-NEXT: ret <vscale x 2 x i32> [[TMP0]]
25+
//
26+
vint32m1_t test_vqdot_vv_i32m1(vint32m1_t vd, vint8m1_t vs2, vint8m1_t vs1,
27+
size_t vl) {
28+
return __riscv_vqdot_vv_i32m1(vd, vs2, vs1, vl);
29+
}
30+
31+
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x i32> @test_vqdot_vv_i32m2(
32+
// CHECK-RV64-SAME: <vscale x 4 x i32> [[VD:%.*]], <vscale x 16 x i8> [[VS2:%.*]], <vscale x 16 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
33+
// CHECK-RV64-NEXT: entry:
34+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.riscv.vqdot.nxv4i32.nxv16i8.nxv16i8.i64(<vscale x 4 x i32> [[VD]], <vscale x 16 x i8> [[VS2]], <vscale x 16 x i8> [[VS1]], i64 [[VL]], i64 3)
35+
// CHECK-RV64-NEXT: ret <vscale x 4 x i32> [[TMP0]]
36+
//
37+
vint32m2_t test_vqdot_vv_i32m2(vint32m2_t vd, vint8m2_t vs2, vint8m2_t vs1,
38+
size_t vl) {
39+
return __riscv_vqdot_vv_i32m2(vd, vs2, vs1, vl);
40+
}
41+
42+
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x i32> @test_vqdot_vv_i32m4(
43+
// CHECK-RV64-SAME: <vscale x 8 x i32> [[VD:%.*]], <vscale x 32 x i8> [[VS2:%.*]], <vscale x 32 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
44+
// CHECK-RV64-NEXT: entry:
45+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i32> @llvm.riscv.vqdot.nxv8i32.nxv32i8.nxv32i8.i64(<vscale x 8 x i32> [[VD]], <vscale x 32 x i8> [[VS2]], <vscale x 32 x i8> [[VS1]], i64 [[VL]], i64 3)
46+
// CHECK-RV64-NEXT: ret <vscale x 8 x i32> [[TMP0]]
47+
//
48+
vint32m4_t test_vqdot_vv_i32m4(vint32m4_t vd, vint8m4_t vs2, vint8m4_t vs1,
49+
size_t vl) {
50+
return __riscv_vqdot_vv_i32m4(vd, vs2, vs1, vl);
51+
}
52+
53+
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x i32> @test_vqdot_vv_i32m8(
54+
// CHECK-RV64-SAME: <vscale x 16 x i32> [[VD:%.*]], <vscale x 64 x i8> [[VS2:%.*]], <vscale x 64 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
55+
// CHECK-RV64-NEXT: entry:
56+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 16 x i32> @llvm.riscv.vqdot.nxv16i32.nxv64i8.nxv64i8.i64(<vscale x 16 x i32> [[VD]], <vscale x 64 x i8> [[VS2]], <vscale x 64 x i8> [[VS1]], i64 [[VL]], i64 3)
57+
// CHECK-RV64-NEXT: ret <vscale x 16 x i32> [[TMP0]]
58+
//
59+
vint32m8_t test_vqdot_vv_i32m8(vint32m8_t vd, vint8m8_t vs2, vint8m8_t vs1,
60+
size_t vl) {
61+
return __riscv_vqdot_vv_i32m8(vd, vs2, vs1, vl);
62+
}
63+
64+
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x i32> @test_vqdot_vv_i32mf2_m(
65+
// CHECK-RV64-SAME: <vscale x 1 x i1> [[VM:%.*]], <vscale x 1 x i32> [[VD:%.*]], <vscale x 4 x i8> [[VS2:%.*]], <vscale x 4 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
66+
// CHECK-RV64-NEXT: entry:
67+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i32> @llvm.riscv.vqdot.mask.nxv1i32.nxv4i8.nxv4i8.i64(<vscale x 1 x i32> [[VD]], <vscale x 4 x i8> [[VS2]], <vscale x 4 x i8> [[VS1]], <vscale x 1 x i1> [[VM]], i64 [[VL]], i64 3)
68+
// CHECK-RV64-NEXT: ret <vscale x 1 x i32> [[TMP0]]
69+
//
70+
vint32mf2_t test_vqdot_vv_i32mf2_m(vbool64_t vm, vint32mf2_t vd, vint8mf2_t vs2,
71+
vint8mf2_t vs1, size_t vl) {
72+
return __riscv_vqdot_vv_i32mf2_m(vm, vd, vs2, vs1, vl);
73+
}
74+
75+
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x i32> @test_vqdot_vv_i32m1_m(
76+
// CHECK-RV64-SAME: <vscale x 2 x i1> [[VM:%.*]], <vscale x 2 x i32> [[VD:%.*]], <vscale x 8 x i8> [[VS2:%.*]], <vscale x 8 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
77+
// CHECK-RV64-NEXT: entry:
78+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i32> @llvm.riscv.vqdot.mask.nxv2i32.nxv8i8.nxv8i8.i64(<vscale x 2 x i32> [[VD]], <vscale x 8 x i8> [[VS2]], <vscale x 8 x i8> [[VS1]], <vscale x 2 x i1> [[VM]], i64 [[VL]], i64 3)
79+
// CHECK-RV64-NEXT: ret <vscale x 2 x i32> [[TMP0]]
80+
//
81+
vint32m1_t test_vqdot_vv_i32m1_m(vbool32_t vm, vint32m1_t vd, vint8m1_t vs2,
82+
vint8m1_t vs1, size_t vl) {
83+
return __riscv_vqdot_vv_i32m1_m(vm, vd, vs2, vs1, vl);
84+
}
85+
86+
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x i32> @test_vqdot_vv_i32m2_m(
87+
// CHECK-RV64-SAME: <vscale x 4 x i1> [[VM:%.*]], <vscale x 4 x i32> [[VD:%.*]], <vscale x 16 x i8> [[VS2:%.*]], <vscale x 16 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
88+
// CHECK-RV64-NEXT: entry:
89+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.riscv.vqdot.mask.nxv4i32.nxv16i8.nxv16i8.i64(<vscale x 4 x i32> [[VD]], <vscale x 16 x i8> [[VS2]], <vscale x 16 x i8> [[VS1]], <vscale x 4 x i1> [[VM]], i64 [[VL]], i64 3)
90+
// CHECK-RV64-NEXT: ret <vscale x 4 x i32> [[TMP0]]
91+
//
92+
vint32m2_t test_vqdot_vv_i32m2_m(vbool16_t vm, vint32m2_t vd, vint8m2_t vs2,
93+
vint8m2_t vs1, size_t vl) {
94+
return __riscv_vqdot_vv_i32m2_m(vm, vd, vs2, vs1, vl);
95+
}
96+
97+
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x i32> @test_vqdot_vv_i32m4_m(
98+
// CHECK-RV64-SAME: <vscale x 8 x i1> [[VM:%.*]], <vscale x 8 x i32> [[VD:%.*]], <vscale x 32 x i8> [[VS2:%.*]], <vscale x 32 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
99+
// CHECK-RV64-NEXT: entry:
100+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i32> @llvm.riscv.vqdot.mask.nxv8i32.nxv32i8.nxv32i8.i64(<vscale x 8 x i32> [[VD]], <vscale x 32 x i8> [[VS2]], <vscale x 32 x i8> [[VS1]], <vscale x 8 x i1> [[VM]], i64 [[VL]], i64 3)
101+
// CHECK-RV64-NEXT: ret <vscale x 8 x i32> [[TMP0]]
102+
//
103+
vint32m4_t test_vqdot_vv_i32m4_m(vbool8_t vm, vint32m4_t vd, vint8m4_t vs2,
104+
vint8m4_t vs1, size_t vl) {
105+
return __riscv_vqdot_vv_i32m4_m(vm, vd, vs2, vs1, vl);
106+
}
107+
108+
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x i32> @test_vqdot_vv_i32m8_m(
109+
// CHECK-RV64-SAME: <vscale x 16 x i1> [[VM:%.*]], <vscale x 16 x i32> [[VD:%.*]], <vscale x 64 x i8> [[VS2:%.*]], <vscale x 64 x i8> [[VS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
110+
// CHECK-RV64-NEXT: entry:
111+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 16 x i32> @llvm.riscv.vqdot.mask.nxv16i32.nxv64i8.nxv64i8.i64(<vscale x 16 x i32> [[VD]], <vscale x 64 x i8> [[VS2]], <vscale x 64 x i8> [[VS1]], <vscale x 16 x i1> [[VM]], i64 [[VL]], i64 3)
112+
// CHECK-RV64-NEXT: ret <vscale x 16 x i32> [[TMP0]]
113+
//
114+
vint32m8_t test_vqdot_vv_i32m8_m(vbool4_t vm, vint32m8_t vd, vint8m8_t vs2,
115+
vint8m8_t vs1, size_t vl) {
116+
return __riscv_vqdot_vv_i32m8_m(vm, vd, vs2, vs1, vl);
117+
}
Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 4
2+
// REQUIRES: riscv-registered-target
3+
// RUN: %clang_cc1 -triple riscv64 -target-feature +v -target-feature +experimental-zvqdotq -disable-O0-optnone \
4+
// RUN: -emit-llvm %s -o - | opt -S -passes=mem2reg | \
5+
// RUN: FileCheck --check-prefix=CHECK-RV64 %s
6+
7+
#include <sifive_vector.h>
8+
9+
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x i32> @test_vqdot_vx_i32mf2(
10+
// CHECK-RV64-SAME: <vscale x 1 x i32> [[VD:%.*]], <vscale x 4 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0:[0-9]+]] {
11+
// CHECK-RV64-NEXT: entry:
12+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i32> @llvm.riscv.vqdot.nxv1i32.nxv4i8.i32.i64(<vscale x 1 x i32> [[VD]], <vscale x 4 x i8> [[VS2]], i32 [[RS1]], i64 [[VL]], i64 3)
13+
// CHECK-RV64-NEXT: ret <vscale x 1 x i32> [[TMP0]]
14+
//
15+
vint32mf2_t test_vqdot_vx_i32mf2(vint32mf2_t vd, vint8mf2_t vs2, uint32_t rs1,
16+
size_t vl) {
17+
return __riscv_vqdot_vx_i32mf2(vd, vs2, rs1, vl);
18+
}
19+
20+
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x i32> @test_vqdot_vx_i32m1(
21+
// CHECK-RV64-SAME: <vscale x 2 x i32> [[VD:%.*]], <vscale x 8 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
22+
// CHECK-RV64-NEXT: entry:
23+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i32> @llvm.riscv.vqdot.nxv2i32.nxv8i8.i32.i64(<vscale x 2 x i32> [[VD]], <vscale x 8 x i8> [[VS2]], i32 [[RS1]], i64 [[VL]], i64 3)
24+
// CHECK-RV64-NEXT: ret <vscale x 2 x i32> [[TMP0]]
25+
//
26+
vint32m1_t test_vqdot_vx_i32m1(vint32m1_t vd, vint8m1_t vs2, uint32_t rs1,
27+
size_t vl) {
28+
return __riscv_vqdot_vx_i32m1(vd, vs2, rs1, vl);
29+
}
30+
31+
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x i32> @test_vqdot_vx_i32m2(
32+
// CHECK-RV64-SAME: <vscale x 4 x i32> [[VD:%.*]], <vscale x 16 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
33+
// CHECK-RV64-NEXT: entry:
34+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.riscv.vqdot.nxv4i32.nxv16i8.i32.i64(<vscale x 4 x i32> [[VD]], <vscale x 16 x i8> [[VS2]], i32 [[RS1]], i64 [[VL]], i64 3)
35+
// CHECK-RV64-NEXT: ret <vscale x 4 x i32> [[TMP0]]
36+
//
37+
vint32m2_t test_vqdot_vx_i32m2(vint32m2_t vd, vint8m2_t vs2, uint32_t rs1,
38+
size_t vl) {
39+
return __riscv_vqdot_vx_i32m2(vd, vs2, rs1, vl);
40+
}
41+
42+
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x i32> @test_vqdot_vx_i32m4(
43+
// CHECK-RV64-SAME: <vscale x 8 x i32> [[VD:%.*]], <vscale x 32 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
44+
// CHECK-RV64-NEXT: entry:
45+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i32> @llvm.riscv.vqdot.nxv8i32.nxv32i8.i32.i64(<vscale x 8 x i32> [[VD]], <vscale x 32 x i8> [[VS2]], i32 [[RS1]], i64 [[VL]], i64 3)
46+
// CHECK-RV64-NEXT: ret <vscale x 8 x i32> [[TMP0]]
47+
//
48+
vint32m4_t test_vqdot_vx_i32m4(vint32m4_t vd, vint8m4_t vs2, uint32_t rs1,
49+
size_t vl) {
50+
return __riscv_vqdot_vx_i32m4(vd, vs2, rs1, vl);
51+
}
52+
53+
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x i32> @test_vqdot_vx_i32m8(
54+
// CHECK-RV64-SAME: <vscale x 16 x i32> [[VD:%.*]], <vscale x 64 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
55+
// CHECK-RV64-NEXT: entry:
56+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 16 x i32> @llvm.riscv.vqdot.nxv16i32.nxv64i8.i32.i64(<vscale x 16 x i32> [[VD]], <vscale x 64 x i8> [[VS2]], i32 [[RS1]], i64 [[VL]], i64 3)
57+
// CHECK-RV64-NEXT: ret <vscale x 16 x i32> [[TMP0]]
58+
//
59+
vint32m8_t test_vqdot_vx_i32m8(vint32m8_t vd, vint8m8_t vs2, uint32_t rs1,
60+
size_t vl) {
61+
return __riscv_vqdot_vx_i32m8(vd, vs2, rs1, vl);
62+
}
63+
64+
// CHECK-RV64-LABEL: define dso_local <vscale x 1 x i32> @test_vqdot_vx_i32mf2_m(
65+
// CHECK-RV64-SAME: <vscale x 1 x i1> [[VM:%.*]], <vscale x 1 x i32> [[VD:%.*]], <vscale x 4 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
66+
// CHECK-RV64-NEXT: entry:
67+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 1 x i32> @llvm.riscv.vqdot.mask.nxv1i32.nxv4i8.i32.i64(<vscale x 1 x i32> [[VD]], <vscale x 4 x i8> [[VS2]], i32 [[RS1]], <vscale x 1 x i1> [[VM]], i64 [[VL]], i64 3)
68+
// CHECK-RV64-NEXT: ret <vscale x 1 x i32> [[TMP0]]
69+
//
70+
vint32mf2_t test_vqdot_vx_i32mf2_m(vbool64_t vm, vint32mf2_t vd, vint8mf2_t vs2,
71+
uint32_t rs1, size_t vl) {
72+
return __riscv_vqdot_vx_i32mf2_m(vm, vd, vs2, rs1, vl);
73+
}
74+
75+
// CHECK-RV64-LABEL: define dso_local <vscale x 2 x i32> @test_vqdot_vx_i32m1_m(
76+
// CHECK-RV64-SAME: <vscale x 2 x i1> [[VM:%.*]], <vscale x 2 x i32> [[VD:%.*]], <vscale x 8 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
77+
// CHECK-RV64-NEXT: entry:
78+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 2 x i32> @llvm.riscv.vqdot.mask.nxv2i32.nxv8i8.i32.i64(<vscale x 2 x i32> [[VD]], <vscale x 8 x i8> [[VS2]], i32 [[RS1]], <vscale x 2 x i1> [[VM]], i64 [[VL]], i64 3)
79+
// CHECK-RV64-NEXT: ret <vscale x 2 x i32> [[TMP0]]
80+
//
81+
vint32m1_t test_vqdot_vx_i32m1_m(vbool32_t vm, vint32m1_t vd, vint8m1_t vs2,
82+
uint32_t rs1, size_t vl) {
83+
return __riscv_vqdot_vx_i32m1_m(vm, vd, vs2, rs1, vl);
84+
}
85+
86+
// CHECK-RV64-LABEL: define dso_local <vscale x 4 x i32> @test_vqdot_vx_i32m2_m(
87+
// CHECK-RV64-SAME: <vscale x 4 x i1> [[VM:%.*]], <vscale x 4 x i32> [[VD:%.*]], <vscale x 16 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
88+
// CHECK-RV64-NEXT: entry:
89+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 4 x i32> @llvm.riscv.vqdot.mask.nxv4i32.nxv16i8.i32.i64(<vscale x 4 x i32> [[VD]], <vscale x 16 x i8> [[VS2]], i32 [[RS1]], <vscale x 4 x i1> [[VM]], i64 [[VL]], i64 3)
90+
// CHECK-RV64-NEXT: ret <vscale x 4 x i32> [[TMP0]]
91+
//
92+
vint32m2_t test_vqdot_vx_i32m2_m(vbool16_t vm, vint32m2_t vd, vint8m2_t vs2,
93+
uint32_t rs1, size_t vl) {
94+
return __riscv_vqdot_vx_i32m2_m(vm, vd, vs2, rs1, vl);
95+
}
96+
97+
// CHECK-RV64-LABEL: define dso_local <vscale x 8 x i32> @test_vqdot_vx_i32m4_m(
98+
// CHECK-RV64-SAME: <vscale x 8 x i1> [[VM:%.*]], <vscale x 8 x i32> [[VD:%.*]], <vscale x 32 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
99+
// CHECK-RV64-NEXT: entry:
100+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 8 x i32> @llvm.riscv.vqdot.mask.nxv8i32.nxv32i8.i32.i64(<vscale x 8 x i32> [[VD]], <vscale x 32 x i8> [[VS2]], i32 [[RS1]], <vscale x 8 x i1> [[VM]], i64 [[VL]], i64 3)
101+
// CHECK-RV64-NEXT: ret <vscale x 8 x i32> [[TMP0]]
102+
//
103+
vint32m4_t test_vqdot_vx_i32m4_m(vbool8_t vm, vint32m4_t vd, vint8m4_t vs2,
104+
uint32_t rs1, size_t vl) {
105+
return __riscv_vqdot_vx_i32m4_m(vm, vd, vs2, rs1, vl);
106+
}
107+
108+
// CHECK-RV64-LABEL: define dso_local <vscale x 16 x i32> @test_vqdot_vx_i32m8_m(
109+
// CHECK-RV64-SAME: <vscale x 16 x i1> [[VM:%.*]], <vscale x 16 x i32> [[VD:%.*]], <vscale x 64 x i8> [[VS2:%.*]], i32 noundef signext [[RS1:%.*]], i64 noundef [[VL:%.*]]) #[[ATTR0]] {
110+
// CHECK-RV64-NEXT: entry:
111+
// CHECK-RV64-NEXT: [[TMP0:%.*]] = call <vscale x 16 x i32> @llvm.riscv.vqdot.mask.nxv16i32.nxv64i8.i32.i64(<vscale x 16 x i32> [[VD]], <vscale x 64 x i8> [[VS2]], i32 [[RS1]], <vscale x 16 x i1> [[VM]], i64 [[VL]], i64 3)
112+
// CHECK-RV64-NEXT: ret <vscale x 16 x i32> [[TMP0]]
113+
//
114+
vint32m8_t test_vqdot_vx_i32m8_m(vbool4_t vm, vint32m8_t vd, vint8m8_t vs2,
115+
uint32_t rs1, size_t vl) {
116+
return __riscv_vqdot_vx_i32m8_m(vm, vd, vs2, rs1, vl);
117+
}

0 commit comments

Comments
 (0)