================ @@ -1267,7 +1268,15 @@ bool Compiler<Emitter>::VisitVectorBinOp(const BinaryOperator *E) { auto getElem = [=](unsigned Offset, unsigned Index) { if (!this->emitGetLocal(PT_Ptr, Offset, E)) return false; - return this->emitArrayElemPop(ElemT, Index, E); + if (!this->emitArrayElemPop(ElemT, Index, E)) + return false; + if (E->isLogicalOp()) { + if (!this->emitPrimCast(ElemT, PT_Bool, Ctx.getASTContext().BoolTy, E)) + return false; + if (!this->emitPrimCast(PT_Bool, ResultElemT, VecTy->getElementType(), E)) + return false; + } ---------------- yronglin wrote:
Yes, this approach doesn't looks well. Seems BitAnd/BitOr doesn't support bool type, should we extend these two operations to support bool type? Then we can avoid these casts. https://github.com/llvm/llvm-project/pull/107678 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits