Changeset 4678


Ignore:
Timestamp:
Jul 16, 2015, 10:06:40 AM (4 years ago)
Author:
cameron
Message:

Complete the bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r4677 r4678  
    6262}
    6363
    64 
    65 
    6664    /* Methods for getting and setting individual carry values. */
    6765   
     
    7068    if (mCarryInfo->getWhileDepth() == 0) {
    7169       Value * packPtr = mBuilder->CreateGEP(mCarryDataPtr, mBuilder->getInt64(cd_index));
    72        mCarryInVector[mCarryInfo->carryOpCarryDataOffset(localIndex)] = mBuilder->CreateAlignedLoad(packPtr, BLOCK_SIZE/8);
     70       mCarryInVector[cd_index] = mBuilder->CreateAlignedLoad(packPtr, BLOCK_SIZE/8);
    7371    }
    7472    return mCarryInVector[cd_index];
     
    273271}
    274272
     273
    275274void CarryManager::ensureCarriesLoadedLocal() {
    276275#if 0
    277     const PabloBlockCarryData & cd = blk.carryData;
    278     const unsigned baseCarryDataIdx = cd.getBlockCarryDataIndex();
    279     const unsigned localCarryDataSize = cd.getLocalCarryDataSize();
    280     const unsigned scopeCarryDataSize = cd.getScopeCarryDataSize();
    281     if (scopeCarryDataSize == 0) return;
    282     if ((cd.getIfDepth() > 0) && (scopeCarryDataSize == 1)) return;
    283     if (cd.getWhileDepth() > 0) return;
    284     for (auto i = baseCarryDataIdx; i < baseCarryDataIdx + localCarryDataSize; ++i) {
    285         mCarryInVector[i] = mBuilder->CreateAlignedLoad(mBuilder->CreateGEP(mCarryDataPtr, mBuilder->getInt64(i)), BLOCK_SIZE/8, false);
     276    if ((mCarryInfo->getScopeCarryDataSize() == 0 ) || (mCarryInfo->getWhileDepth() > 0)) return;
     277    if (mCarryInfo->explicitSummaryRequired()) {
     278        auto localCarryIndex = mCurrentScopeIndex + mCarryInfo->getLocalCarryDataOffset();
     279        auto localCarryPacks = mCarryInfo->getLocalCarryDataSize();
     280        for (auto i = 0; i < localCarryPacks; i++) {       
     281            mCarryInVector[i] = mBuilder->CreateAlignedLoad(mBuilder->CreateGEP(mCarryDataPtr, mBuilder->getInt64(i)), BLOCK_SIZE/8, false);
     282        }
    286283    }
    287284#endif
     
    290287void CarryManager::ensureCarriesStoredLocal() {
    291288#if 0
    292     const PabloBlockCarryData & cd = blk.carryData;
    293     const unsigned baseCarryDataIdx = cd.getBlockCarryDataIndex();
    294     const unsigned localCarryDataSize = cd.getLocalCarryDataSize();
    295     const unsigned scopeCarryDataSize = cd.getScopeCarryDataSize();
    296     const unsigned carrySummaryIndex = cd.summaryCarryDataIndex();
    297     if (scopeCarryDataSize == 0) return;
    298     if (cd.getWhileDepth() > 0) return;
    299     for (auto i = baseCarryDataIdx; i < baseCarryDataIdx + localCarryDataSize; ++i) {
     289    if ((mCarryInfo->getScopeCarryDataSize() == 0 ) || (mCarryInfo->getWhileDepth() > 0)) return;
     290    auto localCarryIndex = mCurrentScopeIndex + mCarryInfo->getLocalCarryDataOffset();
     291    auto localCarryPacks = mCarryInfo->getLocalCarryDataSize();
     292    for (auto i = 0; i < localCarryPacks; i++) {       
    300293        Value * storePtr = mBuilder->CreateGEP(mCarryDataPtr, mBuilder->getInt64(i));
    301294        mBuilder->CreateAlignedStore(mCarryOutVector[i], storePtr, BLOCK_SIZE/8, false);
    302295    }
    303     if (scopeCarryDataSize > 1) {
     296    if (mCarryInfo->getScopeCarryDataSize() > 1) {
     297        const unsigned carrySummaryIndex = mCurrentScopeIndex + mCarryInfo->summaryCarryDataIndex();
    304298        Value * summaryPtr = mBuilder->CreateGEP(mCarryDataPtr, mBuilder->getInt64(carrySummaryIndex));
    305299        mBuilder->CreateAlignedStore(mCarryOutVector[carrySummaryIndex], summaryPtr, BLOCK_SIZE/8, false);
Note: See TracChangeset for help on using the changeset viewer.