Mesa (master): util: Remove u_atomic.h's MSVC inline assembly.

Matt Turner mattst88 at kemper.freedesktop.org
Mon Dec 1 19:42:41 UTC 2014


Module: Mesa
Branch: master
Commit: 972f8458f1ebdf805059d9252ae0ebb727934613
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=972f8458f1ebdf805059d9252ae0ebb727934613

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Nov 21 15:51:42 2014 -0800

util: Remove u_atomic.h's MSVC inline assembly.

There was already an intrinsics path that implemented all of the same
functions, plus more.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 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"




More information about the mesa-commit mailing list