Re: [cxx-mem-model] Generic atomic functions

2011-10-26 Thread Michael Matz
Hi, On Tue, 25 Oct 2011, Andrew MacLeod wrote: and new generic routines are provided as follows: void __atomic_load (T* object, T* return_value, memory_order m) void __atomic_store (T* object, T* new_value, memory_order m) void __atomic_exchange (T* object, T* new_value, T* return_value,

Re: [cxx-mem-model] Generic atomic functions

2011-10-26 Thread Andrew MacLeod
On 10/26/2011 08:29 AM, Michael Matz wrote: Hi, On Tue, 25 Oct 2011, Andrew MacLeod wrote: and new generic routines are provided as follows: void __atomic_load (T* object, T* return_value, memory_order m) void __atomic_store (T* object, T* new_value, memory_order m) void __atomic_exchange

Re: [cxx-mem-model] Generic atomic functions

2011-10-25 Thread Richard Henderson
On 10/25/2011 10:20 AM, Andrew MacLeod wrote: + /* Otherwise there is a lockfree match, transform the call from: +void fn(T* mem, T* desired, T* return, model) + into +*((In *)return = fn (T* mem, *((In *)desired, model) */ This is, in general, an aliasing violation

Re: [cxx-mem-model] Generic atomic functions

2011-10-25 Thread Andrew MacLeod
On 10/25/2011 02:18 PM, Richard Henderson wrote: On 10/25/2011 10:20 AM, Andrew MacLeod wrote: + /* Otherwise there is a lockfree match, transform the call from: +void fn(T* mem, T* desired, T* return, model) + into +*((In *)return = fn (T* mem, *((In *)desired, model)

Re: [cxx-mem-model] Generic atomic functions

2011-10-25 Thread Richard Henderson
On 10/25/2011 12:12 PM, Andrew MacLeod wrote: OK, how's this. (just the c-common.c file) It seems to work fine. Past all the basic tests, and bootstraps in an incremental bootstrap. I'll kick off a full scratch bootstrap/test before feeling all warm and fuzzy tho :-) Looks good. r~