Changeset 4670 for icGREP/icgrepdevel/icgrep/pablo/carry_data.h
 Timestamp:
 Jul 14, 2015, 6:29:35 PM (4 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

icGREP/icgrepdevel/icgrep/pablo/carry_data.h
r4644 r4670 33 33 class PabloBlockCarryData { 34 34 public: 35 PabloBlockCarryData(): blockCarryDataIndex(0),36 ifDepth(0), whileDepth (0), 37 lo calCarries(0), unitAdvances(0),38 shortAdvance s(0), shortAdvanceTotal(0),39 longAdvances(0), longAdvanceTotalBlocks(0),40 nestedBlockCount(0), nestedCarryDataSize(0),41 localCarryDataSize(0), totalCarryDataSize(0),42 carryOffset(0), unitAdvanceOffset(0),43 shortAdvanceOffset(0), longAdvanceOffset(0)35 PabloBlockCarryData(): framePosition(0), 36 ifDepth(0), whileDepth (0), maxNestingDepth(0), 37 longAdvance({0, 0, 0}), 38 shortAdvance({0, 0, 0}), 39 advance1({0, 0}), 40 addWithCarry({0, 0}), 41 nested({0, 0, 0}), 42 summary({0, 0}), 43 totalCarryDataBits(0) 44 44 {} 45 46 47 void setBlockCarryDataIndex (unsigned idx) {blockCarryDataIndex = idx;} 48 49 void setIfDepth (unsigned depth) {ifDepth = depth;} 50 51 void setWhileDepth (unsigned depth) {whileDepth = depth;} 52 45 53 46 unsigned enumerate(PabloBlock & p); 54 47 55 48 unsigned getBlockCarryDataIndex() const { 56 return blockCarryDataIndex;49 return framePosition/BLOCK_SIZE; 57 50 } 58 51 … … 64 57 return whileDepth; 65 58 } 66 59 67 60 unsigned longAdvanceCarryDataOffset(unsigned advanceIndex) const { 68 return blockCarryDataIndex + longAdvanceOffset+ advanceIndex;61 return longAdvance.frameOffsetinBits / BLOCK_SIZE + advanceIndex; 69 62 } 70 63 … … 77 70 } 78 71 79 bool blockHasLongAdvances() const { return longAdvance s > 0;}72 bool blockHasLongAdvances() const { return longAdvance.entries > 0;} 80 73 81 74 unsigned shortAdvanceCarryDataOffset(unsigned advanceIndex) const { 82 return blockCarryDataIndex + shortAdvanceOffset+ advanceIndex;75 return shortAdvance.frameOffsetinBits / BLOCK_SIZE + advanceIndex; 83 76 } 84 77 85 78 unsigned unitAdvanceCarryDataOffset(unsigned advanceIndex) const { 86 return blockCarryDataIndex + unitAdvanceOffset+ advanceIndex;79 return advance1.frameOffsetinBits / BLOCK_SIZE + advanceIndex; 87 80 } 88 81 89 82 unsigned carryOpCarryDataOffset(unsigned idx) const { 90 return blockCarryDataIndex + carryOffset+ idx;83 return addWithCarry.frameOffsetinBits / BLOCK_SIZE + idx; 91 84 } 92 85 93 bool blockHasCarries() const { return totalCarryDataSize > 0;} 86 unsigned summaryCarryDataIndex() const { 87 return summary.frameOffsetinBits / BLOCK_SIZE; 88 } 94 89 95 bool explicitSummaryRequired() const { return totalCarryDataSize > 1;} 90 unsigned getLocalCarryDataSize () { return nested.frameOffsetinBits / BLOCK_SIZE; } 91 92 unsigned getTotalCarryDataSize () { return totalCarryDataBits / BLOCK_SIZE; } 93 94 bool blockHasCarries() const { return totalCarryDataBits > 0;} 95 96 bool explicitSummaryRequired() const { return totalCarryDataBits > BLOCK_SIZE;} 96 97 97 98 bool summaryNeededInParentBlock() const {return (ifDepth > 0) && blockHasCarries();} 98 99 99 unsigned summaryCarryDataIndex() const { 100 return blockCarryDataIndex + totalCarryDataSize  1; 101 } 100 private: 102 101 103 unsigned getLocalCarryDataSize() const { 104 return localCarryDataSize; 105 } 102 unsigned framePosition; 106 103 107 unsigned getTotalCarryDataSize() const {108 return totalCarryDataSize;109 }110 111 private:112 unsigned blockCarryDataIndex;113 104 unsigned ifDepth; 114 105 unsigned whileDepth; 115 unsigned localCarries; 116 unsigned unitAdvances; 117 unsigned shortAdvances; 118 unsigned shortAdvanceTotal; 119 unsigned longAdvances; 120 unsigned longAdvanceTotalBlocks; 121 unsigned nestedBlockCount; 122 unsigned nestedCarryDataSize; 123 unsigned localCarryDataSize; 124 unsigned totalCarryDataSize; 125 unsigned carryOffset; 126 unsigned unitAdvanceOffset; 127 unsigned shortAdvanceOffset; 128 unsigned longAdvanceOffset; 106 unsigned maxNestingDepth; 107 108 struct {unsigned frameOffsetinBits; unsigned entries; unsigned allocatedBitBlocks;} longAdvance; 109 struct {unsigned frameOffsetinBits; unsigned entries; unsigned allocatedBits;} shortAdvance; 110 struct {unsigned frameOffsetinBits; unsigned entries;} advance1; 111 struct {unsigned frameOffsetinBits; unsigned entries;} addWithCarry; 112 struct {unsigned frameOffsetinBits; unsigned entries; unsigned allocatedBits;} nested; 113 struct {unsigned frameOffsetinBits; unsigned allocatedBits;} summary; 114 115 unsigned totalCarryDataBits; 129 116 130 117 };
Note: See TracChangeset
for help on using the changeset viewer.