Run tabbing pass
[c11tester.git] / include / predicatetypes.h
1 /**
2  * @file predicatetypes.h
3  * @brief Define common predicate expression types
4  */
5
6 #ifndef __PREDICATE_TYPES_H__
7 #define __PREDICATE_TYPES_H__
8
9 typedef enum predicate_token {
10         NOPREDICATE, EQUALITY, NULLITY
11 } token_t;
12
13 typedef enum predicate_sleep_result {
14         SLEEP_FAIL_TYPE1, SLEEP_FAIL_TYPE2, SLEEP_FAIL_TYPE3,
15         SLEEP_SUCCESS
16 } sleep_result_t;
17
18 /* If token is EQUALITY, then the predicate asserts whether
19  * this load should read the same value as the last value
20  * read at memory location specified in predicate_expr.
21  */
22 struct pred_expr {
23         pred_expr(token_t token, FuncInst * inst, bool value) :
24                 token(token),
25                 func_inst(inst),
26                 value(value)
27         {}
28
29         token_t token;
30         FuncInst * func_inst;
31         bool value;
32
33         MEMALLOC
34 };
35
36 /* Used by FuncNode to generate Predicates */
37 struct half_pred_expr {
38         half_pred_expr(token_t token, FuncInst * inst) :
39                 token(token),
40                 func_inst(inst)
41         {}
42
43         token_t token;
44         FuncInst * func_inst;
45
46         SNAPSHOTALLOC
47 };
48
49 struct concrete_pred_expr {
50         concrete_pred_expr(token_t token, uint64_t value, bool equality) :
51                 token(token),
52                 value(value),
53                 equality(equality)
54         {}
55
56         token_t token;
57         uint64_t value;
58         bool equality;
59
60         SNAPSHOTALLOC
61 };
62
63 #endif  /* __PREDICATE_TYPES_H__ */
64