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

Last change on this file since 5436 was 5436, checked in by nmedfort, 2 years ago

Continued refactoring work. PabloKernel? now abstract base type with a 'generatePabloMethod' hook to generate Pablo code.

File size: 1.8 KB
RevLine 
[5216]1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
[5219]5#ifndef RADIX64_H
6#define RADIX64_H
[5216]7
8#include "kernel.h"
9
10namespace llvm { class Module; }
[5260]11namespace llvm { class Value; }
[5216]12
13namespace IDISA { class IDISA_Builder; }
14
15namespace kernel {
16
17/*  expand3_4 transforms a byte sequence by duplicating every third byte.
18    Each 3 bytes of the input abc produces a 4 byte output abcc.   
19    This is a useful preparatory transformation in various radix-64 encodings. */
20 
[5431]21class expand3_4Kernel final : public SegmentOrientedKernel {
[5285]22public:   
[5436]23    expand3_4Kernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[5431]24    bool isCachable() const override { return true; }
[5435]25    bool moduleIDisSignature() const override { return true; }
[5216]26private:
[5431]27    void generateDoSegmentMethod() override;
[5216]28};
29
[5431]30class radix64Kernel final : public BlockOrientedKernel {
[5219]31public:
[5436]32    radix64Kernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[5431]33    bool isCachable() const override { return true; }
[5435]34    bool moduleIDisSignature() const override { return true; }
[5219]35private:
[5431]36    virtual void generateDoBlockMethod() override;
37    virtual void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
[5288]38    llvm::Value* processPackData(llvm::Value* packData) const;
[5219]39};
[5216]40
[5431]41class base64Kernel final : public BlockOrientedKernel {
[5219]42public:
[5436]43    base64Kernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[5431]44    bool isCachable() const override { return true; }
[5435]45    bool moduleIDisSignature() const override { return true; }
[5219]46private:
[5431]47    virtual void generateDoBlockMethod() override;
48    virtual void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
[5288]49    llvm::Value* processPackData(llvm::Value* packData) const;
[5219]50};
51
[5216]52}
53#endif
Note: See TracBrowser for help on using the repository browser.