================
@@ -2889,6 +2889,66 @@ static bool interp__builtin_blend(InterpState &S,
CodePtr OpPC,
return true;
}
+static bool interp__builtin_ia32_test_op(
+ InterpState &S, CodePtr OpPC, const CallExpr *Call,
+ llvm::function_ref<bool(const APInt &A, const APInt &B)> Fn) {
+ const Pointer &RHS = S.Stk.pop<Pointer>();
+ const Pointer &LHS = S.Stk.pop<Pointer>();
+
+ assert(LHS.getNumElems() == RHS.getNumElems());
+ assert(LHS.getFieldDesc()->isPrimitiveArray() &&
+ RHS.getFieldDesc()->isPrimitiveArray());
+
+ if (!S.getASTContext().hasSameUnqualifiedType(getElemType(LHS),
+ getElemType(RHS)))
+ return false;
+
+ const unsigned SourceLen = LHS.getNumElems();
+ const QualType ElemQT = getElemType(LHS);
+ const OptPrimType ElemPT = S.getContext().classify(ElemQT);
+
+ if (ElemQT->isIntegerType()) {
+ APInt FirstElem;
+ INT_TYPE_SWITCH_NO_BOOL(*ElemPT,
+ { FirstElem = LHS.elem<T>(0).toAPSInt(); });
+ const unsigned LaneWidth = FirstElem.getBitWidth();
----------------
RKSimon wrote:
Can't you get LaneWidth from ElemQT?
https://github.com/llvm/llvm-project/pull/160428
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits