* doc/loop.texi: Document possibility not to perform disambiguation
[official-gcc.git] / gcc / sync-builtins.def
bloba619ecce073ea531f43a932b447c1b3688535554
1 /* This file contains the definitions and documentation for the
2 synchronization builtins used in the GNU compiler.
3 Copyright (C) 2005 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 2, 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 COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA. */
22 /* Before including this file, you should define a macro:
24 DEF_SYNC_BUILTIN (ENUM, NAME, TYPE, ATTRS)
26 See builtins.def for details. */
28 /* Synchronization Primitives. The "_N" version is the one that the user
29 is supposed to be using. It's overloaded, and is resolved to one of the
30 "_1" through "_16" versions, plus some extra casts. */
32 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_N, "__sync_fetch_and_add",
33 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
34 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_1, "__sync_fetch_and_add_1",
35 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
36 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_2, "__sync_fetch_and_add_2",
37 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
38 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_4, "__sync_fetch_and_add_4",
39 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
40 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_8, "__sync_fetch_and_add_8",
41 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
42 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_ADD_16, "__sync_fetch_and_add_16",
43 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
45 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_N, "__sync_fetch_and_sub",
46 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
47 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_1, "__sync_fetch_and_sub_1",
48 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
49 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_2, "__sync_fetch_and_sub_2",
50 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
51 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_4, "__sync_fetch_and_sub_4",
52 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
53 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_8, "__sync_fetch_and_sub_8",
54 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
55 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_SUB_16, "__sync_fetch_and_sub_16",
56 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
58 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_N, "__sync_fetch_and_or",
59 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
60 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_1, "__sync_fetch_and_or_1",
61 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
62 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_2, "__sync_fetch_and_or_2",
63 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
64 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_4, "__sync_fetch_and_or_4",
65 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
66 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_8, "__sync_fetch_and_or_8",
67 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
68 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_OR_16, "__sync_fetch_and_or_16",
69 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
71 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_N, "__sync_fetch_and_and",
72 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
73 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_1, "__sync_fetch_and_and_1",
74 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
75 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_2, "__sync_fetch_and_and_2",
76 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
77 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_4, "__sync_fetch_and_and_4",
78 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
79 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_8, "__sync_fetch_and_and_8",
80 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
81 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_AND_16, "__sync_fetch_and_and_16",
82 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
84 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_N, "__sync_fetch_and_xor",
85 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
86 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_1, "__sync_fetch_and_xor_1",
87 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
88 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_2, "__sync_fetch_and_xor_2",
89 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
90 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_4, "__sync_fetch_and_xor_4",
91 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
92 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_8, "__sync_fetch_and_xor_8",
93 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
94 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_XOR_16, "__sync_fetch_and_xor_16",
95 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
97 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_N, "__sync_fetch_and_nand",
98 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
99 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_1, "__sync_fetch_and_nand_1",
100 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
101 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_2, "__sync_fetch_and_nand_2",
102 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
103 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_4, "__sync_fetch_and_nand_4",
104 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
105 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_8, "__sync_fetch_and_nand_8",
106 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
107 DEF_SYNC_BUILTIN (BUILT_IN_FETCH_AND_NAND_16, "__sync_fetch_and_nand_16",
108 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
110 DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_N, "__sync_add_and_fetch",
111 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
112 DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_1, "__sync_add_and_fetch_1",
113 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
114 DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_2, "__sync_add_and_fetch_2",
115 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
116 DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_4, "__sync_add_and_fetch_4",
117 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
118 DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_8, "__sync_add_and_fetch_8",
119 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
120 DEF_SYNC_BUILTIN (BUILT_IN_ADD_AND_FETCH_16, "__sync_add_and_fetch_16",
121 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
123 DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_N, "__sync_sub_and_fetch",
124 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
125 DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_1, "__sync_sub_and_fetch_1",
126 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
127 DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_2, "__sync_sub_and_fetch_2",
128 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
129 DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_4, "__sync_sub_and_fetch_4",
130 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
131 DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_8, "__sync_sub_and_fetch_8",
132 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
133 DEF_SYNC_BUILTIN (BUILT_IN_SUB_AND_FETCH_16, "__sync_sub_and_fetch_16",
134 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
136 DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_N, "__sync_or_and_fetch",
137 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
138 DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_1, "__sync_or_and_fetch_1",
139 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
140 DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_2, "__sync_or_and_fetch_2",
141 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
142 DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_4, "__sync_or_and_fetch_4",
143 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
144 DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_8, "__sync_or_and_fetch_8",
145 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
146 DEF_SYNC_BUILTIN (BUILT_IN_OR_AND_FETCH_16, "__sync_or_and_fetch_16",
147 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
149 DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_N, "__sync_and_and_fetch",
150 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
151 DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_1, "__sync_and_and_fetch_1",
152 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
153 DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_2, "__sync_and_and_fetch_2",
154 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
155 DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_4, "__sync_and_and_fetch_4",
156 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
157 DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_8, "__sync_and_and_fetch_8",
158 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
159 DEF_SYNC_BUILTIN (BUILT_IN_AND_AND_FETCH_16, "__sync_and_and_fetch_16",
160 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
162 DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_N, "__sync_xor_and_fetch",
163 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
164 DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_1, "__sync_xor_and_fetch_1",
165 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
166 DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_2, "__sync_xor_and_fetch_2",
167 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
168 DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_4, "__sync_xor_and_fetch_4",
169 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
170 DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_8, "__sync_xor_and_fetch_8",
171 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
172 DEF_SYNC_BUILTIN (BUILT_IN_XOR_AND_FETCH_16, "__sync_xor_and_fetch_16",
173 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
175 DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_N, "__sync_nand_and_fetch",
176 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
177 DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_1, "__sync_nand_and_fetch_1",
178 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
179 DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_2, "__sync_nand_and_fetch_2",
180 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
181 DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_4, "__sync_nand_and_fetch_4",
182 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
183 DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_8, "__sync_nand_and_fetch_8",
184 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
185 DEF_SYNC_BUILTIN (BUILT_IN_NAND_AND_FETCH_16, "__sync_nand_and_fetch_16",
186 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
188 DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_N,
189 "__sync_bool_compare_and_swap",
190 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
191 DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_1,
192 "__sync_bool_compare_and_swap_1",
193 BT_FN_BOOL_VPTR_I1_I1, ATTR_NOTHROW_LIST)
194 DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_2,
195 "__sync_bool_compare_and_swap_2",
196 BT_FN_BOOL_VPTR_I2_I2, ATTR_NOTHROW_LIST)
197 DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_4,
198 "__sync_bool_compare_and_swap_4",
199 BT_FN_BOOL_VPTR_I4_I4, ATTR_NOTHROW_LIST)
200 DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_8,
201 "__sync_bool_compare_and_swap_8",
202 BT_FN_BOOL_VPTR_I8_I8, ATTR_NOTHROW_LIST)
203 DEF_SYNC_BUILTIN (BUILT_IN_BOOL_COMPARE_AND_SWAP_16,
204 "__sync_bool_compare_and_swap_16",
205 BT_FN_BOOL_VPTR_I16_I16, ATTR_NOTHROW_LIST)
207 DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_N,
208 "__sync_val_compare_and_swap",
209 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
210 DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_1,
211 "__sync_val_compare_and_swap_1",
212 BT_FN_I1_VPTR_I1_I1, ATTR_NOTHROW_LIST)
213 DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_2,
214 "__sync_val_compare_and_swap_2",
215 BT_FN_I2_VPTR_I2_I2, ATTR_NOTHROW_LIST)
216 DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_4,
217 "__sync_val_compare_and_swap_4",
218 BT_FN_I4_VPTR_I4_I4, ATTR_NOTHROW_LIST)
219 DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_8,
220 "__sync_val_compare_and_swap_8",
221 BT_FN_I8_VPTR_I8_I8, ATTR_NOTHROW_LIST)
222 DEF_SYNC_BUILTIN (BUILT_IN_VAL_COMPARE_AND_SWAP_16,
223 "__sync_val_compare_and_swap_16",
224 BT_FN_I16_VPTR_I16_I16, ATTR_NOTHROW_LIST)
226 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_N, "__sync_lock_test_and_set",
227 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
228 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_1, "__sync_lock_test_and_set_1",
229 BT_FN_I1_VPTR_I1, ATTR_NOTHROW_LIST)
230 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_2, "__sync_lock_test_and_set_2",
231 BT_FN_I2_VPTR_I2, ATTR_NOTHROW_LIST)
232 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_4, "__sync_lock_test_and_set_4",
233 BT_FN_I4_VPTR_I4, ATTR_NOTHROW_LIST)
234 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_8, "__sync_lock_test_and_set_8",
235 BT_FN_I8_VPTR_I8, ATTR_NOTHROW_LIST)
236 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_TEST_AND_SET_16, "__sync_lock_test_and_set_16",
237 BT_FN_I16_VPTR_I16, ATTR_NOTHROW_LIST)
239 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_N, "__sync_lock_release",
240 BT_FN_VOID_VAR, ATTR_NOTHROW_LIST)
241 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_1, "__sync_lock_release_1",
242 BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST)
243 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_2, "__sync_lock_release_2",
244 BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST)
245 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_4, "__sync_lock_release_4",
246 BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST)
247 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_8, "__sync_lock_release_8",
248 BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST)
249 DEF_SYNC_BUILTIN (BUILT_IN_LOCK_RELEASE_16, "__sync_lock_release_16",
250 BT_FN_VOID_VPTR, ATTR_NOTHROW_LIST)
252 DEF_SYNC_BUILTIN (BUILT_IN_SYNCHRONIZE, "__sync_synchronize",
253 BT_FN_VOID, ATTR_NOTHROW_LIST)