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

110 Commits

Author SHA1 Message Date
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
4dee330229 Added support for types with non-trivial default constructors. 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
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
Andrey Semashev
b8626e355b Moving memory_order.hpp to Boost.Atomic. 2014-05-20 21:59:22 +04:00
Andrey Semashev
7f290018d2 Changed the dmb instruction argument in attempt to fix compilation with old binutils on QNX. 2014-05-18 19:03:55 +04:00
Andrey Semashev
76b78f2491 #9985. Added ebx saves and restores in asm blocks to avoid frame pointer clobbering, when frame pointer omission is disabled. 2014-05-17 21:58:59 +04:00
Andrey Semashev
00c21f9978 Documented new feature test and configuration macros. Fixed disabled gcc atomic backend. 2014-05-17 19:20:51 +04:00
Andrey Semashev
08d30a2320 Added missing include. 2014-05-11 23:14:47 +04:00
Andrey Semashev
890313b8d7 Added missing include. 2014-05-11 23:13:58 +04:00
Andrey Semashev
3a81a36bbe Removed no longer used files. 2014-05-11 20:28:12 +04:00
Andrey Semashev
5c032ccf3a Added gcc Alpha backend. Completely untested. 2014-05-11 20:21:41 +04:00
Andrey Semashev
5cb6e92ed0 Extracted common c86 DCAS code to a separate header. 2014-05-11 17:33:09 +04:00
Andrey Semashev
c319c6efd1 Enabled gcc atomic backend for Intel Compiler on Linux. 2014-05-11 17:00:00 +04:00
Andrey Semashev
c196e6da0c Fixed compilation of ARM backend. Simplified fences implementation. 2014-05-11 14:18:49 +04:00
Andrey Semashev
684917a6fe Implemented gcc ARM backend. Some files renamed. 2014-05-11 02:36:15 +04:00
Andrey Semashev
4e9632a669 Implemented gcc SPARCv9 backend.
The backend also adds support for 64-bit atomics.
2014-05-09 22:24:37 +04:00
Andrey Semashev
f53911de3d Implemented PorwerPC backend. 2014-05-09 20:57:02 +04:00
Andrey Semashev
d3af1bace9 Fixed compilation. 2014-05-09 19:04:41 +04:00
Andrey Semashev
4cb51c6b76 Signed flag is now forwarded to the backends.
Forwarding the "signed" property allows to specialize operations
implementation, which may be desired for some architectures. This also
eliminates the formally implementation-defined result of unsigned-to-
target type.

Also for x86 implementations removed compiler barriers since the
compilers already treat intrinsics/asm blocks as ones.
2014-05-09 18:53:06 +04:00
Andrey Semashev
652e87b7e7 Added Linux ARM backend. 2014-05-07 22:21:04 +04:00
Andrey Semashev
20dd8bd827 Implemented MSVC and Windows backends. 2014-05-04 23:41:16 +04:00
Andrey Semashev
931a5dc2aa Improved assertion messages. 2014-05-04 05:22:59 +04:00
Andrey Semashev
17cf91d8c9 Working on the library rewrite. Implemented gcc-x86 and gcc-sync
backends.
2014-05-04 00:14:24 +04:00
Andrey Semashev
0e5b641e0a Added workarounds for clang. 2014-04-20 19:03:56 +04:00
Andrey Semashev
625c3c3a2e Compilation fixes. Added public headers for atomic_flag and atomic. 2014-04-20 17:26:42 +04:00
Andrey Semashev
f3d59ec1c1 Working on the new library design.
Added implementation of atomic ops with gcc __atomic intrinsics.
Implemented the unified atomic interface. Extracted atomic_flag to a
separate header. atomic_flag now follows standard requirements for
static initialization, if possible.
2014-04-19 22:25:02 +04:00
Andrey Semashev
928bdea4f6 Merge branch 'develop' into decouple_interface_impl_rewrite 2014-03-23 16:07:37 +04:00
Andrey Semashev
e3536bec75 Hopefully, fixes #9447.
Cleanup of the success flag in CAS operations has been reworked. The
flag is automatically cleared by default and only set when the operation
succeeds. Also minor code reformatting and __volatile__ specifications
to prohibit the assembler code moving around.
2014-03-23 15:15:56 +04:00
Andrey Semashev
c56a76c084 Further attempts to work around clang bugs. 2014-03-19 19:07:30 +04:00
Andrey Semashev
8a3e5b1466 Further attempts to work around clang compilation failures. 2014-03-18 21:25:33 +04:00
Andrey Semashev
9e15e02528 Attempt to make Darwin clang compile the asm statement. 2014-03-17 19:36:39 +04:00
Andrey Semashev
522279d1e7 Added missing fence functions for the clang 3.4 workaround. Also made atomic_flag copy and assignment to be deleted on C++11 compilers. 2014-03-16 21:19:42 +04:00
Andrey Semashev
b277b46c5f Removed incorrect constexpr qualifications from constructors with non-empty bodies. 2014-03-15 16:25:10 +04:00
Andrey Semashev
bf1898e2e6 Added a workaround for clang 3.4 bug: the compiler does not implement __atomic intrinsics even though it defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 macro. 2014-03-15 16:11:03 +04:00