Ignore:
Timestamp:
Jul 23, 2015, 4:47:59 PM (4 years ago)
Author:
nmedfort
Message:

Temporary check in.

File:
1 edited

Legend:

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

    r4687 r4692  
    7272}
    7373
    74 Call * PabloBlock::createCall(PabloAST * prototype, const std::vector<PabloAST *> & args) {
     74Call * PabloBlock::createCall(PabloAST * prototype, const std::vector<PabloAST *> &) {
    7575    assert (prototype);
    76     if (prototype == nullptr) {
    77         throw std::runtime_error("Call object cannot be created with a Null prototype!");
    78     }
    79     if (args.size() != cast<Prototype>(prototype)->getNumOfParameters()) {
    80         throw std::runtime_error("Invalid number of arguments passed into Call object!");
    81     }
    8276    return insertAtInsertionPoint(new Call(prototype));
    8377}
     78
    8479
    8580PabloAST * PabloBlock::createNot(PabloAST * expr) {
     
    176171        }
    177172    }
    178     if (isa<Not>(expr1)) {
     173    if (isa<Not>(expr1) || expr1 > expr2) {
    179174        std::swap(expr1, expr2);
    180175    }
     
    204199        }
    205200    }
    206     if (isa<Not>(expr1)) {
     201    if (isa<Not>(expr1) || expr1 > expr2) {
    207202        std::swap(expr1, expr2);
    208203    }
     
    251246        }
    252247    }
     248    if (expr1 > expr2) {
     249        std::swap(expr1, expr2);
     250    }
    253251    return insertAtInsertionPoint(new Or(expr1, expr2, makeName("or_")));
    254252}
     
    292290        }
    293291    }
     292    if (expr1 > expr2) {
     293        std::swap(expr1, expr2);
     294    }
    294295    return insertAtInsertionPoint(new Or(expr1, expr2, makeName(prefix, false)));
    295296}
     
    314315        }
    315316    }
     317    if (expr1 > expr2) {
     318        std::swap(expr1, expr2);
     319    }
    316320    return insertAtInsertionPoint(new Xor(expr1, expr2, makeName("xor_")));
    317321}
     
    336340        }
    337341    }
     342    if (expr1 > expr2) {
     343        std::swap(expr1, expr2);
     344    }
    338345    return insertAtInsertionPoint(new Xor(expr1, expr2, makeName(prefix, false)));
    339346}
     
    343350PabloAST * PabloBlock::createSel(PabloAST * condition, PabloAST * trueExpr, PabloAST * falseExpr) {
    344351    assert (condition && trueExpr && falseExpr);
    345 
    346352    if (isa<Ones>(condition)) {
    347353        return trueExpr;
Note: See TracChangeset for help on using the changeset viewer.