Changeset 6086


Ignore:
Timestamp:
Jun 13, 2018, 12:48:40 PM (4 months ago)
Author:
cameron
Message:

Bug fix for StreamCompress?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/pdep_kernel.cpp

    r6079 r6086  
    196196    Value * pendingBlockEnd = b->CreateAdd(pendingOffsetPhi, bw_sub1Const);
    197197    Value * srcBlockNo = b->CreateUDiv(pendingBlockEnd, bwConst);
    198    
    199198    // Calculate the field values and offsets we need for assembling a
    200199    // a full block of source bits.  Assembly will use the following operations.
     
    243242        Value * output = b->bitCast(b->simd_or(C, D));
    244243        b->storeOutputStreamBlock("output", b->getInt32(i), blockNoPhi, output);
    245         pendingDataPhi[i]->addIncoming(source[i], expandLoop);
    246244    }
    247245    //
     
    251249    blockNoPhi->addIncoming(nextBlk, expandLoop);
    252250    Value * newPending = b->CreateAdd(pendingOffsetPhi, blockPopCount);
     251    Value * isNewBlock = b->CreateICmpNE(srcBlockNo, b->CreateUDiv(b->CreateAdd(newPending, bw_sub1Const), bwConst));
     252
    253253    pendingOffsetPhi->addIncoming(newPending, expandLoop);
     254    for (unsigned i = 0; i < mSelectedStreamCount; i++) {
     255        pendingDataPhi[i]->addIncoming(b->CreateSelect(isNewBlock, source[i], pendingDataPhi[i]), expandLoop);
     256    }
    254257    //
    255258    // Now continue the loop if there are more blocks to process.
Note: See TracChangeset for help on using the changeset viewer.