Skip to content

Commit 1e18ebe

Browse files
committed
#160289 replaced A and B with Value and Amount, removed the explicit urem and called Value.rotl/r(Amount) directly
1 parent 1132144 commit 1e18ebe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

clang/lib/AST/ByteCode/InterpBuiltin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3144,8 +3144,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
31443144
case Builtin::BI_lrotl:
31453145
case Builtin::BI_rotl64:
31463146
return interp__builtin_elementwise_int_binop(
3147-
S, OpPC, Call, [](const APSInt &A, const APSInt &B) -> APInt {
3148-
return A.rotl(B.urem(A.getBitWidth()));
3147+
S, OpPC, Call, [](const APSInt &Value, const APSInt &Amount) -> APInt {
3148+
return Value.rotl(Amount);
31493149
});
31503150

31513151
case Builtin::BI__builtin_rotateright8:
@@ -3158,8 +3158,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
31583158
case Builtin::BI_lrotr:
31593159
case Builtin::BI_rotr64:
31603160
return interp__builtin_elementwise_int_binop(
3161-
S, OpPC, Call, [](const APSInt &A, const APSInt &B) -> APInt {
3162-
return A.rotr(B.urem(A.getBitWidth()));
3161+
S, OpPC, Call, [](const APSInt &Value, const APSInt &Amount) -> APInt {
3162+
return Value.rotr(Amount);
31633163
});
31643164

31653165
case Builtin::BI__builtin_ffs:

0 commit comments

Comments
 (0)