2
0
mirror of https://github.com/boostorg/atomic.git synced 2026-02-02 08:22:08 +00:00
Commit Graph

189 Commits

Author SHA1 Message Date
Andrey Semashev
430169a53c Removed union_cast in favor of memcpy-based implementation and renamed the cast to bitwise_cast. Use __builtin_mem* instead of regular function calls when possible. This saves inclusion of <cstring> and possibly generates better code when -fno-builtin is used. The net result of these changes is no UB that union_cast was introducing while hopefully retaining the same performance. boost-1.60.0 2015-12-02 20:04:10 +03:00
Andrey Semashev
c989d936c5 Renamed casts.hpp to bitwise_cast.hpp. 2015-12-02 18:36:49 +03:00
Andrey Semashev
8bbf5e19db Corrected compiler check for BOOST_ATOMIC_DETAIL_NO_ASM_IMPLIED_ZERO_DISPLACEMENTS. 2015-11-08 17:24:30 +03:00
Andrey Semashev
6e2d7b28de Restored old versions of DCAS operations that use an extra register for compatibility with old binutils, which apparently are used on OS X with gcc 4.2. 2015-11-04 15:25:12 +03:00
Andrey Semashev
45289e534e Added a few notes to the README.md file. 2015-08-28 21:56:15 +03:00
Andrey Semashev
ec4738a8eb Workaround for MSVC-12 ICE. 2015-08-26 23:27:13 +03:00
Andrey Semashev
e3aac4bc65 Simplified memory references in assembler blocks which should reduce the typical number of used registers by one. 2015-08-23 03:27:37 +03:00
Andrey Semashev
4462c1cdf4 Fixed compilation with gcc 4.4. 2015-08-23 02:05:35 +03:00
Andrey Semashev
18fdcb1747 Fixed compilation errors with MSVC caused by using types with large alignment values as function arguments. Alignment is now explicitly specified for all storage types to avoid surprises. Optimized CAS-based exchange implementation on x86. Relaxed initial loads in CAS-based operations as this load is not required to be accurate. 2015-08-23 01:04:08 +03:00
Andrey Semashev
6bb5b17108 Silenced MSVC warnings about 'this' being used in the constructor initialization list. 2015-08-22 20:47:56 +03:00
Tim Blechmann
f0f1ef228c atomic: fix compilation on msvc 8 / Windows CE / arm 2015-08-22 10:17:02 +02:00
Andrey Semashev
ff91811c1a Fixes #10994. Fixed compilation with gcc 4.4 when cmpxchg16b is used. 2015-08-17 23:27:37 +03:00
Andrey Semashev
b1bb36c5b3 Only use intptr_t when available. Only test integer overflows/underflows for unsigned integers (the behavior is undefined for signed ints anyway). This should silence compiler warnings as well. 2015-08-17 22:25:19 +03:00
Andrey Semashev
a8661d4cc2 Corrected memory barriers in store, load and thread_fence. Added indentation to the generated assembler code. 2015-08-15 00:29:43 +03:00
Andrey Semashev
4162cb109f Corrected memory ordering of loads. Relaxed loads do not synchronize-with seq_cst stores, which allowed the test to fail. Also removed unnecessary loads that did not contribute to the test robustness and could have reduced it by issuing extra memory fences. 2015-08-14 15:03:35 +03:00
Andrey Semashev
e6a188d165 Experimental support for IBM XL C++ compilers for PowerPC. 2015-08-13 23:37:33 +03:00
Andrey Semashev
7b1d722d94 Ported tests to core/lightweight_test.hpp.
Boost.Test was dropped due to instability and long-standing differences between develop and master branches. We don't use most of its features anyway.
boost-1.59.0 boost-1.58.0
2015-01-25 18:50:58 +03:00
Tim Blechmann
427a757bbf Merge pull request #4 from jhunold/test_dependency
Add explicit dependency on Boost.Test
2015-01-14 16:17:50 +01:00
Jürgen Hunold
30f72c8d25 Add explicit dependency on Boost.Test 2015-01-14 16:13:41 +01:00
Andrey Semashev
b8c91efe8f Made spinning on the lock less expensive. 2014-12-20 17:30:35 +03:00
Andrey Semashev
b77b0aff22 Made spinning on the lock less expensive. 2014-12-20 17:26:18 +03:00
Andrey Semashev
d6cc2c93c1 Avoid the lock padding member altogether if padding size is 0. 2014-12-20 17:05:24 +03:00
Andrey Semashev
fcff86225e Added workarounds for nvcc - don't use cc clobber and constraint alternatives in asm statements. Hopefully, should fix #10625. 2014-12-20 16:35:03 +03:00
Andrey Semashev
6995a64181 Added missing curly braces to the lock pool initializers. This should fix compilation when the compiler does not support brace folding. 2014-12-20 15:51:21 +03:00
Andrey Semashev
fe8f1dc4e0 Use #pragma intrinsic only with MSVC. boost-1.57.0 2014-10-01 13:30:37 +04:00
Andrey Semashev
5f6e9689a3 Silenced MSVC warnings about unused parameters. 2014-10-01 13:02:15 +04:00
Andrey Semashev
415db70547 Added support for extending operations to GCC atomic backend.
Fix for #10446. Some platforms (e.g. Raspberry Pi) only support atomic ops of some particular size but not less. Use extending arithmetic operations for these platforms. Also, make sure bools are always treated as 8-bit values, even if the actual type is larger. This makes its use in atomic<>, atomic_flag and lock pool more consistent.
2014-09-27 20:40:09 +04:00
Andrey Semashev
8f10f20359 Use #pragma intrinsic only with MSVC. 2014-08-30 14:09:18 +04:00
Andrey Semashev
7f17e3b9a3 Use #pragma intrinsic only with MSVC.
Intel compiler doesn't support and doesn't need #pragma intrinsic and
issues warnings about it. Based on changes to boost/detail/
2014-08-24 00:02:16 +04:00
Andrey Semashev
c3469f4c2b Added myself as a maintainer and the author. 2014-08-18 18:52:43 +04:00
Andrey Semashev
81f41afa6f Merge pull request #3 from danieljames/metadata
Create metadata file.
2014-08-18 18:50:21 +04:00
Daniel James
db37088802 Add metadata file. 2014-08-18 14:57:29 +01:00
Andrey Semashev
4dee330229 Added support for types with non-trivial default constructors. boost-1.56.0 2014-07-07 22:40:41 +04:00
Andrey Semashev
6a184d95dd Renamed union_cast.hpp -> casts.hpp. 2014-07-07 21:51:06 +04:00
Andrey Semashev
00c2879066 Made sure that memory_order_consume is equivalent to memory_order_acquire on SPARC. Also make signal fences more strict in case of memory_order_consume since the standard requires them to be equivalent to thread fences except for thread synchronization instructions. 2014-07-07 21:48:53 +04:00
Andrey Semashev
560e3c0465 Clarified the requirements on the types compatible with boost::atomic. 2014-06-10 00:21:31 +04:00
Andrey Semashev
313497c6ae Added Windows version specification to fix compilation with MSVC. The code targets for Windows 2000. 2014-06-09 01:18:38 +04:00
Andrey Semashev
0c9b1b3806 Reworked platform selection, fixed Windows backend.
Platform selection now works in two stages. First compiler is tested for
the supported configuration. If that fails, OS is tested. Lastly, if
nothing succeeded, emulation backend is selected.
2014-06-09 01:07:26 +04:00
Andrey Semashev
b44027a58e Removed dependency on Boost.Detail. Fixed compilation issues with MSVC
7.1
2014-06-09 00:01:12 +04:00
Andrey Semashev
a6ec366f02 Fixed compilation failure due to a missing argument name. 2014-06-04 21:41:06 +04:00
Andrey Semashev
e0f038e92a Fixed compilation failure due to a missing argument name. 2014-06-04 21:38:15 +04:00
Andrey Semashev
21e497c01b Corrected hw memory barriers for memory_order_consume. 2014-06-03 23:57:52 +04:00
Andrey Semashev
d4ee3a3047 Added a comment about the reason why we promote memory_order_consume to memory_order_acquire. 2014-06-03 23:30:21 +04:00
Andrey Semashev
e55bf17309 Changed memory_order_consume handling on ARM and PPC.
memory_order_consume is promoted to memory_order_acquire on these
architectures as they have a weaker memory model than other
architectures. GCC seems to behave the same way. Added nonessential
checks to compiler barriers so that the behavior is closer to thread
fences.
2014-06-01 20:03:53 +04:00
Andrey Semashev
abdce8f1bb Changed memory_order constant values to simplify checks for success/failure orders in compare_exchange methods. Fixed incorrect cas_failure_order_must_not_be_stronger_than_success_order check. 2014-06-01 02:10:44 +04:00
Andrey Semashev
a721aa468f Removed scratch argument for asm block in non-PIC mode. 2014-05-26 23:21:01 +04:00
Andrey Semashev
97ae84a474 Adjusted the workaround for ldrexd/strexd instruction problem with register pairs allocation. The problem only affects ARMv6k in Thumb mode, so enable these instructions for ARM mode. Also don't base the decision on the compiler version, it is probably not relevant. Updated lockfree test to reflect the recent changes related to ARM backends. 2014-05-23 21:02:07 +04:00
Andrey Semashev
deddca6918 Fixed a few bugs with ARM assembler: incorrect comparisons in compare_exchange, compilation failures due to insufficient registers in some optimization modes. Eventually I had to disable 64-bit atomic ops for gcc 4.7 because it is not able to allocate register pairs suitable for ldrexd/strexd instructions. 2014-05-22 01:01:46 +04:00
Andrey Semashev
a71a23694b Fixed typo in a comment. 2014-05-21 00:36:43 +04:00
Andrey Semashev
7197b188ac Another attempt to work around the problem with old binutils not supporting dmb arguments. Changed 64-bit operations so that the generated asm does not contain offsets in ldrexd and strexd instructions. Otherwise ARM assembler chokes. 2014-05-21 00:34:10 +04:00