source: icGREP/icgrep-devel/icgrep/kernels/radix64.h @ 5219

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

radix64 kernels in progress

File size: 1.8 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 RADIX64_H
6#define RADIX64_H
7
8#include "streamset.h"
9#include "interface.h"
10#include "kernel.h"
11
12namespace llvm { class Module; }
13
14namespace IDISA { class IDISA_Builder; }
15
16namespace kernel {
17
18/*  expand3_4 transforms a byte sequence by duplicating every third byte.
19    Each 3 bytes of the input abc produces a 4 byte output abcc.   
20    This is a useful preparatory transformation in various radix-64 encodings. */
21 
22class expand3_4Kernel : public KernelBuilder {
23public:
24   
25    expand3_4Kernel(IDISA::IDISA_Builder * iBuilder) :
26    KernelBuilder(iBuilder, "expand3_4",
27                  {Binding{iBuilder->getStreamSetTy(1, 8), "sourceStream"}},
28                  {Binding{iBuilder->getStreamSetTy(1, 8), "expandedStream"}},
29                  {}, {}, {}) {}
30   
31private:
32    void generateDoBlockMethod() override;
33    void generateDoSegmentMethod() override;
34   
35};
36
37class radix64Kernel : public KernelBuilder {
38public:
39   
40    radix64Kernel(IDISA::IDISA_Builder * iBuilder) :
41    KernelBuilder(iBuilder, "expand3_4",
42                  {Binding{iBuilder->getStreamSetTy(1, 8), "expandedStream"}},
43                  {Binding{iBuilder->getStreamSetTy(1, 8), "radix64stream"}},
44                  {}, {}, {}) {}
45   
46private:
47    void generateDoBlockLogic() override;
48   
49};
50
51class base64Kernel : public KernelBuilder {
52public:
53   
54    base64Kernel(IDISA::IDISA_Builder * iBuilder) :
55    KernelBuilder(iBuilder, "expand3_4",
56                  {Binding{iBuilder->getStreamSetTy(1, 8), "radix64stream"}},
57                  {Binding{iBuilder->getStreamSetTy(1, 8), "base64stream"}},
58                  {}, {}, {}) {}
59   
60private:
61    void generateDoBlockLogic() override;
62    void generateFinalBlockMethod() override;
63   
64};
65
66}
67#endif
Note: See TracBrowser for help on using the repository browser.