Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
tbb_machine.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2005-2019 Intel Corporation
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 
17 
18 
19 */
20 
21 #ifndef __TBB_machine_H
22 #define __TBB_machine_H
23 
117 #include "tbb_stddef.h"
118 
119 namespace tbb {
120 namespace internal { //< @cond INTERNAL
121 
123 // Overridable helpers declarations
124 //
125 // A machine/*.h file may choose to define these templates, otherwise it must
126 // request default implementation by setting appropriate __TBB_USE_GENERIC_XXX macro(s).
127 //
128 template <typename T, std::size_t S>
129 struct machine_load_store;
130 
131 template <typename T, std::size_t S>
132 struct machine_load_store_relaxed;
133 
134 template <typename T, std::size_t S>
135 struct machine_load_store_seq_cst;
136 //
137 // End of overridable helpers declarations
139 
140 template<size_t S> struct atomic_selector;
141 
142 template<> struct atomic_selector<1> {
143  typedef int8_t word;
144  inline static word fetch_store ( volatile void* location, word value );
145 };
146 
147 template<> struct atomic_selector<2> {
148  typedef int16_t word;
149  inline static word fetch_store ( volatile void* location, word value );
150 };
151 
152 template<> struct atomic_selector<4> {
153 #if _MSC_VER && !_WIN64
154  // Work-around that avoids spurious /Wp64 warnings
155  typedef intptr_t word;
156 #else
157  typedef int32_t word;
158 #endif
159  inline static word fetch_store ( volatile void* location, word value );
160 };
161 
162 template<> struct atomic_selector<8> {
163  typedef int64_t word;
164  inline static word fetch_store ( volatile void* location, word value );
165 };
166 
167 }} //< namespaces internal @endcond, tbb
168 
169 #define __TBB_MACHINE_DEFINE_STORE8_GENERIC_FENCED(M) \
170  inline void __TBB_machine_generic_store8##M(volatile void *ptr, int64_t value) { \
171  for(;;) { \
172  int64_t result = *(volatile int64_t *)ptr; \
173  if( __TBB_machine_cmpswp8##M(ptr,value,result)==result ) break; \
174  } \
175  } \
176 
177 #define __TBB_MACHINE_DEFINE_LOAD8_GENERIC_FENCED(M) \
178  inline int64_t __TBB_machine_generic_load8##M(const volatile void *ptr) { \
179  /* Comparand and new value may be anything, they only must be equal, and */ \
180  /* the value should have a low probability to be actually found in 'location'.*/ \
181  const int64_t anyvalue = 2305843009213693951LL; \
182  return __TBB_machine_cmpswp8##M(const_cast<volatile void *>(ptr),anyvalue,anyvalue); \
183  } \
184 
185 // The set of allowed values for __TBB_ENDIANNESS (see above for details)
186 #define __TBB_ENDIAN_UNSUPPORTED -1
187 #define __TBB_ENDIAN_LITTLE 0
188 #define __TBB_ENDIAN_BIG 1
189 #define __TBB_ENDIAN_DETECT 2
190 
191 #if _WIN32||_WIN64
192 
193 #ifdef _MANAGED
194 #pragma managed(push, off)
195 #endif
196 
197  #if __MINGW64__ || __MINGW32__
198  extern "C" __declspec(dllimport) int __stdcall SwitchToThread( void );
199  #define __TBB_Yield() SwitchToThread()
200  #if (TBB_USE_GCC_BUILTINS && __TBB_GCC_BUILTIN_ATOMICS_PRESENT)
201  #include "machine/gcc_generic.h"
202  #elif __MINGW64__
203  #include "machine/linux_intel64.h"
204  #elif __MINGW32__
205  #include "machine/linux_ia32.h"
206  #endif
207  #elif (TBB_USE_ICC_BUILTINS && __TBB_ICC_BUILTIN_ATOMICS_PRESENT)
208  #include "machine/icc_generic.h"
209  #elif defined(_M_IX86) && !defined(__TBB_WIN32_USE_CL_BUILTINS)
210  #include "machine/windows_ia32.h"
211  #elif defined(_M_X64)
212  #include "machine/windows_intel64.h"
213  #elif defined(_M_ARM) || defined(__TBB_WIN32_USE_CL_BUILTINS)
214  #include "machine/msvc_armv7.h"
215  #endif
216 
217 #ifdef _MANAGED
218 #pragma managed(pop)
219 #endif
220 
221 #elif __TBB_DEFINE_MIC
222 
223  #include "machine/mic_common.h"
224  #if (TBB_USE_ICC_BUILTINS && __TBB_ICC_BUILTIN_ATOMICS_PRESENT)
225  #include "machine/icc_generic.h"
226  #else
227  #include "machine/linux_intel64.h"
228  #endif
229 
230 #elif __linux__ || __FreeBSD__ || __NetBSD__ || __OpenBSD__
231 
232  #ifndef TBB_USE_GCC_BUILTINS
233  #define TBB_USE_GCC_BUILTINS 1
234  #endif
235  #if (TBB_USE_GCC_BUILTINS && __TBB_GCC_BUILTIN_ATOMICS_PRESENT)
236  #include "machine/gcc_generic.h"
237  #elif (TBB_USE_ICC_BUILTINS && __TBB_ICC_BUILTIN_ATOMICS_PRESENT)
238  #include "machine/icc_generic.h"
239  #elif __i386__
240  #include "machine/linux_ia32.h"
241  #elif __x86_64__
242  #include "machine/linux_intel64.h"
243  #elif __ia64__
244  #include "machine/linux_ia64.h"
245  #elif __powerpc__
246  #include "machine/mac_ppc.h"
247  #elif __ARM_ARCH_7A__ || __aarch64__
248  #include "machine/gcc_arm.h"
249  #elif __TBB_GCC_BUILTIN_ATOMICS_PRESENT
250  #include "machine/gcc_generic.h"
251  #endif
252  #include "machine/linux_common.h"
253 
254 #elif __APPLE__
255  //TODO: TBB_USE_GCC_BUILTINS is not used for Mac, Sun, Aix
256  #if (TBB_USE_ICC_BUILTINS && __TBB_ICC_BUILTIN_ATOMICS_PRESENT)
257  #include "machine/icc_generic.h"
258  #elif __TBB_x86_32
259  #include "machine/linux_ia32.h"
260  #elif __TBB_x86_64
261  #include "machine/linux_intel64.h"
262  #elif __POWERPC__
263  #include "machine/mac_ppc.h"
264  #endif
265  #include "machine/macos_common.h"
266 
267 #elif _AIX
268 
269  #include "machine/ibm_aix51.h"
270 
271 #elif __sun || __SUNPRO_CC
272 
273  #define __asm__ asm
274  #define __volatile__ volatile
275 
276  #if __i386 || __i386__
277  #include "machine/linux_ia32.h"
278  #elif __x86_64__
279  #include "machine/linux_intel64.h"
280  #elif __sparc
281  #include "machine/sunos_sparc.h"
282  #endif
283  #include <sched.h>
284 
285  #define __TBB_Yield() sched_yield()
286 
287 #endif /* OS selection */
288 
289 #ifndef __TBB_64BIT_ATOMICS
290  #define __TBB_64BIT_ATOMICS 1
291 #endif
292 
293 //TODO: replace usage of these functions with usage of tbb::atomic, and then remove them
294 //TODO: map functions with W suffix to use cast to tbb::atomic and according op, i.e. as_atomic().op()
295 // Special atomic functions
296 #if __TBB_USE_FENCED_ATOMICS
297  #define __TBB_machine_cmpswp1 __TBB_machine_cmpswp1full_fence
298  #define __TBB_machine_cmpswp2 __TBB_machine_cmpswp2full_fence
299  #define __TBB_machine_cmpswp4 __TBB_machine_cmpswp4full_fence
300  #define __TBB_machine_cmpswp8 __TBB_machine_cmpswp8full_fence
301 
302  #if __TBB_WORDSIZE==8
303  #define __TBB_machine_fetchadd8 __TBB_machine_fetchadd8full_fence
304  #define __TBB_machine_fetchstore8 __TBB_machine_fetchstore8full_fence
305  #define __TBB_FetchAndAddWrelease(P,V) __TBB_machine_fetchadd8release(P,V)
306  #define __TBB_FetchAndIncrementWacquire(P) __TBB_machine_fetchadd8acquire(P,1)
307  #define __TBB_FetchAndDecrementWrelease(P) __TBB_machine_fetchadd8release(P,(-1))
308  #else
309  #define __TBB_machine_fetchadd4 __TBB_machine_fetchadd4full_fence
310  #define __TBB_machine_fetchstore4 __TBB_machine_fetchstore4full_fence
311  #define __TBB_FetchAndAddWrelease(P,V) __TBB_machine_fetchadd4release(P,V)
312  #define __TBB_FetchAndIncrementWacquire(P) __TBB_machine_fetchadd4acquire(P,1)
313  #define __TBB_FetchAndDecrementWrelease(P) __TBB_machine_fetchadd4release(P,(-1))
314  #endif /* __TBB_WORDSIZE==4 */
315 #else /* !__TBB_USE_FENCED_ATOMICS */
316  #define __TBB_FetchAndAddWrelease(P,V) __TBB_FetchAndAddW(P,V)
317  #define __TBB_FetchAndIncrementWacquire(P) __TBB_FetchAndAddW(P,1)
318  #define __TBB_FetchAndDecrementWrelease(P) __TBB_FetchAndAddW(P,(-1))
319 #endif /* !__TBB_USE_FENCED_ATOMICS */
320 
321 #if __TBB_WORDSIZE==4
322  #define __TBB_CompareAndSwapW(P,V,C) __TBB_machine_cmpswp4(P,V,C)
323  #define __TBB_FetchAndAddW(P,V) __TBB_machine_fetchadd4(P,V)
324  #define __TBB_FetchAndStoreW(P,V) __TBB_machine_fetchstore4(P,V)
325 #elif __TBB_WORDSIZE==8
326  #if __TBB_USE_GENERIC_DWORD_LOAD_STORE || __TBB_USE_GENERIC_DWORD_FETCH_ADD || __TBB_USE_GENERIC_DWORD_FETCH_STORE
327  #error These macros should only be used on 32-bit platforms.
328  #endif
329 
330  #define __TBB_CompareAndSwapW(P,V,C) __TBB_machine_cmpswp8(P,V,C)
331  #define __TBB_FetchAndAddW(P,V) __TBB_machine_fetchadd8(P,V)
332  #define __TBB_FetchAndStoreW(P,V) __TBB_machine_fetchstore8(P,V)
333 #else /* __TBB_WORDSIZE != 8 */
334  #error Unsupported machine word size.
335 #endif /* __TBB_WORDSIZE */
336 
337 #ifndef __TBB_Pause
338  inline void __TBB_Pause(int32_t) {
339  __TBB_Yield();
340  }
341 #endif
342 
343 namespace tbb {
344 
347 
348 namespace internal { //< @cond INTERNAL
349 
351 
354 
356  static const int32_t LOOPS_BEFORE_YIELD = 16;
357  int32_t count;
358 public:
359  // In many cases, an object of this type is initialized eagerly on hot path,
360  // as in for(atomic_backoff b; ; b.pause()) { /*loop body*/ }
361  // For this reason, the construction cost must be very small!
362  atomic_backoff() : count(1) {}
363  // This constructor pauses immediately; do not use on hot paths!
364  atomic_backoff( bool ) : count(1) { pause(); }
365 
367  void pause() {
368  if( count<=LOOPS_BEFORE_YIELD ) {
369  __TBB_Pause(count);
370  // Pause twice as long the next time.
371  count*=2;
372  } else {
373  // Pause is so long that we might as well yield CPU to scheduler.
374  __TBB_Yield();
375  }
376  }
377 
379  bool bounded_pause() {
380  __TBB_Pause(count);
381  if( count<LOOPS_BEFORE_YIELD ) {
382  // Pause twice as long the next time.
383  count*=2;
384  return true;
385  } else {
386  return false;
387  }
388  }
389 
390  void reset() {
391  count = 1;
392  }
393 };
394 
396 
397 template<typename T, typename U>
398 void spin_wait_while_eq( const volatile T& location, U value ) {
399  atomic_backoff backoff;
400  while( location==value ) backoff.pause();
401 }
402 
404 
405 template<typename T, typename U>
406 void spin_wait_until_eq( const volatile T& location, const U value ) {
407  atomic_backoff backoff;
408  while( location!=value ) backoff.pause();
409 }
410 
411 template <typename predicate_type>
412 void spin_wait_while(predicate_type condition){
413  atomic_backoff backoff;
414  while( condition() ) backoff.pause();
415 }
416 
418 // Generic compare-and-swap applied to only a part of a machine word.
419 //
420 #ifndef __TBB_ENDIANNESS
421 #define __TBB_ENDIANNESS __TBB_ENDIAN_DETECT
422 #endif
423 
424 #if __TBB_USE_GENERIC_PART_WORD_CAS && __TBB_ENDIANNESS==__TBB_ENDIAN_UNSUPPORTED
425 #error Generic implementation of part-word CAS may not be used with __TBB_ENDIAN_UNSUPPORTED
426 #endif
427 
428 #if __TBB_ENDIANNESS!=__TBB_ENDIAN_UNSUPPORTED
429 //
430 // This function is the only use of __TBB_ENDIANNESS.
431 // The following restrictions/limitations apply for this operation:
432 // - T must be an integer type of at most 4 bytes for the casts and calculations to work
433 // - T must also be less than 4 bytes to avoid compiler warnings when computing mask
434 // (and for the operation to be useful at all, so no workaround is applied)
435 // - the architecture must consistently use either little-endian or big-endian (same for all locations)
436 //
437 // TODO: static_assert for the type requirements stated above
438 template<typename T>
439 inline T __TBB_MaskedCompareAndSwap (volatile T * const ptr, const T value, const T comparand ) {
440  struct endianness{ static bool is_big_endian(){
441  #if __TBB_ENDIANNESS==__TBB_ENDIAN_DETECT
442  const uint32_t probe = 0x03020100;
443  return (((const char*)(&probe))[0]==0x03);
444  #elif __TBB_ENDIANNESS==__TBB_ENDIAN_BIG || __TBB_ENDIANNESS==__TBB_ENDIAN_LITTLE
446  #else
447  #error Unexpected value of __TBB_ENDIANNESS
448  #endif
449  }};
450 
451  const uint32_t byte_offset = (uint32_t) ((uintptr_t)ptr & 0x3);
452  volatile uint32_t * const aligned_ptr = (uint32_t*)((uintptr_t)ptr - byte_offset );
453 
454  // location of T within uint32_t for a C++ shift operation
455  const uint32_t bits_to_shift = 8*(endianness::is_big_endian() ? (4 - sizeof(T) - (byte_offset)) : byte_offset);
456  const uint32_t mask = (((uint32_t)1<<(sizeof(T)*8)) - 1 )<<bits_to_shift;
457  // for signed T, any sign extension bits in cast value/comparand are immediately clipped by mask
458  const uint32_t shifted_comparand = ((uint32_t)comparand << bits_to_shift)&mask;
459  const uint32_t shifted_value = ((uint32_t)value << bits_to_shift)&mask;
460 
461  for( atomic_backoff b;;b.pause() ) {
462  const uint32_t surroundings = *aligned_ptr & ~mask ; // may have changed during the pause
463  const uint32_t big_comparand = surroundings | shifted_comparand ;
464  const uint32_t big_value = surroundings | shifted_value ;
465  // __TBB_machine_cmpswp4 presumed to have full fence.
466  // Cast shuts up /Wp64 warning
467  const uint32_t big_result = (uint32_t)__TBB_machine_cmpswp4( aligned_ptr, big_value, big_comparand );
468  if( big_result == big_comparand // CAS succeeded
469  || ((big_result ^ big_comparand) & mask) != 0) // CAS failed and the bits of interest have changed
470  {
471  return T((big_result & mask) >> bits_to_shift);
472  }
473  else continue; // CAS failed but the bits of interest were not changed
474  }
475 }
476 #endif // __TBB_ENDIANNESS!=__TBB_ENDIAN_UNSUPPORTED
477 
479 template<size_t S, typename T>
480 inline T __TBB_CompareAndSwapGeneric (volatile void *ptr, T value, T comparand );
481 
482 template<>
483 inline int8_t __TBB_CompareAndSwapGeneric <1,int8_t> (volatile void *ptr, int8_t value, int8_t comparand ) {
484 #if __TBB_USE_GENERIC_PART_WORD_CAS
485  return __TBB_MaskedCompareAndSwap<int8_t>((volatile int8_t *)ptr,value,comparand);
486 #else
487  return __TBB_machine_cmpswp1(ptr,value,comparand);
488 #endif
489 }
490 
491 template<>
492 inline int16_t __TBB_CompareAndSwapGeneric <2,int16_t> (volatile void *ptr, int16_t value, int16_t comparand ) {
493 #if __TBB_USE_GENERIC_PART_WORD_CAS
494  return __TBB_MaskedCompareAndSwap<int16_t>((volatile int16_t *)ptr,value,comparand);
495 #else
496  return __TBB_machine_cmpswp2(ptr,value,comparand);
497 #endif
498 }
499 
500 template<>
501 inline int32_t __TBB_CompareAndSwapGeneric <4,int32_t> (volatile void *ptr, int32_t value, int32_t comparand ) {
502  // Cast shuts up /Wp64 warning
503  return (int32_t)__TBB_machine_cmpswp4(ptr,value,comparand);
504 }
505 
506 #if __TBB_64BIT_ATOMICS
507 template<>
508 inline int64_t __TBB_CompareAndSwapGeneric <8,int64_t> (volatile void *ptr, int64_t value, int64_t comparand ) {
509  return __TBB_machine_cmpswp8(ptr,value,comparand);
510 }
511 #endif
512 
513 template<size_t S, typename T>
514 inline T __TBB_FetchAndAddGeneric (volatile void *ptr, T addend) {
515  T result;
516  for( atomic_backoff b;;b.pause() ) {
517  result = *reinterpret_cast<volatile T *>(ptr);
518  // __TBB_CompareAndSwapGeneric presumed to have full fence.
519  if( __TBB_CompareAndSwapGeneric<S,T> ( ptr, result+addend, result )==result )
520  break;
521  }
522  return result;
523 }
524 
525 template<size_t S, typename T>
526 inline T __TBB_FetchAndStoreGeneric (volatile void *ptr, T value) {
527  T result;
528  for( atomic_backoff b;;b.pause() ) {
529  result = *reinterpret_cast<volatile T *>(ptr);
530  // __TBB_CompareAndSwapGeneric presumed to have full fence.
531  if( __TBB_CompareAndSwapGeneric<S,T> ( ptr, value, result )==result )
532  break;
533  }
534  return result;
535 }
536 
537 #if __TBB_USE_GENERIC_PART_WORD_CAS
538 #define __TBB_machine_cmpswp1 tbb::internal::__TBB_CompareAndSwapGeneric<1,int8_t>
539 #define __TBB_machine_cmpswp2 tbb::internal::__TBB_CompareAndSwapGeneric<2,int16_t>
540 #endif
541 
542 #if __TBB_USE_GENERIC_FETCH_ADD || __TBB_USE_GENERIC_PART_WORD_FETCH_ADD
543 #define __TBB_machine_fetchadd1 tbb::internal::__TBB_FetchAndAddGeneric<1,int8_t>
544 #define __TBB_machine_fetchadd2 tbb::internal::__TBB_FetchAndAddGeneric<2,int16_t>
545 #endif
546 
547 #if __TBB_USE_GENERIC_FETCH_ADD
548 #define __TBB_machine_fetchadd4 tbb::internal::__TBB_FetchAndAddGeneric<4,int32_t>
549 #endif
550 
551 #if __TBB_USE_GENERIC_FETCH_ADD || __TBB_USE_GENERIC_DWORD_FETCH_ADD
552 #define __TBB_machine_fetchadd8 tbb::internal::__TBB_FetchAndAddGeneric<8,int64_t>
553 #endif
554 
555 #if __TBB_USE_GENERIC_FETCH_STORE || __TBB_USE_GENERIC_PART_WORD_FETCH_STORE
556 #define __TBB_machine_fetchstore1 tbb::internal::__TBB_FetchAndStoreGeneric<1,int8_t>
557 #define __TBB_machine_fetchstore2 tbb::internal::__TBB_FetchAndStoreGeneric<2,int16_t>
558 #endif
559 
560 #if __TBB_USE_GENERIC_FETCH_STORE
561 #define __TBB_machine_fetchstore4 tbb::internal::__TBB_FetchAndStoreGeneric<4,int32_t>
562 #endif
563 
564 #if __TBB_USE_GENERIC_FETCH_STORE || __TBB_USE_GENERIC_DWORD_FETCH_STORE
565 #define __TBB_machine_fetchstore8 tbb::internal::__TBB_FetchAndStoreGeneric<8,int64_t>
566 #endif
567 
568 #if __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE
569 #define __TBB_MACHINE_DEFINE_ATOMIC_SELECTOR_FETCH_STORE(S) \
570  atomic_selector<S>::word atomic_selector<S>::fetch_store ( volatile void* location, word value ) { \
571  return __TBB_machine_fetchstore##S( location, value ); \
572  }
573 
574 __TBB_MACHINE_DEFINE_ATOMIC_SELECTOR_FETCH_STORE(1)
575 __TBB_MACHINE_DEFINE_ATOMIC_SELECTOR_FETCH_STORE(2)
576 __TBB_MACHINE_DEFINE_ATOMIC_SELECTOR_FETCH_STORE(4)
577 __TBB_MACHINE_DEFINE_ATOMIC_SELECTOR_FETCH_STORE(8)
578 
579 #undef __TBB_MACHINE_DEFINE_ATOMIC_SELECTOR_FETCH_STORE
580 #endif /* __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE */
581 
582 #if __TBB_USE_GENERIC_DWORD_LOAD_STORE
583 /*TODO: find a more elegant way to handle function names difference*/
584 #if ! __TBB_USE_FENCED_ATOMICS
585  /* This name forwarding is needed for generic implementation of
586  * load8/store8 defined below (via macro) to pick the right CAS function*/
587  #define __TBB_machine_cmpswp8full_fence __TBB_machine_cmpswp8
588 #endif
591 
592 #if ! __TBB_USE_FENCED_ATOMICS
593  #undef __TBB_machine_cmpswp8full_fence
594 #endif
595 
596 #define __TBB_machine_store8 tbb::internal::__TBB_machine_generic_store8full_fence
597 #define __TBB_machine_load8 tbb::internal::__TBB_machine_generic_load8full_fence
598 #endif /* __TBB_USE_GENERIC_DWORD_LOAD_STORE */
599 
600 #if __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE
601 
611 template <typename T, size_t S>
612 struct machine_load_store {
613  static T load_with_acquire ( const volatile T& location ) {
614  T to_return = location;
616  return to_return;
617  }
618  static void store_with_release ( volatile T &location, T value ) {
620  location = value;
621  }
622 };
623 
624 //in general, plain load and store of 32bit compiler is not atomic for 64bit types
625 #if __TBB_WORDSIZE==4 && __TBB_64BIT_ATOMICS
626 template <typename T>
627 struct machine_load_store<T,8> {
628  static T load_with_acquire ( const volatile T& location ) {
629  return (T)__TBB_machine_load8( (const volatile void*)&location );
630  }
631  static void store_with_release ( volatile T& location, T value ) {
632  __TBB_machine_store8( (volatile void*)&location, (int64_t)value );
633  }
634 };
635 #endif /* __TBB_WORDSIZE==4 && __TBB_64BIT_ATOMICS */
636 #endif /* __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE */
637 
638 #if __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE
639 template <typename T, size_t S>
641  static T load ( const volatile T& location ) {
644  }
645 #if __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE
646  static void store ( volatile T &location, T value ) {
647  atomic_selector<S>::fetch_store( (volatile void*)&location, (typename atomic_selector<S>::word)value );
648  }
649 #else /* !__TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE */
650  static void store ( volatile T &location, T value ) {
653  }
654 #endif /* !__TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE */
655 };
656 
657 #if __TBB_WORDSIZE==4 && __TBB_64BIT_ATOMICS
658 
660 template <typename T>
661 struct machine_load_store_seq_cst<T,8> {
662  static T load ( const volatile T& location ) {
663  // Comparand and new value may be anything, they only must be equal, and
664  // the value should have a low probability to be actually found in 'location'.
665  const int64_t anyvalue = 2305843009213693951LL;
666  return __TBB_machine_cmpswp8( (volatile void*)const_cast<volatile T*>(&location), anyvalue, anyvalue );
667  }
668  static void store ( volatile T &location, T value ) {
669 #if __TBB_GCC_VERSION >= 40702
670 #pragma GCC diagnostic push
671 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
672 #endif
673  // An atomic initialization leads to reading of uninitialized memory
674  int64_t result = (volatile int64_t&)location;
675 #if __TBB_GCC_VERSION >= 40702
676 #pragma GCC diagnostic pop
677 #endif
678  while ( __TBB_machine_cmpswp8((volatile void*)&location, (int64_t)value, result) != result )
679  result = (volatile int64_t&)location;
680  }
681 };
682 #endif /* __TBB_WORDSIZE==4 && __TBB_64BIT_ATOMICS */
683 #endif /*__TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE */
684 
685 #if __TBB_USE_GENERIC_RELAXED_LOAD_STORE
686 // Relaxed operations add volatile qualifier to prevent compiler from optimizing them out.
690 template <typename T, size_t S>
692  static inline T load ( const volatile T& location ) {
693  return location;
694  }
695  static inline void store ( volatile T& location, T value ) {
696  location = value;
697  }
698 };
699 
700 #if __TBB_WORDSIZE==4 && __TBB_64BIT_ATOMICS
701 template <typename T>
702 struct machine_load_store_relaxed<T,8> {
703  static inline T load ( const volatile T& location ) {
704  return (T)__TBB_machine_load8( (const volatile void*)&location );
705  }
706  static inline void store ( volatile T& location, T value ) {
707  __TBB_machine_store8( (volatile void*)&location, (int64_t)value );
708  }
709 };
710 #endif /* __TBB_WORDSIZE==4 && __TBB_64BIT_ATOMICS */
711 #endif /* __TBB_USE_GENERIC_RELAXED_LOAD_STORE */
712 
713 #undef __TBB_WORDSIZE //this macro is forbidden to use outside of atomic machinery
714 
715 template<typename T>
716 inline T __TBB_load_with_acquire(const volatile T &location) {
718 }
719 template<typename T, typename V>
720 inline void __TBB_store_with_release(volatile T& location, V value) {
722 }
724 inline void __TBB_store_with_release(volatile size_t& location, size_t value) {
726 }
727 
728 template<typename T>
729 inline T __TBB_load_full_fence(const volatile T &location) {
731 }
732 template<typename T, typename V>
733 inline void __TBB_store_full_fence(volatile T& location, V value) {
735 }
737 inline void __TBB_store_full_fence(volatile size_t& location, size_t value) {
739 }
740 
741 template<typename T>
742 inline T __TBB_load_relaxed (const volatile T& location) {
743  return machine_load_store_relaxed<T,sizeof(T)>::load( const_cast<T&>(location) );
744 }
745 template<typename T, typename V>
746 inline void __TBB_store_relaxed ( volatile T& location, V value ) {
747  machine_load_store_relaxed<T,sizeof(T)>::store( const_cast<T&>(location), T(value) );
748 }
750 inline void __TBB_store_relaxed ( volatile size_t& location, size_t value ) {
751  machine_load_store_relaxed<size_t,sizeof(size_t)>::store( const_cast<size_t&>(location), value );
752 }
753 
754 // Macro __TBB_TypeWithAlignmentAtLeastAsStrict(T) should be a type with alignment at least as
755 // strict as type T. The type should have a trivial default constructor and destructor, so that
756 // arrays of that type can be declared without initializers.
757 // It is correct (but perhaps a waste of space) if __TBB_TypeWithAlignmentAtLeastAsStrict(T) expands
758 // to a type bigger than T.
759 // The default definition here works on machines where integers are naturally aligned and the
760 // strictest alignment is 64.
761 #ifndef __TBB_TypeWithAlignmentAtLeastAsStrict
762 
763 #if __TBB_ALIGNAS_PRESENT
764 
765 // Use C++11 keywords alignas and alignof
766 #define __TBB_DefineTypeWithAlignment(PowerOf2) \
767 struct alignas(PowerOf2) __TBB_machine_type_with_alignment_##PowerOf2 { \
768  uint32_t member[PowerOf2/sizeof(uint32_t)]; \
769 };
770 #define __TBB_alignof(T) alignof(T)
771 
772 #elif __TBB_ATTRIBUTE_ALIGNED_PRESENT
773 
774 #define __TBB_DefineTypeWithAlignment(PowerOf2) \
775 struct __TBB_machine_type_with_alignment_##PowerOf2 { \
776  uint32_t member[PowerOf2/sizeof(uint32_t)]; \
777 } __attribute__((aligned(PowerOf2)));
778 #define __TBB_alignof(T) __alignof__(T)
779 
780 #elif __TBB_DECLSPEC_ALIGN_PRESENT
781 
782 #define __TBB_DefineTypeWithAlignment(PowerOf2) \
783 __declspec(align(PowerOf2)) \
784 struct __TBB_machine_type_with_alignment_##PowerOf2 { \
785  uint32_t member[PowerOf2/sizeof(uint32_t)]; \
786 };
787 #define __TBB_alignof(T) __alignof(T)
788 
789 #else /* A compiler with unknown syntax for data alignment */
790 #error Must define __TBB_TypeWithAlignmentAtLeastAsStrict(T)
791 #endif
792 
793 /* Now declare types aligned to useful powers of two */
794 __TBB_DefineTypeWithAlignment(8) // i386 ABI says that uint64_t is aligned on 4 bytes
798 
799 typedef __TBB_machine_type_with_alignment_64 __TBB_machine_type_with_strictest_alignment;
800 
801 // Primary template is a declaration of incomplete type so that it fails with unknown alignments
802 template<size_t N> struct type_with_alignment;
803 
804 // Specializations for allowed alignments
805 template<> struct type_with_alignment<1> { char member; };
806 template<> struct type_with_alignment<2> { uint16_t member; };
807 template<> struct type_with_alignment<4> { uint32_t member; };
808 template<> struct type_with_alignment<8> { __TBB_machine_type_with_alignment_8 member; };
809 template<> struct type_with_alignment<16> {__TBB_machine_type_with_alignment_16 member; };
810 template<> struct type_with_alignment<32> {__TBB_machine_type_with_alignment_32 member; };
811 template<> struct type_with_alignment<64> {__TBB_machine_type_with_alignment_64 member; };
812 
813 #if __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN
814 
817 template<size_t Size, typename T>
818 struct work_around_alignment_bug {
819  static const size_t alignment = __TBB_alignof(T);
820 };
821 #define __TBB_TypeWithAlignmentAtLeastAsStrict(T) tbb::internal::type_with_alignment<tbb::internal::work_around_alignment_bug<sizeof(T),T>::alignment>
822 #else
823 #define __TBB_TypeWithAlignmentAtLeastAsStrict(T) tbb::internal::type_with_alignment<__TBB_alignof(T)>
824 #endif /* __TBB_ALIGNOF_NOT_INSTANTIATED_TYPES_BROKEN */
825 
826 #endif /* __TBB_TypeWithAlignmentAtLeastAsStrict */
827 
828 // Template class here is to avoid instantiation of the static data for modules that don't use it
829 template<typename T>
830 struct reverse {
831  static const T byte_table[256];
832 };
833 // An efficient implementation of the reverse function utilizes a 2^8 lookup table holding the bit-reversed
834 // values of [0..2^8 - 1]. Those values can also be computed on the fly at a slightly higher cost.
835 template<typename T>
836 const T reverse<T>::byte_table[256] = {
837  0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0,
838  0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8,
839  0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
840  0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC,
841  0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2,
842  0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
843  0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6,
844  0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE,
845  0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
846  0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9,
847  0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
848  0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
849  0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
850  0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB,
851  0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
852  0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF
853 };
854 
855 } // namespace internal @endcond
856 } // namespace tbb
857 
858 // Preserving access to legacy APIs
861 
862 // Mapping historically used names to the ones expected by atomic_load_store_traits
863 #define __TBB_load_acquire __TBB_load_with_acquire
864 #define __TBB_store_release __TBB_store_with_release
865 
866 #ifndef __TBB_Log2
867 inline intptr_t __TBB_Log2( uintptr_t x ) {
868  if( x==0 ) return -1;
869  intptr_t result = 0;
870 
871 #if !defined(_M_ARM)
872  uintptr_t tmp_;
873  if( sizeof(x)>4 && (tmp_ = ((uint64_t)x)>>32) ) { x=tmp_; result += 32; }
874 #endif
875  if( uintptr_t tmp = x>>16 ) { x=tmp; result += 16; }
876  if( uintptr_t tmp = x>>8 ) { x=tmp; result += 8; }
877  if( uintptr_t tmp = x>>4 ) { x=tmp; result += 4; }
878  if( uintptr_t tmp = x>>2 ) { x=tmp; result += 2; }
879 
880  return (x&2)? result+1: result;
881 }
882 #endif
883 
884 #ifndef __TBB_AtomicOR
885 inline void __TBB_AtomicOR( volatile void *operand, uintptr_t addend ) {
886  for( tbb::internal::atomic_backoff b;;b.pause() ) {
887  uintptr_t tmp = *(volatile uintptr_t *)operand;
888  uintptr_t result = __TBB_CompareAndSwapW(operand, tmp|addend, tmp);
889  if( result==tmp ) break;
890  }
891 }
892 #endif
893 
894 #ifndef __TBB_AtomicAND
895 inline void __TBB_AtomicAND( volatile void *operand, uintptr_t addend ) {
896  for( tbb::internal::atomic_backoff b;;b.pause() ) {
897  uintptr_t tmp = *(volatile uintptr_t *)operand;
898  uintptr_t result = __TBB_CompareAndSwapW(operand, tmp&addend, tmp);
899  if( result==tmp ) break;
900  }
901 }
902 #endif
903 
904 #if __TBB_PREFETCHING
905 #ifndef __TBB_cl_prefetch
906 #error This platform does not define cache management primitives required for __TBB_PREFETCHING
907 #endif
908 
909 #ifndef __TBB_cl_evict
910 #define __TBB_cl_evict(p)
911 #endif
912 #endif
913 
914 #ifndef __TBB_Flag
915 typedef unsigned char __TBB_Flag;
916 #endif
918 
919 #ifndef __TBB_TryLockByte
920 inline bool __TBB_TryLockByte( __TBB_atomic_flag &flag ) {
921  return __TBB_machine_cmpswp1(&flag,1,0)==0;
922 }
923 #endif
924 
925 #ifndef __TBB_LockByte
928  while( !__TBB_TryLockByte(flag) ) backoff.pause();
929  return 0;
930 }
931 #endif
932 
933 #ifndef __TBB_UnlockByte
934 #define __TBB_UnlockByte(addr) __TBB_store_with_release((addr),0)
935 #endif
936 
937 // lock primitives with Intel(R) Transactional Synchronization Extensions (Intel(R) TSX)
938 #if ( __TBB_x86_32 || __TBB_x86_64 ) /* only on ia32/intel64 */
939 inline void __TBB_TryLockByteElidedCancel() { __TBB_machine_try_lock_elided_cancel(); }
940 
941 inline bool __TBB_TryLockByteElided( __TBB_atomic_flag& flag ) {
942  bool res = __TBB_machine_try_lock_elided( &flag )!=0;
943  // to avoid the "lemming" effect, we need to abort the transaction
944  // if __TBB_machine_try_lock_elided returns false (i.e., someone else
945  // has acquired the mutex non-speculatively).
946  if( !res ) __TBB_TryLockByteElidedCancel();
947  return res;
948 }
949 
950 inline void __TBB_LockByteElided( __TBB_atomic_flag& flag )
951 {
952  for(;;) {
954  if( __TBB_machine_try_lock_elided( &flag ) )
955  return;
956  // Another thread acquired the lock "for real".
957  // To avoid the "lemming" effect, we abort the transaction.
958  __TBB_TryLockByteElidedCancel();
959  }
960 }
961 
962 inline void __TBB_UnlockByteElided( __TBB_atomic_flag& flag ) {
964 }
965 #endif
966 
967 #ifndef __TBB_ReverseByte
968 inline unsigned char __TBB_ReverseByte(unsigned char src) {
970 }
971 #endif
972 
973 template<typename T>
975  T dst;
976  unsigned char *original = (unsigned char *) &src;
977  unsigned char *reversed = (unsigned char *) &dst;
978 
979  for( int i = sizeof(T)-1; i >= 0; i-- )
980  reversed[i] = __TBB_ReverseByte( original[sizeof(T)-i-1] );
981 
982  return dst;
983 }
984 
985 #endif /* __TBB_machine_H */
Class that implements exponential backoff.
Definition: tbb_machine.h:352
Sequential consistency.
Definition: atomic.h:45
void __TBB_EXPORTED_FUNC __TBB_machine_store8(volatile void *ptr, __int64 value)
T __TBB_load_full_fence(const volatile T &location)
Definition: tbb_machine.h:729
#define __TBB_MACHINE_DEFINE_STORE8_GENERIC_FENCED(M)
Definition: tbb_machine.h:169
#define __TBB_ENDIAN_BIG
Definition: tbb_machine.h:188
__TBB_atomic __TBB_Flag __TBB_atomic_flag
Definition: gcc_generic.h:110
#define __TBB_ENDIANNESS
Definition: tbb_machine.h:421
__int64 __TBB_EXPORTED_FUNC __TBB_machine_load8(const volatile void *ptr)
bool __TBB_TryLockByte(__TBB_atomic_flag &flag)
Definition: tbb_machine.h:920
T __TBB_load_with_acquire(const volatile T &location)
Definition: tbb_machine.h:716
int8_t __TBB_CompareAndSwapGeneric< 1, int8_t >(volatile void *ptr, int8_t value, int8_t comparand)
Definition: tbb_machine.h:483
__TBB_machine_type_with_alignment_32 member
Definition: tbb_machine.h:810
unsigned char __TBB_Flag
Definition: gcc_generic.h:109
T __TBB_MaskedCompareAndSwap(volatile T *const ptr, const T value, const T comparand)
Definition: tbb_machine.h:439
unsigned char __TBB_ReverseByte(unsigned char src)
Definition: tbb_machine.h:968
int16_t __TBB_CompareAndSwapGeneric< 2, int16_t >(volatile void *ptr, int16_t value, int16_t comparand)
Definition: tbb_machine.h:492
static void store_with_release(volatile T &location, T value)
Definition: icc_generic.h:102
void __TBB_AtomicAND(volatile void *operand, uintptr_t addend)
Definition: tbb_machine.h:895
#define __TBB_Yield()
Definition: ibm_aix51.h:48
int32_t __TBB_CompareAndSwapGeneric< 4, int32_t >(volatile void *ptr, int32_t value, int32_t comparand)
Definition: tbb_machine.h:501
__TBB_DefineTypeWithAlignment(8) __TBB_DefineTypeWithAlignment(16) __TBB_DefineTypeWithAlignment(32) __TBB_DefineTypeWithAlignment(64) typedef __TBB_machine_type_with_alignment_64 __TBB_machine_type_with_strictest_alignment
unsigned char __TBB_Flag
Definition: tbb_machine.h:915
__int16 __TBB_EXPORTED_FUNC __TBB_machine_cmpswp2(volatile void *ptr, __int16 value, __int16 comparand)
void store(atomic< T > &a, T value)
Definition: atomic.h:524
T load(const atomic< T > &a)
Definition: atomic.h:521
void atomic_fence()
Sequentially consistent full memory fence.
Definition: tbb_machine.h:346
T __TBB_ReverseBits(T src)
Definition: tbb_machine.h:974
void __TBB_store_full_fence(volatile T &location, V value)
Definition: tbb_machine.h:733
#define __TBB_acquire_consistency_helper()
Definition: gcc_generic.h:61
#define __TBB_full_memory_fence()
Definition: gcc_generic.h:63
void __TBB_store_relaxed(volatile T &location, V value)
Definition: tbb_machine.h:746
intptr_t __TBB_Log2(uintptr_t x)
Definition: tbb_machine.h:867
#define __TBB_MACHINE_DEFINE_LOAD8_GENERIC_FENCED(M)
Definition: tbb_machine.h:177
#define __TBB_release_consistency_helper()
Definition: gcc_generic.h:62
__TBB_atomic __TBB_Flag __TBB_atomic_flag
Definition: tbb_machine.h:917
void __TBB_EXPORTED_FUNC __TBB_machine_unlock_elided(volatile void *ptr)
T __TBB_FetchAndStoreGeneric(volatile void *ptr, T value)
Definition: tbb_machine.h:526
The graph class.
__int8 __TBB_EXPORTED_FUNC __TBB_machine_cmpswp1(volatile void *ptr, __int8 value, __int8 comparand)
void spin_wait_while_eq(const volatile T &location, U value)
Spin WHILE the value of the variable is equal to a given value.
Definition: tbb_machine.h:398
__declspec(dllimport) int __stdcall SwitchToThread(void)
int64_t __TBB_CompareAndSwapGeneric< 8, int64_t >(volatile void *ptr, int64_t value, int64_t comparand)
Definition: tbb_machine.h:508
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int void size_t ITT_FORMAT d void ITT_FORMAT p void ITT_FORMAT p __itt_model_site __itt_model_site_instance ITT_FORMAT p __itt_model_task __itt_model_task_instance ITT_FORMAT p void ITT_FORMAT p void ITT_FORMAT p void size_t ITT_FORMAT d void ITT_FORMAT p const wchar_t ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s const char ITT_FORMAT s no args void ITT_FORMAT p size_t ITT_FORMAT d no args const wchar_t const wchar_t ITT_FORMAT s __itt_heap_function void size_t int ITT_FORMAT d __itt_heap_function void ITT_FORMAT p __itt_heap_function void void size_t int ITT_FORMAT d no args no args unsigned int ITT_FORMAT u const __itt_domain __itt_id ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain __itt_id ITT_FORMAT p const __itt_domain __itt_id __itt_timestamp __itt_timestamp ITT_FORMAT lu const __itt_domain __itt_id __itt_id __itt_string_handle ITT_FORMAT p const __itt_domain ITT_FORMAT p const __itt_domain __itt_string_handle unsigned long long value
__TBB_machine_type_with_alignment_8 member
Definition: tbb_machine.h:808
#define __TBB_alignof(T)
Definition: tbb_machine.h:770
namespace msvc_inline_asm static inline void pause(uintptr_t delay)
void spin_wait_until_eq(const volatile T &location, const U value)
Spin UNTIL the value of the variable is equal to a given value.
Definition: tbb_machine.h:406
void spin_wait_while(predicate_type condition)
Definition: tbb_machine.h:412
T __TBB_load_relaxed(const volatile T &location)
Definition: tbb_machine.h:742
#define __TBB_atomic
Definition: tbb_stddef.h:241
static void __TBB_machine_try_lock_elided_cancel()
Definition: gcc_itsx.h:48
void const char const char int ITT_FORMAT __itt_group_sync x void const char ITT_FORMAT __itt_group_sync s void ITT_FORMAT __itt_group_sync p void ITT_FORMAT p void ITT_FORMAT p no args __itt_suppress_mode_t unsigned int mask
__TBB_machine_type_with_alignment_16 member
Definition: tbb_machine.h:809
bool bounded_pause()
Pause for a few times and return false if saturated.
Definition: tbb_machine.h:379
static T load_with_acquire(const volatile T &location)
Definition: icc_generic.h:99
Base class for types that should not be copied or assigned.
Definition: tbb_stddef.h:335
__TBB_Flag __TBB_LockByte(__TBB_atomic_flag &flag)
Definition: tbb_machine.h:926
T __TBB_FetchAndAddGeneric(volatile void *ptr, T addend)
Definition: tbb_machine.h:514
T __TBB_CompareAndSwapGeneric(volatile void *ptr, T value, T comparand)
__TBB_machine_type_with_alignment_64 member
Definition: tbb_machine.h:811
__int8 __TBB_EXPORTED_FUNC __TBB_machine_try_lock_elided(volatile void *ptr)
void __TBB_store_with_release(volatile T &location, V value)
Definition: tbb_machine.h:720
#define __TBB_machine_cmpswp8
Definition: ibm_aix51.h:46
void pause()
Pause for a while.
Definition: tbb_machine.h:367
#define __TBB_machine_cmpswp4
Definition: ibm_aix51.h:45
void __TBB_AtomicOR(volatile void *operand, uintptr_t addend)
Definition: tbb_machine.h:885
void __TBB_Pause(int32_t)
Definition: tbb_machine.h:338

Copyright © 2005-2019 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.