mesa/src
Nicolai Hähnle 8915f0c0de util: use GCC atomic intrinsics with explicit memory model
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, the old
version uses the "relaxed" memory ordering.

The new ordering always uses acquire/release ordering. This is the
strongest possible memory ordering that doesn't require additional
fence instructions on x86. (And the only stronger ordering is
"sequentially consistent", which is usually more than you need anyway.)

I would feel more comfortable if p_atomic_set/read in the old
implementation were at least using volatile loads and stores, but I
don't see a way to get there without typeof (which we cannot use here
since the code is compiled with -std=c99).

Eventually, we should really just move to something that is based on
the atomics in C11 / C++11.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-10-05 15:39:39 +02:00
..
amd radeonsi/compute: Use the HSA abi for non-TGSI compute shaders v3 2016-09-16 23:07:10 +00:00
compiler nir/intrinsics: Add more atomic_counter ops 2016-10-04 16:53:32 -07:00
egl egl: Drop duplicate check on EGLSync type 2016-10-04 14:11:29 -07:00
gallium gallivm: Use AVX2 gather instrinsics. 2016-10-04 23:36:20 +01:00
gbm gbm: return appropriate error when queryImage() fails 2016-09-27 13:37:21 +01:00
getopt Introduce .editorconfig 2016-08-31 17:06:54 -07:00
glx direct-to-native-GL for GLX clients on Cygwin ("Windows-DRI") 2016-09-15 13:14:43 +01:00
gtest Introduce .editorconfig 2016-08-31 17:06:54 -07:00
hgl Introduce .editorconfig 2016-08-31 17:06:54 -07:00
intel aubinator: use the correct format specifier for printing ptrdiff_t. 2016-10-04 17:28:01 -07:00
loader loader/dri3: Always use at least two back buffers 2016-09-06 13:04:48 +09:00
mapi Revert "mapi: export all GLES 3.2 functions in libGLESv2.so" 2016-09-23 12:13:13 -07:00
mesa i965: use L3 data cache for SSBOs 2016-10-05 12:24:04 +01:00
util util: use GCC atomic intrinsics with explicit memory model 2016-10-05 15:39:39 +02:00
Makefile.am glsl: Prepare standalone compiler to be able to use parameter lists 2016-09-27 11:11:15 +10:00
SConscript