source: icGREP/icgrep-devel/icgrep/pablo/pe_advance.h @ 4410

Last change on this file since 4410 was 4410, checked in by nmedfort, 5 years ago

Changes to support 3-operand form for all instructions. CSE disabled but partially redundant now.

File size: 1.4 KB
RevLine 
[3850]1/*
2 *  Copyright (c) 2014 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 *  icgrep is a trademark of International Characters.
5 */
6
7#ifndef PE_ADVANCE_H
8#define PE_ADVANCE_H
9
[4244]10#include "pabloAST.h"
[4410]11#include <pablo/symbol_generator.h>
[3850]12
[4199]13namespace pablo {
14
[4410]15class Advance : public Statement {
[4227]16    friend class PabloBlock;
[3850]17public:
[4244]18    static inline bool classof(const PabloAST * e) {
[4200]19        return e->getClassTypeId() == ClassTypeId::Advance;
[4199]20    }
[4200]21    static inline bool classof(const void *) {
22        return false;
23    }
[4199]24    virtual ~Advance() {
25    }
[4280]26    virtual PabloAST * getOperand(const unsigned index) const {
27        assert (index == 0);
28        return mExpr;
29    }
30    virtual void setOperand(const unsigned index, PabloAST * value) {
31        assert (index == 0);
32        mExpr = value;
33    }
34    virtual unsigned getNumOperands() const {
35        return 1;
36    }
[4244]37    inline PabloAST * getExpr() const {
[4199]38        return mExpr;
39    }
[4260]40    inline int getAdvanceAmount() const {
41        return mShiftAmount;
42    }
[4200]43protected:
[4410]44    Advance(PabloAST * expr, int shiftAmount, SymbolGenerator * sg, PabloBlock * parent)
45    : Statement(ClassTypeId::Advance, sg->make("advance"), parent)
[4260]46    , mExpr(expr)
47        , mShiftAmount(shiftAmount) {
[4404]48        expr->addUser(this);
[4200]49    }
[3850]50private:
[4280]51    PabloAST * mExpr;
[4260]52        int const mShiftAmount;
[3850]53};
54
[4199]55}
56
[3850]57#endif // PE_ADVANCE_H
58
59
60
Note: See TracBrowser for help on using the repository browser.