Ignore:
Timestamp:
Dec 16, 2016, 4:16:28 PM (3 years ago)
Author:
nmedfort
Message:

Rewrite of the CarryManager? to support non-carry-collapsing loops.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/codegenstate.h

    r5217 r5227  
    4545    friend class Branch;
    4646    friend class PabloBuilder;
     47    friend class PabloKernel;
    4748public:
    4849
     
    7677    }
    7778
    78     Advance * createAdvance(PabloAST * expr, PabloAST * shiftAmount, String * const name);
     79    Advance * createAdvance(PabloAST * expr, PabloAST * shiftAmount, String * name);
    7980
    8081    Lookahead * createLookahead(PabloAST * expr, PabloAST * shiftAmount) {
     
    8687    }
    8788
    88     Lookahead * createLookahead(PabloAST * expr, PabloAST * shiftAmount, String * const name);
     89    Lookahead * createLookahead(PabloAST * expr, PabloAST * shiftAmount, String * name);
    8990
    9091    inline Zeroes * createZeroes(Type * const type = nullptr) {
     
    118119    }
    119120
    120     Not * createNot(PabloAST * expr, String * const name);
     121    Not * createNot(PabloAST * expr, String * name);
    121122
    122123    inline Var * createVar(const std::string & name, Type * const type = nullptr) {
     
    140141    }
    141142
    142     InFile * createInFile(PabloAST * expr, String * const name);
     143    InFile * createInFile(PabloAST * expr, String * name);
    143144
    144145    AtEOF * createAtEOF(PabloAST * expr) {
     
    150151    }
    151152
    152     AtEOF * createAtEOF(PabloAST * expr, String * const name);
     153    AtEOF * createAtEOF(PabloAST * expr, String * name);
    153154
    154155    Extract * createExtract(PabloAST * array, const int64_t index) {
     
    168169    }
    169170
    170     Extract * createExtract(PabloAST * array, PabloAST * index, String * const name);
     171    Extract * createExtract(PabloAST * array, PabloAST * index, String * name);
    171172
    172173    Assign * createAssign(PabloAST * const var, PabloAST * const value);
     
    180181    }
    181182
    182     And * createAnd(PabloAST * expr1, PabloAST * expr2, String * const name);
     183    And * createAnd(PabloAST * expr1, PabloAST * expr2, String * name);
    183184
    184185    And * createAnd(Type * const type, const unsigned reserved) {
     
    186187    }
    187188
    188     And * createAnd(Type * const type, const unsigned reserved, String * const name);
     189    And * createAnd(Type * const type, const unsigned reserved, String * name);
    189190
    190191    Or * createOr(PabloAST * expr1, PabloAST * expr2) {
     
    196197    }
    197198
    198     Or * createOr(PabloAST * expr1, PabloAST * expr2, String * const name);
     199    Or * createOr(PabloAST * expr1, PabloAST * expr2, String * name);
    199200
    200201    Or * createOr(Type * const type, const unsigned reserved) {
     
    202203    }
    203204
    204     Or * createOr(Type * const type, const unsigned reserved, String * const name);
     205    Or * createOr(Type * const type, const unsigned reserved, String * name);
    205206
    206207    Xor * createXor(PabloAST * expr1, PabloAST * expr2) {
     
    212213    }
    213214
    214     Xor * createXor(PabloAST * expr1, PabloAST * expr2, String * const name);
     215    Xor * createXor(PabloAST * expr1, PabloAST * expr2, String * name);
    215216
    216217    Xor * createXor(Type * const type, const unsigned reserved) {
     
    218219    }
    219220
    220     Xor * createXor(Type * const type, const unsigned reserved, String * const name);
     221    Xor * createXor(Type * const type, const unsigned reserved, String * name);
    221222
    222223    Sel * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr) {
     
    228229    }
    229230
    230     Sel * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, String * const name);
    231 
    232     Add * createAdd(PabloAST * expr1, PabloAST * expr2) {
    233         return createAdd(expr1, expr2, nullptr);
    234     }
    235 
    236     Add * createAdd(PabloAST * expr1, PabloAST * expr2, const std::string & prefix) {
    237         return createAdd(expr1, expr2, makeName(prefix));
    238     }
    239 
    240     Add * createAdd(PabloAST * expr1, PabloAST * expr2, String * const name);
    241 
    242     Subtract * createSubtract(PabloAST * expr1, PabloAST * expr2) {
    243         return createSubtract(expr1, expr2, nullptr);
    244     }
    245 
    246     Subtract * createSubtract(PabloAST * expr1, PabloAST * expr2, const std::string & prefix) {
    247         return createSubtract(expr1, expr2, makeName(prefix));
    248     }
    249 
    250     Subtract * createSubtract(PabloAST * expr1, PabloAST * expr2, String * const name);
     231    Sel * createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr, String * name);
     232
     233    Add * createAdd(PabloAST * expr1, PabloAST * expr2);
     234
     235    Subtract * createSubtract(PabloAST * expr1, PabloAST * expr2);
     236
     237    LessThan * createLessThan(PabloAST * expr1, PabloAST * expr2);
    251238
    252239    MatchStar * createMatchStar(PabloAST * marker, PabloAST * charclass) {
     
    258245    }
    259246
    260     MatchStar * createMatchStar(PabloAST * marker, PabloAST * charclass, String * const name);
     247    MatchStar * createMatchStar(PabloAST * marker, PabloAST * charclass, String * name);
    261248
    262249    ScanThru * createScanThru(PabloAST * from, PabloAST * thru) {
     
    268255    }
    269256
    270     ScanThru * createScanThru(PabloAST * from, PabloAST * thru, String * const name);
     257    ScanThru * createScanThru(PabloAST * from, PabloAST * thru, String * name);
    271258
    272259    If * createIf(PabloAST * condition, PabloBlock * body);
    273260
    274261    While * createWhile(PabloAST * condition, PabloBlock * body);
     262
     263    Type * getStreamSetTy(const uint64_t NumElements = 1, const uint64_t FieldWidth = 1) {
     264        return mParent->getStreamSetTy(NumElements, FieldWidth);
     265    }
    275266
    276267    inline PabloBlock * getPredecessor() const {
     
    284275    void insert(Statement * const statement);
    285276
    286     unsigned enumerateScopes(unsigned baseScopeIndex);
    287    
     277    inline void setScopeIndex(const unsigned index) {
     278        mScopeIndex = index;
     279    }
     280
    288281    inline unsigned getScopeIndex() const {
    289282        return mScopeIndex;
Note: See TracChangeset for help on using the changeset viewer.