================
@@ -56,6 +56,20 @@ static APSInt popToAPSInt(InterpState &S, QualType T) {
   return popToAPSInt(S.Stk, *S.getContext().classify(T));
 }
 
+static APInt ROTL_fn(const APSInt &A, const APSInt &B) {
+  const APInt &X = static_cast<const APInt &>(A);
+  const unsigned BW = X.getBitWidth();
+  const uint64_t Amt = B.getZExtValue();
+  return X.rotl(static_cast<unsigned>(Amt % BW));
+}
+
+static APInt ROTR_fn(const APSInt &A, const APSInt &B) {
+  const APInt &X = static_cast<const APInt &>(A);
----------------
tbaederr wrote:

This explicit cast is unnecessary AFAIK.

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

Reply via email to