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

2021-12-15 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. @craig.topper : Yep, probably so in both those cases. I'm working on a patch that includes the 2 'nots' as well, which complicates this whole section a bunch though. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115670/new/

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

2021-12-15 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:10393 + if (Elt.getKind() == APValue::Int) { +Elt.setInt(-Elt.getInt()); + } else { Can this be `Elt.getInt().negate()`? Comment at:

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

2021-12-15 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:10389 +return false; + case UO_Minus: { +for (unsigned EltNum = 0; EltNum < VD->getNumElements(); ++EltNum) { aaron.ballman wrote: > Would it be worth handling ~ and ! as well

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

2021-12-15 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:10389 +return false; + case UO_Minus: { +for (unsigned EltNum = 0; EltNum < VD->getNumElements(); ++EltNum) { Would it be worth handling ~ and ! as well given that they seem

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

2021-12-15 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Note, my pre-merge check failure seems completely unrelated. It seems to have some problem with the some 'go' bindings, but I don't believe that has anything to do with this change. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115670/new/

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

2021-12-14 Thread Erich Keane via Phabricator via cfe-commits
erichkeane updated this revision to Diff 394230. erichkeane added a comment. Enable __int128 vectors, and fix the issue of the >64 bit vectors for negation. Also add a test for these. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115670/new/ https://reviews.llvm.org/D115670 Files:

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

2021-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2915 case BO_EQ: -Result = (LHSValue == RHSValue); +Result = -(LHSValue == RHSValue); break; craig.topper wrote: > craig.topper wrote: > > erichkeane wrote: > > >

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

2021-12-13 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2915 case BO_EQ: -Result = (LHSValue == RHSValue); +Result = -(LHSValue == RHSValue); break; craig.topper wrote: > erichkeane wrote: > > efriedma wrote: > > > Using

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

2021-12-13 Thread Craig Topper via Phabricator via cfe-commits
craig.topper added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2915 case BO_EQ: -Result = (LHSValue == RHSValue); +Result = -(LHSValue == RHSValue); break; erichkeane wrote: > efriedma wrote: > > Using "operator=" to assign an int

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

2021-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. To add: I DID just try to fix that thing: [ekeane1@scsel-clx-24 clang]$ git diff diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 2b69c3727852..330772d2b10a 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++

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

2021-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:2915 case BO_EQ: -Result = (LHSValue == RHSValue); +Result = -(LHSValue == RHSValue); break; efriedma wrote: > Using "operator=" to assign an int to an APInt is going to

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

2021-12-13 Thread Eli Friedman via Phabricator via cfe-commits
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

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

2021-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. Note I am adding the folks who were added as reviewers the last time I did vector constexpr work: https://reviews.llvm.org/D79755 I again looked into operator[] to simplify things, but the 'LValueBase' stuff (seemingly required to do something like: VecTy[3] = 1;)

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

2021-12-13 Thread Erich Keane via Phabricator via cfe-commits
erichkeane created this revision. erichkeane added reviewers: RKSimon, aaron.ballman, void, efriedma. erichkeane requested review of this revision. All of our boolean operations on vector types should be using something like vcmpeqd, which results in a mask of '-1' for the 'truth' type. We are