================
@@ -3101,6 +3101,62 @@ static bool interp__builtin_vec_set(InterpState &S, 
CodePtr OpPC,
   return true;
 }
 
+static bool interp__builtin_cmp_mask(InterpState &S, CodePtr OpPC,
+                                     const CallExpr *Call, unsigned ID,
+                                     bool IsUnsigned) {
+  assert(Call->getNumArgs() == 4);
+
+  APSInt Mask = popToAPSInt(S, Call->getArg(3));
+  APSInt Opcode = popToAPSInt(S, Call->getArg(2));
+  const Pointer &RHS = S.Stk.pop<Pointer>();
+  const Pointer &LHS = S.Stk.pop<Pointer>();
+
+  assert(LHS.getNumElems() == RHS.getNumElems());
+
+  APInt RetMask = APInt::getZero(LHS.getNumElems());
+  unsigned VectorLen = LHS.getNumElems();
+  PrimType ElemT = LHS.getFieldDesc()->getPrimType();
+
+  INT_TYPE_SWITCH_NO_BOOL(ElemT, {
----------------
tbaederr wrote:

Move the type switch into the loop body and only do the `elem<>()` calls in the 
type switch body. The macro expands to a lot of code otherwise.

https://github.com/llvm/llvm-project/pull/164026
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to