AIX assembler doesn't allow "bne- 1b" or "bne- 1f" symtax to jump to a
given label. It must be replaced by "bne- $N", N being the memory
offset between the current instruction and the targeted label.
This is in line with the C++20 change that requires the default constructor
of std::atomic to value initialize the atomic object.
Also, use is_nothrow_default_constructible to properly deduce noexceptness
of the default constructors of atomics.
This allows to mark bitwise_cast constexpr when the conditions to use
bit_cast are met:
- both source and target types have the same size, and
- the source type has no padding bits.
The latter is checked using has_unique_object_representations trait, which
we also implement using intrinsics when not available in the standard
library.
This allows atomic constructors to become constexpr for structs and floating
point types with no padding and whose size matches the atomic storage size.
Use __builtin_clear_padding and __builtin_zero_non_value_bits that were
introduced in gcc 11 and MSVC 19.27 to clear the padding bits in atomic
types. The intrinsics are used in bitwise_cast and atomic reference
constructors.
Also, separated atomic impl specializations for enums to allow using
static_cast to convert values to storage. This in turn allows to
relax compiler requirements to mark atomic constructors constexpr.
Updated docs and added tests for structs with padding and constexpr
atomic constructors.
Switch to VS2019 image in attempt to work around the "unable to load
mspdbcore.dll (error code: 126)" errors on compilation for 32-bit x86.
Added calling an environment setup script from VS2019 to work around
missing msvcrt(d).lib errors caused by Boost.Build issue:
https://github.com/bfgroup/b2/issues/98
Also disabled logging of setting up header symlinks.
When targeting Windows 8, the always_has_native_wait_notify static constant
would be set to false even though the native implementation of waiting
and notifying operations through WaitOnAddress would always be used.
To fix this, moved direct WaitOnAddress & co. usage to public header. This
also requires users to link with synchronization.lib, which is done
automatically on compilers that support auto-linking.
The compiled library still implements runtime detection of WaitOnAddress,
even when building for Windows 8 and later. This allows user's code to
be later compiled for Windows 7 and older and still work. This code is
not used when user's code targets Windows 8 or later.
As part of this refactoring, renamed has_synchronization test and
related CMake variable to better communicate that we're testing for
a library.
This works around spurious test failures on Mac OS as the notifying operation
sometimes fails with ENOENT. Presumably, the OS sometimes invalidates the
internal identification of the stack memory region, which makes __ulock_wake
fail to find the ulock object that other threads are blocked on.
By using dynamic memory we (hopefully) are using a location in a normal mapped
memory region that should not be mangled by the OS. Ideally, we would use
process-shared memory for this test, but that makes it more difficult to make
it portable and runnable in parallel. Dynamic local memory should do for now.
As shown by GitHub Actions CI, stock clang 8 from Ubuntu 18.04
also reports an incorrect alignment of 64-bit types on 32-bit targets.
Liiks like the bug was fixed in some patch version of the 8.x branch,
but it's difficult to know which one, so just always use boost::alignment_of
up to clang 9.
In order to avoid hardcoding library dependencies recursively for the
configure checks performed in CMake build scripts, we generate the list
of all include directories. If there is a unified Boost include tree,
we can use that and avoid filesystem scanning.
- Switched gcc 10 to Focal since it is now available in the main
repository and the compiler version is 10.2 rather than a pre-release.
- Added gcc 11 job.
- Added clang 11 and 12 jobs.
Since Boost.Atomic may require linking with pthreads, set up
multithreading compiler flags and add a formal dependency on
the threading library in CMakeLists.txt.
This test verifies arithmetic and bitwise (logic) operations with
immediate constant arguments, which may affect instruction choice
in the operations. In particular, the test verifies that bug
https://github.com/boostorg/atomic/issues/41 is fixed.
Bitwise (logical) instructions in aarch64 have different encoding of
the immediate constant arguments, which require a different asm
constraint. Otherwise, an invalid instruction could be generated,
resulting in a compilation error.
Fixes https://github.com/boostorg/atomic/issues/41.
By default, the destination register is the same as the first input register
in most instructions. Removing it has no practical effect other than, perhaps,
inclining the assembler to generate a shorter encoding for the instruction
in Thumb mode.