v2: prefer intrinsics only on Linux to avoid compilation problems on other
platforms [1].

Is posible that other OS could also benefit from intrinsic.

We need this patch, because Gallium Nine use directly intrinsics.
Otherwise build fails.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=30514

Cc: Tom Fogal <tfo...@alumni.unh.edu>
Cc: Vinson Lee <v...@freedesktop.org>
Signed-off-by: David Heidelberger <david.heidelber...@ixit.cz>
---
 src/gallium/auxiliary/util/u_atomic.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_atomic.h b/src/gallium/auxiliary/util/u_atomic.h
index 68369a1..6271736 100644
--- a/src/gallium/auxiliary/util/u_atomic.h
+++ b/src/gallium/auxiliary/util/u_atomic.h
@@ -24,6 +24,9 @@
 #define PIPE_ATOMIC_MSVC_INTRINSIC
 #elif (defined(PIPE_CC_MSVC) && defined(PIPE_ARCH_X86))
 #define PIPE_ATOMIC_ASM_MSVC_X86
+#elif defined(PIPE_CC_GCC) && (PIPE_CC_GCC_VERSION >= 401) && \
+      defined(PIPE_OS_LINUX)
+#define PIPE_ATOMIC_GCC_INTRINSIC
 #elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86))
 #define PIPE_ATOMIC_ASM_GCC_X86
 #elif (defined(PIPE_CC_GCC) && defined(PIPE_ARCH_X86_64))
--
2.1.2
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to