Ignore:
Timestamp:
Jan 13, 2018, 11:57:43 AM (20 months ago)
Author:
nmedfort
Message:

Pablo support for byte comparisions; LineFeed? kernel processes byte streams directly. Some clean up of PabloBuilder? functionality.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r5823 r5828  
    230230
    231231   
    232 PabloAST * compileCCfromCodeUnitStream(const CC *cc, PabloAST * codeUnitStream, PabloBuilder & pb) {
     232PabloAST * compileCCfromCodeUnitStream(const CC * cc, PabloAST * codeUnitStream, PabloBuilder & pb) {
    233233    const Alphabet * a = cc->getAlphabet();
    234234    if (!isa<CodeUnitAlphabet>(a)) {
     
    239239    unsigned maxCodeVal = (topBit - 1) | topBit;
    240240    PabloAST * ccStrm = pb.createZeroes();
    241 #ifdef PABLO_ALL
    242241    for (const auto & interval : *cc) {
    243242        unsigned lo = re::lo_codepoint(interval);
    244243        unsigned hi = re::hi_codepoint(interval);
    245244        if (lo == hi) {
    246             PabloAST * testVal = pb.createAll(codeUnitWidth, lo);
    247             ccStrm = pb.createOr(ccStrm, pb.createEqual(codeUnitStream, testVal));
     245            PabloAST * testVal = pb.createRepeat(codeUnitWidth, lo);
     246            ccStrm = pb.createOr(ccStrm, pb.createEquals(codeUnitStream, testVal));
    248247        } else if (lo == 0) {
    249248            if (hi == maxCodeVal) {
     
    251250                ccStrm = pb.createOnes();
    252251            } else {
    253                 PabloAST * testVal = pb.createAll(codeUnitWidth, hi+1);
     252                PabloAST * testVal = pb.createRepeat(codeUnitWidth, hi+1);
    254253                ccStrm = pb.createOr(ccStrm, pb.createLessThan(codeUnitStream, testVal));
    255254            }
    256255        } else if (hi == maxCodeVal) {
    257             PabloAST * testVal = pb.createAll(codeUnitWidth, lo);
    258             ccStrm = pb.createOr(ccStrm, pb.createNot(pb.createLessThan(codeUnitStream, testVal));)
     256            PabloAST * testVal = pb.createRepeat(codeUnitWidth, lo);
     257            ccStrm = pb.createOr(ccStrm, pb.createNot(pb.createLessThan(codeUnitStream, testVal)));
    259258        } else {
    260             PabloAST * testVal_lo = pb.createAll(codeUnitWidth, lo);
    261             PabloAST * testVal_hi = pb.createAll(codeUnitWidth, hi+1);
     259            PabloAST * testVal_lo = pb.createRepeat(codeUnitWidth, lo);
     260            PabloAST * testVal_hi = pb.createRepeat(codeUnitWidth, hi + 1);
    262261            ccStrm = pb.createOr(ccStrm, pb.createAnd(pb.createNot(pb.createLessThan(codeUnitStream, testVal_lo)),
    263262                                                      pb.createLessThan(codeUnitStream, testVal_hi)));
    264263        }
    265264    }
    266 #endif
    267265    return ccStrm;
    268266}
Note: See TracChangeset for help on using the changeset viewer.