Changeset 4705


Ignore:
Timestamp:
Jul 29, 2015, 2:34:13 PM (4 years ago)
Author:
cameron
Message:

Carry packing bug fix for add with carry

File:
1 edited

Legend:

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

    r4704 r4705  
    252252
    253253void CarryManager::storeCarryPack(unsigned packIndex) {
     254    //std::cerr << "storeCarryPack , pack = " << packIndex << std::endl;
    254255    mBuilder->CreateAlignedStore(mCarryOutPack[packIndex], mCarryPackPtr[packIndex], PACK_SIZE/8);
    255256}
     
    289290    unsigned carryOffset = carryBit_lo % PACK_SIZE;
    290291    if (carryOffset > 0) {
    291         bits = mBuilder->CreateLShr(bits, mBuilder->getInt64(carryOffset));
     292        bits = mBuilder->CreateShl(bits, mBuilder->getInt64(carryOffset));
    292293    }
    293294    if (mCarryOutPack[packIndex] == nullptr) {
    294295        mCarryOutPack[packIndex] = bits;
     296        //std::cerr << "setCarryBits/initial , pack = " << packIndex << ", offset = " << carryOffset << ", count = " << carryRangeSize << std::endl;
    295297    }
    296298    else {
     299        //std::cerr << "setCarryBits/combine , pack = " << packIndex << ", offset = " << carryOffset << ", count = " << carryRangeSize << std::endl;
    297300        mCarryOutPack[packIndex] = mBuilder->CreateOr(mCarryOutPack[packIndex], bits);
    298301    }
     
    310313#endif
    311314}
    312    
     315
    313316   
    314317void CarryManager::setCarryOpCarryOut(unsigned localIndex, Value * carry_out_strm) {
Note: See TracChangeset for help on using the changeset viewer.