================
@@ -105,11 +105,67 @@ bool SemaPPC::CheckPPCBuiltinFunctionCall(const
TargetInfo &TI,
switch (BuiltinID) {
default:
return false;
- case PPC::BI__builtin_ppc_bcdsetsign:
case PPC::BI__builtin_ppc_national2packed:
case PPC::BI__builtin_ppc_packed2zoned:
case PPC::BI__builtin_ppc_zoned2packed:
return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
+ case PPC::BI__builtin_ppc_bcdsetsign: {
+
+ ASTContext &Context = SemaRef.Context;
+ QualType Arg0Type = TheCall->getArg(0)->getType();
+ QualType Arg1Type = TheCall->getArg(1)->getType();
+
+ QualType VecType = Context.getVectorType(Context.UnsignedCharTy, 16,
+ VectorKind::AltiVecVector);
+
+ // Arg0 must be <16 x unsigned char>
+ if (!Context.hasSameType(Arg0Type, VecType))
+ return SemaRef.Diag(TheCall->getArg(0)->getBeginLoc(),
+ diag::err_ppc_bcd_invalid_vector_type)
+ << 0 << VecType << Arg0Type;
----------------
lei137 wrote:
Since this is repeated below, please consider putting this into a function to
be called for checking for vector types. eg isVecType(ArgNum,
VectorTypeExpected).
https://github.com/llvm/llvm-project/pull/154715
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits