Use double-word atomic intrinsics for recent Clang versions (gcc/x86.h)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 8 Dec 2017 17:02:48 +0000 (20:02 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 22 Dec 2017 07:45:15 +0000 (10:45 +0300)
commit7ea4f2743b7ac17ac2a007cc4989931c02325f6d
tree642c15d6c074636c2de9e58bd830dedd81dbb684
parentdcef32a97167a3e60db0112bd56ee9bd2227fb48
Use double-word atomic intrinsics for recent Clang versions (gcc/x86.h)

Older clang versions have some bugs or limitations that prevent from
using double-word built-in atomic operations.

Note: even as of clang-4.0, there seems to be a bug in some
double-word built-in operation if Thread Sanitizer is used.

* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& __APPLE_CC__ && __x86_64__]
(AO_SKIPATOMIC_double_compare_and_swap_ANY): Do not define if
AO_CLANG_PREREQ(9, 0); update comment.
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& !__APPLE_CC__ && __clang__ && !__x86_64__
&& !AO_PREFER_BUILTIN_ATOMICS && !__CYGWIN__]
(AO_SKIPATOMIC_double_compare_and_swap_ANY,
AO_SKIPATOMIC_DOUBLE_LOAD_STORE_ANY): Do not define if
AO_CLANG_PREREQ(5, 0); update comment.
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& !__APPLE_CC__ && __clang__ && __x86_64__ && !__ILP32__
&& AO_ADDRESS_SANITIZER] (AO_SKIPATOMIC_double_compare_and_swap_ANY
AO_SKIPATOMIC_DOUBLE_LOAD_STORE_ANY): Do not define if
AO_CLANG_PREREQ(4, 0); update comment.
src/atomic_ops/sysdeps/gcc/x86.h