Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r84699 - trunk/boost/atomic/detail
From: andrey.semashev_at_[hidden]
Date: 2013-06-08 14:10:21


Author: andysem
Date: 2013-06-08 14:10:21 EDT (Sat, 08 Jun 2013)
New Revision: 84699
URL: http://svn.boost.org/trac/boost/changeset/84699

Log:
Code cleanup.

Text files modified:
   trunk/boost/atomic/detail/windows.hpp | 18 +++++++-----------
   1 files changed, 7 insertions(+), 11 deletions(-)

Modified: trunk/boost/atomic/detail/windows.hpp
==============================================================================
--- trunk/boost/atomic/detail/windows.hpp Sat Jun 8 13:53:12 2013 (r84698)
+++ trunk/boost/atomic/detail/windows.hpp 2013-06-08 14:10:21 EDT (Sat, 08 Jun 2013) (r84699)
@@ -33,6 +33,10 @@
 #define BOOST_ATOMIC_X86_PAUSE()
 #endif
 
+#if defined(_M_IX86) && _M_IX86 >= 500
+#define BOOST_ATOMIC_X86_HAS_CMPXCHG8B 1
+#endif
+
 // Define hardware barriers
 #if defined(_MSC_VER) && (defined(_M_AMD64) || (defined(_M_IX86) && defined(_M_IX86_FP) && _M_IX86_FP >= 2))
 extern "C" void _mm_mfence(void);
@@ -179,7 +183,7 @@
 #define BOOST_ATOMIC_SHORT_LOCK_FREE 2
 #define BOOST_ATOMIC_INT_LOCK_FREE 2
 #define BOOST_ATOMIC_LONG_LOCK_FREE 2
-#if (defined(_M_IX86) && _M_IX86 >= 500) || defined(_M_AMD64) || defined(_M_IA64)
+#if defined(BOOST_ATOMIC_X86_HAS_CMPXCHG8B) || defined(_M_AMD64) || defined(_M_IA64)
 #define BOOST_ATOMIC_LLONG_LOCK_FREE 2
 #else
 #define BOOST_ATOMIC_LLONG_LOCK_FREE 0
@@ -1465,7 +1469,7 @@
     storage_type v_;
 };
 
-#elif defined(_M_IX86) && _M_IX86 >= 500
+#elif defined(BOOST_ATOMIC_X86_HAS_CMPXCHG8B)
 
 template<typename T>
 inline bool
@@ -1489,15 +1493,7 @@
         lock cmpxchg8b qword ptr [edi]
         mov dword ptr [esi], eax
         mov dword ptr [esi + 4], edx
-#if _M_IX86 >= 600
         sete result
-#else
- mov al, 0
- jne not_equal_label
- mov al, 1
-not_equal_label:
- mov result, al
-#endif
     };
     return result;
 #endif
@@ -1600,7 +1596,7 @@
 } // namespace boost
 
 /* pull in 64-bit atomic type using cmpxchg8b above */
-#if defined(_M_IX86) && _M_IX86 >= 500
+#if defined(BOOST_ATOMIC_X86_HAS_CMPXCHG8B)
 #include <boost/atomic/detail/cas64strong.hpp>
 #endif
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk