Ignore:
Timestamp:
Oct 7, 2014, 12:10:04 PM (5 years ago)
Author:
nmedfort
Message:

Some revisions to the LLVM_Generator; renamed it to PabloCompiler?.

File:
1 edited

Legend:

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

    r4217 r4220  
    3131namespace cc {
    3232
    33 CC_Compiler::CC_Compiler(CodeGenState & cg, const Encoding encoding, const std::string basis_pattern, const std::string gensym_pattern)
     33CC_Compiler::CC_Compiler(PabloBlock & cg, const Encoding encoding, const std::string basis_pattern, const std::string gensym_pattern)
    3434: mCG(cg)
    3535, mBasisBit(encoding.getBits())
     
    4040    for (int i = 0; i < mEncoding.getBits(); i++) {
    4141        mBasisBit[i] = mCG.createVar(mBasisPattern + std::to_string((mEncoding.getBits() - 1) - i));
    42         mCG.push_back(mBasisBit[i]);
    4342    }
    4443}
     
    6564                    if (++j != seq->end()) {
    6665                        marker = mCG.createAdvance(sym);
    67                         mCG.push_back(marker);
    6866                        continue;
    6967                    }
    70                     mCG.push_back(mCG.createAssign(seq->getName(), sym));
     68                    mCG.createAssign(seq->getName(), sym);
    7169                    break;
    7270                }
     
    9896    if (mComputedSet.insert(cc->getName()).second) {
    9997        //Add the new mapping to the list of pablo statements:
    100         mCG.push_back(mCG.createAssign(cc->getName(), charset_expr(cc)));
    101     }
    102 }
    103 
    104 PabloE * CC_Compiler::bit_pattern_expr(int pattern, int selected_bits)
     98        mCG.createAssign(cc->getName(), charset_expr(cc));
     99    }
     100}
     101
     102PabloE * CC_Compiler::bit_pattern_expr(const unsigned pattern, unsigned selected_bits)
    105103{
    106104    if (selected_bits == 0) {
     
    180178}
    181179
    182 PabloE * CC_Compiler::GE_Range(int N, int n) {
     180PabloE * CC_Compiler::GE_Range(const unsigned N, const unsigned n) {
    183181    if (N == 0)
    184182    {
     
    195193    else if (N >= 1)
    196194    {
    197         int hi_bit = n & (1 << (N-1));
     195        int hi_bit = n & (1 << (N - 1));
    198196        int lo_bits = n - hi_bit;
    199         PabloE* lo_range = GE_Range(N-1, lo_bits);
     197        PabloE * lo_range = GE_Range(N - 1, lo_bits);
    200198        if (hi_bit == 0)
    201199        {
     
    219217}
    220218
    221 PabloE * CC_Compiler::LE_Range(int N, int n)
     219PabloE * CC_Compiler::LE_Range(const unsigned N, const unsigned n)
    222220{
    223221    /*
Note: See TracChangeset for help on using the changeset viewer.