Fix _interlockedbittest intrinsics. For some strange reason they were working correctly on x86, the compiler seemed to know "what it means". But that doesn't work on amd64, here we need *a as "=m" operand, not a.

svn path=/branches/ros-amd64-bringup/; revision=35525
This commit is contained in:
Timo Kreuzer
2008-08-22 10:54:47 +00:00
parent 3c6891fdc8
commit adc315d4cc
+4 -4
View File
@@ -493,7 +493,7 @@ static __inline__ __attribute__((always_inline)) long long _InterlockedIncrement
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset(volatile long * a, const long b)
{
unsigned char retval;
__asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory");
__asm__("lock; btrl %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
@@ -501,7 +501,7 @@ static __inline__ __attribute__((always_inline)) unsigned char _interlockedbitte
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandreset64(volatile long long * a, const long long b)
{
unsigned char retval;
__asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory");
__asm__("lock; btrq %[b], %[a]; setb %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
#endif
@@ -509,7 +509,7 @@ static __inline__ __attribute__((always_inline)) unsigned char _interlockedbitte
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset(volatile long * a, const long b)
{
unsigned char retval;
__asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory");
__asm__("lock; btsl %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
@@ -517,7 +517,7 @@ static __inline__ __attribute__((always_inline)) unsigned char _interlockedbitte
static __inline__ __attribute__((always_inline)) unsigned char _interlockedbittestandset64(volatile long long * a, const long long b)
{
unsigned char retval;
__asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (a) : [b] "Ir" (b) : "memory");
__asm__("lock; btsq %[b], %[a]; setc %b[retval]" : [retval] "=r" (retval), [a] "=m" (*a) : [b] "Ir" (b) : "memory");
return retval;
}
#endif