21 #if !defined(__TBB_machine_H) || defined(__TBB_machine_windows_ia32_H) 22 #error Do not #include this internal file directly; use public TBB headers instead. 25 #define __TBB_machine_windows_ia32_H 27 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 29 #pragma warning (push) 30 #pragma warning (disable: 4244 4267) 33 #include "msvc_ia32_common.h" 35 #define __TBB_WORDSIZE 4 36 #define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE 39 __int64 __TBB_EXPORTED_FUNC __TBB_machine_cmpswp8 (
volatile void *ptr, __int64 value, __int64 comparand );
40 __int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchadd8 (
volatile void *ptr, __int64 addend );
41 __int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchstore8 (
volatile void *ptr, __int64 value );
42 void __TBB_EXPORTED_FUNC __TBB_machine_store8 (
volatile void *ptr, __int64 value );
43 __int64 __TBB_EXPORTED_FUNC __TBB_machine_load8 (
const volatile void *ptr);
46 #ifndef __TBB_ATOMIC_PRIMITIVES_DEFINED 48 #define __TBB_MACHINE_DEFINE_ATOMICS(S,T,U,A,C) \ 49 static inline T __TBB_machine_cmpswp##S ( volatile void * ptr, U value, U comparand ) { \ 51 volatile T *p = (T *)ptr; \ 56 __asm mov A , comparand \ 57 __asm lock cmpxchg [edx], C \ 63 static inline T __TBB_machine_fetchadd##S ( volatile void * ptr, U addend ) { \ 65 volatile T *p = (T *)ptr; \ 70 __asm lock xadd [edx], A \ 76 static inline T __TBB_machine_fetchstore##S ( volatile void * ptr, U value ) { \ 78 volatile T *p = (T *)ptr; \ 83 __asm lock xchg [edx], A \ 90 __TBB_MACHINE_DEFINE_ATOMICS(1, __int8, __int8, al, cl)
91 __TBB_MACHINE_DEFINE_ATOMICS(2, __int16, __int16, ax, cx)
92 __TBB_MACHINE_DEFINE_ATOMICS(4, ptrdiff_t, ptrdiff_t, eax, ecx)
94 #undef __TBB_MACHINE_DEFINE_ATOMICS 101 #define __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE 1 102 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1 103 #define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1 104 #define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1 107 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) 108 #pragma warning (pop) 109 #endif // warnings 4244, 4267 are back