42 #ifndef QATOMIC_ALPHA_H
43 #define QATOMIC_ALPHA_H
49 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
56 #define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE
63 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
70 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE
77 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
86 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
95 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE
100 template <
typename T>
104 #if defined(Q_CC_GNU)
108 register int old, tmp;
117 :
"=&r" (old),
"=&r" (tmp),
"+m"(
_q_value)
125 register int old, tmp;
134 :
"=&r" (old),
"=&r" (tmp),
"+m"(
_q_value)
154 :
"r" (expectedValue),
"r" (newValue)
174 :
"r" (expectedValue),
"r" (newValue)
194 :
"r" (expectedValue),
"r" (newValue)
201 register int old, tmp;
210 :
"=&r" (old),
"=&r" (tmp),
"+m" (
_q_value)
218 register int old, tmp;
228 :
"=&r" (old),
"=&r" (tmp),
"+m" (
_q_value)
236 register int old, tmp;
246 :
"=&r" (old),
"=&r" (tmp),
"+m" (
_q_value)
254 register int old, tmp;
263 :
"=&r" (old),
"=&r" (tmp),
"+m"(
_q_value)
271 register int old, tmp;
281 :
"=&r" (old),
"=&r" (tmp),
"+m"(
_q_value)
289 register int old, tmp;
299 :
"=&r" (old),
"=&r" (tmp),
"+m"(
_q_value)
305 template <
typename T>
319 :
"=&r" (ret),
"+m" (_q_value)
320 :
"r" (expectedValue),
"r" (newValue)
325 template <
typename T>
340 :
"=&r" (ret),
"+m" (_q_value)
341 :
"r" (expectedValue),
"r" (newValue)
346 template <
typename T>
361 :
"=&r" (ret),
"+m" (_q_value)
362 :
"r" (expectedValue),
"r" (newValue)
367 template <
typename T>
370 register T *old, *tmp;
379 :
"=&r" (old),
"=&r" (tmp),
"+m" (_q_value)
385 template <
typename T>
388 register T *old, *tmp;
398 :
"=&r" (old),
"=&r" (tmp),
"+m" (_q_value)
404 template <
typename T>
407 register T *old, *tmp;
417 :
"=&r" (old),
"=&r" (tmp),
"+m" (_q_value)
423 template <
typename T>
426 register T *old, *tmp;
435 :
"=&r" (old),
"=&r" (tmp),
"+m"(_q_value)
438 return reinterpret_cast<T *
>(old);
441 template <
typename T>
444 register T *old, *tmp;
454 :
"=&r" (old),
"=&r" (tmp),
"+m"(_q_value)
457 return reinterpret_cast<T *
>(old);
460 template <
typename T>
463 register T *old, *tmp;
473 :
"=&r" (old),
"=&r" (tmp),
"+m"(_q_value)
476 return reinterpret_cast<T *
>(old);
550 template <
typename T>
556 template <
typename T>
562 template <
typename T>
568 template <
typename T>
574 template <
typename T>
580 template <
typename T>
586 template <
typename T>
591 template <
typename T>
597 template <
typename T>
620 template <
typename T>
623 return testAndSetAcquire(expectedValue, newValue);
626 template <
typename T>
629 return fetchAndStoreAcquire(newValue);
632 template <
typename T>
635 return fetchAndAddAcquire(valueToAdd);
642 #endif // QATOMIC_ALPHA_H
int fetchAndStoreRelaxed(int newValue)
void * q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, qptrdiff valueToAdd)
bool testAndSetRelease(int expectedValue, int newValue)
Q_CORE_EXPORT int q_atomic_set_int(volatile int *ptr, int newval)
int q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newValue)
Q_CORE_EXPORT int q_atomic_fetch_and_add_int(volatile int *ptr, int value)
static bool isFetchAndAddNative()
Q_CORE_EXPORT int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expected, void *newval)
int q_atomic_fetch_and_store_release_int(volatile int *ptr, int newValue)
T * fetchAndAddAcquire(qptrdiff valueToAdd)
T * fetchAndAddOrdered(qptrdiff valueToAdd)
Q_CORE_EXPORT void * q_atomic_fetch_and_add_ptr(volatile void *ptr, int value)
int q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newValue)
static bool isReferenceCountingNative()
int fetchAndAddRelaxed(int valueToAdd)
Q_CORE_EXPORT int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expected, int newval)
T * fetchAndStoreAcquire(T *newValue)
T * fetchAndAddRelease(qptrdiff valueToAdd)
int fetchAndAddAcquire(int valueToAdd)
static bool isReferenceCountingWaitFree()
T * fetchAndAddRelaxed(qptrdiff valueToAdd)
static bool isFetchAndAddNative()
bool testAndSetOrdered(T *expectedValue, T *newValue)
bool testAndSetAcquire(int expectedValue, int newValue)
static bool isFetchAndStoreNative()
#define QT_BEGIN_NAMESPACE
Q_CORE_EXPORT int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int value)
static bool isTestAndSetNative()
Q_CORE_EXPORT int q_atomic_test_and_set_ptr(volatile void *ptr, void *expected, void *newval)
static bool isTestAndSetNative()
static bool isFetchAndStoreNative()
T * fetchAndStoreRelaxed(T *newValue)
Q_CORE_EXPORT int q_atomic_increment(volatile int *ptr)
static bool isFetchAndAddWaitFree()
bool testAndSetRelaxed(int expectedValue, int newValue)
Q_CORE_EXPORT int q_atomic_test_and_set_release_int(volatile int *ptr, int expected, int newval)
T * fetchAndStoreRelease(T *newValue)
Q_CORE_EXPORT int q_atomic_fetch_and_add_release_int(volatile int *ptr, int value)
bool testAndSetRelease(T *expectedValue, T *newValue)
void * q_atomic_fetch_and_add_release_ptr(volatile void *ptr, qptrdiff valueToAdd)
static bool isFetchAndStoreWaitFree()
static bool isTestAndSetWaitFree()
GLsizei const GLfloat * value
bool testAndSetAcquire(T *expectedValue, T *newValue)
Q_CORE_EXPORT int q_atomic_test_and_set_int(volatile int *ptr, int expected, int newval)
Q_CORE_EXPORT int q_atomic_decrement(volatile int *ptr)
static bool isFetchAndAddWaitFree()
T * fetchAndStoreOrdered(T *newValue)
static bool isFetchAndStoreWaitFree()
bool testAndSetRelaxed(T *expectedValue, T *newValue)
int fetchAndStoreAcquire(int newValue)
Q_CORE_EXPORT int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expected, void *newval)
static bool isTestAndSetWaitFree()
bool testAndSetOrdered(int expectedValue, int newValue)
int q_atomic_fetch_and_store_acquire_int(volatile int *ptr, int newValue)
int fetchAndAddOrdered(int valueToAdd)
int fetchAndStoreOrdered(int newValue)
int fetchAndAddRelease(int valueToAdd)
int fetchAndStoreRelease(int newValue)
Q_CORE_EXPORT void * q_atomic_set_ptr(volatile void *ptr, void *newval)