Qt 4.8
qatomic_powerpc.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the QtCore module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #ifndef QATOMIC_POWERPC_H
43 #define QATOMIC_POWERPC_H
44 
46 
48 
49 #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_ALWAYS_NATIVE
50 
52 { return true; }
54 { return false; }
55 
56 #define Q_ATOMIC_INT_TEST_AND_SET_IS_ALWAYS_NATIVE
57 
59 { return true; }
61 { return false; }
62 
63 #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE
64 
66 { return true; }
68 { return false; }
69 
70 #define Q_ATOMIC_INT_FETCH_AND_ADD_IS_ALWAYS_NATIVE
71 
73 { return true; }
75 { return false; }
76 
77 #define Q_ATOMIC_POINTER_TEST_AND_SET_IS_ALWAYS_NATIVE
78 
79 template <typename T>
81 { return true; }
82 template <typename T>
84 { return false; }
85 
86 #define Q_ATOMIC_POINTER_FETCH_AND_STORE_IS_ALWAYS_NATIVE
87 
88 template <typename T>
90 { return true; }
91 template <typename T>
93 { return false; }
94 
95 #define Q_ATOMIC_POINTER_FETCH_AND_ADD_IS_ALWAYS_NATIVE
96 
97 template <typename T>
99 { return true; }
100 template <typename T>
102 { return false; }
103 
104 #if defined(Q_CC_GNU)
105 
106 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 2) \
107  || (!defined(__64BIT__) && !defined(__powerpc64__) && !defined(__ppc64__))
108 # define _Q_VALUE "0, %[_q_value]"
109 # define _Q_VALUE_MEMORY_OPERAND "+m" (_q_value)
110 # define _Q_VALUE_REGISTER_OPERAND [_q_value] "r" (&_q_value),
111 #else
112 // On 64-bit with gcc >= 4.2
113 # define _Q_VALUE "%y[_q_value]"
114 # define _Q_VALUE_MEMORY_OPERAND [_q_value] "+Z" (_q_value)
115 # define _Q_VALUE_REGISTER_OPERAND
116 #endif
117 
118 inline bool QBasicAtomicInt::ref()
119 {
120  register int originalValue;
121  register int newValue;
122  asm volatile("lwarx %[originalValue]," _Q_VALUE "\n"
123  "addi %[newValue], %[originalValue], %[one]\n"
124  "stwcx. %[newValue]," _Q_VALUE "\n"
125  "bne- $-12\n"
126  : [originalValue] "=&b" (originalValue),
127  [newValue] "=&r" (newValue),
128  _Q_VALUE_MEMORY_OPERAND
129  : _Q_VALUE_REGISTER_OPERAND
130  [one] "i" (1)
131  : "cc", "memory");
132  return newValue != 0;
133 }
134 
135 inline bool QBasicAtomicInt::deref()
136 {
137  register int originalValue;
138  register int newValue;
139  asm volatile("lwarx %[originalValue]," _Q_VALUE "\n"
140  "addi %[newValue], %[originalValue], %[minusOne]\n"
141  "stwcx. %[newValue]," _Q_VALUE "\n"
142  "bne- $-12\n"
143  : [originalValue] "=&b" (originalValue),
144  [newValue] "=&r" (newValue),
145  _Q_VALUE_MEMORY_OPERAND
146  : _Q_VALUE_REGISTER_OPERAND
147  [minusOne] "i" (-1)
148  : "cc", "memory");
149  return newValue != 0;
150 }
151 
152 inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
153 {
154  register int result;
155  asm volatile("lwarx %[result]," _Q_VALUE "\n"
156  "xor. %[result], %[result], %[expectedValue]\n"
157  "bne $+12\n"
158  "stwcx. %[newValue]," _Q_VALUE "\n"
159  "bne- $-16\n"
160  : [result] "=&r" (result),
161  _Q_VALUE_MEMORY_OPERAND
162  : _Q_VALUE_REGISTER_OPERAND
163  [expectedValue] "r" (expectedValue),
164  [newValue] "r" (newValue)
165  : "cc", "memory");
166  return result == 0;
167 }
168 
169 inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
170 {
171  register int result;
172  asm volatile("lwarx %[result]," _Q_VALUE "\n"
173  "xor. %[result], %[result], %[expectedValue]\n"
174  "bne $+16\n"
175  "stwcx. %[newValue]," _Q_VALUE "\n"
176  "bne- $-16\n"
177  "isync\n"
178  : [result] "=&r" (result),
179  _Q_VALUE_MEMORY_OPERAND
180  : _Q_VALUE_REGISTER_OPERAND
181  [expectedValue] "r" (expectedValue),
182  [newValue] "r" (newValue)
183  : "cc", "memory");
184  return result == 0;
185 }
186 
187 inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
188 {
189  register int result;
190  asm volatile("eieio\n"
191  "lwarx %[result]," _Q_VALUE "\n"
192  "xor. %[result], %[result], %[expectedValue]\n"
193  "bne $+12\n"
194  "stwcx. %[newValue]," _Q_VALUE "\n"
195  "bne- $-16\n"
196  : [result] "=&r" (result),
197  _Q_VALUE_MEMORY_OPERAND
198  : _Q_VALUE_REGISTER_OPERAND
199  [expectedValue] "r" (expectedValue),
200  [newValue] "r" (newValue)
201  : "cc", "memory");
202  return result == 0;
203 }
204 
205 inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
206 {
207  register int originalValue;
208  asm volatile("lwarx %[originalValue]," _Q_VALUE "\n"
209  "stwcx. %[newValue]," _Q_VALUE "\n"
210  "bne- $-8\n"
211  : [originalValue] "=&r" (originalValue),
212  _Q_VALUE_MEMORY_OPERAND
213  : _Q_VALUE_REGISTER_OPERAND
214  [newValue] "r" (newValue)
215  : "cc", "memory");
216  return originalValue;
217 }
218 
219 inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
220 {
221  register int originalValue;
222  asm volatile("lwarx %[originalValue]," _Q_VALUE "\n"
223  "stwcx. %[newValue]," _Q_VALUE "\n"
224  "bne- $-8\n"
225  "isync\n"
226  : [originalValue] "=&r" (originalValue),
227  _Q_VALUE_MEMORY_OPERAND
228  : _Q_VALUE_REGISTER_OPERAND
229  [newValue] "r" (newValue)
230  : "cc", "memory");
231  return originalValue;
232 }
233 
234 inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
235 {
236  register int originalValue;
237  asm volatile("eieio\n"
238  "lwarx %[originalValue]," _Q_VALUE "\n"
239  "stwcx. %[newValue]," _Q_VALUE "\n"
240  "bne- $-8\n"
241  : [originalValue] "=&r" (originalValue),
242  _Q_VALUE_MEMORY_OPERAND
243  : _Q_VALUE_REGISTER_OPERAND
244  [newValue] "r" (newValue)
245  : "cc", "memory");
246  return originalValue;
247 }
248 
249 inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
250 {
251  register int originalValue;
252  register int newValue;
253  asm volatile("lwarx %[originalValue]," _Q_VALUE "\n"
254  "add %[newValue], %[originalValue], %[valueToAdd]\n"
255  "stwcx. %[newValue]," _Q_VALUE "\n"
256  "bne- $-12\n"
257  : [originalValue] "=&r" (originalValue),
258  [newValue] "=&r" (newValue),
259  _Q_VALUE_MEMORY_OPERAND
260  : _Q_VALUE_REGISTER_OPERAND
261  [valueToAdd] "r" (valueToAdd)
262  : "cc", "memory");
263  return originalValue;
264 }
265 
266 inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
267 {
268  register int originalValue;
269  register int newValue;
270  asm volatile("lwarx %[originalValue]," _Q_VALUE "\n"
271  "add %[newValue], %[originalValue], %[valueToAdd]\n"
272  "stwcx. %[newValue]," _Q_VALUE "\n"
273  "bne- $-12\n"
274  "isync\n"
275  : [originalValue] "=&r" (originalValue),
276  [newValue] "=&r" (newValue),
277  _Q_VALUE_MEMORY_OPERAND
278  : _Q_VALUE_REGISTER_OPERAND
279  [valueToAdd] "r" (valueToAdd)
280  : "cc", "memory");
281  return originalValue;
282 }
283 
284 inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
285 {
286  register int originalValue;
287  register int newValue;
288  asm volatile("eieio\n"
289  "lwarx %[originalValue]," _Q_VALUE "\n"
290  "add %[newValue], %[originalValue], %[valueToAdd]\n"
291  "stwcx. %[newValue]," _Q_VALUE "\n"
292  "bne- $-12\n"
293  : [originalValue] "=&r" (originalValue),
294  [newValue] "=&r" (newValue),
295  _Q_VALUE_MEMORY_OPERAND
296  : _Q_VALUE_REGISTER_OPERAND
297  [valueToAdd] "r" (valueToAdd)
298  : "cc", "memory");
299  return originalValue;
300 }
301 
302 #if defined(__64BIT__) || defined(__powerpc64__) || defined(__ppc64__)
303 # define LPARX "ldarx"
304 # define STPCX "stdcx."
305 #else
306 # define LPARX "lwarx"
307 # define STPCX "stwcx."
308 #endif
309 
310 template <typename T>
311 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
312 {
313  register void *result;
314  asm volatile(LPARX" %[result]," _Q_VALUE "\n"
315  "xor. %[result], %[result], %[expectedValue]\n"
316  "bne $+12\n"
317  STPCX" %[newValue]," _Q_VALUE "\n"
318  "bne- $-16\n"
319  : [result] "=&r" (result),
320  _Q_VALUE_MEMORY_OPERAND
321  : _Q_VALUE_REGISTER_OPERAND
322  [expectedValue] "r" (expectedValue),
323  [newValue] "r" (newValue)
324  : "cc", "memory");
325  return result == 0;
326 }
327 
328 template <typename T>
329 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
330 {
331  register void *result;
332  asm volatile(LPARX" %[result]," _Q_VALUE "\n"
333  "xor. %[result], %[result], %[expectedValue]\n"
334  "bne $+16\n"
335  STPCX" %[newValue]," _Q_VALUE "\n"
336  "bne- $-16\n"
337  "isync\n"
338  : [result] "=&r" (result),
339  _Q_VALUE_MEMORY_OPERAND
340  : _Q_VALUE_REGISTER_OPERAND
341  [expectedValue] "r" (expectedValue),
342  [newValue] "r" (newValue)
343  : "cc", "memory");
344  return result == 0;
345 }
346 
347 template <typename T>
348 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
349 {
350  register void *result;
351  asm volatile("eieio\n"
352  LPARX" %[result]," _Q_VALUE "\n"
353  "xor. %[result], %[result], %[expectedValue]\n"
354  "bne $+12\n"
355  STPCX" %[newValue]," _Q_VALUE "\n"
356  "bne- $-16\n"
357  : [result] "=&r" (result),
358  _Q_VALUE_MEMORY_OPERAND
359  : _Q_VALUE_REGISTER_OPERAND
360  [expectedValue] "r" (expectedValue),
361  [newValue] "r" (newValue)
362  : "cc", "memory");
363  return result == 0;
364 }
365 
366 template <typename T>
368 {
369  register T *originalValue;
370  asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n"
371  STPCX" %[newValue]," _Q_VALUE "\n"
372  "bne- $-8\n"
373  : [originalValue] "=&r" (originalValue),
374  _Q_VALUE_MEMORY_OPERAND
375  : _Q_VALUE_REGISTER_OPERAND
376  [newValue] "r" (newValue)
377  : "cc", "memory");
378  return originalValue;
379 }
380 
381 template <typename T>
383 {
384  register T *originalValue;
385  asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n"
386  STPCX" %[newValue]," _Q_VALUE "\n"
387  "bne- $-8\n"
388  "isync\n"
389  : [originalValue] "=&r" (originalValue),
390  _Q_VALUE_MEMORY_OPERAND
391  : _Q_VALUE_REGISTER_OPERAND
392  [newValue] "r" (newValue)
393  : "cc", "memory");
394  return originalValue;
395 }
396 
397 template <typename T>
399 {
400  register T *originalValue;
401  asm volatile("eieio\n"
402  LPARX" %[originalValue]," _Q_VALUE "\n"
403  STPCX" %[newValue]," _Q_VALUE "\n"
404  "bne- $-8\n"
405  : [originalValue] "=&r" (originalValue),
406  _Q_VALUE_MEMORY_OPERAND
407  : _Q_VALUE_REGISTER_OPERAND
408  [newValue] "r" (newValue)
409  : "cc", "memory");
410  return originalValue;
411 }
412 
413 template <typename T>
415 {
416  register T *originalValue;
417  register T *newValue;
418  asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n"
419  "add %[newValue], %[originalValue], %[valueToAdd]\n"
420  STPCX" %[newValue]," _Q_VALUE "\n"
421  "bne- $-12\n"
422  : [originalValue] "=&r" (originalValue),
423  [newValue] "=&r" (newValue),
424  _Q_VALUE_MEMORY_OPERAND
425  : _Q_VALUE_REGISTER_OPERAND
426  [valueToAdd] "r" (valueToAdd * sizeof(T))
427  : "cc", "memory");
428  return originalValue;
429 }
430 
431 template <typename T>
433 {
434  register T *originalValue;
435  register T *newValue;
436  asm volatile(LPARX" %[originalValue]," _Q_VALUE "\n"
437  "add %[newValue], %[originalValue], %[valueToAdd]\n"
438  STPCX" %[newValue]," _Q_VALUE "\n"
439  "bne- $-12\n"
440  "isync\n"
441  : [originalValue] "=&r" (originalValue),
442  [newValue] "=&r" (newValue),
443  _Q_VALUE_MEMORY_OPERAND
444  : _Q_VALUE_REGISTER_OPERAND
445  [valueToAdd] "r" (valueToAdd * sizeof(T))
446  : "cc", "memory");
447  return originalValue;
448 }
449 
450 template <typename T>
452 {
453  register T *originalValue;
454  register T *newValue;
455  asm volatile("eieio\n"
456  LPARX" %[originalValue]," _Q_VALUE "\n"
457  "add %[newValue], %[originalValue], %[valueToAdd]\n"
458  STPCX" %[newValue]," _Q_VALUE "\n"
459  "bne- $-12\n"
460  : [originalValue] "=&r" (originalValue),
461  [newValue] "=&r" (newValue),
462  _Q_VALUE_MEMORY_OPERAND
463  : _Q_VALUE_REGISTER_OPERAND
464  [valueToAdd] "r" (valueToAdd * sizeof(T))
465  : "cc", "memory");
466  return originalValue;
467 }
468 
469 #undef LPARX
470 #undef STPCX
471 #undef _Q_VALUE
472 #undef _Q_VALUE_MEMORY_OPERAND
473 #undef _Q_VALUE_REGISTER_OPERAND
474 
475 #else
476 
477 extern "C" {
478  int q_atomic_test_and_set_int(volatile int *ptr, int expectedValue, int newValue);
479  int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expectedValue, int newValue);
480  int q_atomic_test_and_set_release_int(volatile int *ptr, int expectedValue, int newValue);
481  int q_atomic_test_and_set_ptr(volatile void *ptr, void *expectedValue, void *newValue);
482  int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expectedValue, void *newValue);
483  int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expectedValue, void *newValue);
484  int q_atomic_increment(volatile int *);
485  int q_atomic_decrement(volatile int *);
486  int q_atomic_set_int(volatile int *, int);
487  int q_atomic_fetch_and_store_acquire_int(volatile int *ptr, int newValue);
488  int q_atomic_fetch_and_store_release_int(volatile int *ptr, int newValue);
489  void *q_atomic_set_ptr(volatile void *, void *);
490  int q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newValue);
491  int q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newValue);
492  int q_atomic_fetch_and_add_int(volatile int *ptr, int valueToAdd);
493  int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int valueToAdd);
494  int q_atomic_fetch_and_add_release_int(volatile int *ptr, int valueToAdd);
495  void *q_atomic_fetch_and_add_ptr(volatile void *ptr, qptrdiff valueToAdd);
496  void *q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, qptrdiff valueToAdd);
497  void *q_atomic_fetch_and_add_release_ptr(volatile void *ptr, qptrdiff valueToAdd);
498 } // extern "C"
499 
500 
501 inline bool QBasicAtomicInt::ref()
502 {
503  return q_atomic_increment(&_q_value) != 0;
504 }
505 
506 inline bool QBasicAtomicInt::deref()
507 {
508  return q_atomic_decrement(&_q_value) != 0;
509 }
510 
511 inline bool QBasicAtomicInt::testAndSetRelaxed(int expectedValue, int newValue)
512 {
513  return q_atomic_test_and_set_int(&_q_value, expectedValue, newValue) != 0;
514 }
515 
516 inline bool QBasicAtomicInt::testAndSetAcquire(int expectedValue, int newValue)
517 {
518  return q_atomic_test_and_set_acquire_int(&_q_value, expectedValue, newValue) != 0;
519 }
520 
521 inline bool QBasicAtomicInt::testAndSetRelease(int expectedValue, int newValue)
522 {
523  return q_atomic_test_and_set_release_int(&_q_value, expectedValue, newValue) != 0;
524 }
525 
526 inline int QBasicAtomicInt::fetchAndStoreRelaxed(int newValue)
527 {
528  return q_atomic_set_int(&_q_value, newValue);
529 }
530 
531 inline int QBasicAtomicInt::fetchAndStoreAcquire(int newValue)
532 {
534 }
535 
536 inline int QBasicAtomicInt::fetchAndStoreRelease(int newValue)
537 {
539 }
540 
541 inline int QBasicAtomicInt::fetchAndAddRelaxed(int valueToAdd)
542 {
543  return q_atomic_fetch_and_add_int(&_q_value, valueToAdd);
544 }
545 
546 inline int QBasicAtomicInt::fetchAndAddAcquire(int valueToAdd)
547 {
548  return q_atomic_fetch_and_add_acquire_int(&_q_value, valueToAdd);
549 }
550 
551 inline int QBasicAtomicInt::fetchAndAddRelease(int valueToAdd)
552 {
553  return q_atomic_fetch_and_add_release_int(&_q_value, valueToAdd);
554 }
555 
556 template <typename T>
557 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelaxed(T *expectedValue, T *newValue)
558 {
559  return q_atomic_test_and_set_ptr(&_q_value, expectedValue, newValue) != 0;
560 }
561 
562 template <typename T>
563 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetAcquire(T *expectedValue, T *newValue)
564 {
565  return q_atomic_test_and_set_acquire_ptr(&_q_value, expectedValue, newValue) != 0;
566 }
567 
568 template <typename T>
569 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetRelease(T *expectedValue, T *newValue)
570 {
571  return q_atomic_test_and_set_release_ptr(&_q_value, expectedValue, newValue) != 0;
572 }
573 
574 template <typename T>
576 {
577  return reinterpret_cast<T *>(q_atomic_set_ptr(&_q_value, newValue));
578 }
579 
580 template <typename T>
582 {
583  return reinterpret_cast<T *>(q_atomic_fetch_and_store_acquire_ptr(&_q_value, newValue));
584 }
585 
586 template <typename T>
588 {
589  return reinterpret_cast<T *>(q_atomic_fetch_and_store_release_ptr(&_q_value, newValue));
590 }
591 
592 template <typename T>
594 {
595  return reinterpret_cast<T *>(q_atomic_fetch_and_add_ptr(&_q_value, valueToAdd * sizeof(T)));
596 }
597 template <typename T>
599 {
600  return reinterpret_cast<T *>(q_atomic_fetch_and_add_acquire_ptr(&_q_value, valueToAdd * sizeof(T)));
601 }
602 
603 template <typename T>
605 {
606  return reinterpret_cast<T *>(q_atomic_fetch_and_add_release_ptr(&_q_value, valueToAdd * sizeof(T)));
607 }
608 
609 #endif
610 
611 inline bool QBasicAtomicInt::testAndSetOrdered(int expectedValue, int newValue)
612 {
613  return testAndSetAcquire(expectedValue, newValue);
614 }
615 
616 inline int QBasicAtomicInt::fetchAndStoreOrdered(int newValue)
617 {
618  return fetchAndStoreAcquire(newValue);
619 }
620 
621 inline int QBasicAtomicInt::fetchAndAddOrdered(int valueToAdd)
622 {
623  return fetchAndAddAcquire(valueToAdd);
624 }
625 
626 template <typename T>
627 Q_INLINE_TEMPLATE bool QBasicAtomicPointer<T>::testAndSetOrdered(T *expectedValue, T *newValue)
628 {
629  return testAndSetAcquire(expectedValue, newValue);
630 }
631 
632 template <typename T>
634 {
635  return fetchAndStoreAcquire(newValue);
636 }
637 
638 template <typename T>
640 {
641  return fetchAndAddAcquire(valueToAdd);
642 }
643 
645 
647 
648 #endif // QATOMIC_POWERPC_H
void * q_atomic_fetch_and_add_acquire_ptr(volatile void *ptr, qptrdiff valueToAdd)
static bool isFetchAndStoreNative()
Definition: qatomic_alpha.h:65
static bool isTestAndSetNative()
Definition: qatomic_alpha.h:58
int fetchAndStoreRelease(int newValue)
int q_atomic_fetch_and_store_release_ptr(volatile void *ptr, void *newValue)
static bool isReferenceCountingNative()
Definition: qatomic_alpha.h:51
T * fetchAndAddRelaxed(qptrdiff valueToAdd)
volatile int _q_value
Definition: qbasicatomic.h:64
#define QT_END_NAMESPACE
This macro expands to.
Definition: qglobal.h:90
static bool isFetchAndAddNative()
Definition: qatomic_alpha.h:98
#define QT_BEGIN_HEADER
Definition: qglobal.h:136
static bool isTestAndSetNative()
Definition: qatomic_alpha.h:80
static bool isFetchAndAddNative()
Definition: qatomic_alpha.h:72
T * fetchAndStoreRelease(T *newValue)
static bool isTestAndSetWaitFree()
Definition: qatomic_alpha.h:83
int q_atomic_fetch_and_store_release_int(volatile int *ptr, int newValue)
int q_atomic_fetch_and_store_acquire_ptr(volatile void *ptr, void *newValue)
T * fetchAndAddRelease(qptrdiff valueToAdd)
int q_atomic_test_and_set_int(volatile int *ptr, int expectedValue, int newValue)
bool testAndSetOrdered(T *expectedValue, T *newValue)
int fetchAndAddAcquire(int valueToAdd)
T * fetchAndAddAcquire(qptrdiff valueToAdd)
int fetchAndStoreRelaxed(int newValue)
T * fetchAndAddOrdered(qptrdiff valueToAdd)
bool testAndSetAcquire(int expectedValue, int newValue)
int q_atomic_set_int(volatile int *, int)
int q_atomic_test_and_set_release_ptr(volatile void *ptr, void *expectedValue, void *newValue)
bool testAndSetRelaxed(int expectedValue, int newValue)
#define QT_BEGIN_NAMESPACE
This macro expands to.
Definition: qglobal.h:89
int fetchAndStoreAcquire(int newValue)
QIntegerForSizeof< void * >::Signed qptrdiff
Definition: qglobal.h:987
T * fetchAndStoreOrdered(T *newValue)
#define Q_INLINE_TEMPLATE
Definition: qglobal.h:1713
int fetchAndAddRelease(int valueToAdd)
const T * ptr(const T &t)
bool testAndSetOrdered(int expectedValue, int newValue)
T * fetchAndStoreAcquire(T *newValue)
void * q_atomic_fetch_and_add_release_ptr(volatile void *ptr, qptrdiff valueToAdd)
static bool isFetchAndStoreWaitFree()
Definition: qatomic_alpha.h:67
int q_atomic_increment(volatile int *)
static bool isTestAndSetWaitFree()
Definition: qatomic_alpha.h:60
static bool isReferenceCountingWaitFree()
Definition: qatomic_alpha.h:53
int fetchAndAddOrdered(int valueToAdd)
static bool isFetchAndStoreWaitFree()
Definition: qatomic_alpha.h:92
static bool isFetchAndAddWaitFree()
Definition: qatomic_alpha.h:74
static bool isFetchAndAddWaitFree()
int q_atomic_test_and_set_ptr(volatile void *ptr, void *expectedValue, void *newValue)
bool testAndSetRelease(int expectedValue, int newValue)
int q_atomic_test_and_set_acquire_ptr(volatile void *ptr, void *expectedValue, void *newValue)
int q_atomic_test_and_set_acquire_int(volatile int *ptr, int expectedValue, int newValue)
void * q_atomic_set_ptr(volatile void *, void *)
int fetchAndAddRelaxed(int valueToAdd)
int fetchAndStoreOrdered(int newValue)
bool testAndSetRelaxed(T *expectedValue, T *newValue)
void * q_atomic_fetch_and_add_ptr(volatile void *ptr, qptrdiff valueToAdd)
int q_atomic_decrement(volatile int *)
bool testAndSetRelease(T *expectedValue, T *newValue)
int q_atomic_fetch_and_add_acquire_int(volatile int *ptr, int valueToAdd)
#define QT_END_HEADER
Definition: qglobal.h:137
int q_atomic_test_and_set_release_int(volatile int *ptr, int expectedValue, int newValue)
int q_atomic_fetch_and_store_acquire_int(volatile int *ptr, int newValue)
T * fetchAndStoreRelaxed(T *newValue)
int q_atomic_fetch_and_add_int(volatile int *ptr, int valueToAdd)
int q_atomic_fetch_and_add_release_int(volatile int *ptr, int valueToAdd)
static bool isFetchAndStoreNative()
Definition: qatomic_alpha.h:89
bool testAndSetAcquire(T *expectedValue, T *newValue)