Ignore:
Timestamp:
Mar 13, 2018, 1:17:42 PM (13 months ago)
Author:
cameron
Message:

Byte-Bit grep kernel optimizes when an RE begins with an initial trigraph

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/grep_kernel.cpp

    r5902 r5908  
    357357    }
    358358    PabloAST * const prefixMatches = re_byte_compiler.compile(mPrefixRE);
    359    
     359    Var * const final_matches = pb.createVar("final_matches", pb.createZeroes());
    360360    PabloBlock * scope1 = getEntryScope()->createScope();
    361361    pb.createIf(prefixMatches, scope1);
     
    373373    std::vector<PabloAST *> basis(8);
    374374    for (unsigned i = 0; i < 4; i++) {
     375        // The subtraction 7-bit is because of the confusion between
     376        // little-endian and big-endian bit numbering of bytes.
     377        // We should fix this, switching to little-endian numbering throughout.
    375378        basis[7-2*i] = scope1->createPackL(scope1->getInteger(2), bitpairs[i]);
    376379        basis[7-(2*i + 1)] = scope1->createPackH(scope1->getInteger(2), bitpairs[i]);
     
    379382    cc::Parabix_CC_Compiler ccc(scope1, basis);
    380383    RE_Compiler re_compiler(scope1, ccc);
    381     PabloAST * const matches = re_compiler.compile(mSuffixRE, prefixMatches);
     384    scope1->createAssign(final_matches, re_compiler.compile(mSuffixRE, prefixMatches));
    382385    Var * const output = getOutputStreamVar("matches");
    383     pb.createAssign(pb.createExtract(output, pb.getInteger(0)), matches);
    384 }
    385 
    386 
     386    pb.createAssign(pb.createExtract(output, pb.getInteger(0)), final_matches);
     387}
    387388
    388389
Note: See TracChangeset for help on using the changeset viewer.