Home | History | Annotate | Download | only in Support

Lines Matching full:carry

181 /// 1 is returned if there is a carry out, otherwise 0 is returned.
182 /// @returns the carry of the addition.
187 y = 1; // Carry one to next digit.
189 y = 0; // No need to carry so exit early
236 /// @returns the carry out from the addition
240 bool carry = false;
243 dest[i] = x[i] + y[i] + carry;
244 carry = dest[i] < limit || (carry && dest[i] == limit);
246 return carry;
290 /// @returns the carry out of the multiplication.
295 uint64_t carry = 0;
302 // hasCarry - A flag to indicate if there is a carry to the next digit.
303 // hasCarry == 0, no carry
304 // hasCarry == 1, has carry
305 // hasCarry == 2, no carry and the calculation result == 0.
307 dest[i] = carry + lx * ly;
308 // Determine if the add above introduces carry.
309 hasCarry = (dest[i] < carry) ? 1 : 0;
310 carry = hx * ly + (dest[i] >> 32) + (hasCarry ? (1ULL << 32) : 0);
311 // The upper limit of carry can be (2^32 - 1)(2^32 - 1) +
313 hasCarry = (!carry && hasCarry) ? 1 : (!carry ? 2 : 0);
315 carry += (lx * hy) & 0xffffffffULL;
316 dest[i] = (carry << 32) | (dest[i] & 0xffffffffULL);
317 carry = (((!carry && hasCarry != 2) || hasCarry == 1) ? (1ULL << 32) : 0) +
318 (carry >> 32) + ((lx * hy) >> 32) + hx * hy;
320 return carry;
331 uint64_t carry = 0, lx = 0, hx = 0;
335 // hasCarry - A flag to indicate if has carry.
336 // hasCarry == 0, no carry
337 // hasCarry == 1, has carry
338 // hasCarry == 2, no carry and the calculation result == 0.
340 uint64_t resul = carry + lx * ly;
341 hasCarry = (resul < carry) ? 1 : 0;
342 carry = (hasCarry ? (1ULL << 32) : 0) + hx * ly + (resul >> 32);
343 hasCarry = (!carry && hasCarry) ? 1 : (!carry ? 2 : 0);
345 carry += (lx * hy) & 0xffffffffULL;
346 resul = (carry << 32) | (resul & 0xffffffffULL);
348 carry = (((!carry && hasCarry != 2) || hasCarry == 1) ? (1ULL << 32) : 0)+
349 (carry >> 32) + (dest[i+j] < resul ? 1 : 0) +
352 dest[i+xlen] = carry;
782 uint64_t Carry = 0;
785 Dst[I] = (Tmp >> Shift) | Carry;
786 Carry = Tmp << (64 - Shift);
1165 // If we are shifting less than a word, compute the shift with a simple carry
1229 uint64_t carry = 0;
1231 val[i] = pVal[i] << shiftAmt | carry;
1232 carry = pVal[i] >> (APINT_BITS_PER_WORD - shiftAmt);
1624 // A carry will occur to the left of u[j+n], and it should be ignored
1626 bool carry = false;
1629 u[j+i] += v[i] + carry;
1630 carry = u[j+i] < limit || (carry && u[j+i] == limit);
1632 u[j+n] += carry;
1653 unsigned carry = 0;
1656 r[i] = (u[i] >> shift) | carry;
1657 carry = u[i] << (32 - shift);
2481 /* DST += RHS + C where C is zero or one. Returns the carry flag. */
2506 /* DST -= RHS + C where C is zero or one. Returns the carry flag. */
2539 /* DST += SRC * MULTIPLIER + CARRY if add is true
2540 DST = SRC * MULTIPLIER + CARRY if add is false
2552 integerPart multiplier, integerPart carry,
2568 /* [ LOW, HIGH ] = MULTIPLIER * SRC[i] + DST[i] + CARRY.
2579 low = carry;
2599 /* Now add carry. */
2600 if (low + carry < low)
2602 low += carry;
2613 carry = high;
2619 dst[i] = carry;
2622 /* We overflowed if there is carry. */
2623 if (carry)
2871 /* Increment a bignum in-place, return the carry flag. */