Changeset 4293 for icGREP


Ignore:
Timestamp:
Nov 6, 2014, 2:29:51 PM (5 years ago)
Author:
cameron
Message:

Postpone shift of the advanceQ

File:
1 edited

Legend:

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

    r4290 r4293  
    967967    Value* advanceq_longint = b.CreateBitCast(genAdvanceInLoad(advanceIdx), IntegerType::get(mMod->getContext(), BLOCK_SIZE));
    968968    Value* strm_longint = b.CreateBitCast(strm_value, IntegerType::get(mMod->getContext(), BLOCK_SIZE));
    969     Value* adv_longint = b.CreateOr(b.CreateShl(strm_longint, shift_amount), advanceq_longint, "advance");
     969    Value* adv_longint = b.CreateOr(b.CreateShl(strm_longint, shift_amount), b.CreateLShr(advanceq_longint, BLOCK_SIZE - shift_amount), "advance");
    970970    Value* result_value = b.CreateBitCast(adv_longint, mBitBlockType);
    971971    Value* advance_out = b.CreateBitCast(b.CreateLShr(strm_longint, BLOCK_SIZE - shift_amount, "advance_out"), mBitBlockType);
    972     genAdvanceOutStore(advance_out, advanceIdx);
     972    genAdvanceOutStore(strm_value, advanceIdx);
    973973
    974974    return result_value;
     
    999999        Value* advanceq_longint = b.CreateBitCast(genAdvanceInLoad(advanceIdx), IntegerType::get(mMod->getContext(), BLOCK_SIZE));
    10001000        Value* strm_longint = b.CreateBitCast(strm_value, IntegerType::get(mMod->getContext(), BLOCK_SIZE));
    1001         Value* adv_longint = b.CreateOr(b.CreateShl(strm_longint, shift_amount), advanceq_longint, "advance");
     1001        Value* adv_longint = b.CreateOr(b.CreateShl(strm_longint, shift_amount), b.CreateLShr(advanceq_longint, BLOCK_SIZE - shift_amount), "advance");
    10021002        Value* result_value = b.CreateBitCast(adv_longint, mBitBlockType);
    1003         Value* advance_out = b.CreateBitCast(b.CreateLShr(strm_longint, BLOCK_SIZE - shift_amount, "advance_out"), mBitBlockType);
    1004         genAdvanceOutStore(advance_out, advanceIdx);
     1003        genAdvanceOutStore(strm_value, advanceIdx);
    10051004
    10061005        return result_value;
Note: See TracChangeset for help on using the changeset viewer.