[clang] [clang] Implement __builtin_stdc_rotate_left, __builtin_stdc_rotate_right (PR #160259)

NagaChaitanya Vellanki via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 26 18:02:12 PST 2025


================
@@ -15774,7 +15768,53 @@ bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E,
         !EvaluateInteger(E->getArg(1), Amt, Info))
       return false;
 
-    return Success(Val.rotr(Amt), E);
+    // Normalize shift amount to [0, BitWidth) range to match runtime behavior
+    unsigned BitWidth = Val.getBitWidth();
----------------
chaitanyav wrote:

ExprConstant, InterBuiltin both share the same implementation now.

https://github.com/llvm/llvm-project/pull/160259


More information about the cfe-commits mailing list