equal
deleted
inserted
replaced
211 return dest; |
211 return dest; |
212 } |
212 } |
213 |
213 |
214 template<> |
214 template<> |
215 template<typename T> |
215 template<typename T> |
216 inline void Atomic::PlatformStore<8>::operator()(T store_value, |
216 inline void Atomic::PlatformStore<8>::operator()(T volatile* dest, |
217 T volatile* dest) const { |
217 T store_value) const { |
218 STATIC_ASSERT(8 == sizeof(T)); |
218 STATIC_ASSERT(8 == sizeof(T)); |
219 volatile T* src = &store_value; |
219 volatile T* src = &store_value; |
220 __asm { |
220 __asm { |
221 mov eax, src |
221 mov eax, src |
222 fild qword ptr [eax] |
222 fild qword ptr [eax] |
232 #ifndef AMD64 |
232 #ifndef AMD64 |
233 template<> |
233 template<> |
234 struct Atomic::PlatformOrderedStore<1, RELEASE_X_FENCE> |
234 struct Atomic::PlatformOrderedStore<1, RELEASE_X_FENCE> |
235 { |
235 { |
236 template <typename T> |
236 template <typename T> |
237 void operator()(T v, volatile T* p) const { |
237 void operator()(volatile T* p, T v) const { |
238 __asm { |
238 __asm { |
239 mov edx, p; |
239 mov edx, p; |
240 mov al, v; |
240 mov al, v; |
241 xchg al, byte ptr [edx]; |
241 xchg al, byte ptr [edx]; |
242 } |
242 } |
245 |
245 |
246 template<> |
246 template<> |
247 struct Atomic::PlatformOrderedStore<2, RELEASE_X_FENCE> |
247 struct Atomic::PlatformOrderedStore<2, RELEASE_X_FENCE> |
248 { |
248 { |
249 template <typename T> |
249 template <typename T> |
250 void operator()(T v, volatile T* p) const { |
250 void operator()(volatile T* p, T v) const { |
251 __asm { |
251 __asm { |
252 mov edx, p; |
252 mov edx, p; |
253 mov ax, v; |
253 mov ax, v; |
254 xchg ax, word ptr [edx]; |
254 xchg ax, word ptr [edx]; |
255 } |
255 } |
258 |
258 |
259 template<> |
259 template<> |
260 struct Atomic::PlatformOrderedStore<4, RELEASE_X_FENCE> |
260 struct Atomic::PlatformOrderedStore<4, RELEASE_X_FENCE> |
261 { |
261 { |
262 template <typename T> |
262 template <typename T> |
263 void operator()(T v, volatile T* p) const { |
263 void operator()(volatile T* p, T v) const { |
264 __asm { |
264 __asm { |
265 mov edx, p; |
265 mov edx, p; |
266 mov eax, v; |
266 mov eax, v; |
267 xchg eax, dword ptr [edx]; |
267 xchg eax, dword ptr [edx]; |
268 } |
268 } |