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

Last change on this file since 5787 was 5755, checked in by nmedfort, 20 months ago

Bug fixes and simplified MultiBlockKernel? logic

File size: 2.1 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 
[5507]21class expand3_4Kernel final : public MultiBlockKernel {
[5285]22public:   
[5436]23    expand3_4Kernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[5431]24    bool isCachable() const override { return true; }
[5464]25    bool hasSignature() const override { return false; }
[5216]26private:
[5755]27    llvm::Value * generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value * const numOfStrides) 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; }
[5464]34    bool hasSignature() const override { return false; }
[5219]35private:
[5440]36    virtual void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) override;
37    virtual void generateFinalBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value * remainingBytes) override;
[5755]38    llvm::Value * processPackData(const std::unique_ptr<KernelBuilder> & iBuilder, 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; }
[5464]45    bool hasSignature() const override { return false; }
[5219]46private:
[5440]47    virtual void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) override;
48    virtual void generateFinalBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value * remainingBytes) override;
49    llvm::Value* processPackData(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value* packData) const;
[5219]50};
51
[5216]52}
53#endif
Note: See TracBrowser for help on using the repository browser.