2 * Distributed under the Boost Software License, Version 1.0.
3 * (See accompanying file LICENSE_1_0.txt or copy at
4 * http://www.boost.org/LICENSE_1_0.txt)
6 * Copyright (c) 2017 Andrey Semashev
9 * \file atomic/detail/extra_ops_msvc_x86.hpp
11 * This header contains implementation of the extra atomic operations for x86.
14 #ifndef BOOST_ATOMIC_DETAIL_EXTRA_OPS_MSVC_X86_HPP_INCLUDED_
15 #define BOOST_ATOMIC_DETAIL_EXTRA_OPS_MSVC_X86_HPP_INCLUDED_
18 #include <boost/memory_order.hpp>
19 #include <boost/atomic/detail/config.hpp>
20 #include <boost/atomic/detail/interlocked.hpp>
21 #include <boost/atomic/detail/storage_traits.hpp>
22 #include <boost/atomic/detail/extra_operations_fwd.hpp>
23 #include <boost/atomic/detail/extra_ops_generic.hpp>
24 #include <boost/atomic/detail/header.hpp>
26 #ifdef BOOST_HAS_PRAGMA_ONCE
36 template< typename Base, bool Signed >
37 struct extra_operations< Base, 1u, Signed, true > :
38 public extra_operations_generic< Base, 1u, Signed >
40 typedef extra_operations_generic< Base, 1u, Signed > base_type;
41 typedef typename base_type::storage_type storage_type;
43 static BOOST_FORCEINLINE storage_type fetch_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
45 base_type::fence_before(order);
50 movzx eax, byte ptr [ecx]
55 lock cmpxchg byte ptr [ecx], dl
59 base_type::fence_after(order);
63 static BOOST_FORCEINLINE storage_type negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
65 base_type::fence_before(order);
70 movzx eax, byte ptr [ecx]
75 lock cmpxchg byte ptr [ecx], dl
79 base_type::fence_after(order);
83 static BOOST_FORCEINLINE bool negate_and_test(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
85 base_type::fence_before(order);
90 movzx eax, byte ptr [ecx]
95 lock cmpxchg byte ptr [ecx], dl
100 base_type::fence_after(order);
104 static BOOST_FORCEINLINE void opaque_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
106 base_type::fence_before(order);
110 movzx eax, byte ptr [ecx]
115 lock cmpxchg byte ptr [ecx], dl
118 base_type::fence_after(order);
121 static BOOST_FORCEINLINE storage_type bitwise_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
123 base_type::fence_before(order);
129 movzx eax, byte ptr [edi]
134 lock cmpxchg byte ptr [edi], dl
138 base_type::fence_after(order);
142 static BOOST_FORCEINLINE storage_type bitwise_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
144 base_type::fence_before(order);
150 movzx eax, byte ptr [edi]
155 lock cmpxchg byte ptr [edi], dl
159 base_type::fence_after(order);
163 static BOOST_FORCEINLINE storage_type bitwise_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
165 base_type::fence_before(order);
171 movzx eax, byte ptr [edi]
176 lock cmpxchg byte ptr [edi], dl
180 base_type::fence_after(order);
184 static BOOST_FORCEINLINE storage_type fetch_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
186 base_type::fence_before(order);
187 storage_type old_val;
191 movzx eax, byte ptr [ecx]
196 lock cmpxchg byte ptr [ecx], dl
200 base_type::fence_after(order);
204 static BOOST_FORCEINLINE storage_type bitwise_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
206 base_type::fence_before(order);
207 storage_type new_val;
211 movzx eax, byte ptr [ecx]
216 lock cmpxchg byte ptr [ecx], dl
220 base_type::fence_after(order);
224 static BOOST_FORCEINLINE bool complement_and_test(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
226 base_type::fence_before(order);
231 movzx eax, byte ptr [ecx]
236 lock cmpxchg byte ptr [ecx], dl
241 base_type::fence_after(order);
245 static BOOST_FORCEINLINE void opaque_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
247 base_type::fence_before(order);
251 movzx eax, byte ptr [ecx]
256 lock cmpxchg byte ptr [ecx], dl
259 base_type::fence_after(order);
262 static BOOST_FORCEINLINE void opaque_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
264 base_type::fence_before(order);
269 lock add byte ptr [edx], al
271 base_type::fence_after(order);
274 static BOOST_FORCEINLINE void opaque_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
276 base_type::fence_before(order);
281 lock sub byte ptr [edx], al
283 base_type::fence_after(order);
286 static BOOST_FORCEINLINE void opaque_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
288 base_type::fence_before(order);
292 lock neg byte ptr [edx]
294 base_type::fence_after(order);
297 static BOOST_FORCEINLINE void opaque_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
299 base_type::fence_before(order);
304 lock and byte ptr [edx], al
306 base_type::fence_after(order);
309 static BOOST_FORCEINLINE void opaque_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
311 base_type::fence_before(order);
316 lock or byte ptr [edx], al
318 base_type::fence_after(order);
321 static BOOST_FORCEINLINE void opaque_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
323 base_type::fence_before(order);
328 lock xor byte ptr [edx], al
330 base_type::fence_after(order);
333 static BOOST_FORCEINLINE void opaque_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
335 base_type::fence_before(order);
339 lock not byte ptr [edx]
341 base_type::fence_after(order);
344 static BOOST_FORCEINLINE bool add_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
346 base_type::fence_before(order);
352 lock add byte ptr [edx], al
355 base_type::fence_after(order);
359 static BOOST_FORCEINLINE bool sub_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
361 base_type::fence_before(order);
367 lock sub byte ptr [edx], al
370 base_type::fence_after(order);
374 static BOOST_FORCEINLINE bool and_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
376 base_type::fence_before(order);
382 lock and byte ptr [edx], al
385 base_type::fence_after(order);
389 static BOOST_FORCEINLINE bool or_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
391 base_type::fence_before(order);
397 lock or byte ptr [edx], al
400 base_type::fence_after(order);
404 static BOOST_FORCEINLINE bool xor_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
406 base_type::fence_before(order);
412 lock xor byte ptr [edx], al
415 base_type::fence_after(order);
420 template< typename Base, bool Signed >
421 struct extra_operations< Base, 2u, Signed, true > :
422 public extra_operations_generic< Base, 2u, Signed >
424 typedef extra_operations_generic< Base, 2u, Signed > base_type;
425 typedef typename base_type::storage_type storage_type;
427 static BOOST_FORCEINLINE storage_type fetch_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
429 base_type::fence_before(order);
430 storage_type old_val;
434 movzx eax, word ptr [ecx]
439 lock cmpxchg word ptr [ecx], dx
443 base_type::fence_after(order);
447 static BOOST_FORCEINLINE storage_type negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
449 base_type::fence_before(order);
450 storage_type new_val;
454 movzx eax, word ptr [ecx]
459 lock cmpxchg word ptr [ecx], dx
463 base_type::fence_after(order);
467 static BOOST_FORCEINLINE bool negate_and_test(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
469 base_type::fence_before(order);
474 movzx eax, word ptr [ecx]
479 lock cmpxchg word ptr [ecx], dx
484 base_type::fence_after(order);
488 static BOOST_FORCEINLINE void opaque_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
490 base_type::fence_before(order);
494 movzx eax, word ptr [ecx]
499 lock cmpxchg word ptr [ecx], dx
502 base_type::fence_after(order);
505 static BOOST_FORCEINLINE storage_type bitwise_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
507 base_type::fence_before(order);
513 movzx eax, word ptr [edi]
518 lock cmpxchg word ptr [edi], dx
522 base_type::fence_after(order);
526 static BOOST_FORCEINLINE storage_type bitwise_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
528 base_type::fence_before(order);
534 movzx eax, word ptr [edi]
539 lock cmpxchg word ptr [edi], dx
543 base_type::fence_after(order);
547 static BOOST_FORCEINLINE storage_type bitwise_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
549 base_type::fence_before(order);
555 movzx eax, word ptr [edi]
560 lock cmpxchg word ptr [edi], dx
564 base_type::fence_after(order);
568 static BOOST_FORCEINLINE storage_type fetch_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
570 base_type::fence_before(order);
571 storage_type old_val;
575 movzx eax, word ptr [ecx]
580 lock cmpxchg word ptr [ecx], dx
584 base_type::fence_after(order);
588 static BOOST_FORCEINLINE storage_type bitwise_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
590 base_type::fence_before(order);
591 storage_type new_val;
595 movzx eax, word ptr [ecx]
600 lock cmpxchg word ptr [ecx], dx
604 base_type::fence_after(order);
608 static BOOST_FORCEINLINE bool complement_and_test(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
610 base_type::fence_before(order);
615 movzx eax, word ptr [ecx]
620 lock cmpxchg word ptr [ecx], dx
625 base_type::fence_after(order);
629 static BOOST_FORCEINLINE void opaque_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
631 base_type::fence_before(order);
635 movzx eax, word ptr [ecx]
640 lock cmpxchg word ptr [ecx], dx
643 base_type::fence_after(order);
646 static BOOST_FORCEINLINE void opaque_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
648 base_type::fence_before(order);
653 lock add word ptr [edx], ax
655 base_type::fence_after(order);
658 static BOOST_FORCEINLINE void opaque_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
660 base_type::fence_before(order);
665 lock sub word ptr [edx], ax
667 base_type::fence_after(order);
670 static BOOST_FORCEINLINE void opaque_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
672 base_type::fence_before(order);
676 lock neg word ptr [edx]
678 base_type::fence_after(order);
681 static BOOST_FORCEINLINE void opaque_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
683 base_type::fence_before(order);
688 lock and word ptr [edx], ax
690 base_type::fence_after(order);
693 static BOOST_FORCEINLINE void opaque_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
695 base_type::fence_before(order);
700 lock or word ptr [edx], ax
702 base_type::fence_after(order);
705 static BOOST_FORCEINLINE void opaque_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
707 base_type::fence_before(order);
712 lock xor word ptr [edx], ax
714 base_type::fence_after(order);
717 static BOOST_FORCEINLINE void opaque_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
719 base_type::fence_before(order);
723 lock not word ptr [edx]
725 base_type::fence_after(order);
728 static BOOST_FORCEINLINE bool add_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
730 base_type::fence_before(order);
736 lock add word ptr [edx], ax
739 base_type::fence_after(order);
743 static BOOST_FORCEINLINE bool sub_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
745 base_type::fence_before(order);
751 lock sub word ptr [edx], ax
754 base_type::fence_after(order);
758 static BOOST_FORCEINLINE bool and_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
760 base_type::fence_before(order);
766 lock and word ptr [edx], ax
769 base_type::fence_after(order);
773 static BOOST_FORCEINLINE bool or_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
775 base_type::fence_before(order);
781 lock or word ptr [edx], ax
784 base_type::fence_after(order);
788 static BOOST_FORCEINLINE bool xor_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
790 base_type::fence_before(order);
796 lock xor word ptr [edx], ax
799 base_type::fence_after(order);
803 static BOOST_FORCEINLINE bool bit_test_and_set(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
805 base_type::fence_before(order);
811 lock bts word ptr [edx], ax
814 base_type::fence_after(order);
818 static BOOST_FORCEINLINE bool bit_test_and_reset(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
820 base_type::fence_before(order);
826 lock btr word ptr [edx], ax
829 base_type::fence_after(order);
833 static BOOST_FORCEINLINE bool bit_test_and_complement(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
835 base_type::fence_before(order);
841 lock btc word ptr [edx], ax
844 base_type::fence_after(order);
849 #endif // defined(_M_IX86)
851 #if defined(_M_IX86) || (defined(BOOST_ATOMIC_INTERLOCKED_BTS) && defined(BOOST_ATOMIC_INTERLOCKED_BTR))
853 template< typename Base, bool Signed >
854 struct extra_operations< Base, 4u, Signed, true > :
855 public extra_operations_generic< Base, 4u, Signed >
857 typedef extra_operations_generic< Base, 4u, Signed > base_type;
858 typedef typename base_type::storage_type storage_type;
861 static BOOST_FORCEINLINE storage_type fetch_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
863 base_type::fence_before(order);
864 storage_type old_val;
868 mov eax, dword ptr [ecx]
873 lock cmpxchg dword ptr [ecx], edx
877 base_type::fence_after(order);
881 static BOOST_FORCEINLINE storage_type negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
883 base_type::fence_before(order);
884 storage_type new_val;
888 mov eax, dword ptr [ecx]
893 lock cmpxchg dword ptr [ecx], edx
897 base_type::fence_after(order);
901 static BOOST_FORCEINLINE bool negate_and_test(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
903 base_type::fence_before(order);
908 mov eax, dword ptr [ecx]
913 lock cmpxchg dword ptr [ecx], edx
918 base_type::fence_after(order);
922 static BOOST_FORCEINLINE void opaque_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
924 base_type::fence_before(order);
928 mov eax, dword ptr [ecx]
933 lock cmpxchg dword ptr [ecx], edx
936 base_type::fence_after(order);
939 static BOOST_FORCEINLINE storage_type bitwise_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
941 base_type::fence_before(order);
947 mov eax, dword ptr [edi]
952 lock cmpxchg dword ptr [edi], edx
956 base_type::fence_after(order);
960 static BOOST_FORCEINLINE storage_type bitwise_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
962 base_type::fence_before(order);
968 mov eax, dword ptr [edi]
973 lock cmpxchg dword ptr [edi], edx
977 base_type::fence_after(order);
981 static BOOST_FORCEINLINE storage_type bitwise_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
983 base_type::fence_before(order);
989 mov eax, dword ptr [edi]
994 lock cmpxchg dword ptr [edi], edx
998 base_type::fence_after(order);
1002 static BOOST_FORCEINLINE storage_type fetch_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
1004 base_type::fence_before(order);
1005 storage_type old_val;
1009 mov eax, dword ptr [ecx]
1014 lock cmpxchg dword ptr [ecx], edx
1018 base_type::fence_after(order);
1022 static BOOST_FORCEINLINE storage_type bitwise_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
1024 base_type::fence_before(order);
1025 storage_type new_val;
1029 mov eax, dword ptr [ecx]
1034 lock cmpxchg dword ptr [ecx], edx
1038 base_type::fence_after(order);
1042 static BOOST_FORCEINLINE bool complement_and_test(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
1044 base_type::fence_before(order);
1049 mov eax, dword ptr [ecx]
1054 lock cmpxchg dword ptr [ecx], edx
1059 base_type::fence_after(order);
1063 static BOOST_FORCEINLINE void opaque_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
1065 base_type::fence_before(order);
1069 mov eax, dword ptr [ecx]
1074 lock cmpxchg dword ptr [ecx], edx
1077 base_type::fence_after(order);
1080 static BOOST_FORCEINLINE void opaque_add(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1082 base_type::fence_before(order);
1087 lock add dword ptr [edx], eax
1089 base_type::fence_after(order);
1092 static BOOST_FORCEINLINE void opaque_sub(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1094 base_type::fence_before(order);
1099 lock sub dword ptr [edx], eax
1101 base_type::fence_after(order);
1104 static BOOST_FORCEINLINE void opaque_negate(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
1106 base_type::fence_before(order);
1110 lock neg dword ptr [edx]
1112 base_type::fence_after(order);
1115 static BOOST_FORCEINLINE void opaque_and(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1117 base_type::fence_before(order);
1122 lock and dword ptr [edx], eax
1124 base_type::fence_after(order);
1127 static BOOST_FORCEINLINE void opaque_or(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1129 base_type::fence_before(order);
1134 lock or dword ptr [edx], eax
1136 base_type::fence_after(order);
1139 static BOOST_FORCEINLINE void opaque_xor(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1141 base_type::fence_before(order);
1146 lock xor dword ptr [edx], eax
1148 base_type::fence_after(order);
1151 static BOOST_FORCEINLINE void opaque_complement(storage_type volatile& storage, memory_order order) BOOST_NOEXCEPT
1153 base_type::fence_before(order);
1157 lock not dword ptr [edx]
1159 base_type::fence_after(order);
1162 static BOOST_FORCEINLINE bool add_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1164 base_type::fence_before(order);
1170 lock add dword ptr [edx], eax
1173 base_type::fence_after(order);
1177 static BOOST_FORCEINLINE bool sub_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1179 base_type::fence_before(order);
1185 lock sub dword ptr [edx], eax
1188 base_type::fence_after(order);
1192 static BOOST_FORCEINLINE bool and_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1194 base_type::fence_before(order);
1200 lock and dword ptr [edx], eax
1203 base_type::fence_after(order);
1207 static BOOST_FORCEINLINE bool or_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1209 base_type::fence_before(order);
1215 lock or dword ptr [edx], eax
1218 base_type::fence_after(order);
1222 static BOOST_FORCEINLINE bool xor_and_test(storage_type volatile& storage, storage_type v, memory_order order) BOOST_NOEXCEPT
1224 base_type::fence_before(order);
1230 lock xor dword ptr [edx], eax
1233 base_type::fence_after(order);
1237 static BOOST_FORCEINLINE bool bit_test_and_complement(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
1239 base_type::fence_before(order);
1245 lock btc dword ptr [edx], eax
1248 base_type::fence_after(order);
1251 #endif // defined(_M_IX86)
1253 #if defined(BOOST_ATOMIC_INTERLOCKED_BTS)
1254 static BOOST_FORCEINLINE bool bit_test_and_set(storage_type volatile& storage, unsigned int bit_number, memory_order) BOOST_NOEXCEPT
1256 return !!BOOST_ATOMIC_INTERLOCKED_BTS(&storage, bit_number);
1258 #elif defined(_M_IX86)
1259 static BOOST_FORCEINLINE bool bit_test_and_set(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
1261 base_type::fence_before(order);
1267 lock bts dword ptr [edx], eax
1270 base_type::fence_after(order);
1275 #if defined(BOOST_ATOMIC_INTERLOCKED_BTR)
1276 static BOOST_FORCEINLINE bool bit_test_and_reset(storage_type volatile& storage, unsigned int bit_number, memory_order) BOOST_NOEXCEPT
1278 return !!BOOST_ATOMIC_INTERLOCKED_BTR(&storage, bit_number);
1280 #elif defined(_M_IX86)
1281 static BOOST_FORCEINLINE bool bit_test_and_reset(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
1283 base_type::fence_before(order);
1289 lock btr dword ptr [edx], eax
1292 base_type::fence_after(order);
1298 #endif // defined(_M_IX86) || (defined(BOOST_ATOMIC_INTERLOCKED_BTS) && defined(BOOST_ATOMIC_INTERLOCKED_BTR))
1300 #if defined(BOOST_ATOMIC_INTERLOCKED_BTS64) && defined(BOOST_ATOMIC_INTERLOCKED_BTR64)
1302 template< typename Base, bool Signed >
1303 struct extra_operations< Base, 8u, Signed, true > :
1304 public extra_operations_generic< Base, 8u, Signed >
1306 typedef extra_operations_generic< Base, 8u, Signed > base_type;
1307 typedef typename base_type::storage_type storage_type;
1309 static BOOST_FORCEINLINE bool bit_test_and_set(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
1311 return !!BOOST_ATOMIC_INTERLOCKED_BTS64(&storage, bit_number);
1314 static BOOST_FORCEINLINE bool bit_test_and_reset(storage_type volatile& storage, unsigned int bit_number, memory_order order) BOOST_NOEXCEPT
1316 return !!BOOST_ATOMIC_INTERLOCKED_BTR64(&storage, bit_number);
1320 #endif // defined(BOOST_ATOMIC_INTERLOCKED_BTS64) && defined(BOOST_ATOMIC_INTERLOCKED_BTR64)
1322 } // namespace detail
1323 } // namespace atomics
1324 } // namespace boost
1326 #include <boost/atomic/detail/footer.hpp>
1328 #endif // BOOST_ATOMIC_DETAIL_EXTRA_OPS_MSVC_X86_HPP_INCLUDED_