Changeset 4826


Ignore:
Timestamp:
Oct 6, 2015, 8:43:55 PM (2 years ago)
Author:
cameron
Message:

Reset carries for each file

Location:
icGREP/icgrep-devel/icgrep
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/do_grep.cpp

    r4806 r4826  
    250250
    251251    llvm::raw_os_ostream out(std::cout);
     252    mInitializeCarriesFcn();
    252253    //////////////////////////////////////////////////////////////////////////////////////////
    253254    // Full Segments
  • icGREP/icgrep-devel/icgrep/do_grep.h

    r4803 r4826  
    3939#endif
    4040
     41typedef void (*process_block_initialize_carries_fcn)();
    4142typedef void (*process_block_fcn)(const Basis_bits & basis_bits, Output & output);
    4243
     
    4647public:
    4748
    48     GrepExecutor(void * process_block)
     49    GrepExecutor(void * process_block_initialize_carries, void * process_block)
    4950    : mCountOnlyOption(false)
    5051    , mGetCodePointsOption(false)
     
    5253    , mShowLineNumberingOption(false)
    5354    , mParsedCodePointSet(nullptr)
     55    , mInitializeCarriesFcn(reinterpret_cast<process_block_initialize_carries_fcn>(process_block_initialize_carries))
    5456    , mProcessBlockFcn(reinterpret_cast<process_block_fcn>(process_block)) {
    5557
     
    8183    re::CC * mParsedCodePointSet;
    8284
     85    process_block_initialize_carries_fcn mInitializeCarriesFcn;
    8386    process_block_fcn mProcessBlockFcn;
    8487   
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r4803 r4826  
    185185    engine->finalizeObject();
    186186   
     187    void * icgrep_init_carry_ptr = engine->getPointerToFunction(icgrep_IR->getParent()->getFunction("process_block_initialize_carries"));
    187188    void * icgrep_MCptr = engine->getPointerToFunction(icgrep_IR);
    188189   
    189190    if (icgrep_MCptr) {
    190         GrepExecutor grepEngine(icgrep_MCptr);
     191        GrepExecutor grepEngine(icgrep_init_carry_ptr, icgrep_MCptr);
    191192        grepEngine.setCountOnlyOption(CountOnly);
    192193        grepEngine.setNormalizeLineBreaksOption(NormalizeLineBreaks);
     
    205206    return 0;
    206207}
    207 
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r4824 r4826  
    5454    f->setAttributes(AttrSet);
    5555    llvm::IRBuilderBase::InsertPoint ip = mBuilder->saveIP();
    56     mBuilder->SetInsertPoint(BasicBlock::Create(m->getContext(), "entry", f,0));
    57     mBuilder->CreateMemSet(mCarryBitBlockPtr, mBuilder->getInt8(0), mTotalCarryDataBitBlocks * BLOCK_SIZE, BLOCK_SIZE/8);
     56    mBuilder->SetInsertPoint(BasicBlock::Create(m->getContext(), "entry1", f,0));
     57    mBuilder->CreateMemSet(mCarryBitBlockPtr, mBuilder->getInt8(0), mTotalCarryDataBitBlocks * BLOCK_SIZE/8, 4);
    5858    ReturnInst::Create(m->getContext(), mBuilder->GetInsertBlock());
    5959    mBuilder->restoreIP(ip);
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r4819 r4826  
    560560    engine->finalizeObject();
    561561   
     562    void * icgrep_init_carry_ptr = engine->getPointerToFunction(nameSearchIR->getParent()->getFunction("process_block_initialize_carries"));
    562563    void * icgrep_MCptr = engine->getPointerToFunction(nameSearchIR);
    563564   
    564565    CC * result = nullptr;
    565566    if (icgrep_MCptr) {
    566         GrepExecutor grepEngine(icgrep_MCptr);
     567        GrepExecutor grepEngine(icgrep_init_carry_ptr, icgrep_MCptr);
    567568        grepEngine.setParseCodepointsOption();
    568569        grepEngine.doGrep("../Uname.txt");
Note: See TracChangeset for help on using the changeset viewer.