From 972f8458f1ebdf805059d9252ae0ebb727934613 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 21 Nov 2014 15:51:42 -0800 Subject: [PATCH] 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 --- 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 51e799ec1aa..f326bd1c2c3 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"