[Mesa-dev] [PATCH 4/7] util: Remove u_atomic.h's MSVC inline assembly.

Matt Turner mattst88 at gmail.com
Mon Nov 24 16:39:54 PST 2014


There was already an intrinsics path that implemented all of the same
functions, plus more.
---
 src/util/u_atomic.h | 70 -----------------------------------------------------
 1 file changed, 70 deletions(-)

diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h
index 51e799e..f326bd1 100644
--- a/src/util/u_atomic.h
+++ b/src/util/u_atomic.h
@@ -19,8 +19,6 @@
 #define PIPE_ATOMIC_OS_SOLARIS
 #elif defined(_MSC_VER)
 #define PIPE_ATOMIC_MSVC_INTRINSIC
-#elif (defined(_MSC_VER) && (defined(__i386__) || defined(_M_IX86))
-#define PIPE_ATOMIC_ASM_MSVC_X86                
 #elif defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 401)
 #define PIPE_ATOMIC_GCC_INTRINSIC
 #elif (defined(__GNUC__) && defined(__i386__))
@@ -226,74 +224,6 @@ p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
 #endif
 
 
-/* Locally coded assembly for MSVC on x86:
- */
-#if defined(PIPE_ATOMIC_ASM_MSVC_X86)
-
-#define PIPE_ATOMIC "MSVC x86 assembly"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define p_atomic_set(_v, _i) (*(_v) = (_i))
-#define p_atomic_read(_v) (*(_v))
-
-static inline boolean
-p_atomic_dec_zero(int32_t *v)
-{
-   unsigned char c;
-
-   __asm {
-      mov       eax, [v]
-      lock dec  dword ptr [eax]
-      sete      byte ptr [c]
-   }
-
-   return c != 0;
-}
-
-static inline void
-p_atomic_inc(int32_t *v)
-{
-   __asm {
-      mov       eax, [v]
-      lock inc  dword ptr [eax]
-   }
-}
-
-static inline void
-p_atomic_dec(int32_t *v)
-{
-   __asm {
-      mov       eax, [v]
-      lock dec  dword ptr [eax]
-   }
-}
-
-static inline int32_t
-p_atomic_cmpxchg(int32_t *v, int32_t old, int32_t _new)
-{
-   int32_t orig;
-
-   __asm {
-      mov ecx, [v]
-      mov eax, [old]
-      mov edx, [_new]
-      lock cmpxchg [ecx], edx
-      mov [orig], eax
-   }
-
-   return orig;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
 #if defined(PIPE_ATOMIC_MSVC_INTRINSIC)
 
 #define PIPE_ATOMIC "MSVC Intrinsics"
-- 
2.0.4



More information about the mesa-dev mailing list