source: icGREP/icgrep-devel/icgrep/pablo/pe_not.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.2 KB
Line 
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_NOT_H
8#define PE_NOT_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class PabloBlock;
15
16class Not : public Statement {
17    friend struct OptimizeNot;
18    friend class PabloBlock;
19public:
20    static inline bool classof(const PabloAST * e) {
21        return e->getClassTypeId() == ClassTypeId::Not;
22    }
23    static inline bool classof(const void *) {
24        return false;
25    }
26    virtual PabloAST * getOperand(const unsigned index) const {
27        assert (index == 0);
28        return mExpr;
29    }
30    virtual unsigned getNumOperands() const {
31        return 1;
32    }
33    virtual void setOperand(const unsigned index, PabloAST * value) {
34        assert (index == 0);
35        mExpr = value;
36    }
37    virtual ~Not() {
38    }
39    PabloAST * getExpr() const {
40        return mExpr;
41    }
42protected:
43    Not(PabloAST * expr, PabloBlock * parent);
44private:
45    PabloAST * mExpr;
46};
47
48struct OptimizeNot {
49    PabloAST * operator()(PabloAST * expr, PabloBlock * pb);
50};
51
52}
53
54#endif // PE_NOT_H
55
56
Note: See TracBrowser for help on using the repository browser.