[PATCH] D140992: clang: Add __builtin_elementwise_fma

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 4 10:54:40 PST 2023


arsenm added inline comments.


================
Comment at: clang/lib/Sema/SemaChecking.cpp:2615
     QualType ArgTy = TheCall->getArg(0)->getType();
-    QualType EltTy = ArgTy;
-
-    if (auto *VecTy = EltTy->getAs<VectorType>())
-      EltTy = VecTy->getElementType();
-    if (!EltTy->isFloatingType()) {
-      Diag(TheCall->getArg(0)->getBeginLoc(),
-           diag::err_builtin_invalid_arg_type)
-          << 1 << /* float ty*/ 5 << ArgTy;
-
+    if (checkFPMathBuiltinElementType(*this, TheCall->getArg(0)->getBeginLoc(),
+                                      ArgTy, 1))
----------------
bob80905 wrote:
> This change appears to allow more types (such as integers) as args for this set of builtins in the above cases, where before the behavior was to just allow floats.
> Is this intended behavior?
> 
No? test/Sema/builtins-elementwise-math.c already checks all of these reject integers and passes


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140992/new/

https://reviews.llvm.org/D140992



More information about the cfe-commits mailing list