================
@@ -147,7 +147,14 @@ bool SemaPPC::CheckPPCBuiltinFunctionCall(const TargetInfo 
&TI,
   switch (BuiltinID) {
   default:
     return false;
-  case PPC::BI__builtin_ppc_bcdsetsign:
+  case PPC::BI__builtin_ppc_bcdsetsign: {
+    // Arg0 must be vector unsigned char
+    if (!IsTypeVecUChar(TheCall->getArg(0)->getType(), 0))
+      return false;
+
+    // Restrict Arg1 constant range (0–1)
+    return SemaRef.BuiltinConstantArgRange(TheCall, 1, 0, 1);
----------------
AditiRM wrote:

For`bcdsetsign`, the second argument is required to be a constant `0 or 1`. 
Enforcing the [0,1] constant range is sufficient and matches the documented 
semantics; an explicit unsigned char type check is unnecessary and consistent 
with prior BCD builtin handling.

https://github.com/llvm/llvm-project/pull/178121
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to