Changeset 4537 for icGREP/icgrep-devel


Ignore:
Timestamp:
Mar 11, 2015, 11:48:42 AM (5 years ago)
Author:
cameron
Message:

Set up for necessary AVX2 #defines

Location:
icGREP/icgrep-devel/icgrep/pablo
Files:
2 edited

Legend:

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

    r4535 r4537  
    812812}
    813813
     814
    814815#ifdef USE_UADD_OVERFLOW
    815816#ifdef USE_TWO_UADD_OVERFLOW
     
    862863#endif
    863864#endif
     865
    864866
    865867Value* PabloCompiler::genAddWithCarry(Value* e1, Value* e2) {
     
    991993    return b.CreateXor(expr, mOneInitializer, "not");
    992994}
    993 
    994995Value* PabloCompiler::genAdvanceWithCarry(Value* strm_value, int shift_amount) {
    995996    IRBuilder<> b(mBasicBlock);
     
    10011002    Value* result_value;
    10021003   
    1003 #ifdef USE_LONG_INTEGER_SHIFT
    1004     Value* advanceq_longint = b.CreateBitCast(genAdvanceInLoad(loadIdx), IntegerType::get(mMod->getContext(), BLOCK_SIZE));
    1005     Value* strm_longint = b.CreateBitCast(strm_value, IntegerType::get(mMod->getContext(), BLOCK_SIZE));
    1006     Value* adv_longint = b.CreateOr(b.CreateShl(strm_longint, block_shift), b.CreateLShr(advanceq_longint, BLOCK_SIZE - block_shift), "advance");
    1007     result_value = b.CreateBitCast(adv_longint, mBitBlockType);
    1008     genAdvanceOutStore(strm_value, storeIdx);
    1009 
    1010     return result_value;
    1011 #elif (BLOCK_SIZE == 128)
    10121004    if (advEntries == 1) {
    10131005        if (block_shift == 0) { 
     
    10151007            //b.CreateCall(mFunc_print_register, result_value);
    10161008        }
     1009#if (BLOCK_SIZE == 128) && !defined(USE_LONG_INTEGER_SHIFT)
    10171010        if (block_shift == 1) {
    10181011            Value* advanceq_value = genShiftHighbitToLow(genAdvanceInLoad(loadIdx));
     
    10371030            result_value = b.CreateBitCast(adv_longint, mBitBlockType);
    10381031        }
     1032#else
     1033        Value* advanceq_longint = b.CreateBitCast(genAdvanceInLoad(loadIdx), IntegerType::get(mMod->getContext(), BLOCK_SIZE));
     1034        Value* strm_longint = b.CreateBitCast(strm_value, IntegerType::get(mMod->getContext(), BLOCK_SIZE));
     1035        Value* adv_longint = b.CreateOr(b.CreateShl(strm_longint, block_shift), b.CreateLShr(advanceq_longint, BLOCK_SIZE - block_shift), "advance");
     1036        result_value = b.CreateBitCast(adv_longint, mBitBlockType);
     1037
     1038#endif
    10391039    }
    10401040    else {
     
    10591059    genAdvanceOutStore(strm_value, storeIdx);
    10601060    return result_value;
    1061 #else
    1062     //BLOCK_SIZE == 256
    1063     static_assert(false, "Advance with carry on 256-bit bitblock requires long integer shifts (USE_LONG_INTEGER_SHIFT).");
    1064 #endif //USE_LONG_INTEGER_SHIFT
    10651061}
    10661062
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.h

    r4535 r4537  
    7777
    7878};
     79#if (BLOCK_SIZE==256)
     80#define USE_UADD_OVERFLOW
     81#define USE_TWO_UADD_OVERFLOW
     82#endif
    7983
    8084class PabloCompiler {
Note: See TracChangeset for help on using the changeset viewer.