Skip to content

Commit 50b7123

Browse files
committed
fixup! [RISCV] Support XSfmm C intrinsics
1 parent ae966e1 commit 50b7123

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/lib/Sema/SemaRISCV.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ bool SemaRISCV::CheckBuiltinFunctionCall(const TargetInfo &TI,
729729
return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 15) ||
730730
SemaRef.BuiltinConstantArgMultiple(TheCall, 0, 4);
731731
}
732+
case RISCVVector::BI__builtin_rvv_sf_vtzero_t:
733+
return SemaRef.BuiltinConstantArgRange(TheCall, 0, 0, 15);
732734
case RISCVVector::BI__builtin_rvv_vget_v: {
733735
ASTContext::BuiltinVectorTypeInfo ResVecInfo =
734736
Context.getBuiltinVectorTypeInfo(cast<BuiltinType>(

clang/test/Sema/sifive-xsfmm.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,13 @@ void test(vfloat32m8_t arg0, vuint8m8_t arg1) {
1010
__riscv_sf_mm_f_f_w1(4, arg0, arg0, 1, 2, 3);
1111
__riscv_sf_mm_e5m2_e4m3(8, arg1, arg1, 1, 2, 3);
1212
__riscv_sf_mm_u_u(12, arg1, arg1, 1, 2, 3);
13+
__riscv_sf_vtzero_t_e8w1(0, 0, 0);
1314

1415
__riscv_sf_mm_f_f_w1(5, arg0, arg0, 1, 2, 3); /* expected-error {{argument should be a multiple of 4}} */
1516
__riscv_sf_mm_e5m2_e4m3(7, arg1, arg1, 1, 2, 3); /* expected-error {{argument should be a multiple of 4}} */
1617
__riscv_sf_mm_u_u(15, arg1, arg1, 1, 2, 3); /* expected-error {{argument should be a multiple of 4}} */
18+
__riscv_sf_mm_f_f_w1(16, arg0, arg0, 1, 2, 3); /* expected-error {{argument value 16 is outside the valid range [0, 15]}} */
19+
__riscv_sf_mm_e5m2_e4m3(20, arg1, arg1, 1, 2, 3); /* expected-error {{argument value 20 is outside the valid range [0, 15]}} */
20+
__riscv_sf_mm_u_u(24, arg1, arg1, 1, 2, 3); /* expected-error {{argument value 24 is outside the valid range [0, 15]}} */
21+
__riscv_sf_vtzero_t_e8w1(18, 0, 0); /* expected-error {{argument value 18 is outside the valid range [0, 15]}} */
1722
}

0 commit comments

Comments
 (0)