Re: [Mesa-dev] [PATCH] util: use GCC atomic intrinsics with explicit memory model

2016-10-04 Thread Nicolai Hähnle
On 04.10.2016 17:50, Jan Vesely wrote: On Tue, 2016-10-04 at 16:14 +0200, Nicolai Hähnle wrote: From: Nicolai Hähnle This is motivated by the fact that p_atomic_read and p_atomic_set may somewhat surprisingly not do the right thing in the old version: while stores and loads are de facto atomic

Re: [Mesa-dev] [PATCH] util: use GCC atomic intrinsics with explicit memory model

2016-10-04 Thread Emil Velikov
On 4 October 2016 at 15:14, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > This is motivated by the fact that p_atomic_read and p_atomic_set may > somewhat surprisingly not do the right thing in the old version: while > stores and loads are de facto atomic at least on x86, the compiler may > ap

Re: [Mesa-dev] [PATCH] util: use GCC atomic intrinsics with explicit memory model

2016-10-04 Thread Jan Vesely
On Tue, 2016-10-04 at 16:14 +0200, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > This is motivated by the fact that p_atomic_read and p_atomic_set may > somewhat surprisingly not do the right thing in the old version: > while > stores and loads are de facto atomic at least on x86, afaik, this

Re: [Mesa-dev] [PATCH] util: use GCC atomic intrinsics with explicit memory model

2016-10-04 Thread Marek Olšák
Acked-by: Marek Olšák Somebody else should review the configure.ac change. Marek On Tue, Oct 4, 2016 at 4:14 PM, Nicolai Hähnle wrote: > From: Nicolai Hähnle > > This is motivated by the fact that p_atomic_read and p_atomic_set may > somewhat surprisingly not do the right thing in the old ver

[Mesa-dev] [PATCH] util: use GCC atomic intrinsics with explicit memory model

2016-10-04 Thread Nicolai Hähnle
From: Nicolai Hähnle This is motivated by the fact that p_atomic_read and p_atomic_set may somewhat surprisingly not do the right thing in the old version: while stores and loads are de facto atomic at least on x86, the compiler may apply re-ordering and speculation quite liberally. Basically, th