Changeset 4117


Ignore:
Timestamp:
Aug 31, 2014, 3:55:56 PM (4 years ago)
Author:
cameron
Message:

#ifdefs for experimental options

Location:
icGREP/icgrep-devel/icgrep
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/llvm_gen.cpp

    r4096 r4117  
    11481148}
    11491149
     1150#ifdef USE_UADD_OVERFLOW
    11501151SumWithOverflowPack LLVM_Generator::genUaddOverflow(Value* int128_e1, Value* int128_e2) {
    11511152    std::vector<Value*> struct_res_params;
     
    11701171    return ret;
    11711172}
    1172 
     1173#endif
    11731174
    11741175Value* LLVM_Generator::genAddWithCarry(Value* e1, Value* e2) {
     
    11811182    Value* carryq_value = genCarryInLoad(mptr_carry_q, this_carry_idx);
    11821183
     1184#ifdef USE_UADD_OVERFLOW
    11831185    //new code chunk, use llvm.uadd.with.overflow.i128
    11841186    CastInst* int128_e1 = new BitCastInst(e1, IntegerType::get(mMod->getContext(), 128), "e1_128", mBasicBlock);
     
    12041206    return ret_sum;
    12051207    //new code chunk ends
    1206 
     1208#endif
     1209#ifndef USE_UADD_OVERFLOW
    12071210    //Old code chunk, calculate carry through logical ops
    1208     //Value* carrygen = b.CreateAnd(e1, e2, "carrygen");
    1209     //Value* carryprop = b.CreateOr(e1, e2, "carryprop");
    1210     //Value* digitsum = b.CreateAdd(e1, e2, "digitsum");
    1211     //Value* partial = b.CreateAdd(digitsum, carryq_value, "partial");
    1212     //Value* digitcarry = b.CreateOr(carrygen, b.CreateAnd(carryprop, genNot(partial)));
    1213     //Value* mid_carry_in = genShiftLeft64(b.CreateLShr(digitcarry, 63), "mid_carry_in");
    1214 
    1215     //Value* sum = b.CreateAdd(partial, mid_carry_in, "sum");
    1216     //Value* carry_out = genShiftRight127(b.CreateOr(carrygen, b.CreateAnd(carryprop, genNot(sum))), "carry_out");
    1217     //Value* void_1 = genCarryOutStore(carry_out, mptr_carry_q, this_carry_idx);
    1218 
    1219     //return sum;
     1211    Value* carrygen = b.CreateAnd(e1, e2, "carrygen");
     1212    Value* carryprop = b.CreateOr(e1, e2, "carryprop");
     1213    Value* digitsum = b.CreateAdd(e1, e2, "digitsum");
     1214    Value* partial = b.CreateAdd(digitsum, carryq_value, "partial");
     1215    Value* digitcarry = b.CreateOr(carrygen, b.CreateAnd(carryprop, genNot(partial)));
     1216    Value* mid_carry_in = genShiftLeft64(b.CreateLShr(digitcarry, 63), "mid_carry_in");
     1217
     1218    Value* sum = b.CreateAdd(partial, mid_carry_in, "sum");
     1219    Value* carry_out = genShiftRight127(b.CreateOr(carrygen, b.CreateAnd(carryprop, genNot(sum))), "carry_out");
     1220    Value* void_1 = genCarryOutStore(carry_out, mptr_carry_q, this_carry_idx);
     1221
     1222    return sum;
    12201223    //Old code chunk ends
     1224#endif
    12211225}
    12221226
  • icGREP/icgrep-devel/icgrep/llvm_gen.h

    r4096 r4117  
    88#define LLVM_GENERATOR_H
    99
    10 #define USE_LLVM_3_5
    11 #define DUMP_GENERATED_IR
     10#define USE_LLVM_3_4
     11//#define DUMP_GENERATED_IR
    1212
    1313//Regular Expressions
  • icGREP/icgrep-devel/icgrep/pbix_compiler.cpp

    r4095 r4117  
    7272        PabloE * u8pfx4 = new Var(m_name_map.find("UTF8-Prefix4")->second);
    7373        PabloE * u8pfx = new Or(new Or(u8pfx2, u8pfx3), u8pfx4);
    74 #ifdef USE_IF_FOR_NONFINAL
    7574        cg_state.stmtsl.push_back(new Assign(gs_initial, new Or(u8pfx, u8single)));
    76 #endif
    77       cg_state.newsym = gs_initial;
     75        cg_state.newsym = gs_initial;
    7876
    7977        //Set the 'internal.nonfinal' bit stream for the utf-8 multi-byte encoding.
     
    8179        std::string gs_nonfinal = symgen.gensym("internal.nonfinal");
    8280        m_name_map.insert(make_pair("internal.nonfinal", gs_nonfinal));
     81//#define USE_IF_FOR_NONFINAL
     82#ifdef USE_IF_FOR_NONFINAL
    8383        cg_state.stmtsl.push_back(new Assign(gs_nonfinal, new All(0)));
     84#endif
    8485        PabloE * u8scope32 = new Advance(u8pfx3);
    8586        PabloE * u8scope42 = new Advance(u8pfx4);
Note: See TracChangeset for help on using the changeset viewer.