Ignore:
Timestamp:
Aug 6, 2015, 3:39:27 PM (4 years ago)
Author:
cameron
Message:

Mod64 approximation mode

File:
1 edited

Legend:

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

    r4710 r4716  
    603603        Value* strm_value = compileExpression(adv->getExpr());
    604604        int shift = adv->getAdvanceAmount();
    605         unsigned advance_index = adv->getLocalAdvanceIndex();
    606         expr = mCarryManager->advanceCarryInCarryOut(advance_index, shift, strm_value);
     605        if (adv->isMod64()) {
     606            expr = iBuilder.simd_slli(64, strm_value, shift);
     607        }
     608        else {
     609            unsigned advance_index = adv->getLocalAdvanceIndex();
     610            expr = mCarryManager->advanceCarryInCarryOut(advance_index, shift, strm_value);
     611        }
    607612    }
    608613    else if (const MatchStar * mstar = dyn_cast<MatchStar>(stmt)) {
     
    610615        Value * cc = compileExpression(mstar->getCharClass());
    611616        Value * marker_and_cc = mBuilder->CreateAnd(marker, cc);
    612         unsigned carry_index = mstar->getLocalCarryIndex();
    613         Value * sum = mCarryManager->addCarryInCarryOut(carry_index, marker_and_cc, cc);
     617        Value * sum = nullptr;
     618        if (mstar->isMod64()) {
     619            sum = iBuilder.simd_add(64, marker_and_cc, cc);
     620        }
     621        else {
     622            unsigned carry_index = mstar->getLocalCarryIndex();
     623            sum = mCarryManager->addCarryInCarryOut(carry_index, marker_and_cc, cc);
     624        }
    614625        expr = mBuilder->CreateOr(mBuilder->CreateXor(sum, cc), marker, "matchstar");
    615626    }
     
    617628        Value * marker_expr = compileExpression(sthru->getScanFrom());
    618629        Value * cc_expr = compileExpression(sthru->getScanThru());
    619         unsigned carry_index = sthru->getLocalCarryIndex();
    620         Value * sum = mCarryManager->addCarryInCarryOut(carry_index, marker_expr, cc_expr);
     630        Value * sum = nullptr;
     631        if (sthru->isMod64()) {
     632            sum = iBuilder.simd_add(64, marker_expr, cc_expr);
     633        }
     634        else {
     635            unsigned carry_index = sthru->getLocalCarryIndex();
     636            sum = mCarryManager->addCarryInCarryOut(carry_index, marker_expr, cc_expr);
     637        }
    621638        expr = mBuilder->CreateAnd(sum, genNot(cc_expr), "scanthru");
    622639    }
Note: See TracChangeset for help on using the changeset viewer.