Ignore:
Timestamp:
Jul 10, 2015, 9:10:06 AM (4 years ago)
Author:
cameron
Message:

Move logic for advance operations entirely within carry manager.

File:
1 edited

Legend:

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

    r4647 r4654  
    88#define CARRY_MANAGER_H
    99#include <llvm/IR/IRBuilder.h>
     10#include <llvm/IR/Module.h>
     11#include <IDISA/idisa_builder.h>
    1012
    1113/*
     
    2931public:
    3032 
    31     CarryManager(IRBuilder <> * b, VectorType * bitBlockType, ConstantAggregateZero * zero, Constant * one) :
    32         mBuilder(b), mBitBlockType(bitBlockType), mZeroInitializer(zero), mOneInitializer(one) {}
     33    CarryManager(Module * m, IRBuilder <> * b, VectorType * bitBlockType, ConstantAggregateZero * zero, Constant * one) :
     34        mMod(m), mBuilder(b), mBitBlockType(bitBlockType), mZeroInitializer(zero), mOneInitializer(one) {}
    3335   
    3436    unsigned initialize(PabloBlock * blk, Value * carryDataPtr); 
     
    3840    Value * getBlockNoPtr();
    3941   
    40     /* Methods for getting and setting individual carry values. */
     42    /* Methods for processing individual carry-generating operations. */
    4143   
    4244    Value * getCarryOpCarryIn(PabloBlock * blk, int localIndex);
    4345
    44     Value * getUnitAdvanceCarryIn(PabloBlock * blk, int localIndex);
    45 
    46     Value * getShortAdvanceCarryIn(PabloBlock * blk, int localIndex, int shift_amount);
    47      
    4846    void setCarryOpCarryOut(PabloBlock * blk, unsigned idx, Value * carry_out);
    4947
    50     void setUnitAdvanceCarryOut(PabloBlock * blk, unsigned idx, Value * carry_out);
    51 
    52     void setShortAdvanceCarryOut(PabloBlock * blk, unsigned idx, int shift_amount, Value * carry_out);
    53    
    54     Value * longAdvanceCarryInCarryOut(PabloBlock * blk, int localIndex, int shift_amount, Value * carry_out);
     48    Value * advanceCarryInCarryOut(PabloBlock * blk, int localIndex, int shift_amount, Value * strm);
    5549 
    5650    /* Methods for getting and setting carry summary values for If statements */
     
    8478   
    8579private:
    86   IRBuilder <> * mBuilder;
    87   VectorType * mBitBlockType;
    88   ConstantAggregateZero * mZeroInitializer;
    89   Constant * mOneInitializer;
    90   PabloBlock * mPabloRoot;
    91   Value * mCarryDataPtr;
    92   Value * mBlockNoPtr;
    93   Value * mBlockNo;
    94   unsigned mTotalCarryDataSize;
    95  
    96   std::vector<Value *> mCarryInVector;
    97   std::vector<PHINode *> mCarryInPhis; 
    98   std::vector<PHINode *> mCarryOutAccumPhis; 
    99   std::vector<Value *> mCarryOutVector;
     80    Module * mMod;
     81    IRBuilder <> * mBuilder;
     82    VectorType * mBitBlockType;
     83    ConstantAggregateZero * mZeroInitializer;
     84    Constant * mOneInitializer;
     85    IDISA::IDISA_Builder * iBuilder;
     86    PabloBlock * mPabloRoot;
     87    Value * mCarryDataPtr;
     88    Value * mBlockNoPtr;
     89    Value * mBlockNo;
     90    unsigned mTotalCarryDataSize;
     91
     92    std::vector<Value *> mCarryInVector;
     93    std::vector<PHINode *> mCarryInPhis; 
     94    std::vector<PHINode *> mCarryOutAccumPhis; 
     95    std::vector<Value *> mCarryOutVector;
     96
     97    Value * unitAdvanceCarryInCarryOut(PabloBlock * blk, int localIndex, Value * strm);
     98    Value * shortAdvanceCarryInCarryOut(PabloBlock * blk, int localIndex, int shift_amount, Value * strm);
     99    Value * longAdvanceCarryInCarryOut(PabloBlock * blk, int localIndex, int shift_amount, Value * strm);
     100   
    100101};
    101102
Note: See TracChangeset for help on using the changeset viewer.