PR c/64423
[official-gcc.git] / gcc / omp-builtins.def
blob08b825c843d5fff0d0631a581f8091c335587bd6
1 /* This file contains the definitions and documentation for the
2 OpenMP builtins used in the GNU compiler.
3 Copyright (C) 2005-2014 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
10 version.
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
15 for more details.
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_GOMP_BUILTIN (ENUM, NAME, TYPE, ATTRS)
25 See builtins.def for details. */
27 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_THREAD_NUM, "omp_get_thread_num",
28 BT_FN_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
29 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_NUM_THREADS, "omp_get_num_threads",
30 BT_FN_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
31 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_TEAM_NUM, "omp_get_team_num",
32 BT_FN_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
33 DEF_GOMP_BUILTIN (BUILT_IN_OMP_GET_NUM_TEAMS, "omp_get_num_teams",
34 BT_FN_INT, ATTR_CONST_NOTHROW_LEAF_LIST)
36 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ATOMIC_START, "GOMP_atomic_start",
37 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
38 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ATOMIC_END, "GOMP_atomic_end",
39 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
40 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_BARRIER, "GOMP_barrier",
41 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
42 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_BARRIER_CANCEL, "GOMP_barrier_cancel",
43 BT_FN_BOOL, ATTR_NOTHROW_LEAF_LIST)
44 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKWAIT, "GOMP_taskwait",
45 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
46 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKYIELD, "GOMP_taskyield",
47 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
48 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKGROUP_START, "GOMP_taskgroup_start",
49 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
50 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASKGROUP_END, "GOMP_taskgroup_end",
51 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
52 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CANCEL, "GOMP_cancel",
53 BT_FN_BOOL_INT_BOOL, ATTR_NOTHROW_LEAF_LIST)
54 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CANCELLATION_POINT, "GOMP_cancellation_point",
55 BT_FN_BOOL_INT, ATTR_NOTHROW_LEAF_LIST)
56 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_START, "GOMP_critical_start",
57 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
58 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_END, "GOMP_critical_end",
59 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
60 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_NAME_START,
61 "GOMP_critical_name_start",
62 BT_FN_VOID_PTRPTR, ATTR_NOTHROW_LEAF_LIST)
63 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_CRITICAL_NAME_END,
64 "GOMP_critical_name_end",
65 BT_FN_VOID_PTRPTR, ATTR_NOTHROW_LEAF_LIST)
66 /* NOTE: Do not change the order of BUILT_IN_GOMP_LOOP_*_START. They
67 are used in index arithmetic with enum omp_clause_schedule_kind
68 in omp-low.c. */
69 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_START,
70 "GOMP_loop_static_start",
71 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
72 ATTR_NOTHROW_LEAF_LIST)
73 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DYNAMIC_START,
74 "GOMP_loop_dynamic_start",
75 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
76 ATTR_NOTHROW_LEAF_LIST)
77 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_GUIDED_START,
78 "GOMP_loop_guided_start",
79 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
80 ATTR_NOTHROW_LEAF_LIST)
81 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_RUNTIME_START,
82 "GOMP_loop_runtime_start",
83 BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
84 ATTR_NOTHROW_LEAF_LIST)
85 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START,
86 "GOMP_loop_ordered_static_start",
87 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
88 ATTR_NOTHROW_LEAF_LIST)
89 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START,
90 "GOMP_loop_ordered_dynamic_start",
91 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
92 ATTR_NOTHROW_LEAF_LIST)
93 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START,
94 "GOMP_loop_ordered_guided_start",
95 BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
96 ATTR_NOTHROW_LEAF_LIST)
97 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START,
98 "GOMP_loop_ordered_runtime_start",
99 BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
100 ATTR_NOTHROW_LEAF_LIST)
101 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_STATIC_NEXT, "GOMP_loop_static_next",
102 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
103 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT, "GOMP_loop_dynamic_next",
104 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
105 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_GUIDED_NEXT, "GOMP_loop_guided_next",
106 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
107 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_RUNTIME_NEXT, "GOMP_loop_runtime_next",
108 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
109 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT,
110 "GOMP_loop_ordered_static_next",
111 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
112 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT,
113 "GOMP_loop_ordered_dynamic_next",
114 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
115 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT,
116 "GOMP_loop_ordered_guided_next",
117 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
118 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT,
119 "GOMP_loop_ordered_runtime_next",
120 BT_FN_BOOL_LONGPTR_LONGPTR, ATTR_NOTHROW_LEAF_LIST)
121 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_STATIC_START,
122 "GOMP_loop_ull_static_start",
123 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
124 ATTR_NOTHROW_LEAF_LIST)
125 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_START,
126 "GOMP_loop_ull_dynamic_start",
127 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
128 ATTR_NOTHROW_LEAF_LIST)
129 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_GUIDED_START,
130 "GOMP_loop_ull_guided_start",
131 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
132 ATTR_NOTHROW_LEAF_LIST)
133 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_RUNTIME_START,
134 "GOMP_loop_ull_runtime_start",
135 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
136 ATTR_NOTHROW_LEAF_LIST)
137 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_START,
138 "GOMP_loop_ull_ordered_static_start",
139 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
140 ATTR_NOTHROW_LEAF_LIST)
141 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_START,
142 "GOMP_loop_ull_ordered_dynamic_start",
143 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
144 ATTR_NOTHROW_LEAF_LIST)
145 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_START,
146 "GOMP_loop_ull_ordered_guided_start",
147 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULL_ULLPTR_ULLPTR,
148 ATTR_NOTHROW_LEAF_LIST)
149 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_START,
150 "GOMP_loop_ull_ordered_runtime_start",
151 BT_FN_BOOL_BOOL_ULL_ULL_ULL_ULLPTR_ULLPTR,
152 ATTR_NOTHROW_LEAF_LIST)
153 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_STATIC_NEXT, "GOMP_loop_ull_static_next",
154 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
155 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_DYNAMIC_NEXT, "GOMP_loop_ull_dynamic_next",
156 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
157 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_GUIDED_NEXT, "GOMP_loop_ull_guided_next",
158 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
159 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_RUNTIME_NEXT, "GOMP_loop_ull_runtime_next",
160 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
161 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_STATIC_NEXT,
162 "GOMP_loop_ull_ordered_static_next",
163 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
164 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_DYNAMIC_NEXT,
165 "GOMP_loop_ull_ordered_dynamic_next",
166 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
167 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_GUIDED_NEXT,
168 "GOMP_loop_ull_ordered_guided_next",
169 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
170 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT,
171 "GOMP_loop_ull_ordered_runtime_next",
172 BT_FN_BOOL_ULONGLONGPTR_ULONGLONGPTR, ATTR_NOTHROW_LEAF_LIST)
173 /* NOTE: Do not change the order of BUILT_IN_GOMP_PARALLEL_LOOP_*.
174 They are used in index arithmetic with enum omp_clause_schedule_kind
175 in omp-low.c. */
176 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_STATIC,
177 "GOMP_parallel_loop_static",
178 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
179 ATTR_NOTHROW_LIST)
180 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC,
181 "GOMP_parallel_loop_dynamic",
182 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
183 ATTR_NOTHROW_LIST)
184 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED,
185 "GOMP_parallel_loop_guided",
186 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG_UINT,
187 ATTR_NOTHROW_LIST)
188 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME,
189 "GOMP_parallel_loop_runtime",
190 BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_UINT,
191 ATTR_NOTHROW_LIST)
192 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_END, "GOMP_loop_end",
193 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
194 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_END_CANCEL, "GOMP_loop_end_cancel",
195 BT_FN_BOOL, ATTR_NOTHROW_LEAF_LIST)
196 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_LOOP_END_NOWAIT, "GOMP_loop_end_nowait",
197 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
198 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ORDERED_START, "GOMP_ordered_start",
199 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
200 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_ORDERED_END, "GOMP_ordered_end",
201 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
202 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL, "GOMP_parallel",
203 BT_FN_VOID_OMPFN_PTR_UINT_UINT, ATTR_NOTHROW_LIST)
204 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TASK, "GOMP_task",
205 BT_FN_VOID_OMPFN_PTR_OMPCPYFN_LONG_LONG_BOOL_UINT_PTR,
206 ATTR_NOTHROW_LIST)
207 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_START, "GOMP_sections_start",
208 BT_FN_UINT_UINT, ATTR_NOTHROW_LEAF_LIST)
209 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_NEXT, "GOMP_sections_next",
210 BT_FN_UINT, ATTR_NOTHROW_LEAF_LIST)
211 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_PARALLEL_SECTIONS,
212 "GOMP_parallel_sections",
213 BT_FN_VOID_OMPFN_PTR_UINT_UINT_UINT, ATTR_NOTHROW_LIST)
214 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_END, "GOMP_sections_end",
215 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
216 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_END_CANCEL,
217 "GOMP_sections_end_cancel",
218 BT_FN_BOOL, ATTR_NOTHROW_LEAF_LIST)
219 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SECTIONS_END_NOWAIT,
220 "GOMP_sections_end_nowait",
221 BT_FN_VOID, ATTR_NOTHROW_LEAF_LIST)
222 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_START, "GOMP_single_start",
223 BT_FN_BOOL, ATTR_NOTHROW_LEAF_LIST)
224 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_COPY_START, "GOMP_single_copy_start",
225 BT_FN_PTR, ATTR_NOTHROW_LEAF_LIST)
226 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_SINGLE_COPY_END, "GOMP_single_copy_end",
227 BT_FN_VOID_PTR, ATTR_NOTHROW_LEAF_LIST)
228 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET, "GOMP_target",
229 BT_FN_VOID_INT_OMPFN_PTR_SIZE_PTR_PTR_PTR,
230 ATTR_NOTHROW_LIST)
231 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_DATA, "GOMP_target_data",
232 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, ATTR_NOTHROW_LIST)
233 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_END_DATA, "GOMP_target_end_data",
234 BT_FN_VOID, ATTR_NOTHROW_LIST)
235 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TARGET_UPDATE, "GOMP_target_update",
236 BT_FN_VOID_INT_PTR_SIZE_PTR_PTR_PTR, ATTR_NOTHROW_LIST)
237 DEF_GOMP_BUILTIN (BUILT_IN_GOMP_TEAMS, "GOMP_teams",
238 BT_FN_VOID_UINT_UINT, ATTR_NOTHROW_LIST)