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

Last change on this file since 5292 was 5292, checked in by nmedfort, 3 years ago

Removed 'function' and 'self' parameters from generateXXXMethod() functions.

File size: 1.1 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(llvm::Value * blockNo) override;
32
33    void generateFinalBlockMethod(llvm::Value * remainingBytes, llvm::Value * blockNo) override;
34
35private:
36    const unsigned mDeletionFieldWidth;
37    const unsigned mStreamCount;
38};
39
40}
41   
42#endif
43
Note: See TracBrowser for help on using the repository browser.