[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


================
@@ -19812,11 +19821,13 @@ bool Sema::SemaBuiltinElementwiseTernaryMath(CallExpr *TheCall) {
     Args[I] = Converted.get();
   }
 
-  int ArgOrdinal = 1;
-  for (Expr *Arg : Args) {
-    if (checkFPMathBuiltinElementType(*this, Arg->getBeginLoc(), Arg->getType(),
-                                      ArgOrdinal++))
-      return true;
+  if (enforceFloatingPointCheck) {
+    int ArgOrdinal = 1;
+    for (Expr *Arg : Args) {
+      if (checkFPMathBuiltinElementType(*this, Arg->getBeginLoc(),
+                                        Arg->getType(), ArgOrdinal++))
----------------
bogner wrote:

Should this call some other element type check instead in this case? I initially thought `checkMathBuiltinElementType` would make sense, but from a quick glance that seems to be tied to matrix types for some reason.

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


More information about the cfe-commits mailing list