| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
(fix of commit 1f8f5af84)
* src/atomic_ops/sysdeps/msftc/arm64.h: Fix typo in #ifndef.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/msftc/arm.h [_M_ARM>=6]: Remove TODO about
double-wide operations support.
* src/atomic_ops/sysdeps/msftc/arm.h [_M_ARM>=7 && !AO_NO_DOUBLE_CAS]:
Include standard_ao_double_t.h.
* src/atomic_ops/sysdeps/msftc/arm.h [_M_ARM>=7 && !AO_NO_DOUBLE_CAS]
(_InterlockedCompareExchange64, _InterlockedCompareExchange64_acq,
_InterlockedCompareExchange64_nf, _InterlockedCompareExchange64_rel):
Specify as intrinsic.
* src/atomic_ops/sysdeps/msftc/arm.h [_M_ARM>=7 && !AO_NO_DOUBLE_CAS]
(AO_double_compare_and_swap, AO_double_compare_and_swap_acquire,
AO_double_compare_and_swap_release, AO_double_compare_and_swap_full):
Implement (similar to that in msftc/x86.h).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also, do not include msftc/x86_64.h if target is arm64 (i.e., new
internal header is created - msftc/arm64.h).
* src/Makefile.am (nobase_private_HEADERS): Add msftc/aarch64.h.
* src/atomic_ops.h [(_MSC_VER || __DMC__ || __BORLANDC__
|| __WATCOMC__ && __NT__) && _M_ARM64]: Include msftc/aarch64.h
instead of msftc/x86_64.h.
* src/atomic_ops/sysdeps/msftc/arm64.h: New file.
* src/atomic_ops/sysdeps/msftc/x86_64.h: Include ordered_except_wr.h
unconditionally (again).
* src/atomic_ops/sysdeps/standard_ao_double_t.h [_M_ARM64 && _MSC_VER]
(double_ptr_storage): Define; add comment.
|
|
|
|
|
|
|
| |
(fix of commit e078c7bb7)
* src/atomic_ops/sysdeps/msftc/x86_64.h: Do not include
ordered_except_wr.h if _M_ARM64.
|
|
|
|
|
|
|
|
|
|
| |
(fix of commit 9831779d8)
* src/atomic_ops/sysdeps/msftc/common32_defs.h: Mention 64-bit
architectures in comment.
* src/atomic_ops/sysdeps/msftc/x86_64.h
[!AO_USE_INTERLOCKED_INTRINSICS] (AO_USE_INTERLOCKED_INTRINSICS):
Define (before include common32_defs.h).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(refactoring)
* src/atomic_ops/sysdeps/msftc/arm.h: Include common32_defs.h (and
define AO_ASSUME_WINDOWS98) after include test_and_set_t_is_ao_t.h and
all_aligned_atomic_load_store.h.
* src/atomic_ops/sysdeps/msftc/arm.h (AO_T_IS_INT): Define before
include common32_defs.h.
* src/atomic_ops/sysdeps/msftc/x86.h (AO_T_IS_INT): Likewise.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [_MSC_VER<=1400]: Add
comment about WIN32_LEAN_AND_MEAN.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [_MSC_VER>=1800
|| _MSC_VER>1400 && !_M_ARM] (_InterlockedAnd8, _InterlockedOr8,
_InterlockedXor8): Do not declare via pragma if _MSC_VER>=1800 and
AO_PREFER_GENERALIZED.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [_MSC_VER>=1800
|| _MSC_VER>1400 && !_M_ARM] (AO_char_and_full, AO_char_or_full,
AO_char_xor_full): Do not define if _MSC_VER>=1800 and
AO_PREFER_GENERALIZED.
* src/atomic_ops/sysdeps/msftc/common32_defs.h
[(!AO_PREFER_GENERALIZED || !AO_ASSUME_WINDOWS98) && !AO_T_IS_INT]
(_InterlockedIncrement64, _InterlockedDecrement64,
_InterlockedExchangeAdd64): Add pragma intrinsic.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [!AO_T_IS_INT]
(_InterlockedCompareExchange64): Likewise.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [(!AO_PREFER_GENERALIZED
|| !AO_ASSUME_WINDOWS98) && !AO_T_IS_INT] (AO_fetch_and_add_full,
AO_fetch_and_add1_full, AO_fetch_and_sub1_full): Use 64-bit intrinsic.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [AO_ASSUME_WINDOWS98
&& !AO_T_IS_INT] (AO_fetch_compare_and_swap_full): Likewise.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [!AO_T_IS_INT
&& !AO_PREFER_GENERALIZED] (AO_int_fetch_and_add_full,
AO_int_fetch_and_add1_full, AO_int_fetch_and_sub1_full): Implement
(move it from x86_64.h).
* src/atomic_ops/sysdeps/msftc/common32_defs.h [AO_ASSUME_WINDOWS98
&& !AO_T_IS_INT] (AO_int_fetch_compare_and_swap_full): Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h [!AO_ASSUME_WINDOWS98]
(AO_ASSUME_WINDOWS98): Define.
* src/atomic_ops/sysdeps/msftc/x86_64.h: Include common32_defs.h;
do not include intrin.h (directly).
* src/atomic_ops/sysdeps/msftc/x86_64.h (_InterlockedIncrement,
_InterlockedIncrement64, _InterlockedDecrement,
_InterlockedDecrement64, _InterlockedExchangeAdd,
_InterlockedExchangeAdd64, _InterlockedCompareExchange,
_InterlockedCompareExchange64, _InterlockedAnd8,
_InterlockedCompareExchange16, _InterlockedOr8, _InterlockedXor8,
_InterlockedIncrement16, _InterlockedDecrement16,
_InterlockedCompareExchange8, _InterlockedExchangeAdd16,
_InterlockedExchangeAdd8): Remove pragma.
* src/atomic_ops/sysdeps/msftc/x86_64.h [AO_PREFER_GENERALIZED]
(AO_fetch_and_add_full, AO_fetch_and_add1_full, AO_fetch_and_sub1_full,
AO_int_fetch_and_add_full, AO_int_fetch_and_add1_full,
AO_int_fetch_and_sub1_full): Remove implementation.
* src/atomic_ops/sysdeps/msftc/x86_64.h
(AO_fetch_compare_and_swap_full, AO_int_fetch_compare_and_swap_full):
Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h [_MSC_VER>1400]
(AO_char_and_full, AO_char_or_full, AO_char_xor_full,
AO_short_fetch_compare_and_swap_full): Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h [_MSC_VER>1400
&& AO_PREFER_GENERALIZED] (AO_short_fetch_and_add1_full,
AO_short_fetch_and_sub1_full): Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h [_MSC_VER>=1800]
(AO_char_fetch_compare_and_swap_full): Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h [_MSC_VER>=1800
&& AO_PREFER_GENERALIZED] (AO_char_fetch_and_add_full,
AO_short_fetch_and_add_full): Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h [AO_CMPXCHG16B_AVAILABLE]:
Remove misleading comment; reformat code.
|
|
|
|
|
|
|
| |
(refactoring)
* src/atomic_ops_stack.c [AO_THREAD_SANITIZER] (AO_load_next): Add
const to argument.
|
|
|
|
|
|
|
|
|
|
|
|
| |
(fix of commit 81242ce88)
gcc-6.5/m68k and gcc-6.5/s390 (and earlier) produce a pedantic warning
if __alignof__ keyword is used (unless -std=c11). Such behavior is not
observed in gcc-7.5 or later.
* src/atomic_ops.h [__STDC_VERSION__<201112L && !LINT2]
(AO_ALIGNOF_SUPPORTED): Do not define unless AO_GNUC_PREREQ(7,5)
(instead of AO_GNUC_PREREQ(4,3)).
|
|
|
|
|
|
|
|
|
| |
Use the same type for input and output inline asm operands in
AO_compare_and_swap_full().
* src/atomic_ops/sysdeps/gcc/sparc.h [!AO_NO_SPARC_V9
&& !AO_GENERALIZE_ASM_BOOL_CAS] (AO_compare_and_swap_full): Change type
of ret local variable from char to AO_t.
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/sparc.h [!AO_NO_SPARC_V9]
(AO_compare_and_swap_full): Do not define if AO_GENERALIZE_ASM_BOOL_CAS.
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/sparc.h [!AO_NO_SPARC_V9]
(AO_fetch_compare_and_swap_full): Implement; remove TODO.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops.h [(AO_GNUC_PREREQ(4,3)||__STDC_VERSION__>=201112L)
&& !LINT2] (AO_ALIGNOF_SUPPORTED): Define (means __alignof__ is
supported).
* src/atomic_ops.h (AO_ASSERT_ADDR_ALIGNED): New internal macro
(depending on AO_ALIGNOF_SUPPORTED).
* src/atomic_ops.h: Update copyright year.
* src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h
[AO_ALIGNOF_SUPPORTED] (AO_ACCESS_CHECK_ALIGNED): Define (regardless of
__m68k__).
* src/atomic_ops/sysdeps/loadstore/atomic_load.template
(AO_XSIZE_load): Replace assert((addr&(sizeof(*addr)-1))==0) with
AO_ASSERT_ADDR_ALIGNED(addr).
* src/atomic_ops/sysdeps/loadstore/atomic_store.template
(AO_XSIZE_store): Likewise.
* src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h
(AO_double_load, AO_double_store): Likewise.
* src/atomic_ops/sysdeps/msftc/x86.h [AO_ASSUME_VISTA]
(AO_double_compare_and_swap_full): Likewise.
* src/atomic_ops/sysdeps/msftc/x86_64.h [AO_CMPXCHG16B_AVAILABLE
&& _MSC_VER>=1500] (AO_compare_double_and_swap_double_full): Likewise.
* src/atomic_ops/sysdeps/loadstore/atomic_load.h: Regenerate.
* src/atomic_ops/sysdeps/loadstore/atomic_store.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/char_atomic_load.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/char_atomic_store.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/int_atomic_load.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/int_atomic_store.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/short_atomic_load.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/short_atomic_store.h: Likewise.
|
|
|
|
|
|
|
| |
Issue #48 (libatomic_ops).
* src/atomic_ops/sysdeps/all_aligned_atomic_load_store.h
(AO_ACCESS_CHECK_ALIGNED): Do not define if __m68k__; add comment.
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/m68k.h (AO_t): Use __aligned__ instead of
aligned.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #46 (libatomic_ops).
gcc/riscv requires the client to add -latomic (or -pthread) flag
if char- or short-width compare-and-swap or an arithmetic primitive
is used. To avoid such a requirement, the corresponding AO primitives
are not provided for now unless AO_PREFER_BUILTIN_ATOMICS is defined.
* src/atomic_ops/sysdeps/gcc/generic-arithm.h: Regenerate.
* src/atomic_ops/sysdeps/gcc/generic-arithm.template
(AO_XSIZE_fetch_and_add_XBAR): Do not define if AO_NO_XSIZE_ARITHM.
* src/atomic_ops/sysdeps/gcc/generic-arithm.template
[!AO_SKIPATOMIC_ANY_and_ANY] (AO_XSIZE_and_XBAR): Likewise.
* src/atomic_ops/sysdeps/gcc/generic-arithm.template
[!AO_SKIPATOMIC_ANY_or_ANY] (AO_XSIZE_or_XBAR): Likewise.
* src/atomic_ops/sysdeps/gcc/generic-arithm.template
[!AO_SKIPATOMIC_ANY_xor_ANY] (AO_XSIZE_xor_XBAR): Likewise.
* src/atomic_ops/sysdeps/gcc/riscv.h (AO_GCC_FORCE_HAVE_CAS): Define
only if __clang__ or AO_PREFER_BUILTIN_ATOMICS; update comment.
* src/atomic_ops/sysdeps/gcc/riscv.h [!__clang__
&& !AO_PREFER_BUILTIN_ATOMICS && !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1]
(AO_NO_char_ARITHM): Define macro; add comment.
* src/atomic_ops/sysdeps/gcc/riscv.h [!__clang__
&& !AO_PREFER_BUILTIN_ATOMICS && !__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2]
(AO_NO_short_ARITHM): Likewise.
* src/atomic_ops/sysdeps/gcc/riscv.h (AO_NO_char_ARITHM,
AO_NO_short_ARITHM): Undefine after include generic.h.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/s390.h [AO_CLANG_PREREQ(8,0) && __s390x__
&& !AO_DISABLE_GCC_ATOMICS]: Include generic.h.
* src/atomic_ops/sysdeps/gcc/s390.h [!(AO_CLANG_PREREQ(8,0)
&& __s390x__ && !AO_DISABLE_GCC_ATOMICS)]: Do not include
ordered_except_wr.h, all_aligned_atomic_load_store.h,
test_and_set_t_is_ao_t.h.
* src/atomic_ops/sysdeps/gcc/s390.h [!(AO_CLANG_PREREQ(8,0)
&& __s390x__ && !AO_DISABLE_GCC_ATOMICS)] (AO_compare_and_swap_full,
AO_fetch_compare_and_swap_full): Do not define.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/s390.h [AO_GNUC_PREREQ(5,4) && __s390x__
&& !AO_DISABLE_GCC_ATOMICS]: Include generic.h.
* src/atomic_ops/sysdeps/gcc/s390.h [!(AO_GNUC_PREREQ(5,4) && __s390x__
&& !AO_DISABLE_GCC_ATOMICS)]: Do not include ordered_except_wr.h,
all_aligned_atomic_load_store.h, test_and_set_t_is_ao_t.h.
* src/atomic_ops/sysdeps/gcc/s390.h [!(AO_GNUC_PREREQ(5,4) && __s390x__
&& !AO_DISABLE_GCC_ATOMICS)] (AO_compare_and_swap_full,
AO_fetch_compare_and_swap_full): Do not define.
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/powerpc.h [AO_DISABLE_GCC_ATOMICS
&& !AO_PREFER_GENERALIZED] (AO_test_and_set): Remove comment that the
function is untested.
* src/atomic_ops/sysdeps/gcc/s390.h: Remove comment that the all
functions are untested; replace FIXME with TODO for
test_and_set_t_is_ao_t.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the compiler support flag outputs, then we can get rid of setz
instruction.
* src/atomic_ops/sysdeps/gcc/x86.h [AO_DISABLE_GCC_ATOMICS
&& !AO_GENERALIZE_ASM_BOOL_CAS && !AO_USE_SYNC_CAS_BUILTIN]
(AO_compare_and_swap_full): If __GCC_ASM_FLAG_OUTPUTS__ is defined,
then define dummy local variable and store cmpxchg result to it, fill
in "result" varaible using @ccz asm specification, do not use asm setz
instruction.
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& !AO_SKIPATOMIC_double_compare_and_swap_ANY]
(AO_compare_double_and_swap_double_full): If __GCC_ASM_FLAG_OUTPUTS__
is defined, then do not define dummy local variable, fill in "result"
variable using @ccz asm specification, do not use asm setz instruction,
specify that old_val2 and old_val1 are modified by cmpxchg8/16b
instruction.
|
|
|
|
|
|
|
|
|
|
|
| |
Reuse of the PIC hard register, instead of using a fixed register, is
implemented in Clang and GCC 5.1+, at least.
* src/atomic_ops/sysdeps/gcc/x86.h [!(AO_GCC_ATOMIC_TEST_AND_SET
&& !AO_SKIPATOMIC_double_compare_and_swap_ANY) && !__x86_64__
&& (!AO_USE_SYNC_CAS_BUILTIN || AO_GCC_ATOMIC_TEST_AND_SET) && __PIC__]
(AO_compare_double_and_swap_double_full): Use non-PIC implementation
if GCC version >= 5.1 or Clang version >= 4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/x86.h [AO_DISABLE_GCC_ATOMICS]
(AO_fetch_and_add_full, AO_char_fetch_and_add_full,
AO_short_fetch_and_add_full, AO_and_full, AO_or_full, AO_xor_full,
AO_char_and_full, AO_char_or_full, AO_char_xor_full, AO_short_and_full,
AO_short_or_full, AO_short_xor_full, AO_test_and_set_full,
AO_compare_and_swap_full, AO_fetch_compare_and_swap_full,
AO_short_fetch_compare_and_swap_full,
AO_int_fetch_compare_and_swap_full, AO_int_fetch_and_add_full,
AO_int_and_full, AO_int_or_full, AO_int_xor_full): Merge "=m" output
and "m" input entries into "+m" in-output one.
* src/atomic_ops/sysdeps/gcc/x86.h [!(AO_GCC_ATOMIC_TEST_AND_SET
&& !AO_SKIPATOMIC_double_compare_and_swap_ANY)]
(AO_compare_double_and_swap_double_full): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(fix of commits 1dc2fb3, 929954a)
Bind E/RDX to a dummy output since cmpxchg8/16b clobbers it.
* src/atomic_ops/sysdeps/gcc/x86.h [!(AO_GCC_ATOMIC_TEST_AND_SET
&& !AO_SKIPATOMIC_double_compare_and_swap_ANY)]
(AO_compare_double_and_swap_double_full): Declare dummy local variable;
specify "=d"(dummy) for asm code.
* src/atomic_ops/sysdeps/sunc/x86.h [__i386 && !AO_NO_CMPXCHG8B ||
!__i386 && AO_CMPXCHG16B_AVAILABLE]
(AO_compare_double_and_swap_double_full): Likewise.
|
|
|
|
|
|
|
| |
* src/atomic_ops.h [!AO_HAVE_CLEAR]: Replace "AO_AO_TS_T" with
"defined(AO_AO_TS_T)" and AO_CHAR_TS_T" with "defined(AO_CHAR_TS_T)",
respectively, in the "if" preprocessor directives.
* src/atomic_ops/generalize.h: Likewise.
|
|
|
|
|
|
| |
* src/atomic_ops_malloc.c (get_chunk): Replace p1-p2>limit expression
with (AO_t)p1>(AO_t)(p2+limit), where p1>=p2 and p2+limit does not
overflow.
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops_malloc.c (get_chunk): Skip assertion about
my_chunk_ptr value alignment if CPPCHECK.
* tests/test_malloc.c (DEFAULT_NTHREADS): Add comment about the
maximum value.
* tests/test_malloc.c (main): Remove assertion of nthreads value which
is set to DEFAULT_NTHREADS (ideally there should be a static_assert).
* tests/test_stack.c (main): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(revert part of commit cbde60d)
* src/atomic_ops/sysdeps/icc/ia64.h (AO_char_load_acquire): Fix typo
("an ld.acq") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_load_acquire): Likewise.
* src/atomic_ops/sysdeps/icc/ia64.h (AO_short_load_acquire,
AO_int_load_acquire): Add comment (similar to that of
AO_char_load_acquire).
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_store_release): Fix typo ("an st.rel") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h:
Regenerate.
* src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h:
Likewise.
|
|
|
|
|
|
|
|
| |
(fix of commit 9b7cecba)
* src/atomic_ops/sysdeps/gcc/arm.h (AO_ARM_HAVE_DMB, AO_ARM_HAVE_LDREX,
AO_ARM_HAVE_LDREXBH, AO_ARM_HAVE_LDREXD, AO_ARM_HAVE_SWP): Undefine at
the end of the file.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(code refactoring)
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h:
Regenerate.
* src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_GCC_BARRIER): Define only if AO_HAVE_GCC_BARRIER is undefined.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
[!AO_HAVE_GCC_BARRIER] (AO_HAVE_GCC_BARRIER): Define macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #38 (libatomic_ops).
Both gcc and clang have correct support of 64-bit atomic primitives
on AArch64, so need to use inline assembly.
* src/atomic_ops/sysdeps/gcc/aarch64.h [!__clang__] (AO_double_load,
AO_double_load_acquire, AO_double_store, AO_double_store_release,
AO_double_compare_and_swap, AO_double_compare_and_swap_acquire,
AO_double_compare_and_swap_release, AO_double_compare_and_swap_full):
Do not define if __ILP32__ (unless AO_AARCH64_ASM_LOAD_STORE_CAS).
* src/atomic_ops/sysdeps/gcc/aarch64.h [!__clang__
|| AO_CLANG_PREREQ(3,9)] (AO_GCC_HAVE_double_SYNC_CAS): Do not define
if __ILP32__; update gcc version in comment.
|
|
|
|
| |
* src/atomic_ops.h [_MSC_VER && _M_ARM64]: Include msftc/x86_64.h.
|
|
|
|
|
| |
* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER && __nios2__] (AO_CAN_EMUL_CAS): Define macro.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #38 (libatomic_ops).
* src/atomic_ops/sysdeps/gcc/aarch64.h [(!__clang__
|| AO_AARCH64_ASM_LOAD_STORE_CAS) && !AO_PREFER_GENERALIZED
&& __ILP32__] (AO_double_load, AO_double_load_acquire, AO_double_store,
AO_double_store_release): Specify the size ("w") of arguments of the
aarch64 instructions.
* src/atomic_ops/sysdeps/gcc/aarch64.h [(!__clang__
|| AO_AARCH64_ASM_LOAD_STORE_CAS) && __ILP32__]
(AO_double_compare_and_swap, AO_double_compare_and_swap_acquire,
AO_double_compare_and_swap_release, AO_double_compare_and_swap_full):
Likewise.
|
|
|
|
|
| |
* src/atomic_ops_malloc.c (get_chunk): Move get_mmaped() call into the
for loop; replace return statement inside the loop with break.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/armcc/arm_v6.h [!AO_UNIPROCESSOR]
(AO_nop_full): Fix typo ("a data memory barrier") in comment.
* src/atomic_ops/sysdeps/icc/ia64.h (AO_char_load_acquire): Fix typo
("a ld.acq instruction") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_load_acquire): Likewise.
* src/atomic_ops/sysdeps/icc/ia64.h (AO_short_load_acquire,
AO_int_load_acquire): Remove comment duplicating that in
AO_char_load_acquire.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.template
(AO_XSIZE_store_release): Fix typo ("a st.rel instruction") in comment.
* src/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h:
Regenerate.
* src/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h:
Likewise.
* src/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h:
Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(code refactoring)
* src/atomic_ops/sysdeps/armcc/arm_v6.h (AO_test_and_set): Remove
redundant blank line at the start of a code block.
* src/atomic_ops/sysdeps/hpc/ia64.h (AO_fetch_compare_and_swap_release,
AO_char_fetch_compare_and_swap_acquire,
AO_char_fetch_compare_and_swap_release,
AO_short_fetch_compare_and_swap_acquire,
AO_short_fetch_compare_and_swap_release): Remove redundant blank line
at the end of a code block.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* README.md (Copyright & Warranty): Add copyrights from the source
code files.
* src/atomic_ops.h: Update header copyright (add Ivan Maidanski).
* src/atomic_ops/ao_version.h: Likewise.
* src/atomic_ops/sysdeps/gcc/aarch64.h: Likewise.
* src/atomic_ops/sysdeps/gcc/arm.h: Likewise.
* src/atomic_ops/sysdeps/gcc/generic.h: Likewise.
* src/atomic_ops/sysdeps/gcc/x86.h: Likewise.
* src/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h:
Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h: Likewise.
* src/atomic_ops/sysdeps/msftc/common32_defs.h: Likewise.
* src/atomic_ops/sysdeps/sunc/x86.h: Likewise.
|
|
|
|
|
|
|
|
|
|
| |
Issue #34 (libatomic_ops).
* src/atomic_ops/sysdeps/gcc/x86.h [!AO_DISABLE_GCC_ATOMICS
&& !__APPLE_CC__ && !__clang__ && AO_GNUC_PREREQ(7, 0)
&& !AO_PREFER_BUILTIN_ATOMICS && !AO_THREAD_SANITIZER
&& !__MINGW32__] (AO_SKIPATOMIC_double_compare_and_swap_ANY,
AO_SKIPATOMIC_DOUBLE_LOAD_STORE_ANY): Define macro; add comment.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't set mips2/3 for mips r6. MIPS release 6 changes the encoding of
some instructions, including ll/sc. Setting mips2/3 here produces the
binary with the old encoding (not compatible with mips r6).
This patch has no effect if gcc 4.9+ or clang 3.5+ unless
AO_DISABLE_GCC_ATOMICS is defined manually in CFLAGS.
* src/atomic_ops/sysdeps/gcc/mips.h [AO_DISABLE_GCC_ATOMICS
&& __mips_isa_rev>=6] (AO_MIPS_SET_ISA): Define to empty string
(instead of ".set mips2" or ".set mips3").
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Issue #31 (libatomic_ops).
At least for gcc-7.2.0 does not define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1
and __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 macros but, nonetheless, all the
provided CAS operations are lock-free (except for double-word).
* src/Makefile.am (nobase_private_HEADERS): Add gcc/riscv.h entry.
* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER && __riscv]: Include gcc/riscv.h file.
* src/atomic_ops/sysdeps/gcc/riscv.h: New file (include generic.h).
* src/atomic_ops/sysdeps/gcc/riscv.h (AO_GCC_FORCE_HAVE_CAS): Define
before include generic.h (and undefined at the end of file); add
comment about double-word operations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(code refactoring)
* src/Makefile.am (nobase_private_HEADERS): Remove nios2.h, riscv.h
entries.
* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER]: Use #elif instead of #endif - #if pairs.
* src/atomic_ops.h [__GNUC__ && !AO_USE_PTHREAD_DEFS
&& !__INTEL_COMPILER && (__nios2__ || __riscv)]: Do not include
gcc/nios2.h and gcc/riscv.h files; gcc/generic.h is included instead.
* src/atomic_ops/sysdeps/gcc/nios2.h: Delete file.
* src/atomic_ops/sysdeps/gcc/riscv.h: Likewise.
|
|
|
|
|
|
|
|
| |
Issue #31 (libatomic_ops).
* src/Makefile.am (nobase_private_HEADERS): Add riscv.h entry.
* src/atomic_ops.h [__riscv]: Include riscv.h file.
* src/atomic_ops/sysdeps/gcc/riscv.h: New file (just include generic.h).
|
|
|
|
|
|
|
|
|
| |
Explicit pointer casts are added where necessary.
* src/atomic_ops_malloc.c [HAVE_MMAP] (get_mmaped): Cast result of
mmap() to char* (when assigned to "result" local variable).
* src/atomic_ops_malloc.c (AO_free): Cast AO_free_large() argument
to char*.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Put declarations of exported variables and non-inline functions into
extern "C" blocks.
* src/atomic_ops/sysdeps/emul_cas.h [__cplusplus]
(AO_fetch_compare_and_swap_emulation,
AO_compare_double_and_swap_double_emulation, AO_store_full_emulation):
Wrap the prototypes (but not included headers).
* src/atomic_ops/sysdeps/gcc/x86.h [AO_WEAK_DOUBLE_CAS_EMULATION
&& __cplusplus] (AO_compare_double_and_swap_double_emulation): Likewise.
* src/atomic_ops/sysdeps/generic_pthread.h [__cplusplus] (AO_pt_lock):
Likewise.
* src/atomic_ops/sysdeps/sunc/sparc.h [__cplusplus]
(AO_test_and_set_full): Likewise.
* src/atomic_ops_malloc.h [__cplusplus] (AO_free, AO_malloc,
AO_malloc_enable_mmap): Likewise.
* src/atomic_ops_stack.h [__cplusplus]
(AO_stack_push_explicit_aux_release,
AO_stack_pop_explicit_aux_acquire, AO_stack_init,
AO_stack_push_release, AO_stack_pop_acquire): Likewise.
* tests/test_atomic.c [AO_TEST_EMULATION && __cplusplus]
(AO_store_full_emulation, AO_fetch_compare_and_swap_emulation,
AO_compare_double_and_swap_double_emulation): Likewise.
* src/atomic_ops/sysdeps/msftc/common32_defs.h [_MSC_VER<1400
&& __cplusplus]: Adjust comment for the end of extern "C" block.
|
|
|
|
|
|
|
|
|
| |
(fix commit 441415c8)
* src/atomic_ops_stack.c [!AO_USE_ALMOST_LOCK_FREE
&& AO_THREAD_SANITIZER && !AO_HAVE_compare_and_swap_double &&
!AO_HAVE_compare_double_and_swap_double] (load_before_cas): Define as
macro (not as a static function).
|
|
|
|
|
| |
* src/Makefile.am (LIBATOMIC_OPS_GPL_VER_INFO): Increment revision
(bump version info of libatomic_ops_gpl.so to 2:2:1).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(fix commits 6ffda1db, 110b0dcc)
This is also a workaround for a TSan false positive reported
in AO_stack_pop_acquire.
* src/atomic_ops_stack.c (AO_copy_before_cas): Remove.
* src/atomic_ops_stack.c (store_before_cas): New static function (or
defined as a macro).
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE] (load_before_cas):
Likewiese.
* src/atomic_ops_stack.c (AO_stack_push_explicit_aux_release,
AO_stack_push_release): Use store_before_cas instead of
AO_copy_before_cas.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE] (load_before_cas):
Add volatile to addr argument if Clang.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE] (AO_stack_pop_acquire):
Use load_before_cas instead of AO_copy_before_cas.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(fix commits c058d9d, 6ffda1db)
The TSan-related workaround in AO_malloc is no longer needed.
* src/atomic_ops_malloc.c [AO_THREAD_SANITIZER
&& AO_USE_ALMOST_LOCK_FREE] (AO_malloc): Do not use AO_store (always
use *result=log_sz); remove comment.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE
&& AO_THREAD_SANITIZER] (AO_load_next): New static function (with
AO_ATTR_NO_SANITIZE_THREAD attribute); add comments.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE
&& !AO_THREAD_SANITIZER] (AO_load_next): Define to AO_load.
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_pop_explicit_aux_acquire): Replace AO_load(first_ptr) with
AO_load_next(first_ptr).
|
|
|
|
|
|
|
|
|
|
| |
The macro is AO_STACK_PREFER_CAS_DOUBLE. This is only for testing.
* src/atomic_ops_stack.c [!USE_ALMOST_LOCK_FREE
&& AO_HAVE_compare_double_and_swap_double && AO_STACK_PREFER_CAS_DOUBLE
&& AO_HAVE_compare_and_swap_double] (AO_stack_pop_acquire,
AO_stack_pop_acquire): Use implementation based compare_and_swap_double
instead of compare_double_and_swap_double); remove #error directive.
|
|
|
|
|
|
| |
* src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
(AO_stack_push_explicit_aux_release): Replace a->AO_stack_bl+i with
&a->AO_stack_bl[i] (including the case of i==0).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Note: to disable it, AO_NO_MALLOC_POISON should be defined by client.
* src/atomic_ops_malloc.c [AO_ADDRESS_SANITIZER && !AO_NO_MALLOC_POISON]
(__asan_poison_memory_region, __asan_unpoison_memory_region): Prototype.
* src/atomic_ops_malloc.c (ASAN_POISON_MEMORY_REGION,
ASAN_UNPOISON_MEMORY_REGION): New macro.
* src/atomic_ops_malloc.c (add_chunk_as): Call
ASAN_POISON_MEMORY_REGION() for each pushed region.
* src/atomic_ops_malloc.c (AO_malloc): Call
ASAN_UNPOISON_MEMORY_REGION() for the returned memory region.
* src/atomic_ops_malloc.c (AO_free): Call ASAN_POISON_MEMORY_REGION()
before pushing the freed region to AO_free_list.
|