diff --git a/common/include/Utilities/Threading.h b/common/include/Utilities/Threading.h index 6fa4de885d..26967e5a8a 100644 --- a/common/include/Utilities/Threading.h +++ b/common/include/Utilities/Threading.h @@ -158,7 +158,7 @@ namespace Threading // For use in spin/wait loops. extern void SpinWait(); - + // Use prior to committing data to another thread extern void StoreFence(); @@ -181,16 +181,6 @@ namespace Threading extern s32 AtomicRead( volatile s32& Target ); extern u32 AtomicExchange( volatile u32& Target, u32 value ); extern s32 AtomicExchange( volatile s32& Target, s32 value ); - extern u32 AtomicExchangeAdd( volatile u32& Target, u32 value ); - extern s32 AtomicExchangeAdd( volatile s32& Target, s32 value ); - extern s32 AtomicExchangeSub( volatile s32& Target, s32 value ); - extern u32 AtomicIncrement( volatile u32& Target ); - extern s32 AtomicIncrement( volatile s32& Target ); - extern u32 AtomicDecrement( volatile u32& Target ); - extern s32 AtomicDecrement( volatile s32& Target ); - - extern bool AtomicBitTestAndReset( volatile u32& bitset, u8 bit ); - extern bool AtomicBitTestAndReset( volatile s32& bitset, u8 bit ); // pthread Cond is an evil api that is not suited for Pcsx2 needs. // Let's not use it. Use mutexes and semaphores instead to create waits. (Air) diff --git a/common/include/intrin_x86.h b/common/include/intrin_x86.h index 9665dd141c..6b83a2928e 100644 --- a/common/include/intrin_x86.h +++ b/common/include/intrin_x86.h @@ -54,16 +54,6 @@ /*** Atomic operations ***/ -static __inline__ __attribute__((always_inline)) s32 _InterlockedCompareExchange(volatile s32 * const Destination, const s32 Exchange, const s32 Comperand) -{ - return __sync_val_compare_and_swap(Destination, Comperand, Exchange); -} - -static __inline__ __attribute__((always_inline)) s64 _InterlockedCompareExchange64(volatile s64 * const Destination, const s64 Exchange, const s64 Comperand) -{ - return __sync_val_compare_and_swap(Destination, Comperand, Exchange); -} - static __inline__ __attribute__((always_inline)) s32 _InterlockedExchange(volatile s32 * const Target, const s32 Value) { /* NOTE: __sync_lock_test_and_set would be an acquire barrier, so we force a full barrier */ @@ -78,21 +68,6 @@ static __inline__ __attribute__((always_inline)) s64 _InterlockedExchange64(vola return __sync_lock_test_and_set(Target, Value); } -static __inline__ __attribute__((always_inline)) s32 _InterlockedExchangeAdd(volatile s32 * const Addend, const s32 Value) -{ - return __sync_fetch_and_add(Addend, Value); -} - -static __inline__ __attribute__((always_inline)) s32 _InterlockedDecrement(volatile s32 * const lpAddend) -{ - return _InterlockedExchangeAdd(lpAddend, -1) - 1; -} - -static __inline__ __attribute__((always_inline)) s32 _InterlockedIncrement(volatile s32 * const lpAddend) -{ - return _InterlockedExchangeAdd(lpAddend, 1) + 1; -} - /*** System information ***/ static __inline__ __attribute__((always_inline)) void __cpuid(int CPUInfo[], const int InfoType) { diff --git a/common/src/Utilities/ThreadTools.cpp b/common/src/Utilities/ThreadTools.cpp index 7c9820a210..417dbe05d5 100644 --- a/common/src/Utilities/ThreadTools.cpp +++ b/common/src/Utilities/ThreadTools.cpp @@ -803,31 +803,6 @@ __fi s32 Threading::AtomicExchange( volatile s32& Target, s32 value ) { return _InterlockedExchange( (volatile vol_t*)&Target, value ); } -__fi u32 Threading::AtomicExchangeAdd( volatile u32& Target, u32 value ) { - return _InterlockedExchangeAdd( (volatile vol_t*)&Target, value ); -} -__fi s32 Threading::AtomicExchangeAdd( volatile s32& Target, s32 value ) { - return _InterlockedExchangeAdd( (volatile vol_t*)&Target, value ); -} - -__fi s32 Threading::AtomicExchangeSub( volatile s32& Target, s32 value ) { - return _InterlockedExchangeAdd( (volatile vol_t*)&Target, -value ); -} - -__fi u32 Threading::AtomicIncrement( volatile u32& Target ) { - return _InterlockedExchangeAdd( (volatile vol_t*)&Target, 1 ); -} -__fi s32 Threading::AtomicIncrement( volatile s32& Target) { - return _InterlockedExchangeAdd( (volatile vol_t*)&Target, 1 ); -} - -__fi u32 Threading::AtomicDecrement( volatile u32& Target ) { - return _InterlockedExchangeAdd( (volatile vol_t*)&Target, -1 ); -} -__fi s32 Threading::AtomicDecrement(volatile s32& Target) { - return _InterlockedExchangeAdd((volatile vol_t*)&Target, -1); -} - // -------------------------------------------------------------------------------------- // BaseThreadError // --------------------------------------------------------------------------------------