2
0
mirror of https://github.com/boostorg/atomic.git synced 2026-02-01 20:12:09 +00:00
Andrey Semashev c91cb67396 Fixed incorrect code generated by clang for 32-bit x86 PIC.
The compiler, surprisingly, uses ebx for memory operands, which messed up the
save/restore logic in asm blocks, resulting the memory operand (which was
supposed to be the pointer to the atomic storage) being incorrect.

First, clang (and, apparently, recent gcc as well) are able to deal with ebx
around the asm blocks by themselves, which makes it unnecessary to save/restore
the register in the asm blocks. Therefore, for those compilers we now use the
non-PIC branch in PIC mode as well. This sidesteps the original problem with
clang.

Second, since we can't be sure if other compilers are able to pull the same
trick, the PIC branches of code have been updated to avoid any memory operand
constraints and use the explicitly calculated pointer in a register instead. We
also no longer use a scratch slot on the stack to save ebx but instead use esi
for that, which is also conveniently used for one of the inputs. This should
be slightly faster as well. The downside is that we're possibly wasting one
register for storing the pointer to the storage, but there seem to be no way
around it.
2018-02-03 00:46:07 +03:00
2016-11-06 21:29:33 +03:00
2017-10-10 20:26:34 +03:00

Boost.Atomic

Boost.Atomic, part of collection of the Boost C++ Libraries, implements atomic operations for various CPU architectures, reflecting and extending the standard interface defined in C++11.

Directories

  • build - Boost.Atomic build scripts
  • doc - QuickBook documentation sources
  • include - Interface headers of Boost.Atomic
  • src - Compilable source code of Boost.Atomic
  • test - Boost.Atomic unit tests

More information

  • Documentation
  • Report bugs. Be sure to mention Boost version, platform and compiler you're using. A small compilable code sample to reproduce the problem is always good as well.
  • Submit your patches as pull requests against develop branch. Note that by submitting patches you agree to license your modifications under the Boost Software License, Version 1.0.

Build status

Master: AppVeyor Travis CI Develop: AppVeyor Travis CI

License

Distributed under the Boost Software License, Version 1.0.

Description
Mirrored via gitea-mirror
Readme 2.3 MiB
Languages
C++ 99.3%
CMake 0.7%