Ignore:
Timestamp:
Apr 24, 2017, 2:58:47 PM (2 years ago)
Author:
cameron
Message:

lz4d - LZ4 decompressor - initial check-in

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/kernel.h

    r5419 r5422  
    386386private:
    387387
    388     bool useIndirectBr() const {
     388    virtual bool useIndirectBr() const {
    389389        return iBuilder->supportsIndirectBr();
    390390    }
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r5391 r5422  
    124124    Value * bytepack[8];
    125125    for (unsigned i = 0; i < 8; i++) {
    126         bytepack[i] = loadInputStreamPack("byteStream", iBuilder->getInt32(0), iBuilder->getInt32(i));
     126        if (mAligned) {
     127            bytepack[i] = loadInputStreamPack("byteStream", iBuilder->getInt32(0), iBuilder->getInt32(i));
     128        } else {
     129            Value * ptr = getInputStreamPackPtr("byteStream", iBuilder->getInt32(0), iBuilder->getInt32(i));
     130            // CreateLoad defaults to aligned here, so we need to force the alignment to 1 byte.
     131            bytepack[i] = iBuilder->CreateAlignedLoad(ptr, 1);
     132        }
    127133    }
    128134    Value * basisbits[8];
     
    161167}
    162168
    163 S2PKernel::S2PKernel(IDISA::IDISA_Builder * builder)
    164 : BlockOrientedKernel(builder, "Parabix:s2p",
    165     {Binding{builder->getStreamSetTy(1, 8), "byteStream"}}, {Binding{builder->getStreamSetTy(8, 1), "basisBits"}}, {}, {}, {}) {
     169S2PKernel::S2PKernel(IDISA::IDISA_Builder * builder, bool aligned)
     170: BlockOrientedKernel(builder, aligned ? "Parabix:s2p" : "Parabix:s2p_unaligned",
     171    {Binding{builder->getStreamSetTy(1, 8), "byteStream"}}, {Binding{builder->getStreamSetTy(8, 1), "basisBits"}}, {}, {}, {}),
     172  mAligned(aligned) {
    166173    setNoTerminateAttribute(true);
    167174}
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.h

    r5392 r5422  
    1414class S2PKernel : public BlockOrientedKernel {
    1515public:   
    16     S2PKernel(IDISA::IDISA_Builder * builder);
     16    S2PKernel(IDISA::IDISA_Builder * builder, bool aligned = true);
    1717    bool moduleIDisSignature() override {return true;}
    1818    virtual ~S2PKernel() {}
     
    2020    void generateDoBlockMethod() override;
    2121    void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
     22private:
     23    bool mAligned;
    2224};
    2325
  • icGREP/icgrep-devel/icgrep/kernels/toolchain.cpp

    r5418 r5422  
    295295    PM.add(createVerifierPass());
    296296    #endif
     297    PM.add(createPromoteMemoryToRegisterPass()); //Force the use of mem2reg to promote stack variables.
    297298    PM.add(createReassociatePass());             //Reassociate expressions.
    298299    PM.add(createGVNPass());                     //Eliminate common subexpressions.
Note: See TracChangeset for help on using the changeset viewer.