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

Last change on this file since 5350 was 5347, checked in by nmedfort, 3 years ago

Added enable asserts (-ea) command line flag + restructured BlockOrientedKernels? to allow for inlined code.

File size: 1.5 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    bool hasVariableLength() const {
58        return variableLength;
59    }
60
61   
62protected:
63
64    SummaryType             summaryType;
65    bool                    variableLength;
66
67};
68
69
70}
71
72
73#endif // CARRY_DATA_H
Note: See TracBrowser for help on using the repository browser.