Ignore:
Timestamp:
Oct 16, 2015, 11:53:10 AM (4 years ago)
Author:
cameron
Message:

Clean-up and encapsulate if/summary test in carry_manager

File:
1 edited

Legend:

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

    r4837 r4838  
    522522
    523523
    524 Value * CarryManager::getCarrySummaryExpr() {
    525     unsigned summary_index = summaryPackIndex();
    526     if (mITEMS_PER_PACK > 1) {// #ifdef PACKING
    527         Value * pack = getCarryPack(summary_index);
    528         Value * summary_bits = maskSelectBitRange(pack, summaryPosition() % mPACK_SIZE, summaryBits());
    529         return mBuilder->CreateBitCast(mBuilder->CreateZExt(summary_bits, mBuilder->getIntNTy(mBITBLOCK_WIDTH)), mBitBlockType);
    530     }
    531     else {
    532         return getCarryPack(summary_index);
    533     }
     524Value * CarryManager::generateBitBlockOrSummaryTest(Value * bitblock) {
     525    Value * test_expr = bitblock;
     526    if (mCarryInfo->blockHasCarries()) {
     527        Value * summary_pack = getCarryPack(summaryPackIndex());
     528        if (mITEMS_PER_PACK > 1) {// #ifdef PACKING
     529            Value * summary_bits = maskSelectBitRange(summary_pack, summaryPosition() % mPACK_SIZE, summaryBits());
     530            test_expr = iBuilder->simd_or(test_expr, mBuilder->CreateZExt(summary_bits, mBuilder->getIntNTy(mBITBLOCK_WIDTH)));
     531        }
     532        else {
     533            test_expr = iBuilder->simd_or(test_expr, summary_pack);
     534        }
     535    }
     536    return iBuilder->bitblock_any(test_expr);
    534537}
    535538
Note: See TracChangeset for help on using the changeset viewer.