Beispiel #1
0
        /// <remarks>Don't call me unless you are WriteWord</remarks>
        void PutWordInCache(TWord word, int bitCount)
        {
            Contract.Ensures(Contract.OldValue(mCacheBitIndex) == mCacheBitIndex);

            // amount to shift word before appending it to mCache bits
            int   shift     = (kWordBitCount - mCacheBitIndex) - bitCount;
            TWord word_mask = kBitmaskLUT[bitCount];

            word   &= word_mask;
            word  <<= shift;
            mCache |= word;
        }