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;
770 uint64_t Carry = 0;
773 Dst[I] = (Tmp >> Shift) | Carry;
774 Carry = Tmp << (64 - Shift);
1151 // If we are shifting less than a word, compute the shift with a simple carry
1209 uint64_t carry = 0;
1211 val[i] = pVal[i] << shiftAmt | carry;
1212 carry = pVal[i] >> (APINT_BITS_PER_WORD - shiftAmt);
1599 bool carry = true; // true because b's complement is "complement + 1"
1601 u[i] = ~u[i] + carry; // b's complement
1602 carry = carry && u[i] == 0;
1618 // A carry will occur to the left of u[j+n], and it should be ignored
1620 bool carry = false;
1623 u[j+i] += v[i] + carry;
1624 carry = u[j+i] < limit || (carry && u[j+i] == limit);
1626 u[j+n] += carry;
1647 unsigned carry = 0;
1650 r[i] = (u[i] >> shift) | carry;
1651 carry = u[i] << (32 - shift);
2455 /* DST += RHS + C where C is zero or one. Returns the carry flag. */
2480 /* DST -= RHS + C where C is zero or one. Returns the carry flag. */
2513 /* DST += SRC * MULTIPLIER + CARRY if add is true
2514 DST = SRC * MULTIPLIER + CARRY if add is false
2526 integerPart multiplier, integerPart carry,
2542 /* [ LOW, HIGH ] = MULTIPLIER * SRC[i] + DST[i] + CARRY.
2553 low = carry;
2573 /* Now add carry. */
2574 if (low + carry < low)
2576 low += carry;
2587 carry = high;
2593 dst[i] = carry;
2596 /* We overflowed if there is carry. */
2597 if (carry)
2845 /* Increment a bignum in-place, return the carry flag. */