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

Last change on this file since 5335 was 5313, checked in by cameron, 2 years ago

DeleteByPEXTkernel

File size: 1.4 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}
56   
57#endif
58
Note: See TracBrowser for help on using the repository browser.