21 #if !defined(__TBB_machine_H) || defined(__TBB_machine_linux_intel64_H) 22 #error Do not #include this internal file directly; use public TBB headers instead. 25 #define __TBB_machine_linux_intel64_H 28 #include "gcc_ia32_common.h" 30 #define __TBB_WORDSIZE 8 31 #define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE 33 #define __TBB_compiler_fence() __asm__ __volatile__("": : :"memory") 34 #define __TBB_control_consistency_helper() __TBB_compiler_fence() 35 #define __TBB_acquire_consistency_helper() __TBB_compiler_fence() 36 #define __TBB_release_consistency_helper() __TBB_compiler_fence() 38 #ifndef __TBB_full_memory_fence 39 #define __TBB_full_memory_fence() __asm__ __volatile__("mfence": : :"memory") 42 #define __TBB_MACHINE_DEFINE_ATOMICS(S,T,X) \ 43 static inline T __TBB_machine_cmpswp##S (volatile void *ptr, T value, T comparand ) \ 47 __asm__ __volatile__("lock\ncmpxchg" X " %2,%1" \ 48 : "=a"(result), "=m"(*(volatile T*)ptr) \ 49 : "q"(value), "0"(comparand), "m"(*(volatile T*)ptr) \ 54 static inline T __TBB_machine_fetchadd##S(volatile void *ptr, T addend) \ 57 __asm__ __volatile__("lock\nxadd" X " %0,%1" \ 58 : "=r"(result),"=m"(*(volatile T*)ptr) \ 59 : "0"(addend), "m"(*(volatile T*)ptr) \ 64 static inline T __TBB_machine_fetchstore##S(volatile void *ptr, T value) \ 67 __asm__ __volatile__("lock\nxchg" X " %0,%1" \ 68 : "=r"(result),"=m"(*(volatile T*)ptr) \ 69 : "0"(value), "m"(*(volatile T*)ptr) \ 74 __TBB_MACHINE_DEFINE_ATOMICS(1,int8_t,
"")
75 __TBB_MACHINE_DEFINE_ATOMICS(2,int16_t,"")
76 __TBB_MACHINE_DEFINE_ATOMICS(4,int32_t,"")
77 __TBB_MACHINE_DEFINE_ATOMICS(8,int64_t,"q")
79 #undef __TBB_MACHINE_DEFINE_ATOMICS 81 static inline void __TBB_machine_or(
volatile void *ptr, uint64_t value ) {
82 __asm__ __volatile__(
"lock\norq %1,%0" :
"=m"(*(
volatile uint64_t*)ptr) :
"r"(value),
"m"(*(
volatile uint64_t*)ptr) :
"memory");
85 static inline void __TBB_machine_and(
volatile void *ptr, uint64_t value ) {
86 __asm__ __volatile__(
"lock\nandq %1,%0" :
"=m"(*(
volatile uint64_t*)ptr) :
"r"(value),
"m"(*(
volatile uint64_t*)ptr) :
"memory");
89 #define __TBB_AtomicOR(P,V) __TBB_machine_or(P,V) 90 #define __TBB_AtomicAND(P,V) __TBB_machine_and(P,V) 92 #define __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE 1 93 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1 94 #define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1 95 #define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1