Lines Matching refs:bitPosition

337 /// as "bitPosition".
339 void APInt::flipBit(unsigned bitPosition) {
340 assert(bitPosition < BitWidth && "Out of the bit-width range!");
341 if ((*this)[bitPosition]) clearBit(bitPosition);
342 else setBit(bitPosition);
345 void APInt::insertBits(const APInt &subBits, unsigned bitPosition) {
347 assert(0 < subBitWidth && (subBitWidth + bitPosition) <= BitWidth &&
359 U.VAL &= ~(mask << bitPosition);
360 U.VAL |= (subBits.U.VAL << bitPosition);
364 unsigned loBit = whichBit(bitPosition);
365 unsigned loWord = whichWord(bitPosition);
366 unsigned hi1Word = whichWord(bitPosition + subBitWidth - 1);
398 setBit(bitPosition + i);
400 clearBit(bitPosition + i);
404 void APInt::insertBits(uint64_t subBits, unsigned bitPosition, unsigned numBits) {
408 U.VAL &= ~(maskBits << bitPosition);
409 U.VAL |= subBits << bitPosition;
413 unsigned loBit = whichBit(bitPosition);
414 unsigned loWord = whichWord(bitPosition);
415 unsigned hiWord = whichWord(bitPosition + numBits - 1);
431 APInt APInt::extractBits(unsigned numBits, unsigned bitPosition) const {
433 assert(bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth &&
437 return APInt(numBits, U.VAL >> bitPosition);
439 unsigned loBit = whichBit(bitPosition);
440 unsigned loWord = whichWord(bitPosition);
441 unsigned hiWord = whichWord(bitPosition + numBits - 1);
469 unsigned bitPosition) const {
471 assert(bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth &&
477 return (U.VAL >> bitPosition) & maskBits;
479 unsigned loBit = whichBit(bitPosition);
480 unsigned loWord = whichWord(bitPosition);
481 unsigned hiWord = whichWord(bitPosition + numBits - 1);