[Mesa-dev] [PATCH 07/14] gallium/auxiliary: Prefer intrinsics to handrolled atomic ops for Linux (v2)

David Heidelberger david.heidelberger at ixit.cz
Mon Oct 20 05:37:50 PDT 2014


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

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

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

Signed-off-by: David Heidelberger <david.heidelberger at 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 2f2b42b..951a01a 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



More information about the mesa-dev mailing list