Lines Matching full:parts

338 static void tcComplement(APInt::WordType *dst, unsigned parts) {
339 for (unsigned i = 0; i < parts; i++)
602 // We can check that all parts of an integer are equal by making use of a
2309 /// out higher parts.
2310 void APInt::tcSet(WordType *dst, WordType part, unsigned parts) {
2311 assert(parts > 0);
2313 for (unsigned i = 1; i < parts; i++)
2318 void APInt::tcAssign(WordType *dst, const WordType *src, unsigned parts) {
2319 for (unsigned i = 0; i < parts; i++)
2324 bool APInt::tcIsZero(const WordType *src, unsigned parts) {
2325 for (unsigned i = 0; i < parts; i++)
2333 int APInt::tcExtractBit(const WordType *parts, unsigned bit) {
2334 return (parts[whichWord(bit)] & maskBit(bit)) != 0;
2338 void APInt::tcSetBit(WordType *parts, unsigned bit) {
2339 parts[whichWord(bit)] |= maskBit(bit);
2343 void APInt::tcClearBit(WordType *parts, unsigned bit) {
2344 parts[whichWord(bit)] &= ~maskBit(bit);
2349 unsigned APInt::tcLSB(const WordType *parts, unsigned n) {
2351 if (parts[i] != 0) {
2352 unsigned lsb = llvm::countr_zero(parts[i]);
2362 unsigned APInt::tcMSB(const WordType *parts, unsigned n) {
2366 if (parts[n] != 0) {
2367 static_assert(sizeof(parts[n]) <= sizeof(uint64_t));
2368 unsigned msb = llvm::Log2_64(parts[n]);
2378 /// DST, of dstCOUNT parts, such that the bit srcLSB becomes the least
2406 // Clear high parts.
2413 WordType c, unsigned parts) {
2416 for (unsigned i = 0; i < parts; i++) {
2435 unsigned parts) {
2436 for (unsigned i = 0; i < parts; ++i) {
2448 WordType c, unsigned parts) {
2451 for (unsigned i = 0; i < parts; i++) {
2473 unsigned parts) {
2474 for (unsigned i = 0; i < parts; ++i) {
2486 void APInt::tcNegate(WordType *dst, unsigned parts) {
2487 tcComplement(dst, parts);
2488 tcIncrement(dst, parts);
2497 /// DSTPARTS parts of the result, and if all of the omitted higher
2498 /// parts were zero return zero, otherwise overflow occurred and
2567 // We would overflow if any significant unwritten parts would be
2568 // non-zero. This is true if any remaining src parts are non-zero
2580 /// is filled with the least significant parts of the result. Returns
2584 const WordType *rhs, unsigned parts) {
2589 for (unsigned i = 0; i < parts; i++) {
2593 tcMultiplyPart(&dst[i], lhs, rhs[i], 0, parts, parts - i, i != 0);
2628 unsigned parts) {
2631 unsigned shiftCount = tcMSB(rhs, parts) + 1;
2635 shiftCount = parts * APINT_BITS_PER_WORD - shiftCount;
2639 tcAssign(srhs, rhs, parts);
2640 tcShiftLeft(srhs, parts, shiftCount);
2641 tcAssign(remainder, lhs, parts);
2642 tcSet(lhs, 0, parts);
2647 int compare = tcCompare(remainder, srhs, parts);
2649 tcSubtract(remainder, srhs, 0, parts);
2656 tcShiftRight(srhs, parts, 1);
2722 unsigned parts) {
2723 while (parts) {
2724 parts--;
2725 if (lhs[parts] != rhs[parts])
2726 return (lhs[parts] > rhs[parts]) ? 1 : -1;