Changeset 4655 for icGREP


Ignore:
Timestamp:
Jul 10, 2015, 9:30:08 AM (4 years ago)
Author:
cameron
Message:

Simplify of unit advance with IDISA dslli improves performance

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.cpp

    r4653 r4655  
    152152}
    153153
     154Value * IDISA_Builder::mvmd_dslli(unsigned fw, Value * a, Value * b, unsigned shift) {
     155    unsigned field_count = mBitBlockSize/fw;
     156    Value * aVec = fwCast(fw, a);
     157    Value * bVec = fwCast(fw, b);
     158    std::vector<Constant*> Idxs;
     159    for (unsigned i = shift; i < field_count + shift; i++) {
     160        Idxs.push_back(llvm_builder->getInt32(i));
     161    }
     162    return bitBlockCast(llvm_builder->CreateShuffleVector(aVec, bVec, ConstantVector::get(Idxs)));
     163}
    154164
    155165
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.h

    r4653 r4655  
    4949    Value * hsimd_signmask(unsigned fw, Value * a);
    5050
     51    Value * mvmd_dslli(unsigned fw, Value * a, Value * b, unsigned shift);
     52
    5153private:
    5254    Module * mMod;
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r4654 r4655  
    9191   
    9292#if (BLOCK_SIZE == 128) && !defined(USE_LONG_INTEGER_SHIFT)
    93     Value* advanceq_longint = mBuilder->CreateBitCast(carry_in, mBuilder->getIntNTy(BLOCK_SIZE));
    94     Value* advanceq_value = mBuilder->CreateBitCast(mBuilder->CreateLShr(advanceq_longint, BLOCK_SIZE - 1), mBitBlockType);
    95     Value* srli_1_value = mBuilder->CreateLShr(strm, 63);
    96     Value* packed_shuffle;
    97     Constant* const_packed_1_elems [] = {mBuilder->getInt32(0), mBuilder->getInt32(2)};
    98     Constant* const_packed_1 = ConstantVector::get(const_packed_1_elems);
    99     packed_shuffle = mBuilder->CreateShuffleVector(advanceq_value, srli_1_value, const_packed_1);
    100    
    101     Constant* const_packed_2_elems[] = {mBuilder->getInt64(1), mBuilder->getInt64(1)};
    102     Constant* const_packed_2 = ConstantVector::get(const_packed_2_elems);
    103    
    104     Value* shl_value = mBuilder->CreateShl(strm, const_packed_2);
    105     result_value = mBuilder->CreateOr(shl_value, packed_shuffle, "advance");
     93    Value * ahead64 = iBuilder->mvmd_dslli(64, carry_in, strm, 1);
     94    result_value = mBuilder->CreateOr(iBuilder->simd_srli(64, ahead64, 63), iBuilder->simd_slli(64, strm, 1));
    10695#else
    10796    Value* advanceq_longint = mBuilder->CreateBitCast(carry_in, mBuilder->getIntNTy(BLOCK_SIZE));
Note: See TracChangeset for help on using the changeset viewer.