Opened 9 years ago
Closed 9 years ago
#8574 closed Patches (fixed)
Optimization for 64 bit loads and stores for 32 bit x86 on gcc
Reported by: | Andrey Semashev | Owned by: | timblechmann |
---|---|---|---|
Milestone: | To Be Determined | Component: | atomic |
Version: | Boost Development Trunk | Severity: | Problem |
Keywords: | Cc: |
Description
The attached patch contains some fixes and optimizations for 32 bit x86 atomics support for gcc and its pretenders. In particular, the patch contains:
- Fix for BOOST_ATOMIC_LLONG_LOCK_FREE macro value on 32 bit x86. The macro should have value 2 when cmpxchg8b instruction is enabled in compile time and 0 otherwise (as long as Boost.Atomic doesn't perform run time detection).
- Fixed compile time cmpxchg8b presence check. The previous check only worked on compilers with sync* intrinsics support or on i686 class CPUs (but not later or i586).
- Optimized 64 bit loads and stores in 32 bit x86. When the target/source memory is 8-byte aligned (which is the most common case) it is possible to avoid expensive "lock cmpxchg8b" and use regular loads and stores instead.
- Added a few missing noexcept specifications.
Attachments (1)
Change History (3)
by , 9 years ago
Attachment: | atomic_x86.patch added |
---|
comment:1 by , 9 years ago
Note: I tried it locally on Linux with gcc and clang 32 and 64 bit. All tests passed.
comment:2 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
The patch with fixes and optimizations for 32 bit x86