Avoid atomic_compare_exchange_n if no __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n
authorIvan Maidanski <ivmai@mail.ru>
Wed, 6 Apr 2016 08:40:45 +0000 (11:40 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 7 Apr 2016 07:28:27 +0000 (10:28 +0300)
commit83fca6816765592cca864a81060cb0f58d3e401c
treedf3635d5300fa3b186eb1c061d542bae1d5ea9ad
parent157e8ad79a1bcc3d0ab331ab2217a9b81f35864c
Avoid atomic_compare_exchange_n if no __GCC_HAVE_SYNC_COMPARE_AND_SWAP_n

* src/atomic_ops/sysdeps/gcc/aarch64.h (AO_GCC_FORCE_HAVE_CAS,
AO_GCC_HAVE_double_SYNC_CAS): Define macro before include generic.h
if __clang__ (workaround).
* src/atomic_ops/sysdeps/gcc/generic-small.h: Regenerate.
* src/atomic_ops/sysdeps/gcc/generic-small.template
(AO_XSIZE_fetch_compare_and_swap, AO_XSIZE_compare_and_swap): Do not
define unless AO_GCC_HAVE_XSIZE_SYNC_CAS.
* src/atomic_ops/sysdeps/gcc/generic.h (AO_GCC_HAVE_char_SYNC_CAS,
AO_GCC_HAVE_short_SYNC_CAS, AO_GCC_HAVE_int_SYNC_CAS,
AO_GCC_HAVE_SYNC_CAS): New internal macro (based on
__GCC_HAVE_SYNC_COMPARE_AND_SWAP_<n> or AO_GCC_FORCE_HAVE_CAS presence).
* src/atomic_ops/sysdeps/gcc/generic.h (AO_GCC_HAVE_double_SYNC_CAS):
New internal macro if AO_HAVE_DOUBLE_PTR_STORAGE.
* src/atomic_ops/sysdeps/gcc/generic.h (AO_double_compare_and_swap):
Check AO_GCC_HAVE_double_SYNC_CAS instead of AO_HAVE_DOUBLE_PTR_STORAGE.
src/atomic_ops/sysdeps/gcc/aarch64.h
src/atomic_ops/sysdeps/gcc/generic-small.h
src/atomic_ops/sysdeps/gcc/generic-small.template
src/atomic_ops/sysdeps/gcc/generic.h