[PATCH] D115670: Correct behavior of Vector boolean-operations, implement vector operator-

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 13 13:28:21 PST 2021


efriedma added inline comments.


================
Comment at: clang/lib/AST/ExprConstant.cpp:2915
   case BO_EQ:
-    Result = (LHSValue == RHSValue);
+    Result = -(LHSValue == RHSValue);
     break;
----------------
Using "operator=" to assign an int to an APInt is going to lead to weird/confusing results.  For example, I think this produces the wrong result if you have an int128_t vector.


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

https://reviews.llvm.org/D115670



More information about the cfe-commits mailing list