================
@@ -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 passing float or any other type :
**XL behaviour** 
`"test.cpp", line 6.32: 1540-2881 (S) The built-in function 
"__builtin_bcdsetsign"'s argument "2" must be "a constant integral expression".`

**OpenXL behaviour :** 
 ```
test.c:7:12: error: argument to '__builtin_ppc_bcdsetsign' must be a constant 
integer
    7 |     return __builtin_ppc_bcdsetsign(a, b);
      |            ^                           ~
1 error generated.
```

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