[clang] [llvm] [HLSL] implement `mad` intrinsic (PR #83826)

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 4 09:48:08 PST 2024


================
@@ -5298,6 +5298,14 @@ bool Sema::CheckHLSLBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
       return true;
     break;
   }
+  case Builtin::BI__builtin_hlsl_mad: {
+    if (checkArgCount(*this, TheCall, 3))
+      return true;
+    if (CheckVectorElementCallArgs(this, TheCall))
+      return true;
+    if (SemaBuiltinElementwiseTernaryMath(TheCall, false))
----------------
bogner wrote:

It's generally best to locally document boolean args for readability, like `/*EnforceFloatingPointCheck=*/false`

https://github.com/llvm/llvm-project/pull/83826


More information about the cfe-commits mailing list