source: icGREP/icgrep-devel/icgrep/kernels/lz4/aio/lz4_twist_aio.h @ 6135

Last change on this file since 6135 was 6135, checked in by xwa163, 12 months ago
  1. Implement twist_kernel and untwist_kernel by PEXT and PDEP
  2. Use twist form for multiplexing lz4 grep
File size: 1.9 KB
Line 
1
2
3#ifndef ICGREP_LZ4_I4_BYTESTREAM_AIO_H
4#define ICGREP_LZ4_I4_BYTESTREAM_AIO_H
5
6#include "kernels/lz4/aio/lz4_sequential_aio_base.h"
7
8namespace kernel{
9    class LZ4TwistAioKernel : public LZ4SequentialAioBaseKernel {
10    public:
11        LZ4TwistAioKernel(const std::unique_ptr<kernel::KernelBuilder> &b, unsigned twistWidth, unsigned blockSize = 4 * 1024 * 1024);
12
13    protected:
14        virtual void doLiteralCopy(const std::unique_ptr<KernelBuilder> &b, llvm::Value *literalStart,
15                                   llvm::Value *literalLength, llvm::Value* blockStart) override;
16        virtual void doMatchCopy(const std::unique_ptr<KernelBuilder> &b, llvm::Value *matchOffset,
17                                 llvm::Value *matchLength) override;
18        virtual void setProducedOutputItemCount(const std::unique_ptr<KernelBuilder> &b, llvm::Value* produced) override;
19
20
21        virtual void initializationMethod(const std::unique_ptr<KernelBuilder> &b) override;
22        virtual void prepareProcessBlock(const std::unique_ptr<KernelBuilder> &b, llvm::Value* blockStart, llvm::Value* blockEnd) override;
23        virtual void beforeTermination(const std::unique_ptr<KernelBuilder> &b) override;
24
25    private:
26        void doShortMatchCopy(const std::unique_ptr<KernelBuilder> &b, llvm::Value *matchOffset,
27                                 llvm::Value *matchLength);
28        void doLongMatchCopy(const std::unique_ptr<KernelBuilder> &b, llvm::Value *matchOffset,
29                                 llvm::Value *matchLength);
30
31        inline size_t getNormalCopyLength();
32        inline llvm::Value* getNormalCopyLengthValue(const std::unique_ptr<KernelBuilder> &b);
33        inline llvm::Value* getOutputMask(const std::unique_ptr<KernelBuilder> &b, llvm::Value* outputPosRem4);
34
35
36        const unsigned mTwistWidth;
37        const unsigned mItemsPerByte;
38    };
39}
40
41#endif //ICGREP_LZ4_I4_BYTESTREAM_AIO_H
Note: See TracBrowser for help on using the repository browser.