[clang] [clang][bytecode] Implement logical operators for vector type (PR #107678)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Sat Sep 7 02:25:56 PDT 2024
================
@@ -1300,6 +1309,16 @@ bool Compiler<Emitter>::VisitVectorBinOp(const BinaryOperator *E) {
if (!this->emitGT(ElemT, E))
return false;
break;
+ case BO_LAnd:
+ // a && b is equivalent to a!=0 & b!=0
----------------
tbaederr wrote:
I was trying to prove this wrong but it's really what the current interpreter does. Since the vector isn't implicitly convertible to bool, there's no short-circuiting: https://godbolt.org/z/aaoTPWcKo
https://github.com/llvm/llvm-project/pull/107678
More information about the cfe-commits
mailing list