@@ -3256,8 +3256,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
3256
3256
case clang::X86::BI__builtin_ia32_psllv8si:
3257
3257
return interp__builtin_elementwise_int_binop (
3258
3258
S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3259
- if (RHS.uge (RHS .getBitWidth ())) {
3260
- return APInt::getZero (RHS .getBitWidth ());
3259
+ if (RHS.uge (LHS .getBitWidth ())) {
3260
+ return APInt::getZero (LHS .getBitWidth ());
3261
3261
}
3262
3262
return LHS.shl (RHS.getZExtValue ());
3263
3263
});
@@ -3266,8 +3266,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
3266
3266
case clang::X86::BI__builtin_ia32_psrav8si:
3267
3267
return interp__builtin_elementwise_int_binop (
3268
3268
S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3269
- if (RHS.uge (RHS .getBitWidth ())) {
3270
- return LHS.ashr (RHS .getBitWidth () - 1 );
3269
+ if (RHS.uge (LHS .getBitWidth ())) {
3270
+ return LHS.ashr (LHS .getBitWidth () - 1 );
3271
3271
}
3272
3272
return LHS.ashr (RHS.getZExtValue ());
3273
3273
});
@@ -3278,8 +3278,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
3278
3278
case clang::X86::BI__builtin_ia32_psrlv8si:
3279
3279
return interp__builtin_elementwise_int_binop (
3280
3280
S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3281
- if (RHS.uge (RHS .getBitWidth ())) {
3282
- return APInt::getZero (RHS .getBitWidth ());
3281
+ if (RHS.uge (LHS .getBitWidth ())) {
3282
+ return APInt::getZero (LHS .getBitWidth ());
3283
3283
}
3284
3284
return LHS.lshr (RHS.getZExtValue ());
3285
3285
});
0 commit comments