Changes in src/tests/builtins/sync.c [1f81d61:13073be]
- File:
-
- 1 edited
-
src/tests/builtins/sync.c (modified) (33 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/tests/builtins/sync.c
r1f81d61 r13073be 8 8 volatile int * vp4 = 0; int * rp4 = 0; int v4 = 0; 9 9 volatile long long int * vp8 = 0; long long int * rp8 = 0; long long int v8 = 0; 10 #if defined(__SIZEOF_INT128__)11 10 volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0; 12 #endif13 11 14 12 { char ret; ret = __sync_fetch_and_add(vp1, v1); } … … 20 18 { long long int ret; ret = __sync_fetch_and_add(vp8, v8); } 21 19 { long long int ret; ret = __sync_fetch_and_add_8(vp8, v8); } 22 #if defined(__SIZEOF_INT128__)23 20 { __int128 ret; ret = __sync_fetch_and_add(vp16, v16); } 24 21 { __int128 ret; ret = __sync_fetch_and_add_16(vp16, v16); } 25 #endif26 22 27 23 { char ret; ret = __sync_fetch_and_sub(vp1, v1); } … … 33 29 { long long int ret; ret = __sync_fetch_and_sub(vp8, v8); } 34 30 { long long int ret; ret = __sync_fetch_and_sub_8(vp8, v8); } 35 #if defined(__SIZEOF_INT128__)36 31 { __int128 ret; ret = __sync_fetch_and_sub(vp16, v16); } 37 32 { __int128 ret; ret = __sync_fetch_and_sub_16(vp16, v16); } 38 #endif39 33 40 34 { char ret; ret = __sync_fetch_and_or(vp1, v1); } … … 46 40 { long long int ret; ret = __sync_fetch_and_or(vp8, v8); } 47 41 { long long int ret; ret = __sync_fetch_and_or_8(vp8, v8); } 48 #if defined(__SIZEOF_INT128__)49 42 { __int128 ret; ret = __sync_fetch_and_or(vp16, v16); } 50 43 { __int128 ret; ret = __sync_fetch_and_or_16(vp16, v16); } 51 #endif52 44 53 45 { char ret; ret = __sync_fetch_and_and(vp1, v1); } … … 59 51 { long long int ret; ret = __sync_fetch_and_and(vp8, v8); } 60 52 { long long int ret; ret = __sync_fetch_and_and_8(vp8, v8); } 61 #if defined(__SIZEOF_INT128__)62 53 { __int128 ret; ret = __sync_fetch_and_and(vp16, v16); } 63 54 { __int128 ret; ret = __sync_fetch_and_and_16(vp16, v16); } 64 #endif65 55 66 56 { char ret; ret = __sync_fetch_and_xor(vp1, v1); } … … 72 62 { long long int ret; ret = __sync_fetch_and_xor(vp8, v8); } 73 63 { long long int ret; ret = __sync_fetch_and_xor_8(vp8, v8); } 74 #if defined(__SIZEOF_INT128__)75 64 { __int128 ret; ret = __sync_fetch_and_xor(vp16, v16); } 76 65 { __int128 ret; ret = __sync_fetch_and_xor_16(vp16, v16); } 77 #endif78 66 79 67 { char ret; ret = __sync_fetch_and_nand(vp1, v1); } … … 85 73 { long long int ret; ret = __sync_fetch_and_nand(vp8, v8); } 86 74 { long long int ret; ret = __sync_fetch_and_nand_8(vp8, v8); } 87 #if defined(__SIZEOF_INT128__)88 75 { __int128 ret; ret = __sync_fetch_and_nand(vp16, v16); } 89 76 { __int128 ret; ret = __sync_fetch_and_nand_16(vp16, v16); } 90 #endif91 77 92 78 { char ret; ret = __sync_add_and_fetch(vp1, v1); } … … 98 84 { long long int ret; ret = __sync_add_and_fetch(vp8, v8); } 99 85 { long long int ret; ret = __sync_add_and_fetch_8(vp8, v8); } 100 #if defined(__SIZEOF_INT128__)101 86 { __int128 ret; ret = __sync_add_and_fetch(vp16, v16); } 102 87 { __int128 ret; ret = __sync_add_and_fetch_16(vp16, v16); } 103 #endif104 88 105 89 { char ret; ret = __sync_sub_and_fetch(vp1, v1); } … … 111 95 { long long int ret; ret = __sync_sub_and_fetch(vp8, v8); } 112 96 { long long int ret; ret = __sync_sub_and_fetch_8(vp8, v8); } 113 #if defined(__SIZEOF_INT128__)114 97 { __int128 ret; ret = __sync_sub_and_fetch(vp16, v16); } 115 98 { __int128 ret; ret = __sync_sub_and_fetch_16(vp16, v16); } 116 #endif117 99 118 100 { char ret; ret = __sync_or_and_fetch(vp1, v1); } … … 124 106 { long long int ret; ret = __sync_or_and_fetch(vp8, v8); } 125 107 { long long int ret; ret = __sync_or_and_fetch_8(vp8, v8); } 126 #if defined(__SIZEOF_INT128__)127 108 { __int128 ret; ret = __sync_or_and_fetch(vp16, v16); } 128 109 { __int128 ret; ret = __sync_or_and_fetch_16(vp16, v16); } 129 #endif130 110 131 111 { char ret; ret = __sync_and_and_fetch(vp1, v1); } … … 137 117 { long long int ret; ret = __sync_and_and_fetch(vp8, v8); } 138 118 { long long int ret; ret = __sync_and_and_fetch_8(vp8, v8); } 139 #if defined(__SIZEOF_INT128__)140 119 { __int128 ret; ret = __sync_and_and_fetch(vp16, v16); } 141 120 { __int128 ret; ret = __sync_and_and_fetch_16(vp16, v16); } 142 #endif143 121 144 122 { char ret; ret = __sync_xor_and_fetch(vp1, v1); } … … 150 128 { long long int ret; ret = __sync_xor_and_fetch(vp8, v8); } 151 129 { long long int ret; ret = __sync_xor_and_fetch_8(vp8, v8); } 152 #if defined(__SIZEOF_INT128__)153 130 { __int128 ret; ret = __sync_xor_and_fetch(vp16, v16); } 154 131 { __int128 ret; ret = __sync_xor_and_fetch_16(vp16, v16); } 155 #endif156 132 157 133 { char ret; ret = __sync_nand_and_fetch(vp1, v1); } … … 163 139 { long long int ret; ret = __sync_nand_and_fetch(vp8, v8); } 164 140 { long long int ret; ret = __sync_nand_and_fetch_8(vp8, v8); } 165 #if defined(__SIZEOF_INT128__)166 141 { __int128 ret; ret = __sync_nand_and_fetch(vp16, v16); } 167 142 { __int128 ret; ret = __sync_nand_and_fetch_16(vp16, v16); } 168 #endif169 143 170 144 { _Bool ret; ret = __sync_bool_compare_and_swap(vp1, v1, v1); } … … 176 150 { _Bool ret; ret = __sync_bool_compare_and_swap(vp8, v8, v8); } 177 151 { _Bool ret; ret = __sync_bool_compare_and_swap_8(vp8, v8, v8); } 178 #if defined(__SIZEOF_INT128__)179 152 { _Bool ret; ret = __sync_bool_compare_and_swap(vp16, v16, v16); } 180 153 { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); } 181 #endif182 154 183 155 { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); } … … 189 161 { long long int ret; ret = __sync_val_compare_and_swap(vp8, v8, v8); } 190 162 { long long int ret; ret = __sync_val_compare_and_swap_8(vp8, v8, v8); } 191 #if defined(__SIZEOF_INT128__)192 163 { __int128 ret; ret = __sync_val_compare_and_swap(vp16, v16, v16); } 193 164 { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); } 194 #endif195 165 196 166 { char ret; ret = __sync_lock_test_and_set(vp1, v1); } … … 202 172 { long long int ret; ret = __sync_lock_test_and_set(vp8, v8); } 203 173 { long long int ret; ret = __sync_lock_test_and_set_8(vp8, v8); } 204 #if defined(__SIZEOF_INT128__)205 174 { __int128 ret; ret = __sync_lock_test_and_set(vp16, v16); } 206 175 { __int128 ret; ret = __sync_lock_test_and_set_16(vp16, v16); } 207 #endif208 176 209 177 { __sync_lock_release(vp1); } … … 215 183 { __sync_lock_release(vp8); } 216 184 { __sync_lock_release_8(vp8); } 217 #if defined(__SIZEOF_INT128__)218 185 { __sync_lock_release(vp16); } 219 186 { __sync_lock_release_16(vp16); } 220 #endif221 187 222 188 { __sync_synchronize(); } … … 242 208 { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); } 243 209 { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); } 244 #if defined(__SIZEOF_INT128__)245 210 { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); } 246 211 { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); } 247 212 { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); } 248 #endif249 213 250 214 { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); } … … 260 224 { long long int ret; ret = __atomic_load_8(vp8, __ATOMIC_SEQ_CST); } 261 225 { long long int ret; __atomic_load(vp8, &ret, __ATOMIC_SEQ_CST); } 262 #if defined(__SIZEOF_INT128__)263 226 { __int128 ret; ret = __atomic_load_n(vp16, __ATOMIC_SEQ_CST); } 264 227 { __int128 ret; ret = __atomic_load_16(vp16, __ATOMIC_SEQ_CST); } 265 228 { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); } 266 #endif267 229 268 230 { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } … … 278 240 { _Bool ret; ret = __atomic_compare_exchange_8(vp8, rp8, v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 279 241 { _Bool ret; ret = __atomic_compare_exchange(vp8, rp8, &v8, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 280 #if defined(__SIZEOF_INT128__)281 242 { _Bool ret; ret = __atomic_compare_exchange_n(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 282 243 { _Bool ret; ret = __atomic_compare_exchange_16(vp16, rp16, v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 283 244 { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 284 #endif285 245 286 246 { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); } … … 296 256 { __atomic_store_8(vp8, v8, __ATOMIC_SEQ_CST); } 297 257 { __atomic_store(vp8, &v8, __ATOMIC_SEQ_CST); } 298 #if defined(__SIZEOF_INT128__)299 258 { __atomic_store_n(vp16, v16, __ATOMIC_SEQ_CST); } 300 259 { __atomic_store_16(vp16, v16, __ATOMIC_SEQ_CST); } 301 260 { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); } 302 #endif303 261 304 262 { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 310 268 { long long int ret; ret = __atomic_add_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 311 269 { long long int ret; ret = __atomic_add_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 312 #if defined(__SIZEOF_INT128__)313 270 { __int128 ret; ret = __atomic_add_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 314 271 { __int128 ret; ret = __atomic_add_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 315 #endif316 272 317 273 { char ret; ret = __atomic_sub_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 323 279 { long long int ret; ret = __atomic_sub_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 324 280 { long long int ret; ret = __atomic_sub_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 325 #if defined(__SIZEOF_INT128__)326 281 { __int128 ret; ret = __atomic_sub_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 327 282 { __int128 ret; ret = __atomic_sub_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 328 #endif329 283 330 284 { char ret; ret = __atomic_and_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 336 290 { long long int ret; ret = __atomic_and_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 337 291 { long long int ret; ret = __atomic_and_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 338 #if defined(__SIZEOF_INT128__)339 292 { __int128 ret; ret = __atomic_and_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 340 293 { __int128 ret; ret = __atomic_and_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 341 #endif342 294 343 295 { char ret; ret = __atomic_nand_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 349 301 { long long int ret; ret = __atomic_nand_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 350 302 { long long int ret; ret = __atomic_nand_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 351 #if defined(__SIZEOF_INT128__)352 303 { __int128 ret; ret = __atomic_nand_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 353 304 { __int128 ret; ret = __atomic_nand_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 354 #endif355 305 356 306 { char ret; ret = __atomic_xor_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 362 312 { long long int ret; ret = __atomic_xor_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 363 313 { long long int ret; ret = __atomic_xor_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 364 #if defined(__SIZEOF_INT128__)365 314 { __int128 ret; ret = __atomic_xor_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 366 315 { __int128 ret; ret = __atomic_xor_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 367 #endif368 316 369 317 { char ret; ret = __atomic_or_fetch(vp1, v1, __ATOMIC_SEQ_CST); } … … 375 323 { long long int ret; ret = __atomic_or_fetch(vp8, v8, __ATOMIC_SEQ_CST); } 376 324 { long long int ret; ret = __atomic_or_fetch_8(vp8, v8, __ATOMIC_SEQ_CST); } 377 #if defined(__SIZEOF_INT128__)378 325 { __int128 ret; ret = __atomic_or_fetch(vp16, v16, __ATOMIC_SEQ_CST); } 379 326 { __int128 ret; ret = __atomic_or_fetch_16(vp16, v16, __ATOMIC_SEQ_CST); } 380 #endif381 327 382 328 { char ret; ret = __atomic_fetch_add(vp1, v1, __ATOMIC_SEQ_CST); } … … 388 334 { long long int ret; ret = __atomic_fetch_add(vp8, v8, __ATOMIC_SEQ_CST); } 389 335 { long long int ret; ret = __atomic_fetch_add_8(vp8, v8, __ATOMIC_SEQ_CST); } 390 #if defined(__SIZEOF_INT128__)391 336 { __int128 ret; ret = __atomic_fetch_add(vp16, v16, __ATOMIC_SEQ_CST); } 392 337 { __int128 ret; ret = __atomic_fetch_add_16(vp16, v16, __ATOMIC_SEQ_CST); } 393 #endif394 338 395 339 { char ret; ret = __atomic_fetch_sub(vp1, v1, __ATOMIC_SEQ_CST); } … … 401 345 { long long int ret; ret = __atomic_fetch_sub(vp8, v8, __ATOMIC_SEQ_CST); } 402 346 { long long int ret; ret = __atomic_fetch_sub_8(vp8, v8, __ATOMIC_SEQ_CST); } 403 #if defined(__SIZEOF_INT128__)404 347 { __int128 ret; ret = __atomic_fetch_sub(vp16, v16, __ATOMIC_SEQ_CST); } 405 348 { __int128 ret; ret = __atomic_fetch_sub_16(vp16, v16, __ATOMIC_SEQ_CST); } 406 #endif407 349 408 350 { char ret; ret = __atomic_fetch_and(vp1, v1, __ATOMIC_SEQ_CST); } … … 414 356 { long long int ret; ret = __atomic_fetch_and(vp8, v8, __ATOMIC_SEQ_CST); } 415 357 { long long int ret; ret = __atomic_fetch_and_8(vp8, v8, __ATOMIC_SEQ_CST); } 416 #if defined(__SIZEOF_INT128__)417 358 { __int128 ret; ret = __atomic_fetch_and(vp16, v16, __ATOMIC_SEQ_CST); } 418 359 { __int128 ret; ret = __atomic_fetch_and_16(vp16, v16, __ATOMIC_SEQ_CST); } 419 #endif420 360 421 361 { char ret; ret = __atomic_fetch_nand(vp1, v1, __ATOMIC_SEQ_CST); } … … 427 367 { long long int ret; ret = __atomic_fetch_nand(vp8, v8, __ATOMIC_SEQ_CST); } 428 368 { long long int ret; ret = __atomic_fetch_nand_8(vp8, v8, __ATOMIC_SEQ_CST); } 429 #if defined(__SIZEOF_INT128__)430 369 { __int128 ret; ret = __atomic_fetch_nand(vp16, v16, __ATOMIC_SEQ_CST); } 431 370 { __int128 ret; ret = __atomic_fetch_nand_16(vp16, v16, __ATOMIC_SEQ_CST); } 432 #endif433 371 434 372 { char ret; ret = __atomic_fetch_xor(vp1, v1, __ATOMIC_SEQ_CST); } … … 440 378 { long long int ret; ret = __atomic_fetch_xor(vp8, v8, __ATOMIC_SEQ_CST); } 441 379 { long long int ret; ret = __atomic_fetch_xor_8(vp8, v8, __ATOMIC_SEQ_CST); } 442 #if defined(__SIZEOF_INT128__)443 380 { __int128 ret; ret = __atomic_fetch_xor(vp16, v16, __ATOMIC_SEQ_CST); } 444 381 { __int128 ret; ret = __atomic_fetch_xor_16(vp16, v16, __ATOMIC_SEQ_CST); } 445 #endif446 382 447 383 { char ret; ret = __atomic_fetch_or(vp1, v1, __ATOMIC_SEQ_CST); } … … 453 389 { long long int ret; ret = __atomic_fetch_or(vp8, v8, __ATOMIC_SEQ_CST); } 454 390 { long long int ret; ret = __atomic_fetch_or_8(vp8, v8, __ATOMIC_SEQ_CST); } 455 #if defined(__SIZEOF_INT128__)456 391 { __int128 ret; ret = __atomic_fetch_or(vp16, v16, __ATOMIC_SEQ_CST); } 457 392 { __int128 ret; ret = __atomic_fetch_or_16(vp16, v16, __ATOMIC_SEQ_CST); } 458 #endif459 393 460 394 { _Bool ret; ret = __atomic_always_lock_free(sizeof(int), vp4); }
Note:
See TracChangeset
for help on using the changeset viewer.