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

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

Add deletion kernel

File size: 1.2 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
9
10namespace llvm { class Module; class Value;}
11
12namespace IDISA { class IDISA_Builder; }
13
14//
15// Parallel Prefix Deletion
16// see Parallel Prefix Compress in Henry S. Warren, Hacker's Delight, Chapter 7
17//
18// Given that we want to delete bits within fields of width fw, moving
19// nondeleted bits to the right, the parallel prefix compress method can
20// be applied.   This requires a preprocessing step to compute log2(fw)
21// masks that can be used to select bits to be moved in each step of the
22// algorithm.
23//
24// Deletion Mask Calculation
25
26std::vector<llvm::Value *> parallel_prefix_deletion_masks(IDISA::IDISA_Builder * iBuilder, unsigned fw, llvm::Value * del_mask);
27
28// Applying Deletion Masks to a Stream
29
30llvm::Value * apply_parallel_prefix_deletion(IDISA::IDISA_Builder * iBuilder, unsigned fw, llvm::Value * del_mask, std::vector<llvm::Value *> mv, llvm::Value * strm);
31
32namespace kernel {
33 
34    class KernelBuilder;
35
36    void generateDeletionKernel(llvm::Module * m, IDISA::IDISA_Builder * iBuilder, unsigned fw, unsigned stream_count, KernelBuilder * kBuilder);
37
38}
39#endif
40
Note: See TracBrowser for help on using the repository browser.