source: icGREP/icgrep-devel/icgrep/kernels/expand3_4.h @ 5216

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

Radix 64 expansion kernel

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 EXPAND3_4_H
6#define EXPAND3_4_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{parabix::StreamSetType(iBuilder, 1, parabix::i8), "sourceStream"}},
28                  {Binding{parabix::StreamSetType(iBuilder, 1, parabix::i8), "expandedStream"}},
29                  {}, {}, 
30                  {Binding{iBuilder->fwVectorType(parabix::i8), "pendingPack"}}) {}
31   
32   
33private:
34    void generateDoBlockMethod() override;
35    void generateDoSegmentMethod() override;
36   
37};
38
39   
40
41}
42#endif
Note: See TracBrowser for help on using the repository browser.