source: icGREP/icgrep-devel/icgrep/pablo/carry_data.h @ 5297

Last change on this file since 5297 was 5267, checked in by nmedfort, 2 years ago

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

File size: 1.4 KB
Line 
1/*
2 *  Copyright (c) 2015 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 CARRY_DATA_H
8#define CARRY_DATA_H
9
10/*
11 * Carry Data system.
12 *
13 * Each PabloBlock (Main, If, While) has a contiguous data area for carry information.
14 * The data area may be at a fixed or variable base offset from the base of the
15 * main function carry data area.
16 * The data area for each block consists of contiguous space for the local carries and
17 * advances of the block plus the areas of any ifs/whiles nested within the block.
18
19*/
20
21namespace pablo {
22
23class CarryData {
24    friend class CarryManager;
25public:
26
27    enum SummaryType : int {
28        NoSummary
29        , ImplicitSummary
30        , BorrowedSummary
31        , ExplicitSummary
32    };
33
34    CarryData()
35    : summaryType(NoSummary)   
36    , variableLength(false)
37    {
38
39    }
40             
41    bool hasSummary() const {
42        return (summaryType != NoSummary);
43    }
44   
45    bool hasImplicitSummary() const {
46        return (summaryType == ImplicitSummary);
47    }
48
49    bool hasBorrowedSummary() const {
50        return (summaryType == BorrowedSummary);
51    }
52
53    bool hasExplicitSummary() const {
54        return (summaryType == ExplicitSummary);
55    }
56
57   
58protected:
59
60    SummaryType     summaryType;
61    bool            variableLength;
62
63};
64
65
66}
67
68
69#endif // CARRY_DATA_H
Note: See TracBrowser for help on using the repository browser.