File indexing completed on 2024-11-15 09:58:26
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #if !defined(__TBB_machine_H) || defined(__TBB_machine_windows_ia32_H)
0018 #error Do not #include this internal file directly; use public TBB headers instead.
0019 #endif
0020
0021 #define __TBB_machine_windows_ia32_H
0022
0023 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
0024
0025 #pragma warning (push)
0026 #pragma warning (disable: 4244 4267)
0027 #endif
0028
0029 #include "msvc_ia32_common.h"
0030
0031 #define __TBB_WORDSIZE 4
0032 #define __TBB_ENDIANNESS __TBB_ENDIAN_LITTLE
0033
0034 extern "C" {
0035 __int64 __TBB_EXPORTED_FUNC __TBB_machine_cmpswp8 (volatile void *ptr, __int64 value, __int64 comparand );
0036 __int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchadd8 (volatile void *ptr, __int64 addend );
0037 __int64 __TBB_EXPORTED_FUNC __TBB_machine_fetchstore8 (volatile void *ptr, __int64 value );
0038 void __TBB_EXPORTED_FUNC __TBB_machine_store8 (volatile void *ptr, __int64 value );
0039 __int64 __TBB_EXPORTED_FUNC __TBB_machine_load8 (const volatile void *ptr);
0040 }
0041
0042 #if !__TBB_MSVC_PART_WORD_INTERLOCKED_INTRINSICS_PRESENT
0043
0044 #define __TBB_MACHINE_DEFINE_ATOMICS(S,T,U,A,C) \
0045 static inline T __TBB_machine_cmpswp##S ( volatile void * ptr, U value, U comparand ) { \
0046 T result; \
0047 volatile T *p = (T *)ptr; \
0048 __asm \
0049 { \
0050 __asm mov edx, p \
0051 __asm mov C , value \
0052 __asm mov A , comparand \
0053 __asm lock cmpxchg [edx], C \
0054 __asm mov result, A \
0055 } \
0056 return result; \
0057 } \
0058 \
0059 static inline T __TBB_machine_fetchadd##S ( volatile void * ptr, U addend ) { \
0060 T result; \
0061 volatile T *p = (T *)ptr; \
0062 __asm \
0063 { \
0064 __asm mov edx, p \
0065 __asm mov A, addend \
0066 __asm lock xadd [edx], A \
0067 __asm mov result, A \
0068 } \
0069 return result; \
0070 }\
0071 \
0072 static inline T __TBB_machine_fetchstore##S ( volatile void * ptr, U value ) { \
0073 T result; \
0074 volatile T *p = (T *)ptr; \
0075 __asm \
0076 { \
0077 __asm mov edx, p \
0078 __asm mov A, value \
0079 __asm lock xchg [edx], A \
0080 __asm mov result, A \
0081 } \
0082 return result; \
0083 }
0084
0085
0086 __TBB_MACHINE_DEFINE_ATOMICS(1, __int8, __int8, al, cl)
0087 __TBB_MACHINE_DEFINE_ATOMICS(2, __int16, __int16, ax, cx)
0088 __TBB_MACHINE_DEFINE_ATOMICS(4, ptrdiff_t, ptrdiff_t, eax, ecx)
0089
0090 #undef __TBB_MACHINE_DEFINE_ATOMICS
0091
0092 #endif
0093
0094
0095
0096
0097 #define __TBB_USE_FETCHSTORE_AS_FULL_FENCED_STORE 1
0098 #define __TBB_USE_GENERIC_HALF_FENCED_LOAD_STORE 1
0099 #define __TBB_USE_GENERIC_RELAXED_LOAD_STORE 1
0100 #define __TBB_USE_GENERIC_SEQUENTIAL_CONSISTENCY_LOAD_STORE 1
0101
0102
0103 #if defined(_MSC_VER) && !defined(__INTEL_COMPILER)
0104 #pragma warning (pop)
0105 #endif