1 /*
2  * Copyright (c) 2018, NVIDIA CORPORATION.  All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17 
18 #ifndef EXPATOMICS_H_
19 #define EXPATOMICS_H_
20 
21 #include "gbldefs.h"
22 #include "symtab.h"
23 #include "expand.h"
24 #include "ili.h"
25 
26 /**
27    \brief ...
28  */
29 bool exp_end_atomic(int store, int curilm);
30 
31 /**
32    \brief ...
33  */
34 ILI_OP get_atomic_update_opcode(int current_ili);
35 
36 /**
37    \brief ...
38  */
39 int create_atomic_capture_seq(int update_ili, int read_ili, int capture_first);
40 
41 /**
42    \brief ...
43  */
44 int create_atomic_read_seq(int store_ili);
45 
46 /**
47    \brief ...
48  */
49 int create_atomic_seq(int store_ili);
50 
51 /**
52    \brief ...
53  */
54 int create_atomic_write_seq(int store_ili);
55 
56 /**
57    \brief ...
58  */
59 int exp_mp_atomic_read(ILM *ilmp);
60 
61 /**
62    \brief ...
63  */
64 int get_atomic_capture_created(void);
65 
66 /**
67    \brief ...
68  */
69 int get_atomic_function_ex(ILI_OP opcode);
70 
71 /**
72    \brief ...
73  */
74 int get_atomic_function(ILI_OP opcode);
75 
76 /**
77    \brief ...
78  */
79 int get_atomic_read_opcode(int current_ili);
80 
81 /**
82    \brief ...
83  */
84 int get_atomic_store_created(void);
85 
86 /**
87    \brief ...
88  */
89 int get_atomic_write_opcode(int current_ili);
90 
91 /**
92    \brief ...
93  */
94 int get_capture_read_ili(void);
95 
96 /**
97    \brief ...
98  */
99 int get_capture_update_ili(void);
100 
101 /**
102    \brief ...
103  */
104 int get_is_in_atomic_capture(void);
105 
106 /**
107    \brief ...
108  */
109 int get_is_in_atomic_read(void);
110 
111 /**
112    \brief ...
113  */
114 int get_is_in_atomic(void);
115 
116 /**
117    \brief ...
118  */
119 int get_is_in_atomic_write(void);
120 
121 /**
122    \brief ...
123  */
124 void exp_mp_atomic_capture(ILM *ilmp);
125 
126 /**
127    \brief ...
128  */
129 void exp_mp_atomic_update(ILM *ilmp);
130 
131 /**
132    \brief ...
133  */
134 void exp_mp_atomic_write(ILM *ilmp);
135 
136 /**
137    \brief ...
138  */
139 void set_atomic_capture_created(int x);
140 
141 /**
142    \brief ...
143  */
144 void set_atomic_store_created(int x);
145 
146 /**
147    \brief ...
148  */
149 void set_capture_read_ili(int x);
150 
151 /**
152    \brief ...
153  */
154 void set_capture_update_ili(int x);
155 
156 /**
157    \brief ...
158  */
159 void set_is_in_atomic_capture(int x);
160 
161 /**
162    \brief ...
163  */
164 void set_is_in_atomic(int x);
165 
166 /**
167    \brief ...
168  */
169 void set_is_in_atomic_read(int x);
170 
171 /**
172    \brief ...
173  */
174 void set_is_in_atomic_write(int x);
175 
176 #endif
177