[PATCH] D80979: [clang] Implement VectorType logic not operator.

JunMa via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 3 20:53:54 PDT 2020


junparser marked 3 inline comments as done.
junparser added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2746
+  if (E->getType()->isVectorType() &&
+      E->getType()->castAs<VectorType>()->getVectorKind() ==
+          VectorType::GenericVector) {
----------------
erichkeane wrote:
> Why limit this to just the base vector type?  Doesn't this remove the ext-vector implementation?
> 
> 
the kind of ext-vector is  GenericVector as well. so it also includes ext-vector.


================
Comment at: clang/lib/Sema/SemaExpr.cpp:14442
+      break;
+    } else if (Context.getLangOpts().CPlusPlus && resultType->isVectorType()) {
+      const VectorType *VTy = resultType->castAs<VectorType>();
----------------
erichkeane wrote:
> Why C++ only?  It seems if we're doing this, it should be for all language modes.
Here we keep the behavior  as same as gcc since ! of vector only allows with C++ in gcc


================
Comment at: clang/test/CodeGen/vector.c:90
+// CHECK: define i32 @lax_vector_logic_not1(i32 {{.*}}, i32 {{.*}})
+// CHECK: icmp ne i32
+
----------------
erichkeane wrote:
> Can you clarify what this is doing here?  It doesn't seem clear to me what the output of this is.
> 
> Additionally, what about FP types?  What do we expect this to emit?
sorry for the confusing. it seems i add the wrong code which test the != rather than !.  I'll add the new testcases


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80979





More information about the cfe-commits mailing list