Changeset 6112


Ignore:
Timestamp:
Jun 24, 2018, 1:28:20 AM (5 months ago)
Author:
xwa163
Message:

Remove S2PByPextKernel

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r6089 r6112  
    242242}
    243243
    244 
    245 S2PByPextKernel::S2PByPextKernel(const std::unique_ptr<kernel::KernelBuilder> &b, cc::BitNumbering numbering, std::string prefix)
    246         : BlockOrientedKernel(prefix + "s2pByPext" + cc::numberingSuffix(numbering),
    247                            {Binding{b->getStreamSetTy(1, 8), "byteStream", FixedRate(), Principal()}},
    248                            {Binding{b->getStreamSetTy(8, 1), "basisBits"}}, {}, {}, {}),
    249     mBasisSetNumbering(numbering) {
    250 }
    251 
    252 void S2PByPextKernel::generateDoBlockMethod(const std::unique_ptr<KernelBuilder> &b) {
    253     Value* inputBasePtr = b->CreatePointerCast(b->getInputStreamBlockPtr("byteStream", b->getSize(0)), b->getInt64Ty()->getPointerTo());
    254     std::vector<Value*> outputPtrs(8, nullptr);
    255     for (unsigned i = 0; i < 8; i++) {
    256         outputPtrs[i] = b->CreatePointerCast(b->getOutputStreamBlockPtr("basisBits", b->getSize(i)), b->getInt64Ty()->getPointerTo());
    257     }
    258     uint64_t base_mask = 0x0101010101010101;
    259 
    260     Constant * pext = Intrinsic::getDeclaration(b->getModule(), Intrinsic::x86_bmi_pext_64);
    261 
    262     for (unsigned iBlockIndex = 0; iBlockIndex < 4; iBlockIndex++) {
    263         std::vector<Value*> tempValues(8, b->getInt64(0));
    264         for (size_t iDataIndex = 0; iDataIndex < 8; iDataIndex++) {
    265             Value* inputData = b->CreateLoad(b->CreateGEP(inputBasePtr, b->getSize(iDataIndex + iBlockIndex * 8)));
    266             for (unsigned iStreamIndex = 0; iStreamIndex < 8; iStreamIndex++) {
    267                 const unsigned bitIndex = mBasisSetNumbering == cc::BitNumbering::LittleEndian ? iStreamIndex : 7 - iStreamIndex;
    268                 Value* targetMask = b->getInt64(base_mask << bitIndex);
    269                 Value * const outputValue = b->CreateCall(pext, {inputData, targetMask});
    270                 tempValues[iStreamIndex] = b->CreateOr(tempValues[iStreamIndex], b->CreateShl(outputValue, b->getInt64(iDataIndex * 8)));
    271             }
    272         }
    273         for (int iStreamIndex = 0; iStreamIndex < 8; iStreamIndex++) {
    274             b->CreateStore(tempValues[iStreamIndex], b->CreateGEP(outputPtrs[iStreamIndex], b->getSize(iBlockIndex)));
    275         }
    276     }
    277 }
    278 }
     244}
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.h

    r6089 r6112  
    5050
    5151
    52 class S2PByPextKernel final : public BlockOrientedKernel {
    53 public:
    54     S2PByPextKernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian, std::string prefix = "");
    55     bool isCachable() const override { return true; }
    56     bool hasSignature() const override { return false; }
    57 protected:
    58     void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) override;
    59     cc::BitNumbering mBasisSetNumbering;
    60 };
    61 
    6252}
    6353#endif
  • icGREP/icgrep-devel/icgrep/lz4/LZ4GrepGenerator.cpp

    r6111 r6112  
    598598    StreamSetBuffer * const decompressionBitStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getDecompressedBufferBlocks(iBuilder));
    599599    Kernel * s2pk = mPxDriver.addKernelInstance<S2PKernel>(iBuilder, cc::BitNumbering::LittleEndian, /*aligned = */ true, "a");
    600 //    Kernel * s2pk = mPxDriver.addKernelInstance<S2PByPextKernel>(iBuilder, cc::BitNumbering::LittleEndian, "a");
    601600    mPxDriver.makeKernelCall(s2pk, {decompressedByteStream}, {decompressionBitStream});
    602601
     
    640639    StreamSetBuffer * const decompressionBitStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getDecompressedBufferBlocks(iBuilder));
    641640    Kernel * s2pk = mPxDriver.addKernelInstance<S2PKernel>(iBuilder, cc::BitNumbering::LittleEndian, /*aligned = */ true, "a");
    642 //    Kernel * s2pk = mPxDriver.addKernelInstance<S2PByPextKernel>(iBuilder, "a");
    643641    mPxDriver.makeKernelCall(s2pk, {decompressedByteStream}, {decompressionBitStream});
    644642
Note: See TracChangeset for help on using the changeset viewer.