
1 Apr
2010
1 Apr
'10
5:20 a.m.
Tim Blechmann wrote:
are you sure, that _mm_loadl_epi64 is actually atomic in your case? according to the intel manual, the value should be 64bit aligned or should not cross a cache line boundary. are you sure, that this cannot occur?
Yes, atomic64_t is declared as typedef long long __declspec( align(8) ) atomic64_t ; for x86 win32 (for x86 gcc there is similar declaration) So, I hope it is aligned and atomic. In additions, I check the proper alignment in calls by assert( is_aligned<8>( pAddr )) ; where is_aligned is: template <int ALIGN, typename T> static inline bool is_aligned(T const * p) { return (((uptr_atomic_t)p) & (ALIGN - 1)) == 0 ; } Regards, Max