Ignore:
Timestamp:
Jul 25, 2015, 12:51:19 PM (4 years ago)
Author:
cameron
Message:

Bit pack carry manager progress

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/carry_data.h

    r4697 r4700  
    2424unsigned const LongAdvanceBase = 64;
    2525
     26//#define PACKING
     27
    2628#ifdef PACKING
    2729const unsigned PACK_SIZE = 64;
     
    4446    return alignCeiling(bits, block_size) / block_size;
    4547}
     48
     49static void EnsurePackHasSpace(unsigned & packedTotalBits, unsigned addedBits) {
     50    unsigned bitsInCurrentPack = packedTotalBits % PACK_SIZE;
     51    if ((bitsInCurrentPack > 0) && (bitsInCurrentPack + addedBits > PACK_SIZE)) {
     52        packedTotalBits = alignCeiling(packedTotalBits, PACK_SIZE);
     53    }
     54}
     55
    4656
    4757namespace pablo {
Note: See TracChangeset for help on using the changeset viewer.