| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
| |
(fix commit 7a6a7cc)
Issue #23 (libatomic_ops).
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& __APPLE_CC__] (AO_GCC_FORCE_HAVE_CAS): Define also for arch i386;
refine comment.
|
|
|
|
|
|
|
|
|
| |
Issue #23 (libatomic_ops).
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& __APPLE_CC__ && __x86_64__] (AO_GCC_FORCE_HAVE_CAS): Define (to
workaround missing __GCC_HAVE_SYNC_COMPARE_AND_SWAP_<n> predefined
macro in Apple clang-425/x86_64); add comment.
|
|
|
|
| |
(fix commit fa3ebc3)
|
| |
|
|
|
|
|
|
| |
* configure.ac: Add AC_SUBST(CFLAGS_EXTRA).
* src/Makefile.am (CFLAGS): Append $(CFLAGS_EXTRA).
* tests/Makefile.am (CFLAGS): Likewise.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit also eliminates 'cast from pointer to integer' compiler
warnings and '32-bit value shift followed by expansion to 64-bit'
static analysis tool warning.
* src/atomic_ops_malloc.c [AO_TRACE_MALLOC] (AO_malloc, AO_free):
Use %p (instead of %x) format specifier to print pthread_self() value
(and cast pthread_self() to void*).
* src/atomic_ops_malloc.c [AO_TRACE_MALLOC] (AO_malloc): Cast result+1
to void* (to match %p printf format specifier).
* src/atomic_ops_malloc.c [AO_TRACE_MALLOC] (AO_free): Use "UL" suffix
for 1 and remove the cast to unsigned long (instead of performing left
shift of an integer value and extending the result to unsigned long).
|
|
|
|
|
|
| |
* tests/test_atomic_include.template (test_atomicXX): Ensure old_w is
always initialized before AO_double_storeXX; add comment about MSan
false warning.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
As of clang-3.8, double-wide arguments are incorrectly passed to
atomic intrinsic operations for x64 target if Address Sanitizer is
enabled.
* src/atomic_ops.h [__has_feature(address_sanitizer)]
(AO_ADDRESS_SANITIZER): New internal macro.
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& __clang__ && __x86_64__ && !__ILP32__]
(AO_SKIPATOMIC_double_compare_and_swap_ANY, AO_SKIPATOMIC_double_load,
AO_SKIPATOMIC_double_load_acquire, AO_SKIPATOMIC_double_store,
AO_SKIPATOMIC_double_store_release): Define also if AO_ADDRESS_SANITIZER;
update comment.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(fix commits 9803386, f6a1b68, eb6d4fd)
* src/atomic_ops/sysdeps/gcc/generic.h [AO_HAVE_DOUBLE_PTR_STORAGE
&& !AO_HAVE_double_store] (AO_double_store): Do not define if
AO_SKIPATOMIC_double_store.
* src/atomic_ops/sysdeps/gcc/generic.h [AO_HAVE_DOUBLE_PTR_STORAGE
&& !AO_HAVE_double_store_release] (AO_double_store_release): Do not
define if AO_SKIPATOMIC_double_load.
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& __clang__ && !__x86_64__ && !__APPLE_CC__ && !__CYGWIN__
&& !AO_PREFER_BUILTIN_ATOMICS] (AO_SKIPATOMIC_double_load,
AO_SKIPATOMIC_double_load_acquire, AO_SKIPATOMIC_double_store,
AO_SKIPATOMIC_double_store_release): Define internal macro (undefined
at the end of file).
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET
&& (__clang__ && !__x86_64__ && !__APPLE_CC__ && !__CYGWIN__
&& !AO_PREFER_BUILTIN_ATOMICS) || (__APPLE_CC__ && __x86_64__))]
(AO_SKIPATOMIC_double_compare_and_swap_ANY): Move definition here
(remove at other places in this file); undefine at the end of the file.
* src/atomic_ops/sysdeps/gcc/x86.h [AO_GCC_ATOMIC_TEST_AND_SET]: Check
AO_SKIPATOMIC_double_compare_and_swap_ANY instead of checking multiple
macros to detect whether a workaround for the CAS (and others)
double-wide operations is needed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(fix commits 03a0465f, 3c52619c, 66f7a4d3)
* src/atomic_ops/sysdeps/gcc/aarch64.h (AO_SKIPATOMIC_double_load,
AO_SKIPATOMIC_double_load_acquire): Undefine at the end of file.
* src/atomic_ops/sysdeps/gcc/arm.h (AO_SKIPATOMIC_ANY_and_ANY,
AO_SKIPATOMIC_ANY_or_ANY, AO_SKIPATOMIC_ANY_xor_ANY,
AO_SKIPATOMIC_char_store, AO_SKIPATOMIC_char_store_release,
AO_SKIPATOMIC_int_store, AO_SKIPATOMIC_int_store_release,
AO_SKIPATOMIC_short_store, AO_SKIPATOMIC_short_store_release,
AO_SKIPATOMIC_store, AO_SKIPATOMIC_store_release): Likewise.
|
|
|
|
|
|
|
| |
(fix commit 96a8fd9)
* configure.ac [GCC] (ac_cv_cc_pedantic): Compile code that contains
"extern int quiet" (since the translation unit cannot be empty).
|
|
|
|
|
|
| |
* configure.ac [GCC] (WPEDANTIC): New variable (set to
"-Wpedantic -Wno-long-long" if supported by the compiler).
* configure.ac [GCC] (CFLAGS): Add $WPEDANTIC.
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/arm.h [!AO_UNIPROCESSOR && AO_ARM_HAVE_DMB
&& !AO_PREFER_BUILTIN_ATOMICS] (AO_nop_write): Refine comment about
"dmb ishst" for big.LITTLE architecture.
|
|
|
|
|
|
|
|
| |
GCC/powerpc-ibm-aix does not define any of __powerpc__, __ppc__,
__PPC__, __powerpc64__, __ppc64__; but it does define _ARCH_PPC (and
_POWER).
* src/atomic_ops.h [_ARCH_PPC]: Include gcc/powerpc.h.
|
|
|
|
|
| |
* tests/test_malloc.c (print_list): Define only if DEBUG_RUN_ONE_TEST.
* tests/test_stack.c (print_list): Define only if VERBOSE.
|
|
|
|
|
|
|
| |
(fix commit c2edeab)
* src/atomic_ops/sysdeps/gcc/s390.h (AO_fetch_compare_and_swap_full):
Adjust indentation of #endif.
|
| |
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/s390.h (AO_compare_and_swap_full): Do not
define if AO_GENERALIZE_ASM_BOOL_CAS.
* src/atomic_ops/sysdeps/gcc/s390.h (AO_fetch_compare_and_swap_full):
Implement; remove TODO item.
|
| |
|
| |
|
|
|
|
| |
(Cherry-pick commit 03a1704 from 'release-7_4' branch.)
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/gcc/hexagon.h (AO_test_and_set,
AO_compare_and_swap, AO_fetch_compare_and_swap): Remove spaces
preceding "\n".
* src/atomic_ops/sysdeps/gcc/mips.h (AO_nop_full, AO_fetch_and_add,
AO_test_and_set, AO_compare_and_swap): Likewise.
* src/atomic_ops/sysdeps/gcc/hexagon.h (AO_fetch_and_add,
AO_test_and_set, AO_fetch_compare_and_swap): Align comments.
|
|
|
|
|
| |
* doc/README.txt: Document AO_REQUIRE_CAS better (replace
"compare-and-swap" with "AO_compare_and_swap*").
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, only AO_and/or/xor and AO_[fetch]_CAS tests (for AO_t)
existed in test_atomic.
* tests/test_atomic_include.template (test_atomicXX): Add minimal
testing of AO_short_compare_and_swapXX, AO_short_orXX, AO_short_xorXX,
AO_short_andXX, AO_short_fetch_compare_and_swapXX,
AO_char_compare_and_swapXX, AO_char_orXX, AO_char_xorXX, AO_char_andXX,
AO_char_fetch_compare_and_swapXX, AO_int_compare_and_swapXX,
AO_int_orXX, AO_int_xorXX, AO_int_andXX,
AO_int_fetch_compare_and_swapXX.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
AO_XSIZE_and/or/xor_dd_acquire_read are meaningless and not implemented,
thus their absence is not reported in the tests.
* tests/test_atomic_include.template [!AO_HAVE_orXX] (test_atomicXX):
Do not call MISSING(AO_or) if all AO_HAVE_or* excluding
AO_HAVE_or_dd_acquire_read are not defined.
* tests/test_atomic_include.template [!AO_HAVE_xorXX] (test_atomicXX):
Do not call MISSING(AO_xor) if all AO_HAVE_xor* excluding
AO_HAVE_xor_dd_acquire_read are not defined.
* tests/test_atomic_include.template [!AO_HAVE_andXX] (test_atomicXX):
Do not call MISSING(AO_and) if all AO_HAVE_and* excluding
AO_HAVE_and_dd_acquire_read are not defined.
|
|
|
|
|
|
|
|
|
|
| |
This matters only if AO_double_compare_and_swap[_acquire_read] actually
defined in generalize.h too.
* src/atomic_ops/generalize.h
[!AO_HAVE_double_compare_and_swap_dd_acquire_read]
(AO_double_compare_and_swap_dd_acquire_read): Define (same as definition
as auto-generated in generalize-small.h).
|
|
|
|
|
|
|
|
| |
(fix commit 4c303bc)
* src/atomic_ops_malloc.c [USE_MMAP_ANON && CPPCHECK] (OPT_MAP_ANON):
Define to immediate non-zero value (taken from Linux libc) instead of
MAP_ANON (because the latter is used in ifdef).
|
|
|
|
|
|
| |
* src/atomic_ops/sysdeps/standard_ao_double_t.h [!__ILP32__
&& (__GNUC__ >= 4.7 || __clang__ >= 3.6)] (double_ptr_storage): Turn
off pedantic warnings reporting (for this typedef only).
|
|
|
|
|
|
|
| |
(fix commit c1a7aad)
* src/atomic_ops_malloc.c [USE_MMAP_ANON && MAP_ANONYMOUS]
(OPT_MAP_ANON): Define to MAP_ANON (instead of 0) if CPPCHECK.
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops.h [AO_CAN_EMUL_CAS]: Include emul_cas.h also if
CPPCHECK (to define AO_store_full as AO_store_full_emulation).
* tests/test_atomic_include.template [CPPCHECK] (list_atomicXX,
char_list_atomicXX, short_list_atomicXX, int_list_atomicXX,
double_list_atomicXX): Declare function.
* tests/test_atomic_include.template test_atomicXX (test_atomicXX):
Call list_atomicXX, char_list_atomicXX, short_list_atomicXX,
int_list_atomicXX and double_list_atomicXX if CPPCHECK.
|
|
|
|
|
|
|
| |
* tests/Makefile.am (test_atomic_include.h): Add "_dd_acquire_read"
test generation.
* tests/test_atomic.c [!AO_NO_PTHREADS || !AO_USE_PTHREAD_DEFS] (main):
Call test_atomic_dd_acquire_read().
|
|
|
|
|
| |
* src/atomic_ops.c [!_MSC_VER && !__MINGW32__] (AO_locks): Define as
static.
|
|
|
|
|
|
|
| |
* src/atomic_ops_malloc.c [USE_MMAP_ANON] (OPT_MAP_ANON): Define to 0
(do not use MAP_ANONYMOUS value) if CPPCHECK.
* src/atomic_ops_malloc.c [SIZE_MAX] (AO_SIZE_MAX): Do not use SIZE_MAX
value if CPPCHECK.
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_PPC_L, AO_PPC_BR_A): New
internal macros (undefined at the end of file); definition depends on
_AIX macro presence.
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_load_acquire,
AO_test_and_set, AO_compare_and_swap, AO_fetch_compare_and_swap,
AO_fetch_and_add): Use AO_PPC_L for label definitions; use AO_PPC_BR_A
to specify jump target.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_PPC_LD, AO_PPC_LxARX,
AO_PPC_CMPx, AO_PPC_STxCXd, AO_PPC_LOAD_CLOBBER): New internal macros
(undefined at the end of the file).
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_T_IS_INT): Move definition
upper (to have single check of __ppc64__).
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_load_acquire): Use AO_PPC_LD,
AO_PPC_LOAD_CLOBBER (and eliminate code duplication).
* src/atomic_ops/sysdeps/gcc/powerpc.h (AO_test_and_set,
AO_compare_and_swap, AO_fetch_compare_and_swap, AO_fetch_and_add): Use
AO_PPC_LxARX, AO_PPC_CMPx, AO_PPC_STxCXd (and eliminate code
duplication).
|
| |
| |
| |
| |
| |
| |
| |
| | |
Assertion for v value after fetch_and_sub1(&v) is added.
* tests/test_atomic_include.template (test_atomicXX): Call TA_assert
for s, b, zz values after they are decremented (use volatile pointer to
avoid "condition is always true" compiler warning).
|
| |
| |
| |
| |
| |
| | |
* src/atomic_ops_malloc.c (AO_free): Do not perform subtraction from
"p" argument if its value is null; change type of "base" local variable
from char* to AO_t*.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Long (32-bit) type is sufficient to represent time delta (duration)
in test_stack.
* tests/test_stack.c (get_msecs): Change return type from long long
to unsigned long (use lowest 32 bits of time value).
* tests/test_stack.c (main): Change type of start_time local variable
to unsigned long; remove redundant type cast.
|
| |
| |
| |
| |
| | |
* tests/run_parallel.h (AO_PTRDIFF_T): Define to ptrdiff_t for all
targets.
|
| |
| |
| |
| |
| | |
* tests/test_stack.c [VERBOSE] (main): Print value name along with the
value itself; print "ms" for time value; remove extra get_msecs() call.
|
|/
|
|
|
|
| |
* src/atomic_ops_stack.c [AO_HAVE_compare_and_swap_double]
(AO_stack_push_release): Move local variable declaration to the inner
scope where the variable is actually used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Undefine internal macros that are defined and used solely in a single
CPU-specific file.
* src/atomic_ops/sysdeps/gcc/arm.h (AO_BR_ALIGN, AO_MASK_PTR,
AO_THUMB_GO_ARM, AO_THUMB_RESTORE_MODE, AO_THUMB_SWITCH_CLOBBERS):
Undefine at the end of file.
* src/atomic_ops/sysdeps/gcc/hppa.h (AO_PA_LDCW_ALIGNMENT, AO_ldcw,
AO_ldcw_align): Likewise.
* src/atomic_ops/sysdeps/gcc/ia64.h (AO_IN_ADDR, AO_LEN, AO_MASK,
AO_OUT_ADDR, AO_SWIZZLE): Likewise.
* src/atomic_ops/sysdeps/gcc/mips.h (AO_MIPS_LL, AO_MIPS_LL_1,
AO_MIPS_SC, AO_MIPS_SET_ISA): Likewise.
* src/atomic_ops/sysdeps/hpc/hppa.h (AO_PA_LDCW_ALIGNMENT, AO_ldcw,
AO_ldcw_align): Likewise.
* src/atomic_ops/sysdeps/hpc/ia64.h (AO_T_FASIZE, AO_T_SIZE): Likewise.
* src/atomic_ops/sysdeps/icc/ia64.h (AO_INTEL_PTR_t): Likewise.
* src/atomic_ops/sysdeps/test_and_set_t_is_char.h (AO_TS_SET_TRUEVAL):
Likewise.
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops.h [AO_REQUIRE_CAS && !AO_CAN_EMUL_CAS]: Skip #error
pragma if CPPCHECK.
* src/atomic_ops/generalize.h [AO_HAVE_nop_acquire]: Likewise.
* src/atomic_ops/generalize.h [AO_HAVE_nop_release]: Likewise.
* src/atomic_ops/sysdeps/armcc/arm_v6.h [__TARGET_ARCH_ARM < 6]:
Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* src/atomic_ops.h [_HPUX_SOURCE && !__ia64] (AO_barrier_dummy):
Fix typo ("do not") in comment.
* src/atomic_ops/generalize.h [AO_HAVE_nop_acquire]: Fix typo
("do not") in #error message.
* src/atomic_ops/generalize.h [AO_HAVE_nop_release]: Likewise.
* src/atomic_ops/sysdeps/armcc/arm_v6.h [__TARGET_ARCH_ARM < 6]:
Likewise.
* src/atomic_ops/sysdeps/armcc/arm_v6.h [__TARGET_ARCH_ARM < 6]: Add
#error pragma.
* src/atomic_ops_stack.c [AO_HAVE_compare_and_swap_double]: Fix typo
("does not") in #error message.
|