code: public boolean setMaxRegister(final long registerIndex, final long value) {
          final long bitIndex = registerIndex * registerWidth;
          final int firstWordIndex = (int)(bitIndex >>> LOG2_BITS_PER_WORD)/*aka (bitIndex / BITS_PER_WORD)*/;
          final int secondWordIndex = (int)((bitIndex + registerWidth - 1) >>> LOG2_BITS_PER_WORD)/*see above*/;
          final int bitRemainder = (int)(bitIndex & BITS_PER_WORD_MASK)/*aka (bitIndex % BITS_PER_WORD)*/;
  
          // NOTE:  matches getRegister()
          final long registerValue;
          final long words[] = this.words/*for convenience/performance*/;
          if(firstWordIndex == secondWordIndex)
              registerValue = ((words[firstWordIndex] >>> bitRemainder) & registerMask);
          else /*register spans words*/
              registerValue = (words[firstWordIndex] >>> bitRemainder)/*no need to mask since at top of word*/
                            | (words[secondWordIndex] << (BITS_PER_WORD - bitRemainder)) & registerMask;
  
          // determine which is the larger and update as necessary
          if(value > registerValue) {
              // NOTE:  matches setRegister()
              if(firstWordIndex == secondWordIndex) {
                  // clear then set
                  words[firstWordIndex] &= ~(registerMask << bitRemainder);
                  words[firstWordIndex] |= (value << bitRemainder);
              } else {/*register spans words*/
                  // clear then set each partial word
                  words[firstWordIndex] &= (1L << bitRemainder) - 1;
                  words[firstWordIndex] |= (value << bitRemainder);
  
                  words[secondWordIndex] &= ~(registerMask >>> (BITS_PER_WORD - bitRemainder));
                  words[secondWordIndex] |= (value >>> (BITS_PER_WORD - bitRemainder));
              }
          } /* else -- the register value is greater (or equal) so nothing needs to be done */
  
          return (value >= registerValue);
      }
docs: NOTE:  if this changes then setRegister() must change