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/re/re_compiler.cpp

    r4686 r4716  
    2828#include <assert.h>
    2929#include <stdexcept>
     30#include <iostream>
    3031
    3132#include "llvm/Support/CommandLine.h"
     
    4243static cl::opt<bool> DisableUnicodeLineBreak("disable-unicode-linebreak", cl::init(false),
    4344                     cl::desc("disable Unicode line breaks - use LF only"), cl::cat(fREcompilationOptions));
     45static cl::opt<bool> SetMod64Approximation("mod64-approximate", cl::init(false),
     46                     cl::desc("set mod64 approximate mode"), cl::cat(fREcompilationOptions));
    4447#ifndef DISABLE_PREGENERATED_UCD_FUNCTIONS
    4548static cl::opt<bool> DisablePregeneratedUnicode("disable-pregenerated-unicode", cl::init(false),
     
    501504    else if (isUnicodeUnitLength(repeated) && !DisableMatchStar && !DisableUnicodeMatchStar) {
    502505        PabloAST * cc = markerVar(compile(repeated, pb));
    503         return makeMarker(FinalPostPositionByte, pb.createAnd(pb.createMatchStar(base, pb.createOr(mNonFinal, cc)), mFinal, "unbounded"));
     506        PabloAST * mstar = pb.createMatchStar(base, pb.createOr(mNonFinal, cc));
     507        if (SetMod64Approximation) {
     508            if (isa<MatchStar>(mstar)) {
     509                dyn_cast<MatchStar>(mstar)->setMod64();
     510            }
     511        }
     512        return makeMarker(FinalPostPositionByte, pb.createAnd(mstar, mFinal, "unbounded"));
    504513    }
    505514    else if (mStarDepth > 0){
Note: See TracChangeset for help on using the changeset viewer.