source: icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_swizzled_match_copy_kernel.h @ 5981

Last change on this file since 5981 was 5981, checked in by xwa163, 4 months ago

Improve performance of swizzled_match_copy_kernel by adjusting loop structure

File size: 1.5 KB
Line 
1//
2// Created by wxy325 on 2018/3/9.
3//
4
5#ifndef ICGREP_LZ4_SWIZZLED_MATCH_COPY_KERNEL_H
6#define ICGREP_LZ4_SWIZZLED_MATCH_COPY_KERNEL_H
7
8#include "kernels/kernel.h"
9
10namespace IDISA { class IDISA_Builder; }
11
12
13namespace kernel {
14    class LZ4SwizzledMatchCopyKernel: public SegmentOrientedKernel {
15    public:
16        LZ4SwizzledMatchCopyKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, unsigned streamCount, unsigned streamSize, unsigned swizzleFactor, unsigned PDEP_width = 64);
17    protected:
18        void generateDoSegmentMethod(const std::unique_ptr<KernelBuilder> & b) override;
19        void generateOutputCopy(const std::unique_ptr<KernelBuilder> & iBuilder);
20
21    private:
22
23        const unsigned mSwizzleFactor;
24        const unsigned mPDEPWidth;
25        const unsigned mStreamSize;
26        const unsigned mStreamCount;
27        std::pair<llvm::Value*, llvm::Value*> loadNextMatchOffset(const std::unique_ptr<KernelBuilder> &iBuilder);
28        std::pair<llvm::Value*, llvm::Value*> loadNextM0StartEnd(const std::unique_ptr<KernelBuilder> &iBuilder);
29        llvm::Value *advanceUntilNextBit(const std::unique_ptr<KernelBuilder> &iBuilder, std::string inputName,
30                                          llvm::Value *startPos, bool isNextOne);
31
32        llvm::Value* doMatchCopy(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value* matchPos, llvm::Value* matchOffset, llvm::Value* matchLength);
33
34    };
35}
36
37
38
39
40#endif //ICGREP_LZ4_SWIZZLED_MATCH_COPY_KERNEL_H
Note: See TracBrowser for help on using the repository browser.