source: icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_bitstream_not_kernel.cpp @ 6047

Last change on this file since 6047 was 6039, checked in by xwa163, 15 months ago

Init checkin for bitstream version of lz4d match copy

File size: 991 bytes
Line 
1
2#include "lz4_bitstream_not_kernel.h"
3
4#include <kernels/kernel_builder.h>
5#include <pablo/pabloAST.h>
6#include <pablo/builder.hpp>
7#include <pablo/pe_pack.h>
8
9#include <llvm/Support/raw_ostream.h>
10
11
12using namespace llvm;
13using namespace kernel;
14using namespace std;
15using namespace pablo;
16
17
18namespace kernel {
19    LZ4BitStreamNotKernel::LZ4BitStreamNotKernel(const std::unique_ptr<pablo::PabloKernel::KernelBuilder> &b):
20            PabloKernel(b, "LZ4BitStreamNotKernel",
21                        {Binding{b->getStreamSetTy(1), "inputBitStream"}},
22                        {Binding{b->getStreamSetTy(1), "outputBitStream"}}){
23    }
24
25    void LZ4BitStreamNotKernel::generatePabloMethod() {
26        PabloBuilder pb(getEntryScope());
27
28        Var *e0Marker = getInputStreamVar("inputBitStream");
29        PabloAST *v = pb.createExtract(e0Marker, 0);
30
31        Var *eMarker = getOutputStreamVar("outputBitStream");
32        pb.createAssign(pb.createExtract(eMarker, 0), pb.createNot(v));
33    }
34}
35
Note: See TracBrowser for help on using the repository browser.