mirror of https://github.com/PCSX2/pcsx2.git
gsdx: drop interlocked* function on linux
This commit is contained in:
parent
a601991f91
commit
f9b4ff17a5
|
@ -387,80 +387,6 @@ struct aligned_free_second {template<class T> void operator()(T& p) {_aligned_fr
|
||||||
return Mask ? 1 : 0;
|
return Mask ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
__forceinline unsigned char _interlockedbittestandreset(volatile long* a, const long b)
|
|
||||||
{
|
|
||||||
unsigned char retval;
|
|
||||||
|
|
||||||
__asm__("lock; btrl %k[b], %[a]; setb %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline unsigned char _interlockedbittestandset(volatile long* a, const long b)
|
|
||||||
{
|
|
||||||
unsigned char retval;
|
|
||||||
|
|
||||||
__asm__("lock; btsl %k[b], %[a]; setc %b[retval]" : [retval] "=q" (retval), [a] "+m" (*a) : [b] "Ir" (b) : "memory");
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline long _InterlockedCompareExchange(volatile long* const Destination, const long Exchange, const long Comperand)
|
|
||||||
{
|
|
||||||
long retval = Comperand;
|
|
||||||
|
|
||||||
__asm__("lock; cmpxchgl %k[Exchange], %[Destination]" : [retval] "+a" (retval) : [Destination] "m" (*Destination), [Exchange] "q" (Exchange): "memory");
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline long _InterlockedExchange(volatile long* const Target, const long Value)
|
|
||||||
{
|
|
||||||
long retval = Value;
|
|
||||||
|
|
||||||
__asm__("xchgl %[retval], %[Target]" : [retval] "+r" (retval) : [Target] "m" (*Target) : "memory");
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline long _InterlockedExchangeAdd(volatile long* const Addend, const long Value)
|
|
||||||
{
|
|
||||||
long retval = Value;
|
|
||||||
|
|
||||||
__asm__("lock; xaddl %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline short _InterlockedExchangeAdd16(volatile short* const Addend, const short Value)
|
|
||||||
{
|
|
||||||
short retval = Value;
|
|
||||||
|
|
||||||
__asm__("lock; xaddw %[retval], %[Addend]" : [retval] "+r" (retval) : [Addend] "m" (*Addend) : "memory");
|
|
||||||
|
|
||||||
return retval;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline long _InterlockedDecrement(volatile long* const lpAddend)
|
|
||||||
{
|
|
||||||
return _InterlockedExchangeAdd(lpAddend, -1) - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline long _InterlockedIncrement(volatile long* const lpAddend)
|
|
||||||
{
|
|
||||||
return _InterlockedExchangeAdd(lpAddend, 1) + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline short _InterlockedDecrement16(volatile short* const lpAddend)
|
|
||||||
{
|
|
||||||
return _InterlockedExchangeAdd16(lpAddend, -1) - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
__forceinline short _InterlockedIncrement16(volatile short* const lpAddend)
|
|
||||||
{
|
|
||||||
return _InterlockedExchangeAdd16(lpAddend, 1) + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef __GNUC__
|
#ifdef __GNUC__
|
||||||
|
|
||||||
// gcc 4.8 define __rdtsc but unfortunately the compiler crash...
|
// gcc 4.8 define __rdtsc but unfortunately the compiler crash...
|
||||||
|
|
Loading…
Reference in New Issue