1 /* This file contains the definitions and documentation for the
2 Offloading and Multi Processing builtins used in the GNU compiler.
3 Copyright (C
) 2005-2015 Free Software Foundation
, Inc.
5 This file is part of GCC.
7 GCC is free software
; you can redistribute it and
/or modify it under
8 the terms of the GNU General Public License as published by the Free
9 Software Foundation
; either version
3, or (at your option
) any later
12 GCC is distributed in the hope that it will be useful
, but WITHOUT ANY
13 WARRANTY
; without even the implied warranty of MERCHANTABILITY or
14 FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 You should have received a copy of the GNU General Public License
18 along with GCC
; see the file COPYING3. If not see
19 <http
://www.gnu.org
/licenses
/>.
*/
21 /* Before including this file
, you should define a macro
:
23 DEF_GOACC_BUILTIN (ENUM
, NAME
, TYPE, ATTRS
)
24 DEF_GOACC_BUILTIN_COMPILER (ENUM
, NAME
, TYPE, ATTRS
)
25 DEF_GOMP_BUILTIN (ENUM
, NAME
, TYPE, ATTRS
)
27 See builtins.def for details.
*/
29 /* The reason why they aren
't in gcc/builtins.def is that the Fortran front end
30 doesn't source those.
*/
32 DEF_GOACC_BUILTIN (BUILT_IN_ACC_GET_DEVICE_TYPE
, "acc_get_device_type",
33 BT_FN_INT
, ATTR_NOTHROW_LIST
)
34 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_DATA_START
, "GOACC_data_start",
35 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR
, ATTR_NOTHROW_LIST
)
36 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_DATA_END
, "GOACC_data_end",
37 BT_FN_VOID
, ATTR_NOTHROW_LIST
)
38 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_ENTER_EXIT_DATA
, "GOACC_enter_exit_data",
39 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR
,
41 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_PARALLEL
, "GOACC_parallel",
42 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR_INT_INT_INT_INT_INT_VAR
,
44 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_UPDATE
, "GOACC_update",
45 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR_INT_INT_VAR
,
47 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_WAIT
, "GOACC_wait",
48 BT_FN_VOID_INT_INT_VAR
,
50 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_GET_THREAD_NUM
, "GOACC_get_thread_num",
51 BT_FN_INT
, ATTR_CONST_NOTHROW_LEAF_LIST
)
52 DEF_GOACC_BUILTIN (BUILT_IN_GOACC_GET_NUM_THREADS
, "GOACC_get_num_threads",
53 BT_FN_INT
, ATTR_CONST_NOTHROW_LEAF_LIST
)
55 DEF_GOACC_BUILTIN_COMPILER (BUILT_IN_ACC_ON_DEVICE
, "acc_on_device",
56 BT_FN_INT_INT
, ATTR_CONST_NOTHROW_LEAF_LIST
)
58 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_THREAD_NUM
, "omp_get_thread_num",
59 BT_FN_INT
, ATTR_CONST_NOTHROW_LEAF_LIST
)
60 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_NUM_THREADS
, "omp_get_num_threads",
61 BT_FN_INT
, ATTR_CONST_NOTHROW_LEAF_LIST
)
62 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_TEAM_NUM
, "omp_get_team_num",
63 BT_FN_INT
, ATTR_CONST_NOTHROW_LEAF_LIST
)
64 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_NUM_TEAMS
, "omp_get_num_teams",
65 BT_FN_INT
, ATTR_CONST_NOTHROW_LEAF_LIST
)
67 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ATOMIC_START
, "GOMP_atomic_start",
68 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
69 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ATOMIC_END
, "GOMP_atomic_end",
70 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
71 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_BARRIER
, "GOMP_barrier",
72 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
73 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_BARRIER_CANCEL
, "GOMP_barrier_cancel",
74 BT_FN_BOOL
, ATTR_NOTHROW_LEAF_LIST
)
75 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKWAIT
, "GOMP_taskwait",
76 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
77 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKYIELD
, "GOMP_taskyield",
78 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
79 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKGROUP_START
, "GOMP_taskgroup_start",
80 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
81 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKGROUP_END
, "GOMP_taskgroup_end",
82 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
83 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CANCEL
, "GOMP_cancel",
84 BT_FN_BOOL_INT_BOOL
, ATTR_NOTHROW_LEAF_LIST
)
85 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CANCELLATION_POINT
, "GOMP_cancellation_point",
86 BT_FN_BOOL_INT
, ATTR_NOTHROW_LEAF_LIST
)
87 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_START
, "GOMP_critical_start",
88 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
89 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_END
, "GOMP_critical_end",
90 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
91 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_NAME_START
,
92 "GOMP_critical_name_start",
93 BT_FN_VOID_PTRPTR
, ATTR_NOTHROW_LEAF_LIST
)
94 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_NAME_END
,
95 "GOMP_critical_name_end",
96 BT_FN_VOID_PTRPTR
, ATTR_NOTHROW_LEAF_LIST
)
97 /* NOTE
: Do not change the order of BUILT_IN_GOMP_LOOP_
*_START. They
98 are used in index arithmetic with enum omp_clause_schedule_kind
100 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_START
,
101 "GOMP_loop_static_start",
102 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR
,
103 ATTR_NOTHROW_LEAF_LIST
)
104 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DYNAMIC_START
,
105 "GOMP_loop_dynamic_start",
106 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR
,
107 ATTR_NOTHROW_LEAF_LIST
)
108 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_GUIDED_START
,
109 "GOMP_loop_guided_start",
110 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR
,
111 ATTR_NOTHROW_LEAF_LIST
)
112 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_RUNTIME_START
,
113 "GOMP_loop_runtime_start",
114 BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR
,
115 ATTR_NOTHROW_LEAF_LIST
)
116 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START
,
117 "GOMP_loop_ordered_static_start",
118 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR
,
119 ATTR_NOTHROW_LEAF_LIST
)
120 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START
,
121 "GOMP_loop_ordered_dynamic_start",
122 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR
,
123 ATTR_NOTHROW_LEAF_LIST
)
124 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START
,
125 "GOMP_loop_ordered_guided_start",
126 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR
,
127 ATTR_NOTHROW_LEAF_LIST
)
128 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START
,
129 "GOMP_loop_ordered_runtime_start",
130 BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR
,
131 ATTR_NOTHROW_LEAF_LIST
)
132 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_NEXT
, "GOMP_loop_static_next",
133 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
134 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT
, "GOMP_loop_dynamic_next",
135 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
136 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_GUIDED_NEXT
, "GOMP_loop_guided_next",
137 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
138 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_RUNTIME_NEXT
, "GOMP_loop_runtime_next",
139 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
140 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT
,
141 "GOMP_loop_ordered_static_next",
142 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
143 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT
,
144 "GOMP_loop_ordered_dynamic_next",
145 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
146 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT
,
147 "GOMP_loop_ordered_guided_next",
148 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
149 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT
,
150 "GOMP_loop_ordered_runtime_next",
151 BT_FN_BOOL_LONGPTR_LONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
152 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_STATIC_START
,
153 "GOMP_loop_ull_static_start",
154 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
155 ATTR_NOTHROW_LEAF_LIST
)
156 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_START
,
157 "GOMP_loop_ull_dynamic_start",
158 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
159 ATTR_NOTHROW_LEAF_LIST
)
160 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_GUIDED_START
,
161 "GOMP_loop_ull_guided_start",
162 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
163 ATTR_NOTHROW_LEAF_LIST
)
164 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_RUNTIME_START
,
165 "GOMP_loop_ull_runtime_start",
166 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
167 ATTR_NOTHROW_LEAF_LIST
)
168 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_START
,
169 "GOMP_loop_ull_ordered_static_start",
170 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
171 ATTR_NOTHROW_LEAF_LIST
)
172 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_START
,
173 "GOMP_loop_ull_ordered_dynamic_start",
174 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
175 ATTR_NOTHROW_LEAF_LIST
)
176 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_START
,
177 "GOMP_loop_ull_ordered_guided_start",
178 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
179 ATTR_NOTHROW_LEAF_LIST
)
180 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_START
,
181 "GOMP_loop_ull_ordered_runtime_start",
182 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR
,
183 ATTR_NOTHROW_LEAF_LIST
)
184 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_STATIC_NEXT
, "GOMP_loop_ull_static_next",
185 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
186 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_NEXT
, "GOMP_loop_ull_dynamic_next",
187 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
188 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_GUIDED_NEXT
, "GOMP_loop_ull_guided_next",
189 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
190 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_RUNTIME_NEXT
, "GOMP_loop_ull_runtime_next",
191 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
192 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_NEXT
,
193 "GOMP_loop_ull_ordered_static_next",
194 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
195 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_NEXT
,
196 "GOMP_loop_ull_ordered_dynamic_next",
197 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
198 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_NEXT
,
199 "GOMP_loop_ull_ordered_guided_next",
200 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
201 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT
,
202 "GOMP_loop_ull_ordered_runtime_next",
203 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR
, ATTR_NOTHROW_LEAF_LIST
)
204 /* NOTE
: Do not change the order of BUILT_IN_GOMP_PARALLEL_LOOP_
*.
205 They are used in index arithmetic with enum omp_clause_schedule_kind
207 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_STATIC
,
208 "GOMP_parallel_loop_static",
209 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT
,
211 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC
,
212 "GOMP_parallel_loop_dynamic",
213 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT
,
215 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED
,
216 "GOMP_parallel_loop_guided",
217 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT
,
219 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME
,
220 "GOMP_parallel_loop_runtime",
221 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT
,
223 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_END
, "GOMP_loop_end",
224 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
225 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_END_CANCEL
, "GOMP_loop_end_cancel",
226 BT_FN_BOOL
, ATTR_NOTHROW_LEAF_LIST
)
227 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_END_NOWAIT
, "GOMP_loop_end_nowait",
228 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
229 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ORDERED_START
, "GOMP_ordered_start",
230 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
231 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ORDERED_END
, "GOMP_ordered_end",
232 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
233 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL
, "GOMP_parallel",
234 BT_FN_VOID_OMPFN_PTR_UINT_UINT
, ATTR_NOTHROW_LIST
)
235 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASK
, "GOMP_task",
236 BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR
,
238 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_START
, "GOMP_sections_start",
239 BT_FN_UINT_UINT
, ATTR_NOTHROW_LEAF_LIST
)
240 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_NEXT
, "GOMP_sections_next",
241 BT_FN_UINT
, ATTR_NOTHROW_LEAF_LIST
)
242 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_SECTIONS
,
243 "GOMP_parallel_sections",
244 BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT
, ATTR_NOTHROW_LIST
)
245 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_END
, "GOMP_sections_end",
246 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
247 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_END_CANCEL
,
248 "GOMP_sections_end_cancel",
249 BT_FN_BOOL
, ATTR_NOTHROW_LEAF_LIST
)
250 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_END_NOWAIT
,
251 "GOMP_sections_end_nowait",
252 BT_FN_VOID
, ATTR_NOTHROW_LEAF_LIST
)
253 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_START
, "GOMP_single_start",
254 BT_FN_BOOL
, ATTR_NOTHROW_LEAF_LIST
)
255 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_COPY_START
, "GOMP_single_copy_start",
256 BT_FN_PTR
, ATTR_NOTHROW_LEAF_LIST
)
257 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_COPY_END
, "GOMP_single_copy_end",
258 BT_FN_VOID_PTR
, ATTR_NOTHROW_LEAF_LIST
)
259 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET
, "GOMP_target",
260 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR
,
262 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_DATA
, "GOMP_target_data",
263 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR
, ATTR_NOTHROW_LIST
)
264 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_END_DATA
, "GOMP_target_end_data",
265 BT_FN_VOID
, ATTR_NOTHROW_LIST
)
266 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_UPDATE
, "GOMP_target_update",
267 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR
, ATTR_NOTHROW_LIST
)
268 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TEAMS
, "GOMP_teams",
269 BT_FN_VOID_UINT_UINT
, ATTR_NOTHROW_LIST
)