Intel(R) Threading Building Blocks Doxygen Documentation
version 4.2.3
|
Go to the documentation of this file.
21 #ifndef __TBB_machine_H
22 #error Do not include this file directly; include tbb_machine.h instead
27 #include <sys/param.h>
30 #define __TBB_WORDSIZE 4
37 #if __BIG_ENDIAN__ || (defined(__BYTE_ORDER__) && __BYTE_ORDER__==__ORDER_BIG_ENDIAN__)
38 #define __TBB_ENDIANNESS __TBB_ENDIAN_BIG
39 #elif __LITTLE_ENDIAN__ || (defined(__BYTE_ORDER__) && __BYTE_ORDER__==__ORDER_LITTLE_ENDIAN__)
40 #define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE
41 #elif defined(__BYTE_ORDER__)
42 #define __TBB_ENDIANNESS __TBB_ENDIAN_UNSUPPORTED
44 #define __TBB_ENDIANNESS __TBB_ENDIAN_DETECT
48 #define __TBB_compiler_fence() __asm__ __volatile__("": : :"memory")
49 #define __TBB_full_memory_fence() __asm__ __volatile__("dmb ish": : :"memory")
50 #define __TBB_control_consistency_helper() __TBB_full_memory_fence()
51 #define __TBB_acquire_consistency_helper() __TBB_full_memory_fence()
52 #define __TBB_release_consistency_helper() __TBB_full_memory_fence()
77 "strexeq %0, %5, [%3]\n"
78 :
"=&r" (res),
"=&r" (oldval),
"+Qo" (*(
volatile int32_t*)ptr)
79 :
"r" ((
volatile int32_t *)ptr),
"Ir" (comparand),
"r" (
value)
103 __asm__ __volatile__(
105 "ldrexd %1, %H1, [%3]\n"
110 "strexdeq %0, %5, %H5, [%3]"
111 :
"=&r" (res),
"=&r" (oldval),
"+Qo" (*(
volatile int64_t*)ptr)
112 :
"r" ((
volatile int64_t *)ptr),
"r" (comparand),
"r" (
value)
124 int32_t result, tmp2;
128 __asm__ __volatile__(
129 "1: ldrex %0, [%4]\n"
131 " strex %1, %3, [%4]\n"
134 :
"=&r" (result),
"=&r" (tmp),
"+Qo" (*(
volatile int32_t*)ptr),
"=&r"(tmp2)
135 :
"r" ((
volatile int32_t *)ptr),
"Ir" (addend)
146 int64_t result, tmp2;
150 __asm__ __volatile__(
151 "1: ldrexd %0, %H0, [%4]\n"
153 " adc %H3, %H0, %H5\n"
154 " strexd %1, %3, %H3, [%4]\n"
157 :
"=&r" (result),
"=&r" (tmp),
"+Qo" (*(
volatile int64_t*)ptr),
"=&r"(tmp2)
158 :
"r" ((
volatile int64_t *)ptr),
"r" (addend)
169 template <
typename T,
size_t S>
170 struct machine_load_store_relaxed {
171 static inline T
load (
const volatile T& location ) {
172 const T
value = location;
182 static inline void store (
volatile T& location, T
value ) {
190 #define __TBB_CompareAndSwap4(P,V,C) __TBB_machine_cmpswp4(P,V,C)
191 #define __TBB_CompareAndSwap8(P,V,C) __TBB_machine_cmpswp8(P,V,C)
194 #define __TBB_USE_GENERIC_PART_WORD_CAS 1
195 #define __TBB_USE_GENERIC_PART_WORD_FETCH_ADD 1
196 #define __TBB_USE_GENERIC_PART_WORD_FETCH_STORE 1
197 #define __TBB_USE_GENERIC_FETCH_STORE 1
198 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
199 #define __TBB_USE_GENERIC_DWORD_LOAD_STORE 1
200 #define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1
201 #elif defined __aarch64__
205 #error compilation requires an ARMv7-a or ARMv8-a architecture.
206 #endif // __ARM_ARCH_7A__
212 __asm__ __volatile__(
"yield" :::
"memory");
216 #define __TBB_Pause(V) __TBB_machine_pause(V)
long __TBB_machine_fetchadd4(volatile void *ptr, __int32 addend)
void __TBB_machine_pause(int32_t delay)
#define __TBB_acquire_consistency_helper()
#define __TBB_full_memory_fence()
#define __TBB_machine_cmpswp8
#define __TBB_machine_cmpswp4
static int64_t __TBB_machine_fetchadd8(volatile void *ptr, int64_t addend)
static T load(const T &location)
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
static void store(T &location, T value)
Copyright © 2005-2020 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.