Ignore:
Timestamp:
May 19, 2016, 8:50:15 PM (3 years ago)
Author:
cameron
Message:

Add pablo.atEOF; clean out bit4/6 hack for unterminated final lines in icgrep.

File:
1 edited

Legend:

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

    r5039 r5042  
    112112    mCarryManager->initialize(function, mKernelBuilder);
    113113   
    114     mKernelBuilder->addInternalState(mBitBlockType, "EOFmask");
     114    mKernelBuilder->addInternalState(mBitBlockType, "EOFmark");
    115115   
    116116    mFunction = mKernelBuilder->prepareFunction({mInputStreamOffset.begin(), mInputStreamOffset.end()});
     
    396396        expr = iBuilder->simd_and(sum, iBuilder->simd_not(cc_expr));
    397397    } else if (const InFile * e = dyn_cast<InFile>(stmt)) {
    398         // Currently InFile(x) => x;  a no-op
    399         Value * EOFmask = iBuilder->CreateLoad(mKernelBuilder->getInternalState("EOFmask"));
    400         expr = iBuilder->simd_and(compileExpression(e->getExpr()), iBuilder->simd_not(EOFmask));
     398        Value * EOFmark = iBuilder->CreateLoad(mKernelBuilder->getInternalState("EOFmark"));
     399        Value * infileMask = iBuilder->simd_add(iBuilder->getBitBlockWidth(), EOFmark, iBuilder->allOnes());
     400        expr = iBuilder->simd_and(compileExpression(e->getExpr()), infileMask);
     401    } else if (const AtEOF * e = dyn_cast<AtEOF>(stmt)) {
     402        Value * EOFmark = iBuilder->CreateLoad(mKernelBuilder->getInternalState("EOFmark"));
     403        expr = iBuilder->simd_and(compileExpression(e->getExpr()), EOFmark);
    401404    } else if (const Count * c = dyn_cast<Count>(stmt)) {
    402405        Value * const to_count = compileExpression(c->getExpr());
Note: See TracChangeset for help on using the changeset viewer.