Lines Matching defs:bitPosition
363 /// as "bitPosition".
365 void APInt::flipBit(unsigned bitPosition) {
366 assert(bitPosition < BitWidth && "Out of the bit-width range!");
367 setBitVal(bitPosition, !(*this)[bitPosition]);
370 void APInt::insertBits(const APInt &subBits, unsigned bitPosition) {
372 assert((subBitWidth + bitPosition) <= BitWidth && "Illegal bit insertion");
387 U.VAL &= ~(mask << bitPosition);
388 U.VAL |= (subBits.U.VAL << bitPosition);
392 unsigned loBit = whichBit(bitPosition);
393 unsigned loWord = whichWord(bitPosition);
394 unsigned hi1Word = whichWord(bitPosition + subBitWidth - 1);
425 setBitVal(bitPosition + i, subBits[i]);
428 void APInt::insertBits(uint64_t subBits, unsigned bitPosition, unsigned numBits) {
432 U.VAL &= ~(maskBits << bitPosition);
433 U.VAL |= subBits << bitPosition;
437 unsigned loBit = whichBit(bitPosition);
438 unsigned loWord = whichWord(bitPosition);
439 unsigned hiWord = whichWord(bitPosition + numBits - 1);
455 APInt APInt::extractBits(unsigned numBits, unsigned bitPosition) const {
456 assert(bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth &&
460 return APInt(numBits, U.VAL >> bitPosition, /*isSigned=*/false,
463 unsigned loBit = whichBit(bitPosition);
464 unsigned loWord = whichWord(bitPosition);
465 unsigned hiWord = whichWord(bitPosition + numBits - 1);
494 unsigned bitPosition) const {
495 assert(bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth &&
501 return (U.VAL >> bitPosition) & maskBits;
505 unsigned loBit = whichBit(bitPosition);
506 unsigned loWord = whichWord(bitPosition);
507 unsigned hiWord = whichWord(bitPosition + numBits - 1);