================
@@ -678,6 +678,30 @@ static bool interp__builtin_popcount(InterpState &S, 
CodePtr OpPC,
   return true;
 }
 
+static bool interp__builtin_parity(InterpState &S, CodePtr OpPC,
+                                   const InterpFrame *Frame,
+                                   const CallExpr *Call) {
+  APSInt Val = popToAPSInt(S, Call->getArg(0));
+  pushInteger(S, Val.popcount() % 2, Call->getType());
+  return true;
+}
+
+static bool interp__builtin_clrsb(InterpState &S, CodePtr OpPC,
+                                  const InterpFrame *Frame,
+                                  const CallExpr *Call) {
+  APSInt Val = popToAPSInt(S, Call->getArg(0));
+  pushInteger(S, Val.getBitWidth() - Val.getSignificantBits(), 
Call->getType());
+  return true;
+}
+
+static bool interp__builtin_bitreverse(InterpState &S, CodePtr OpPC,
+                                       const InterpFrame *Frame,
+                                       const CallExpr *Call) {
+  APSInt Val = popToAPSInt(S, Call->getArg(0));
+  pushInteger(S, Val.reverseBits(), Call->getType());
+  return true;
+}
----------------
SeongjaeP wrote:

Ah, I see — that makes sense. I must have messed up the merge at some point.
I’m still getting used to the rebase workflow, so mistakes like this happen 
sometimes.
I’ll fix it and clean up the patch soon.

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

Reply via email to