@@ -2549,7 +2549,7 @@ static bool interp__builtin_is_within_lifetime(InterpState &S, CodePtr OpPC,
25492549}
25502550
25512551static bool interp__builtin_elementwise_int_binop (
2552- InterpState &S, CodePtr OpPC, const CallExpr *Call, unsigned BuiltinID,
2552+ InterpState &S, CodePtr OpPC, const CallExpr *Call,
25532553 llvm::function_ref<APInt(const APSInt &, const APSInt &)> Fn) {
25542554 assert (Call->getNumArgs () == 2 );
25552555
@@ -3287,26 +3287,26 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
32873287
32883288 case Builtin::BI__builtin_elementwise_add_sat:
32893289 return interp__builtin_elementwise_int_binop (
3290- S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3290+ S, OpPC, Call, [](const APSInt &LHS, const APSInt &RHS) {
32913291 return LHS.isSigned () ? LHS.sadd_sat (RHS) : LHS.uadd_sat (RHS);
32923292 });
32933293
32943294 case Builtin::BI__builtin_elementwise_sub_sat:
32953295 return interp__builtin_elementwise_int_binop (
3296- S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3296+ S, OpPC, Call, [](const APSInt &LHS, const APSInt &RHS) {
32973297 return LHS.isSigned () ? LHS.ssub_sat (RHS) : LHS.usub_sat (RHS);
32983298 });
32993299
33003300 case clang::X86::BI__builtin_ia32_pmulhuw128:
33013301 case clang::X86::BI__builtin_ia32_pmulhuw256:
33023302 case clang::X86::BI__builtin_ia32_pmulhuw512:
3303- return interp__builtin_elementwise_int_binop (S, OpPC, Call, BuiltinID,
3303+ return interp__builtin_elementwise_int_binop (S, OpPC, Call,
33043304 llvm::APIntOps::mulhu);
33053305
33063306 case clang::X86::BI__builtin_ia32_pmulhw128:
33073307 case clang::X86::BI__builtin_ia32_pmulhw256:
33083308 case clang::X86::BI__builtin_ia32_pmulhw512:
3309- return interp__builtin_elementwise_int_binop (S, OpPC, Call, BuiltinID,
3309+ return interp__builtin_elementwise_int_binop (S, OpPC, Call,
33103310 llvm::APIntOps::mulhs);
33113311
33123312 case clang::X86::BI__builtin_ia32_psllv2di:
@@ -3324,7 +3324,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
33243324 case clang::X86::BI__builtin_ia32_psllqi256:
33253325 case clang::X86::BI__builtin_ia32_psllqi512:
33263326 return interp__builtin_elementwise_int_binop (
3327- S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3327+ S, OpPC, Call, [](const APSInt &LHS, const APSInt &RHS) {
33283328 if (RHS.uge (LHS.getBitWidth ())) {
33293329 return APInt::getZero (LHS.getBitWidth ());
33303330 }
@@ -3344,7 +3344,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
33443344 case clang::X86::BI__builtin_ia32_psraqi256:
33453345 case clang::X86::BI__builtin_ia32_psraqi512:
33463346 return interp__builtin_elementwise_int_binop (
3347- S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3347+ S, OpPC, Call, [](const APSInt &LHS, const APSInt &RHS) {
33483348 if (RHS.uge (LHS.getBitWidth ())) {
33493349 return LHS.ashr (LHS.getBitWidth () - 1 );
33503350 }
@@ -3366,7 +3366,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
33663366 case clang::X86::BI__builtin_ia32_psrlqi256:
33673367 case clang::X86::BI__builtin_ia32_psrlqi512:
33683368 return interp__builtin_elementwise_int_binop (
3369- S, OpPC, Call, BuiltinID, [](const APSInt &LHS, const APSInt &RHS) {
3369+ S, OpPC, Call, [](const APSInt &LHS, const APSInt &RHS) {
33703370 if (RHS.uge (LHS.getBitWidth ())) {
33713371 return APInt::getZero (LHS.getBitWidth ());
33723372 }
@@ -3384,7 +3384,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
33843384 case clang::X86::BI__builtin_ia32_prolq256:
33853385 case clang::X86::BI__builtin_ia32_prolq512:
33863386 return interp__builtin_elementwise_int_binop (
3387- S, OpPC, Call, BuiltinID,
3387+ S, OpPC, Call,
33883388 [](const APSInt &LHS, const APSInt &RHS) { return LHS.rotl (RHS); });
33893389
33903390 case clang::X86::BI__builtin_ia32_prord128:
@@ -3394,7 +3394,7 @@ bool InterpretBuiltin(InterpState &S, CodePtr OpPC, const CallExpr *Call,
33943394 case clang::X86::BI__builtin_ia32_prorq256:
33953395 case clang::X86::BI__builtin_ia32_prorq512:
33963396 return interp__builtin_elementwise_int_binop (
3397- S, OpPC, Call, BuiltinID,
3397+ S, OpPC, Call,
33983398 [](const APSInt &LHS, const APSInt &RHS) { return LHS.rotr (RHS); });
33993399
34003400 case Builtin::BI__builtin_elementwise_max:
0 commit comments