source: icGREP/icgrep-devel/icgrep/pablo/pe_setithbit.h @ 4878

Last change on this file since 4878 was 4699, checked in by nmedfort, 4 years ago

Temporary check in.

File size: 949 bytes
Line 
1#ifndef PE_SETITHBIT_H
2#define PE_SETITHBIT_H
3
4#include <pablo/pabloAST.h>
5#include <pablo/pe_integer.h>
6
7namespace pablo {
8
9class SetIthBit : public Statement {
10    friend class PabloBlock;
11public:
12    static inline bool classof(const PabloAST * e) {
13        return e->getClassTypeId() == ClassTypeId::SetIthBit;
14    }
15    static inline bool classof(const void *) {
16        return false;
17    }
18    inline PabloAST * variable() const {
19        return getOperand(0);
20    }
21    inline Integer::Type position() const {
22        return cast<Integer>(getOperand(1))->value();
23    }
24    inline bool value() const {
25        return cast<Integer>(getOperand(2))->value() == 1;
26    }
27    virtual ~SetIthBit() {}
28protected:
29    explicit SetIthBit(PabloAST * var, PabloAST * position, PabloAST * value, PabloAST * name)
30    : Statement(ClassTypeId::SetIthBit, {var, cast<Integer>(position), cast<Integer>(value)}, name) {
31
32    }
33};
34
35}
36
37
38#endif // PE_SETITHBIT_H
Note: See TracBrowser for help on using the repository browser.