Lines Matching full:parts
340 static void tcComplement(APInt::WordType *dst, unsigned parts) {
341 for (unsigned i = 0; i < parts; i++)
606 // We can check that all parts of an integer are equal by making use of a
2313 /// out higher parts.
2314 void APInt::tcSet(WordType *dst, WordType part, unsigned parts) {
2315 assert(parts > 0);
2317 for (unsigned i = 1; i < parts; i++)
2322 void APInt::tcAssign(WordType *dst, const WordType *src, unsigned parts) {
2323 for (unsigned i = 0; i < parts; i++)
2328 bool APInt::tcIsZero(const WordType *src, unsigned parts) {
2329 for (unsigned i = 0; i < parts; i++)
2337 int APInt::tcExtractBit(const WordType *parts, unsigned bit) {
2338 return (parts[whichWord(bit)] & maskBit(bit)) != 0;
2342 void APInt::tcSetBit(WordType *parts, unsigned bit) {
2343 parts[whichWord(bit)] |= maskBit(bit);
2347 void APInt::tcClearBit(WordType *parts, unsigned bit) {
2348 parts[whichWord(bit)] &= ~maskBit(bit);
2353 unsigned APInt::tcLSB(const WordType *parts, unsigned n) {
2355 if (parts[i] != 0) {
2356 unsigned lsb = llvm::countr_zero(parts[i]);
2366 unsigned APInt::tcMSB(const WordType *parts, unsigned n) {
2370 if (parts[n] != 0) {
2371 static_assert(sizeof(parts[n]) <= sizeof(uint64_t));
2372 unsigned msb = llvm::Log2_64(parts[n]);
2382 /// DST, of dstCOUNT parts, such that the bit srcLSB becomes the least
2410 // Clear high parts.
2417 WordType c, unsigned parts) {
2420 for (unsigned i = 0; i < parts; i++) {
2439 unsigned parts) {
2440 for (unsigned i = 0; i < parts; ++i) {
2452 WordType c, unsigned parts) {
2455 for (unsigned i = 0; i < parts; i++) {
2477 unsigned parts) {
2478 for (unsigned i = 0; i < parts; ++i) {
2490 void APInt::tcNegate(WordType *dst, unsigned parts) {
2491 tcComplement(dst, parts);
2492 tcIncrement(dst, parts);
2501 /// DSTPARTS parts of the result, and if all of the omitted higher
2502 /// parts were zero return zero, otherwise overflow occurred and
2571 // We would overflow if any significant unwritten parts would be
2572 // non-zero. This is true if any remaining src parts are non-zero
2584 /// is filled with the least significant parts of the result. Returns
2588 const WordType *rhs, unsigned parts) {
2593 for (unsigned i = 0; i < parts; i++) {
2597 tcMultiplyPart(&dst[i], lhs, rhs[i], 0, parts, parts - i, i != 0);
2632 unsigned parts) {
2635 unsigned shiftCount = tcMSB(rhs, parts) + 1;
2639 shiftCount = parts * APINT_BITS_PER_WORD - shiftCount;
2643 tcAssign(srhs, rhs, parts);
2644 tcShiftLeft(srhs, parts, shiftCount);
2645 tcAssign(remainder, lhs, parts);
2646 tcSet(lhs, 0, parts);
2651 int compare = tcCompare(remainder, srhs, parts);
2653 tcSubtract(remainder, srhs, 0, parts);
2660 tcShiftRight(srhs, parts, 1);
2726 unsigned parts) {
2727 while (parts) {
2728 parts--;
2729 if (lhs[parts] != rhs[parts])
2730 return (lhs[parts] > rhs[parts]) ? 1 : -1;