miri::shims::x86

Function carrying_add

Source
fn carrying_add<'tcx>(
    this: &mut MiriInterpCx<'tcx>,
    cb_in: &OpTy<'tcx>,
    a: &OpTy<'tcx>,
    b: &OpTy<'tcx>,
    op: BinOp,
) -> InterpResult<'tcx, (ImmTy<'tcx>, Scalar)>
Expand description

Calcultates either a + b + cb_in or a - b - cb_in depending on the value of op and returns both the sum and the overflow bit. op is expected to be either one of mir::BinOp::AddWithOverflow and mir::BinOp::SubWithOverflow.