@@ -3256,8 +3256,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32563256 case clang::X86::BI__builtin_ia32_psllv8si:
32573257 return interp__builtin_elementwise_int_binop (
32583258 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 ());
32613261 }
32623262 return LHS.shl (RHS.getZExtValue ());
32633263 });
@@ -3266,8 +3266,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32663266 case clang::X86::BI__builtin_ia32_psrav8si:
32673267 return interp__builtin_elementwise_int_binop (
32683268 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 );
32713271 }
32723272 return LHS.ashr (RHS.getZExtValue ());
32733273 });
@@ -3278,8 +3278,8 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32783278 case clang::X86::BI__builtin_ia32_psrlv8si:
32793279 return interp__builtin_elementwise_int_binop (
32803280 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 ());
32833283 }
32843284 return LHS.lshr (RHS.getZExtValue ());
32853285 });
0 commit comments