On Fri, Jul 15, 2011 at 12:02:06PM +0200, Paolo Bonzini wrote: > On 07/15/2011 11:37 AM, Jakub Jelinek wrote: > >While __sync_lock_test_and_set isn't a full barrier on all targets, > >I hope it doesn't matter, because the inline caller has already done one > >__sync_val_compare_and_swap which is a full barrier. > > Why not take the occasion to add the __sync_swap extension that > clang added already?
I think Andrew and Aldy are already extending all the __sync_* builtins to have extra argument with required barrier behavior bits for C++ memory model. Jakub