Ignore:
Timestamp:
Jul 29, 2015, 10:34:01 AM (4 years ago)
Author:
cameron
Message:

Carry manager fixes, restructuring

File:
1 edited

Legend:

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

    r4703 r4704  
    7474                           nested({0, 0, 0}),
    7575                           summary({0, 0}),
    76                            scopeCarryDataBits(0)
     76                           scopeCarryDataSize(0)
    7777    {enumerateLocal();}
    7878       
     
    8383   
    8484    unsigned getFrameIndex()  const {
    85         return framePosition/BLOCK_SIZE;
     85        return framePosition;
    8686    }
    8787   
     
    116116    bool blockHasLongAdvances() const { return longAdvance.entries > 0;}
    117117   
    118     unsigned getLocalCarryPackIndex () { return shortAdvance.frameOffsetinBits / PACK_SIZE; }
     118    unsigned getLocalCarryPackIndex () {
     119#ifdef PACKING
     120        return shortAdvance.frameOffset / PACK_SIZE;
     121#else
     122        return shortAdvance.frameOffset;
     123#endif
     124    }
    119125
    120     unsigned getLocalCarryPackCount () { return fullOrPartialBlocks(nested.frameOffsetinBits - shortAdvance.frameOffsetinBits, PACK_SIZE); }
    121 
    122     unsigned getScopeCarryPackCount () { return fullOrPartialBlocks(scopeCarryDataBits, PACK_SIZE); }
    123    
    124     bool blockHasCarries() const { return scopeCarryDataBits > 0;}
     126    unsigned getLocalCarryPackCount () {
     127#ifdef PACKING
     128        return fullOrPartialBlocks(nested.frameOffset, PACK_SIZE) - shortAdvance.frameOffset / PACK_SIZE;
     129#else
     130        return nested.frameOffset - shortAdvance.frameOffset;
     131#endif
     132    }
    125133   
    126     bool explicitSummaryRequired() const { return (ifDepth > 0) && (scopeCarryDataBits > PACK_SIZE);}
     134    unsigned getScopeCarryPackCount () {
     135#ifdef PACKING
     136        return fullOrPartialBlocks(scopeCarryDataSize, PACK_SIZE);
     137#else
     138        return scopeCarryDataSize;
     139#endif
     140    }
     141   
     142    bool blockHasCarries() const { return scopeCarryDataSize > 0;}
     143   
     144    bool explicitSummaryRequired() const {
     145#ifdef PACKING
     146        return (ifDepth > 0) && (scopeCarryDataSize > PACK_SIZE);
     147#else
     148        return (ifDepth > 0) && (scopeCarryDataSize > 1);
     149#endif
     150    }
    127151   
    128152protected:
     
    136160    unsigned maxNestingDepth;   
    137161   
    138     struct {unsigned frameOffsetinBits; unsigned entries; unsigned allocatedBitBlocks;} longAdvance;
    139     struct {unsigned frameOffsetinBits; unsigned entries; unsigned allocatedBits;} shortAdvance;
    140     struct {unsigned frameOffsetinBits; unsigned entries;} advance1;
    141     struct {unsigned frameOffsetinBits; unsigned entries;} addWithCarry;
    142     struct {unsigned frameOffsetinBits; unsigned entries; unsigned allocatedBits;} nested;
    143     struct {unsigned frameOffsetinBits; unsigned allocatedBits;} summary;
     162    struct {unsigned frameOffset; unsigned entries; unsigned allocatedBitBlocks;} longAdvance;
     163    struct {unsigned frameOffset; unsigned entries; unsigned allocatedBits;} shortAdvance;
     164    struct {unsigned frameOffset; unsigned entries;} advance1;
     165    struct {unsigned frameOffset; unsigned entries;} addWithCarry;
     166    struct {unsigned frameOffset; unsigned entries; unsigned allocatedBits;} nested;
     167    struct {unsigned frameOffset; unsigned allocatedBits;} summary;
    144168
    145     unsigned scopeCarryDataBits;
     169    unsigned scopeCarryDataSize;
    146170   
    147171    llvm::Value * ifEntryPack;
Note: See TracChangeset for help on using the changeset viewer.