@@ -1413,6 +1413,7 @@ static bool interp__builtin_ia32_pext(InterpState &S, CodePtr OpPC,
1413
1413
return true ;
1414
1414
}
1415
1415
1416
+ // / (CarryIn, LHS, RHS, Result)
1416
1417
static bool interp__builtin_ia32_addcarry_subborrow (InterpState &S,
1417
1418
CodePtr OpPC,
1418
1419
const InterpFrame *Frame,
@@ -1423,16 +1424,17 @@ static bool interp__builtin_ia32_addcarry_subborrow(InterpState &S,
1423
1424
!Call->getArg (2 )->getType ()->isIntegerType ())
1424
1425
return false ;
1425
1426
1426
- APSInt CarryIn = peekToAPSInt (
1427
- S.Stk , *S.getContext ().classify (Call->getArg (0 )),
1428
- align (primSize (*S.getContext ().classify (Call->getArg (2 )))) +
1429
- align (primSize (*S.getContext ().classify (Call->getArg (1 )))) +
1430
- align (primSize (*S.getContext ().classify (Call->getArg (0 )))));
1427
+ PrimType CarryInT = *S.getContext ().classify (Call->getArg (0 ));
1428
+ PrimType LHST = *S.getContext ().classify (Call->getArg (1 ));
1429
+ PrimType RHST = *S.getContext ().classify (Call->getArg (2 ));
1430
+ unsigned PtrSize = align (primSize (PT_Ptr));
1431
+ APSInt CarryIn =
1432
+ peekToAPSInt (S.Stk , CarryInT,
1433
+ PtrSize + align (primSize (RHST)) + align (primSize (LHST)) +
1434
+ align (primSize (CarryInT)));
1431
1435
APSInt LHS = peekToAPSInt (
1432
- S.Stk , *S.getContext ().classify (Call->getArg (1 )),
1433
- align (primSize (*S.getContext ().classify (Call->getArg (2 )))) +
1434
- align (primSize (*S.getContext ().classify (Call->getArg (1 )))));
1435
- APSInt RHS = peekToAPSInt (S.Stk , *S.getContext ().classify (Call->getArg (2 )));
1436
+ S.Stk , LHST, PtrSize + align (primSize (RHST)) + align (primSize (LHST)));
1437
+ APSInt RHS = peekToAPSInt (S.Stk , RHST, PtrSize + align (primSize (RHST)));
1436
1438
1437
1439
bool IsAdd = BuiltinOp == clang::X86::BI__builtin_ia32_addcarryx_u32 ||
1438
1440
BuiltinOp == clang::X86::BI__builtin_ia32_addcarryx_u64;
0 commit comments