Commits on Aug 24, 2016
  1. Workaround 'condition always true', 'unused stored value' cppcheck wa…

    * tests/test_atomic_include.template (test_atomicXX): Treat "x"
    variable as volatile one to suppress cppcheck warning that x==13 is
    always true.
    * tests/test_atomic_include.template (test_atomicXX): Make
    TA_assert(x==117) unconditional to suppress cppcheck warning that the
    value assigned by x=117 is never used.
    committed Aug 24, 2016
  2. Fix assertions style in test_atomic_include

    Use TA_assert consistently (not assert).
    * tests/test_atomic_include.template (test_atomicXX): Replace assert()
    calls with TA_assert().
    committed Aug 24, 2016
Commits on Aug 23, 2016
  1. Eliminate 'scope of variable can be reduced' cppcheck warnings

    * src/atomic_ops_malloc.c (msb): Declare "v" variable exactly in the
    scope where the variable is used in.
    * tests/run_parallel.h [USE_PTHREADS || USE_WINTHREADS] (run_parallel):
    Declare "code" variable exactly in the scope where the variable is
    used in.
    committed Aug 23, 2016
Commits on Aug 22, 2016
  1. Fix size value wrap around in AO_malloc_large

    AO_malloc(SIZE_MAX) should return NULL now.
    * src/atomic_ops_malloc.c (SIZET_SAT_ADD): New macro.
    * src/atomic_ops_malloc.c (AO_malloc_large): Use SIZET_SAT_ADD to
    avoid integer overflow when computing the memory size to map (i.e.,
    malloc should handle arguments close to SIZE_MAX correctly).
    committed Aug 22, 2016
Commits on Aug 20, 2016
  1. Workaround a bug in double-wide CAS intrinsic of Apple clang-600/x64

    The bug causes test_stack failure.
    * src/atomic_ops/sysdeps/gcc/x86.h
    [AO_GCC_ATOMIC_TEST_AND_SET && __APPLE_CC__ && __x86_64__]: Fall-back
    to asm-based implementation of double-wide CAS
    (AO_compare_double_and_swap_double_full); add comment explaining the
    * src/atomic_ops/sysdeps/gcc/x86.h
    && __APPLE_CC__] (AO_SKIPATOMIC_double_compare_and_swap_ANY): Define.
    committed Aug 20, 2016
  2. Use C11 double-wide atomic intrinsics for Clang/x86 on Cygwin and OS X

    Others (e.g., NDK clang/i686) still might need -latomic linker option.
    * src/atomic_ops/sysdeps/gcc/x86.h
    [AO_GCC_ATOMIC_TEST_AND_SET && __clang__]: Do not fallback to
    non-intrinsic implementation if __APPLE_CC__ or __CYGWIN__.
    committed Aug 20, 2016
  3. Code refactoring of int-wide primitives in gcc/x86.h

    * src/atomic_ops/sysdeps/gcc/x86.h (AO_int_fetch_and_add_full,
    AO_int_and_full, AO_int_or_full, AO_int_xor_full, AO_T_IS_INT): Move
    to separate 'ifdef' block (inside AO_DISABLE_GCC_ATOMICS case).
    committed Aug 20, 2016
Commits on Aug 18, 2016
  1. Avoid extra nop_full in stack_pop_acquire if atomic intrinsics used (…

    * src/atomic_ops/generalize.h [AO_HAVE_double_compare_and_swap_acquire]
    (AO_compare_double_and_swap_double_acquire): Implement (by redirecting
    to AO_double_compare_and_swap_acquire).
    * src/atomic_ops/generalize.h [AO_HAVE_double_compare_and_swap_release]
    (AO_compare_double_and_swap_double_release): Implement (by redirecting
    to AO_double_compare_and_swap_release).
    committed Aug 18, 2016
  2. Add CI (continuous integration) badges to README

    committed Aug 18, 2016
  3. Refine README how to build the library source from the repository

    * (Installation and Usage): Add information that
    should be launched first if building from the development repository.
    committed Aug 18, 2016
  4. Refine README about library downloading

    * (Download): New section; add link to Download page (located
    on GitHub); add information about the code repository.
    committed Aug 18, 2016
  5. Add asm-based and/or/xor implementation for char/short/int (gcc/x86)

    * src/atomic_ops/sysdeps/gcc/x86.h [AO_DISABLE_GCC_ATOMICS]
    (AO_char_and_full, AO_char_or_full, AO_char_xor_full,
    AO_short_and_full, AO_short_or_full, AO_short_xor_full): New inline
    * src/atomic_ops/sysdeps/gcc/x86.h [AO_DISABLE_GCC_ATOMICS
    && !AO_T_IS_INT] (AO_int_and_full, AO_int_or_full, AO_int_xor_full):
    committed Aug 18, 2016
Commits on Aug 17, 2016
  1. Fix (delete) comment for AO_and_full (x86)

    * src/atomic_ops/sysdeps/gcc/x86.h [!AO_PREFER_GENERALIZED]
    (AO_and_full): Remove incorrect comment (the code should work even for
    * src/atomic_ops/sysdeps/sunc/x86.h [!AO_PREFER_GENERALIZED]
    (AO_and_full): Likewise.
    committed Aug 17, 2016
Commits on Aug 15, 2016
  1. Add configuration file for AppVeyor CI

    * appveyor.yml: New file (not a part of the distribution archive).
    committed Aug 15, 2016
  2. Add configure '--disable-atomic-intrinsics' option

    * (atomic-intrinsics): New configure option.
    AC_DEFINE depending atomic-intrinsics option.
    committed Aug 15, 2016
  3. @hboehm

    Fix store-load ordering in AO_stack_pop_explicit_aux_acquire (PowerPC)

    Issue #15.
    The core issue is that AO_stack_pop_explicit_aux_acquire really needs
    to ensure that the store to the blacklist via
    AO_compare_and_swap_acquire becomes visible before the load to check
    the list head.  This effectively needs store-load ordering.
    Currently the only ordering here is imposed by the _acquire on the
    compare_and_swap.  On PowerPC that turns into an lwsync, which is too
    weak to enforce store to load ordering.
    This patch should fix the issue.  But this is suboptimal on x86, and
    we may want to make the fence conditional on "not x86", where the CAS
    already includes sufficient ordering.  (With C++11 atomics, this would
    also be tricky and probably involve making a bunch of accesses seq_cst.)
    * src/atomic_ops_stack.c [AO_USE_ALMOST_LOCK_FREE]
    (AO_stack_pop_explicit_aux_acquire): Call AO_compare_and_swap instead
    of AO_compare_and_swap_acquire; call AO_nop_full just before
    (first != AO_load(list)).
    hboehm committed with Aug 15, 2016
Commits on Aug 11, 2016
  1. Add configuration for Travis CI

    * .travis.yml: New file.
    committed Aug 11, 2016
Commits on Jul 29, 2016
  1. Update ChangeLog file

    committed Jul 29, 2016
Commits on May 23, 2016
  1. @hboehm

    Add disclaimer to README to favor C11/C++14 atomics over libatomic_op…

    …s use
    * Add top-level disclaimer that it is better to use
    C11 or C++14 atomic primitives instead of this library for the
    newly-developed code.
    hboehm committed with May 23, 2016
Commits on May 12, 2016
  1. @hboehm

    gcc/generic-small.h: Add TODO items

    * src/atomic_ops/sysdeps/gcc/generic-small.h: Regenerate.
    * src/atomic_ops/sysdeps/gcc/generic-small.template: Add TODO items
    for XSIZE_load_read, XSIZE_load_full, XSIZE_load_dd_acquire_read,
    hboehm committed with May 12, 2016
  2. @hboehm

    Refine documentation about _full memory ordering suffix

    * doc/README.txt (_full): Refine documentation (regarding AO_nop_full
    hboehm committed with May 12, 2016
Commits on May 11, 2016
  1. Update AUTHORS file

    committed May 11, 2016
  2. Basic support of TILE-Gx and TILEPro CPUs

    This patch is an updated version of the CentOS 6 patch that we have
    been carrying as part of our own CentOS-like distribution since 2012.
    * src/ (nobase_private_HEADERS): Add tile.h.
    * src/atomic_ops.h [__tile__]: Include tile.h file.
    * src/atomic_ops/sysdeps/gcc/tile.h: New file.
    Chris Metcalf committed with May 11, 2016
Commits on Apr 26, 2016
  1. Update ChangeLog file

    committed Apr 26, 2016
Commits on Apr 25, 2016
  1. Use GCC atomic intrinsics for x86 and x64 (gcc 4.8+ and clang 3.4+)

    * src/atomic_ops/sysdeps/gcc/generic.h (AO_GCC_HAVE_double_SYNC_CAS):
    Do not define if AO_SKIPATOMIC_double_compare_and_swap_ANY.
    * src/atomic_ops/sysdeps/gcc/x86.h (AO_GCC_ATOMIC_TEST_AND_SET): Define
    if gcc4.8+ (but not Intel compiler) or clang3.4+ (if not
    * src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET]: Do not
    include all_aligned_atomic_load_store.h, test_and_set_t_is_char.h,
    * src/atomic_ops/sysdeps/gcc/x86.h (AO_nop_full, 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_test_and_set_full,
    AO_compare_and_swap_full) [AO_GCC_ATOMIC_TEST_AND_SET]: Do not define.
    * src/atomic_ops/sysdeps/gcc/x86.h: Include standard_ao_double_t.h if
    * src/atomic_ops/sysdeps/gcc/x86.h (AO_double_load_acquire,
    AO_double_store_release, AO_SKIPATOMIC_double_compare_and_swap_ANY):
    Define if AO_GCC_ATOMIC_TEST_AND_SET and clang/x86 (unless
    * src/atomic_ops/sysdeps/gcc/x86.h
    (AO_compare_double_and_swap_double_full) [x86]: Define also for
    clang/x86 if AO_GCC_ATOMIC_TEST_AND_SET (unless
    * src/atomic_ops/sysdeps/gcc/x86.h
    (AO_compare_double_and_swap_double_full) [x86_64]: Remove TODO item;
    check __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 to detect presence of
    * src/atomic_ops/sysdeps/gcc/x86.h: Include generic.h if
    * src/atomic_ops/sysdeps/standard_ao_double_t.h (double_ptr_storage):
    Use unsigned __int128 instead of __m128 for GCC x86_64 atomic
    committed Apr 25, 2016
Commits on Apr 21, 2016
  1. Do not force GCC atomic intrinsics usage if AO_PREFER_BUILTIN_ATOMICS

    The macro should only prevent usage of assembly completely but only
    if at least some of GCC atomic intrinsics are available.
    * src/atomic_ops/sysdeps/gcc/arm.h (AO_PREFER_BUILTIN_ATOMICS): Remove
    from the condition whether to include generic.h.
    * src/atomic_ops/sysdeps/gcc/mips.h (AO_PREFER_BUILTIN_ATOMICS):
    committed Apr 21, 2016
Commits on Apr 19, 2016

    Declare and document (using AH_TEMPLATE).
    committed Apr 19, 2016
Commits on Apr 18, 2016
  1. Fix typo in (in description of AO_ASM_X64_AVAILABLE)

    * (AO_ASM_X64_AVAILABLE): Fix typo ("available").
    committed Apr 18, 2016
  2. Remove AO_T_IS_INT definition for GCC atomic intrinsics case

    (Code refactoring)
    In case of GCC/C11 atomic intrinsics are used, AO_int_* are defined in
    generic-arithm.h and generic-small.h files.
    * src/atomic_ops/sysdeps/gcc/arm.h (AO_T_IS_INT): Do not define if
    * src/atomic_ops/sysdeps/gcc/mips.h (AO_T_IS_INT): Likewise.
    * src/atomic_ops/sysdeps/gcc/nios2.h (AO_T_IS_INT): Do not define.
    committed Apr 18, 2016
Commits on Apr 15, 2016
  1. Fix AO_TS_VAL_t used for __atomic_test_and_set (gcc)

    * src/atomic_ops/sysdeps/gcc/aarch64.h (AO_GCC_ATOMIC_TEST_AND_SET):
    * src/atomic_ops/sysdeps/gcc/mips.h [!AO_DISABLE_GCC_ATOMICS]
    * src/atomic_ops/sysdeps/gcc/nios2.h (AO_GCC_ATOMIC_TEST_AND_SET):
    * src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h (AO_TS_SET_TRUEVAL):
    * src/atomic_ops/sysdeps/gcc/aarch64.h: Remove include
    test_and_set_t_is_ao_t.h file.
    * src/atomic_ops/sysdeps/gcc/mips.h [!AO_DISABLE_GCC_ATOMICS]: Likewise.
    * src/atomic_ops/sysdeps/gcc/nios2.h: Likewise.
    * src/atomic_ops/sysdeps/gcc/arm.h: Include test_and_set_t_is_ao_t.h
    only if not AO_GCC_ATOMIC_TEST_AND_SET.
    * src/atomic_ops/sysdeps/gcc/generic.h (AO_GCC_ATOMIC_TEST_AND_SET):
    Define macro.
    * src/atomic_ops/sysdeps/gcc/generic.h: Include
    test_and_set_t_is_char.h file.
    * src/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h (AO_TS_val): Define
    AO_TS_set to 1; update comment.
    committed Apr 15, 2016
  2. Fix typo in gcc/arm.h (ARMv6)

    * src/atomic_ops/sysdeps/gcc/arm.h (AO_SKIPATOMIC_ANY_and_ANY): Fix
    CPU architecture version in comment (ARMv6).
    committed Apr 15, 2016
Commits on Apr 13, 2016
  1. Avoid __atomic_and/or/xor_fetch if unsupported (clang/arm-v5te)

    * src/atomic_ops/sysdeps/gcc/arm.h (AO_SKIPATOMIC_ANY_and_ANY,
    internal macro (before include "generic.h") if
    AO_GCC_ATOMIC_TEST_AND_SET and __clang__, and not AO_ARM_HAVE_LDREX.
    * src/atomic_ops/sysdeps/gcc/generic-arithm.h: Regenerate.
    * src/atomic_ops/sysdeps/gcc/generic-arithm.template
    (AO_XSIZE_and_XBAR): Do not define if AO_SKIPATOMIC_ANY_and_ANY.
    * src/atomic_ops/sysdeps/gcc/generic-arithm.template
    (AO_XSIZE_or_XBAR): Do not define if AO_SKIPATOMIC_ANY_or_ANY.
    * src/atomic_ops/sysdeps/gcc/generic-arithm.template
    (AO_XSIZE_xor_XBAR): Do not define if AO_SKIPATOMIC_ANY_xor_ANY.
    committed Apr 13, 2016
Commits on Apr 11, 2016
  1. Use GCC atomic intrinsics for ARM (gcc 4.8+ and clang 3.5+)

    * src/atomic_ops/sysdeps/gcc/arm.h (AO_GCC_ATOMIC_TEST_AND_SET): Define
    if gcc 4.8+ or clang 3.5+ or AO_PREFER_BUILTIN_ATOMICS unless
    * src/atomic_ops/sysdeps/gcc/arm.h (AO_nop_write, AO_store,
    AO_char_store, AO_short_store): Do not define (in assembly code) if
    * src/atomic_ops/sysdeps/gcc/arm.h (AO_SKIPATOMIC_store,
    AO_SKIPATOMIC_store_release, AO_SKIPATOMIC_char_store,
    AO_SKIPATOMIC_char_store_release, AO_SKIPATOMIC_short_store,
    AO_SKIPATOMIC_short_store_release, AO_SKIPATOMIC_int_store,
    AO_SKIPATOMIC_int_store_release): Define if AO_BROKEN_TASKSWITCH_CLREX.
    * src/atomic_ops/sysdeps/gcc/arm.h (AO_nop_full, AO_test_and_set,
    AO_fetch_and_add, AO_fetch_and_add1, AO_fetch_and_sub1, AO_and, AO_or,
    AO_xor, AO_char_fetch_and_add, AO_short_fetch_and_add,
    AO_compare_and_swap, AO_fetch_compare_and_swap, AO_double_load,
    AO_double_store, AO_double_compare_and_swap, AO_test_and_set_full): Do
    not define (in assembly code) if AO_GCC_ATOMIC_TEST_AND_SET.
    * src/atomic_ops/sysdeps/gcc/arm.h: Do not include atomic_store.h,
    all_atomic_only_load.h, char_atomic_store.h, short_atomic_store.h,
    all_aligned_atomic_load_store.h if AO_GCC_ATOMIC_TEST_AND_SET.
    * src/atomic_ops/sysdeps/gcc/arm.h: Include generic.h (at the end of
    the file) if AO_GCC_ATOMIC_TEST_AND_SET.
    * src/atomic_ops/sysdeps/gcc/generic-small.h: Regenerate.
    * src/atomic_ops/sysdeps/gcc/generic-small.template (AO_XSIZE_store):
    Do not define if AO_SKIPATOMIC_XSIZE_store.
    * src/atomic_ops/sysdeps/gcc/generic-small.template
    (AO_XSIZE_store_release): Do not define if
    committed Apr 11, 2016