================
@@ -2361,6 +2363,101 @@ static ExprResult BuiltinMaskedStore(Sema &S, CallExpr
*TheCall) {
return TheCall;
}
+static ExprResult BuiltinMaskedGather(Sema &S, CallExpr *TheCall) {
+ if (S.checkArgCountRange(TheCall, 3, 4))
+ return ExprError();
+
+ Expr *MaskArg = TheCall->getArg(0);
+ Expr *IdxArg = TheCall->getArg(1);
+ Expr *PtrArg = TheCall->getArg(2);
+ if (CheckMaskedBuiltinArgs(S, MaskArg, PtrArg, 3, /*Vector=*/false))
+ return ExprError();
+
+ QualType IdxTy = IdxArg->getType();
+ const VectorType *IdxVecTy = IdxTy->getAs<VectorType>();
+ if (!IdxTy->isExtVectorType() ||
!IdxVecTy->getElementType()->isIntegerType())
+ return S.Diag(MaskArg->getBeginLoc(), diag::err_builtin_invalid_arg_type)
+ << 1 << /* vector of */ 4 << /* integer */ 1 << /* no fp */ 0
+ << IdxTy;
+
+ QualType MaskTy = MaskArg->getType();
+ QualType PtrTy = PtrArg->getType();
+ QualType PointeeTy = PtrTy->getPointeeType();
+ const VectorType *MaskVecTy = MaskTy->getAs<VectorType>();
----------------
jhuber6 wrote:
There should be a sema check that the first argument is a boolean vector in the
common helper.
https://github.com/llvm/llvm-project/pull/157895
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits