Changes in / [98d4df9:686f731]
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/prelude/sync-builtins.cf
r98d4df9 r686f731 323 323 _Bool __sync_bool_compare_and_swap_16(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 324 324 #endif 325 forall(dtype T) _Bool __sync_bool_compare_and_swap(T * volatile *, T *, T*, ...);326 325 327 326 char __sync_val_compare_and_swap(volatile char *, char, char,...); … … 349 348 unsigned __int128 __sync_val_compare_and_swap_16(volatile unsigned __int128 *, unsigned __int128, unsigned __int128,...); 350 349 #endif 351 forall(dtype T) T * __sync_val_compare_and_swap(T * volatile *, T *, T*,...);352 350 353 351 char __sync_lock_test_and_set(volatile char *, char,...); … … 436 434 #endif 437 435 438 char __atomic_exchange_n(volatile char *, char, int);436 char __atomic_exchange_n(volatile char *, volatile char *, int); 439 437 char __atomic_exchange_1(volatile char *, char, int); 440 438 void __atomic_exchange(volatile char *, volatile char *, volatile char *, int); 441 signed char __atomic_exchange_n(volatile signed char *, signed char, int);439 signed char __atomic_exchange_n(volatile signed char *, volatile signed char *, int); 442 440 signed char __atomic_exchange_1(volatile signed char *, signed char, int); 443 441 void __atomic_exchange(volatile signed char *, volatile signed char *, volatile signed char *, int); 444 unsigned char __atomic_exchange_n(volatile unsigned char *, unsigned char, int);442 unsigned char __atomic_exchange_n(volatile unsigned char *, volatile unsigned char *, int); 445 443 unsigned char __atomic_exchange_1(volatile unsigned char *, unsigned char, int); 446 444 void __atomic_exchange(volatile unsigned char *, volatile unsigned char *, volatile unsigned char *, int); 447 signed short __atomic_exchange_n(volatile signed short *, signed short, int);445 signed short __atomic_exchange_n(volatile signed short *, volatile signed short *, int); 448 446 signed short __atomic_exchange_2(volatile signed short *, signed short, int); 449 447 void __atomic_exchange(volatile signed short *, volatile signed short *, volatile signed short *, int); 450 unsigned short __atomic_exchange_n(volatile unsigned short *, unsigned short, int);448 unsigned short __atomic_exchange_n(volatile unsigned short *, volatile unsigned short *, int); 451 449 unsigned short __atomic_exchange_2(volatile unsigned short *, unsigned short, int); 452 450 void __atomic_exchange(volatile unsigned short *, volatile unsigned short *, volatile unsigned short *, int); 453 signed int __atomic_exchange_n(volatile signed int *, signed int, int);451 signed int __atomic_exchange_n(volatile signed int *, volatile signed int *, int); 454 452 signed int __atomic_exchange_4(volatile signed int *, signed int, int); 455 453 void __atomic_exchange(volatile signed int *, volatile signed int *, volatile signed int *, int); 456 unsigned int __atomic_exchange_n(volatile unsigned int *, unsigned int, int);454 unsigned int __atomic_exchange_n(volatile unsigned int *, volatile unsigned int *, int); 457 455 unsigned int __atomic_exchange_4(volatile unsigned int *, unsigned int, int); 458 456 void __atomic_exchange(volatile unsigned int *, volatile unsigned int *, volatile unsigned int *, int); 459 signed long long int __atomic_exchange_n(volatile signed long long int *, signed long long int, int);457 signed long long int __atomic_exchange_n(volatile signed long long int *, volatile signed long long int *, int); 460 458 signed long long int __atomic_exchange_8(volatile signed long long int *, signed long long int, int); 461 459 void __atomic_exchange(volatile signed long long int *, volatile signed long long int *, volatile signed long long int *, int); 462 unsigned long long int __atomic_exchange_n(volatile unsigned long long int *, unsigned long long int, int);460 unsigned long long int __atomic_exchange_n(volatile unsigned long long int *, volatile unsigned long long int *, int); 463 461 unsigned long long int __atomic_exchange_8(volatile unsigned long long int *, unsigned long long int, int); 464 462 void __atomic_exchange(volatile unsigned long long int *, volatile unsigned long long int *, volatile unsigned long long int *, int); 465 463 #if defined(__SIZEOF_INT128__) 466 signed __int128 __atomic_exchange_n(volatile signed __int128 *, signed __int128, int);464 signed __int128 __atomic_exchange_n(volatile signed __int128 *, volatile signed __int128 *, int); 467 465 signed __int128 __atomic_exchange_16(volatile signed __int128 *, signed __int128, int); 468 466 void __atomic_exchange(volatile signed __int128 *, volatile signed __int128 *, volatile signed __int128 *, int); 469 unsigned __int128 __atomic_exchange_n(volatile unsigned __int128 *, unsigned __int128, int);467 unsigned __int128 __atomic_exchange_n(volatile unsigned __int128 *, volatile unsigned __int128 *, int); 470 468 unsigned __int128 __atomic_exchange_16(volatile unsigned __int128 *, unsigned __int128, int); 471 469 void __atomic_exchange(volatile unsigned __int128 *, volatile unsigned __int128 *, volatile unsigned __int128 *, int); 472 470 #endif 473 forall(dtype T) T * __atomic_exchange_n(T * volatile *, T *, int);474 forall(dtype T) void __atomic_exchange(T * volatile *, T * volatile *, T * volatile *, int);475 471 476 472 _Bool __atomic_load_n(const volatile _Bool *, int); … … 511 507 void __atomic_load(const volatile unsigned __int128 *, volatile unsigned __int128 *, int); 512 508 #endif 513 forall(dtype T) T * __atomic_load_n(T * const volatile *, int);514 forall(dtype T) void __atomic_load(T * const volatile *, T **, int);515 509 516 510 _Bool __atomic_compare_exchange_n(volatile char *, char *, char, _Bool, int, int); … … 549 543 _Bool __atomic_compare_exchange (volatile unsigned __int128 *, unsigned __int128 *, unsigned __int128 *, _Bool, int, int); 550 544 #endif 551 forall(dtype T) _Bool __atomic_compare_exchange_n (T * volatile *, T **, T*, _Bool, int, int);552 forall(dtype T) _Bool __atomic_compare_exchange (T * volatile *, T **, T**, _Bool, int, int);553 545 554 546 void __atomic_store_n(volatile _Bool *, _Bool, int); … … 589 581 void __atomic_store(volatile unsigned __int128 *, unsigned __int128 *, int); 590 582 #endif 591 forall(dtype T) void __atomic_store_n(T * volatile *, T *, int);592 forall(dtype T) void __atomic_store(T * volatile *, T **, int);593 583 594 584 char __atomic_add_fetch (volatile char *, char, int); -
tests/builtins/sync.cfa
r98d4df9 r686f731 11 11 volatile __int128 * vp16 = 0; __int128 * rp16 = 0; __int128 v16 = 0; 12 12 #endif 13 struct type * volatile * vpp = 0; struct type ** rpp = 0; struct type * vp = 0;14 13 15 14 { char ret; ret = __sync_fetch_and_add(vp1, v1); } … … 181 180 { _Bool ret; ret = __sync_bool_compare_and_swap_16(vp16, v16,v16); } 182 181 #endif 183 { _Bool ret; ret = __sync_bool_compare_and_swap(vpp, vp, vp); }184 182 185 183 { char ret; ret = __sync_val_compare_and_swap(vp1, v1, v1); } … … 195 193 { __int128 ret; ret = __sync_val_compare_and_swap_16(vp16, v16,v16); } 196 194 #endif 197 { struct type * ret; ret = __sync_val_compare_and_swap(vpp, vp, vp); }198 199 195 200 196 { char ret; ret = __sync_lock_test_and_set(vp1, v1); } … … 234 230 { __atomic_clear(vp1, v1); } 235 231 236 { char ret; ret = __atomic_exchange_n(vp1, v1, __ATOMIC_SEQ_CST); }232 { char ret; ret = __atomic_exchange_n(vp1, &v1, __ATOMIC_SEQ_CST); } 237 233 { char ret; ret = __atomic_exchange_1(vp1, v1, __ATOMIC_SEQ_CST); } 238 234 { char ret; __atomic_exchange(vp1, &v1, &ret, __ATOMIC_SEQ_CST); } 239 { short ret; ret = __atomic_exchange_n(vp2, v2, __ATOMIC_SEQ_CST); }235 { short ret; ret = __atomic_exchange_n(vp2, &v2, __ATOMIC_SEQ_CST); } 240 236 { short ret; ret = __atomic_exchange_2(vp2, v2, __ATOMIC_SEQ_CST); } 241 237 { short ret; __atomic_exchange(vp2, &v2, &ret, __ATOMIC_SEQ_CST); } 242 { int ret; ret = __atomic_exchange_n(vp4, v4, __ATOMIC_SEQ_CST); }238 { int ret; ret = __atomic_exchange_n(vp4, &v4, __ATOMIC_SEQ_CST); } 243 239 { int ret; ret = __atomic_exchange_4(vp4, v4, __ATOMIC_SEQ_CST); } 244 240 { int ret; __atomic_exchange(vp4, &v4, &ret, __ATOMIC_SEQ_CST); } 245 { long long int ret; ret = __atomic_exchange_n(vp8, v8, __ATOMIC_SEQ_CST); }241 { long long int ret; ret = __atomic_exchange_n(vp8, &v8, __ATOMIC_SEQ_CST); } 246 242 { long long int ret; ret = __atomic_exchange_8(vp8, v8, __ATOMIC_SEQ_CST); } 247 243 { long long int ret; __atomic_exchange(vp8, &v8, &ret, __ATOMIC_SEQ_CST); } 248 244 #if defined(__SIZEOF_INT128__) 249 { __int128 ret; ret = __atomic_exchange_n(vp16, v16, __ATOMIC_SEQ_CST); }245 { __int128 ret; ret = __atomic_exchange_n(vp16, &v16, __ATOMIC_SEQ_CST); } 250 246 { __int128 ret; ret = __atomic_exchange_16(vp16, v16, __ATOMIC_SEQ_CST); } 251 247 { __int128 ret; __atomic_exchange(vp16, &v16, &ret, __ATOMIC_SEQ_CST); } 252 248 #endif 253 { struct type * ret; ret = __atomic_exchange_n(vpp, vp, __ATOMIC_SEQ_CST); }254 { struct type * ret; __atomic_exchange(vpp, &vp, &ret, __ATOMIC_SEQ_CST); }255 249 256 250 { char ret; ret = __atomic_load_n(vp1, __ATOMIC_SEQ_CST); } … … 271 265 { __int128 ret; __atomic_load(vp16, &ret, __ATOMIC_SEQ_CST); } 272 266 #endif 273 { struct type * ret; ret = __atomic_load_n(vpp, __ATOMIC_SEQ_CST); }274 { struct type * ret; __atomic_load(vpp, &ret, __ATOMIC_SEQ_CST); }275 267 276 268 { _Bool ret; ret = __atomic_compare_exchange_n(vp1, rp1, v1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } … … 291 283 { _Bool ret; ret = __atomic_compare_exchange(vp16, rp16, &v16, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); } 292 284 #endif 293 { _Bool ret; ret = __atomic_compare_exchange_n(vpp, rpp, vp, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }294 { _Bool ret; ret = __atomic_compare_exchange(vpp, rpp, &vp, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); }295 285 296 286 { __atomic_store_n(vp1, v1, __ATOMIC_SEQ_CST); } … … 311 301 { __atomic_store(vp16, &v16, __ATOMIC_SEQ_CST); } 312 302 #endif 313 { __atomic_store_n(vpp, vp, __ATOMIC_SEQ_CST); }314 { __atomic_store(vpp, &vp, __ATOMIC_SEQ_CST); }315 303 316 304 { char ret; ret = __atomic_add_fetch(vp1, v1, __ATOMIC_SEQ_CST); }
Note: See TracChangeset
for help on using the changeset viewer.