Ignore:
Timestamp:
Jul 14, 2015, 6:29:35 PM (4 years ago)
Author:
cameron
Message:

Carry Manager progress

File:
1 edited

Legend:

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

    r4663 r4670  
    1010#include <llvm/IR/Module.h>
    1111#include <IDISA/idisa_builder.h>
     12#include <codegenstate.h>
    1213
    1314/*
     
    3637    , mZeroInitializer(zero)
    3738    , mOneInitializer(one)
    38     , iBuilder(idb) {
     39    , iBuilder(idb)
     40    , mPabloRoot(nullptr)
     41    , mCurrentScope(nullptr)
     42    , mCarryInfo(nullptr)
     43    , mCurrentScopeIndex(0)
     44    , mCarryDataPtr(nullptr)
     45    , mBlockNoPtr(nullptr)
     46    , mBlockNo(nullptr)
     47    , mTotalCarryDataSize(0)
     48    {
    3949
    4050    }
     
    4656    Value * getBlockNoPtr();
    4757   
     58    /* Entering and leaving scopes. */
     59   
     60    void enterScope(PabloBlock * blk);
     61
     62    void leaveScope();
     63   
    4864    /* Methods for processing individual carry-generating operations. */
    4965   
    50     Value * getCarryOpCarryIn(PabloBlock * blk, int localIndex);
     66    Value * getCarryOpCarryIn(int localIndex);
    5167
    52     void setCarryOpCarryOut(PabloBlock * blk, unsigned idx, Value * carry_out);
     68    void setCarryOpCarryOut(unsigned idx, Value * carry_out);
    5369
    54     Value * advanceCarryInCarryOut(PabloBlock * blk, int localIndex, int shift_amount, Value * strm);
     70    Value * advanceCarryInCarryOut(int localIndex, int shift_amount, Value * strm);
    5571 
    5672    /* Methods for getting and setting carry summary values for If statements */
    5773   
    58     bool blockHasCarries(PabloBlock & blk);
     74    bool blockHasCarries();
    5975   
    60     Value * getCarrySummaryExpr(PabloBlock & blk);
     76    Value * getCarrySummaryExpr();
    6177   
    62     void generateCarryOutSummaryCode(PabloBlock & blk);
     78    void generateCarryOutSummaryCode();
    6379   
    64     bool summaryNeededInParentBlock(PabloBlock & blk);
     80    bool summaryNeededInParentBlock();
    6581   
    66     void addSummaryPhi(PabloBlock & blk, BasicBlock * ifEntryBlock, BasicBlock * ifBodyFinalBlock);
     82    void addSummaryPhi(BasicBlock * ifEntryBlock, BasicBlock * ifBodyFinalBlock);
    6783   
    6884    /* Methods for load/store of carries for non-while blocks. */
    6985   
    70     void ensureCarriesLoadedLocal(PabloBlock & blk);
     86    void ensureCarriesLoadedLocal();
    7187
    72     void ensureCarriesStoredLocal(PabloBlock & blk);
     88    void ensureCarriesStoredLocal();
    7389   
    7490    /* Methods for handling while statements */
    7591   
    76     void ensureCarriesLoadedRecursive(PabloBlock & whileBlk);
     92    void ensureCarriesLoadedRecursive();
    7793
    78     void initializeCarryDataPhisAtWhileEntry(PabloBlock & whileBlk, BasicBlock * whileBodyFinalBlock);
     94    void initializeCarryDataPhisAtWhileEntry(BasicBlock * whileBodyFinalBlock);
    7995
    80     void extendCarryDataPhisAtWhileBodyFinalBlock(PabloBlock & whileBlk, BasicBlock * whileBodyFinalBlock);
     96    void extendCarryDataPhisAtWhileBodyFinalBlock(BasicBlock * whileBodyFinalBlock);
    8197
    82     void ensureCarriesStoredRecursive(PabloBlock & whileBlk);
     98    void ensureCarriesStoredRecursive();
    8399
    84100   
     
    90106    IDISA::IDISA_Builder * iBuilder;
    91107    PabloBlock * mPabloRoot;
     108    PabloBlock * mCurrentScope;
     109    PabloBlockCarryData * mCarryInfo;
     110    unsigned mCurrentScopeIndex;
    92111    Value * mCarryDataPtr;
    93112    Value * mBlockNoPtr;
     
    100119    std::vector<Value *> mCarryOutVector;
    101120
    102     Value * unitAdvanceCarryInCarryOut(PabloBlock * blk, int localIndex, Value * strm);
    103     Value * shortAdvanceCarryInCarryOut(PabloBlock * blk, int localIndex, int shift_amount, Value * strm);
    104     Value * longAdvanceCarryInCarryOut(PabloBlock * blk, int localIndex, int shift_amount, Value * strm);
     121    Value * unitAdvanceCarryInCarryOut(int localIndex, Value * strm);
     122    Value * shortAdvanceCarryInCarryOut(int localIndex, int shift_amount, Value * strm);
     123    Value * longAdvanceCarryInCarryOut(int localIndex, int shift_amount, Value * strm);
    105124   
    106125};
Note: See TracChangeset for help on using the changeset viewer.