source: icGREP/icgrep-devel/icgrep/pablo/pe_scanthru.h @ 4716

Last change on this file since 4716 was 4716, checked in by cameron, 4 years ago

Mod64 approximation mode

File size: 1.3 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 PS_SCANTHRU_H
8#define PS_SCANTHRU_H
9
10#include <pablo/pabloAST.h>
11
12namespace pablo {
13
14class ScanThru : public Statement {
15    friend class PabloBlock;
16public:
17    static inline bool classof(const PabloAST * e) {
18        return e->getClassTypeId() == ClassTypeId::ScanThru;
19    }
20    static inline bool classof(const void *) {
21        return false;
22    }
23    virtual ~ScanThru() {
24    }
25    PabloAST * getScanFrom() const {
26        return getOperand(0);
27    }
28    PabloAST * getScanThru() const {
29        return getOperand(1);
30    }
31    inline void setLocalCarryIndex(const unsigned idx) {
32        localCarryIndex = idx;
33    }
34    inline unsigned getLocalCarryIndex() const {
35        return localCarryIndex;
36    }
37    inline void setMod64() {
38        isMod64approx = true;
39    }
40    inline bool isMod64() const {
41        return isMod64approx;
42    }
43protected:
44    ScanThru(PabloAST * from, PabloAST * thru, String * name)
45    : Statement(ClassTypeId::ScanThru, {from, thru}, name)
46    , isMod64approx(false)
47    {
48
49    }
50private:
51    bool isMod64approx;
52    unsigned localCarryIndex;
53};
54
55}
56
57#endif // PS_SCANTHRU_H
58
59
60
Note: See TracBrowser for help on using the repository browser.