Lines Matching defs:bitPosition

361 /// as "bitPosition".
363 void APInt::flipBit(unsigned bitPosition) {
364 assert(bitPosition < BitWidth && "Out of the bit-width range!");
365 setBitVal(bitPosition, !(*this)[bitPosition]);
368 void APInt::insertBits(const APInt &subBits, unsigned bitPosition) {
370 assert((subBitWidth + bitPosition) <= BitWidth && "Illegal bit insertion");
385 U.VAL &= ~(mask << bitPosition);
386 U.VAL |= (subBits.U.VAL << bitPosition);
390 unsigned loBit = whichBit(bitPosition);
391 unsigned loWord = whichWord(bitPosition);
392 unsigned hi1Word = whichWord(bitPosition + subBitWidth - 1);
423 setBitVal(bitPosition + i, subBits[i]);
426 void APInt::insertBits(uint64_t subBits, unsigned bitPosition, unsigned numBits) {
430 U.VAL &= ~(maskBits << bitPosition);
431 U.VAL |= subBits << bitPosition;
435 unsigned loBit = whichBit(bitPosition);
436 unsigned loWord = whichWord(bitPosition);
437 unsigned hiWord = whichWord(bitPosition + numBits - 1);
453 APInt APInt::extractBits(unsigned numBits, unsigned bitPosition) const {
454 assert(bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth &&
458 return APInt(numBits, U.VAL >> bitPosition);
460 unsigned loBit = whichBit(bitPosition);
461 unsigned loWord = whichWord(bitPosition);
462 unsigned hiWord = whichWord(bitPosition + numBits - 1);
490 unsigned bitPosition) const {
491 assert(bitPosition < BitWidth && (numBits + bitPosition) <= BitWidth &&
497 return (U.VAL >> bitPosition) & maskBits;
499 unsigned loBit = whichBit(bitPosition);
500 unsigned loWord = whichWord(bitPosition);
501 unsigned hiWord = whichWord(bitPosition + numBits - 1);