[PATCH] D114688: [Clang] Add __builtin_elementwise_ceil

Florian Hahn via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 7 07:47:39 PST 2021


fhahn added a comment.

Thanks for the update, it looks like it should be in line with @aaron.ballman's suggestions!

I think it might be good to split off the refactoring of `SemaBuiltinElementwiseMathOneArg`-> `PrepareBuiltinElementwiseMathOneArgCall` and the update for `BI__builtin_elementwise_abs` into a separate, non functional change (NFC).



================
Comment at: clang/lib/Sema/SemaChecking.cpp:2101
 
-  case Builtin::BI__builtin_elementwise_abs:
-    if (SemaBuiltinElementwiseMathOneArg(TheCall))
+  // __builtin_elementwise_abs estricts the element type to signed integers or
+  // floating point types only.
----------------
nit: typo estricts -> restricts? 


================
Comment at: clang/lib/Sema/SemaChecking.cpp:2121
+
+  // __builtin_elementwise_abs estricts the element type to floating point
+  // types only.
----------------
nit: typo `estricts` -> `restricts`? It should also say `_ceil` instead of `_abs`, right?


================
Comment at: clang/lib/Sema/SemaChecking.cpp:16739
 
-  QualType EltTy = TyA;
-  if (auto *VecTy = EltTy->getAs<VectorType>())
-    EltTy = VecTy->getElementType();
-  if (EltTy->isUnsignedIntegerType())
-    return Diag(ArgLoc, diag::err_builtin_invalid_arg_type)
-           << 1 << /*signed integer or float ty*/ 3 << TyA;
+  if (checkMathBuiltinElementType(*this, A.get()->getBeginLoc(), TyA))
+    return true;
----------------
w


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

https://reviews.llvm.org/D114688



More information about the cfe-commits mailing list