source: icGREP/icgrep-devel/icgrep/kernels/deletion.h @ 5355

Last change on this file since 5355 was 5355, checked in by cameron, 3 years ago

Swizzled bitstream deletion and -enable-AVX-deletion in u8u16

File size: 1.9 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef DELETION_H
6#define DELETION_H
7
8#include "kernel.h"
9namespace IDISA { class IDISA_Builder; }
10
11//
12// Parallel Prefix Deletion
13// see Parallel Prefix Compress in Henry S. Warren, Hacker's Delight, Chapter 7
14//
15// Given that we want to delete bits within fields of width fw, moving
16// nondeleted bits to the right, the parallel prefix compress method can
17// be applied.   This requires a preprocessing step to compute log2(fw)
18// masks that can be used to select bits to be moved in each step of the
19// algorithm.
20//
21
22namespace kernel {
23
24class DeletionKernel : public BlockOrientedKernel {
25public:
26
27    DeletionKernel(IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned streamCount);
28   
29protected:
30
31    void generateDoBlockMethod() override;
32
33    void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
34
35private:
36    const unsigned mDeletionFieldWidth;
37    const unsigned mStreamCount;
38};
39
40class DeleteByPEXTkernel : public BlockOrientedKernel {
41public:
42   
43    DeleteByPEXTkernel(IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned streamCount);
44   
45protected:
46   
47    void generateDoBlockMethod() override;
48   
49    void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
50   
51private:
52    const unsigned mDelCountFieldWidth;
53    const unsigned mStreamCount;
54};
55   
56class SwizzledBitstreamCompressByCount : public BlockOrientedKernel {
57public:
58   
59    SwizzledBitstreamCompressByCount(IDISA::IDISA_Builder * iBuilder, unsigned bitStreamCount, unsigned fieldWidth = 64);
60   
61protected:
62   
63    void generateDoBlockMethod() override;
64    void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
65   
66private:
67    const unsigned mBitStreamCount;
68    const unsigned mFieldWidth;
69    const unsigned mSwizzleFactor;
70    const unsigned mSwizzleSetCount;
71};
72
73   
74}
75   
76#endif
77
Note: See TracBrowser for help on using the repository browser.