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

Last change on this file since 5239 was 5230, checked in by nmedfort, 3 years ago

Multi-threading support for PabloAST / PabloCompiler?. Requires unique LLVM Context / Module for each thread.

File size: 1000 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 int64_t pint64_tion() 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, const PabloAST * name, Allocator & allocator)
30    : Statement(ClassTypeId::SetIthBit, {var, cast<Integer>(position), cast<Integer>(value)}, cast<String>(name), allocator) {
31
32    }
33};
34
35}
36
37
38#endif // PE_SETITHBIT_H
Note: See TracBrowser for help on using the repository browser.