platform/upstream/libatomic_ops.git
7 years agoTravis CI: compile for host CPU (to test double-wide primitives)
Ivan Maidanski [Thu, 26 Jan 2017 07:43:08 +0000 (10:43 +0300)]
Travis CI: compile for host CPU (to test double-wide primitives)
(Cherry-pick part of commits d9f88cd, 8268b62 from 'master' branch.)

7 years agoTravis CI: compile both for x86 and x64
Ivan Maidanski [Fri, 27 Jan 2017 17:20:31 +0000 (20:20 +0300)]
Travis CI: compile both for x86 and x64
(Cherry-pick part of commits e294a77, bb94b84 from 'master' branch.)

7 years agoTravis CI: Exclude osx/gcc builds
Ivan Maidanski [Fri, 27 Jan 2017 21:36:09 +0000 (00:36 +0300)]
Travis CI: Exclude osx/gcc builds
(Cherry-pick commit 6890d9b from 'master' branch.)

7 years agoAppveyor CI: Test double-wide CAS in debug builds (x86/x64)
Ivan Maidanski [Fri, 27 Jan 2017 16:11:22 +0000 (19:11 +0300)]
Appveyor CI: Test double-wide CAS in debug builds (x86/x64)

7 years agoAppveyor CI: run test_malloc/stack
Ivan Maidanski [Thu, 26 Jan 2017 20:10:57 +0000 (23:10 +0300)]
Appveyor CI: run test_malloc/stack

7 years agoEnable limited testing in Makefile.msft without Cygwin
Ivan Maidanski [Thu, 26 Jan 2017 20:07:57 +0000 (23:07 +0300)]
Enable limited testing in Makefile.msft without Cygwin
(Cherry-pick commit 18a05e9 from 'master' branch.)

New target "check-noautogen" is introduced in Makefile.msft to build and
run only test_malloc and test_stack (which do not need test code
auto-generation by sed).

* src/Makefile.msft: Refine comment about tests execution; add comment
about "check-noautogen" target.
* src/Makefile.msft (check): Add dependency on check-noautogen;
move test_malloc and test_stack to check-noautogen.
* src/Makefile.msft (check-noautogen): New target (executes test_malloc
and test_stack only).

7 years agoAdd configure --enable-gcov option (enable code coverage analysis)
Ivan Maidanski [Fri, 13 Jan 2017 17:47:35 +0000 (20:47 +0300)]
Add configure --enable-gcov option (enable code coverage analysis)
(Cherry-pick commits 0d0a16d, 45896dc from 'master' branch.)

* configure.ac (gcov): New --enable-* option.
* configure.ac [enable_gcov] (CFLAGS): Add "--coverage" option; filter
out "-O" options.

7 years agoWorkaround 'uninitialized memory use' MemorySanitizer warning (test_atomic)
Ivan Maidanski [Mon, 5 Dec 2016 17:26:16 +0000 (20:26 +0300)]
Workaround 'uninitialized memory use' MemorySanitizer warning (test_atomic)
(Cherry-pick commit 8fc1a2f from 'master' branch.)

* tests/test_atomic_include.template (test_atomicXX): Ensure old_w is
always initialized before AO_double_storeXX; add comment about MSan
false warning.

7 years agoFix test_atomic fail caused by AO_double_t misaligned load (Linux/i686)
Ivan Maidanski [Tue, 31 Jan 2017 07:29:44 +0000 (10:29 +0300)]
Fix test_atomic fail caused by AO_double_t misaligned load (Linux/i686)
(Cherry-pick commit a53e41b from 'master' branch.)

* src/atomic_ops/sysdeps/standard_ao_double_t.h [__i386__ && __GNUC__]
(double_ptr_storage): Add aligned(8) attribute (so that AO_double_t
global/static variables to have proper (double-word) alignment).

7 years agoFix test_atomic failure caused unaligned AO_double_t access on x86
Ivan Maidanski [Tue, 24 Jan 2017 19:46:57 +0000 (22:46 +0300)]
Fix test_atomic failure caused unaligned AO_double_t access on x86

The failure is caused by violation of an assertion that checks
AO_double_t variable is 8-byte aligned on x86.

* doc/README.txt (AO_double_t): Add note about required alignment.
* src/atomic_ops/sysdeps/standard_ao_double_t.h (AO_double_t): Add
comment about alignment.
* src/atomic_ops_stack.h (AO_stack_t): Likewise.
* tests/test_atomic_include.template (test_atomicXX): Define old_w, w
local variables as static (as otherwise, e.g., they could have 4-byte
alignment on x86); add comment.

7 years agoFix type of general AO_TS_INITIALIZER
Ivan Maidanski [Thu, 26 Jan 2017 06:46:57 +0000 (09:46 +0300)]
Fix type of general AO_TS_INITIALIZER

* src/atomic_ops.h (AO_TS_INITIALIZER): Change type from AO_t to
AO_TS_t; add outermost parentheses.

7 years agoAdd assertion that double-wide CAS target is aligned (msftc/x86[_64])
Ivan Maidanski [Fri, 20 Jan 2017 00:03:54 +0000 (03:03 +0300)]
Add assertion that double-wide CAS target is aligned (msftc/x86[_64])

* src/atomic_ops/sysdeps/msftc/x86.h [AO_ASSUME_VISTA]
(AO_double_compare_and_swap_full): Add assert() that addr pointer is
aligned according to the size of AO_double_t.
* src/atomic_ops/sysdeps/msftc/x86_64.h [AO_CMPXCHG16B_AVAILABLE
&& _MSC_VER>=1500] (AO_compare_double_and_swap_double_full): Likewise.

7 years agoRemove outdated FIXME in msftc/arm.h about _InterlockedOps memory barrier
Ivan Maidanski [Mon, 16 Jan 2017 20:55:01 +0000 (23:55 +0300)]
Remove outdated FIXME in msftc/arm.h about _InterlockedOps memory barrier

* src/atomic_ops/sysdeps/msftc/arm.h: Remove FIXME about memory barrier
of _InterlockedOps (they have the correct one according to the MSDN).

7 years agoSupport CFLAGS_EXTRA to pass extra user-defined compiler flags (MS VC)
Ivan Maidanski [Fri, 27 Jan 2017 16:05:17 +0000 (19:05 +0300)]
Support CFLAGS_EXTRA to pass extra user-defined compiler flags (MS VC)
(Cherry-pick commit 8be4790 from 'master' branch.)

* src/Makefile.msft: Remove commented out variable assignments.
* src/Makefile.msft (CFLAGS_EXTRA): New variable (empty by default).
* src/Makefile.msft (CFLAGS): Append CFLAGS_EXTRA value.

7 years agoSupport CFLAGS_EXTRA to pass extra user-defined compiler flags (configure)
Ivan Maidanski [Fri, 9 Dec 2016 21:31:25 +0000 (00:31 +0300)]
Support CFLAGS_EXTRA to pass extra user-defined compiler flags (configure)

* configure.ac: Add AC_SUBST(CFLAGS_EXTRA).
* src/Makefile.am (CFLAGS): Append $(CFLAGS_EXTRA).
* tests/Makefile.am (CFLAGS): Likewise.

7 years agoEliminate 'printf format specifies type void*' GCC pedantic warnings
Ivan Maidanski [Wed, 7 Dec 2016 09:35:47 +0000 (12:35 +0300)]
Eliminate 'printf format specifies type void*' GCC pedantic warnings

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).

7 years ago.gitignore: Ignore coverage.info (generated by lcov)
Ivan Maidanski [Tue, 31 Jan 2017 20:48:32 +0000 (23:48 +0300)]
.gitignore: Ignore coverage.info (generated by lcov)

7 years ago.gitignore: Ignore test_atomic_generalized
Ivan Maidanski [Fri, 27 Jan 2017 06:47:03 +0000 (09:47 +0300)]
.gitignore: Ignore test_atomic_generalized

7 years ago.gitignore: Ignore gcov c/h output files
Ivan Maidanski [Fri, 13 Jan 2017 17:31:12 +0000 (20:31 +0300)]
.gitignore: Ignore gcov c/h output files

7 years ago.gitignore: Ignore folders and files of static code analysis tools
Ivan Maidanski [Mon, 12 Dec 2016 21:46:56 +0000 (00:46 +0300)]
.gitignore: Ignore folders and files of static code analysis tools
(Cherry-pick commits fa3ebc3, 8550ecd from 'master' branch.)

7 years agoUpdate ChangeLog file (v7.4 changes)
Ivan Maidanski [Sat, 26 Nov 2016 18:49:24 +0000 (21:49 +0300)]
Update ChangeLog file (v7.4 changes)

7 years agoFix powerpc detection on AIX (gcc)
Tobias Leich [Thu, 17 Nov 2016 22:05:42 +0000 (01:05 +0300)]
Fix powerpc detection on AIX (gcc)

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.

7 years agoUpdate AUTHORS file (add 'Tobias Leich')
Ivan Maidanski [Thu, 10 Nov 2016 09:28:35 +0000 (12:28 +0300)]
Update AUTHORS file (add 'Tobias Leich')

7 years agoImplement fetch-CAS for s390[x] (gcc)
Tobias Leich [Thu, 10 Nov 2016 08:02:56 +0000 (09:02 +0100)]
Implement fetch-CAS for s390[x] (gcc)
(Cherry-pick commits c2edeab, 796b2a6 from 'master' branch.)

* 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.

7 years agoTravis CI configuration: remove unsupported --enable-werror
Ivan Maidanski [Fri, 11 Nov 2016 20:13:46 +0000 (23:13 +0300)]
Travis CI configuration: remove unsupported --enable-werror
(fix commit 4fb86d9)

Note: this configuration is for libatomic_ops of version 7.4.x.

7 years agoUpdate ChangeLog file (v7.4 changes)
Ivan Maidanski [Tue, 8 Nov 2016 06:04:28 +0000 (09:04 +0300)]
Update ChangeLog file (v7.4 changes)

7 years agoUpdate AUTHORS file
Ivan Maidanski [Mon, 10 Oct 2016 20:15:06 +0000 (23:15 +0300)]
Update AUTHORS file

7 years agoSupport AIX/ppc (gcc)
Jean Girardet [Mon, 10 Oct 2016 08:04:24 +0000 (11:04 +0300)]
Support AIX/ppc (gcc)

* 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.

7 years agoCode refactoring of gcc/powerpc.h to avoid code duplication
Ivan Maidanski [Fri, 7 Oct 2016 16:27:09 +0000 (19:27 +0300)]
Code refactoring of gcc/powerpc.h to avoid code duplication

* 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).

8 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Fri, 4 Nov 2016 21:34:00 +0000 (00:34 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

8 years agoFix (improve) AO_REQUIRE_CAS description in README
Ivan Maidanski [Wed, 2 Nov 2016 08:15:15 +0000 (11:15 +0300)]
Fix (improve) AO_REQUIRE_CAS description in README

* doc/README.txt: Document AO_REQUIRE_CAS better (replace
"compare-and-swap" with "AO_compare_and_swap*").

8 years agoAdd configuration file for AppVeyor CI
Ivan Maidanski [Mon, 15 Aug 2016 19:44:10 +0000 (22:44 +0300)]
Add configuration file for AppVeyor CI
(Cherry-pick commit 9010888 from 'master' branch.)

Note: builds version is set to 7.4.x

* appveyor.yml: New file (not a part of the distribution archive).

8 years agoAdd configuration for Travis CI
Ivan Maidanski [Thu, 11 Aug 2016 19:29:46 +0000 (22:29 +0300)]
Add configuration for Travis CI

* .travis.yml: New file.

8 years agoFix 'visibility' of some CPU-specific internal macros
Ivan Maidanski [Wed, 2 Nov 2016 22:05:01 +0000 (01:05 +0300)]
Fix 'visibility' of some CPU-specific internal macros
(Cherry-pick commit 9b7cecb from 'master' branch.)

Undefine internal macros that are defined and used solely in a single
CPU-specific file.

* src/atomic_ops/sysdeps/gcc/arm.h
(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): 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.

8 years agoSupport n32 ABI for mips64
Frank Schaefer [Sat, 9 May 2015 05:26:43 +0000 (05:26 +0000)]
Support n32 ABI for mips64

Without the proposed change, the existing preprocessor checks for
mips64 support do not account for the n32 ABI (when building with
"gcc -mabi=n32", test_atomic and test_stack both fail, and
test_malloc appears to hang indefinitely while spinning at 100%).

* src/atomic_ops/sysdeps/gcc/mips.h (AO_MIPS_SET_ISA, AO_MIPS_LL_1,
AO_MIPS_SC): Define depending on _MIPS_SIM value.

8 years agoUse LLD and SCD instructions on mips64
James Cowgill [Thu, 8 Jan 2015 16:00:38 +0000 (16:00 +0000)]
Use LLD and SCD instructions on mips64
(Cherry-pick commits 54d1da5, 22ca163 and part of 9b7cecb from 'master' branch.)

8 years agoFix size value wrap around in AO_malloc_large
Ivan Maidanski [Mon, 22 Aug 2016 17:12:19 +0000 (20:12 +0300)]
Fix size value wrap around in AO_malloc_large
(Cherry-pick commits 1033478 and b1365bd from 'master' branch.)

AO_malloc(SIZE_MAX) should return NULL now.

* src/atomic_ops_malloc.c: Include limits.h (unless SIZE_MAX already
defined).
* src/atomic_ops_malloc.c (AO_SIZE_MAX): New macro.
* 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).

8 years agoEliminate 'cast to long from void*' compiler warning in test_atomic
Ivan Maidanski [Wed, 12 Oct 2016 06:17:01 +0000 (09:17 +0300)]
Eliminate 'cast to long from void*' compiler warning in test_atomic

* tests/run_parallel.h (AO_PTRDIFF_T): Define to ptrdiff_t for all
targets.

8 years agoFix missing printed value names (test_stack)
Ivan Maidanski [Tue, 11 Oct 2016 14:45:01 +0000 (17:45 +0300)]
Fix missing printed value names (test_stack)

* tests/test_stack.c [VERBOSE] (main): Print value name along with the
value itself; print "ms" for time value; remove extra get_msecs() call.

8 years agoFix typos in 'error' pragma messages
Ivan Maidanski [Wed, 5 Oct 2016 18:47:35 +0000 (21:47 +0300)]
Fix typos in 'error' pragma messages

* 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.

8 years agoFix assertions style in test_atomic_include
Ivan Maidanski [Wed, 24 Aug 2016 08:07:38 +0000 (11:07 +0300)]
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().

8 years agoRefine README about library downloading
Ivan Maidanski [Thu, 18 Aug 2016 09:03:15 +0000 (12:03 +0300)]
Refine README about library downloading

* README.md (Download): New section; add link to Download page (located
on GitHub); add information about the code repository.

8 years agoFix (delete) comment for AO_and_full (x86)
Ivan Maidanski [Wed, 17 Aug 2016 16:51:30 +0000 (19:51 +0300)]
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
i386).
* src/atomic_ops/sysdeps/sunc/x86.h [!AO_PREFER_GENERALIZED]
(AO_and_full): Likewise.

8 years ago[7.4.4] libatomic_ops-7_4_4
Ivan Maidanski [Tue, 24 May 2016 17:59:44 +0000 (20:59 +0300)]
[7.4.4]

Bump libatomic_ops version to 7.4.4

* ChangeLog: Add release date.
* README.md: Bump version.
* configure.ac (AC_INIT): Likewise.
* src/atomic_ops/ao_version.h (AO_VERSION_MICRO): Likewise.

8 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Mon, 23 May 2016 21:41:16 +0000 (00:41 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

8 years agoAdd disclaimer to README to favor C11/C++14 atomics over libatomic_ops use
Hans Boehm [Mon, 23 May 2016 18:24:33 +0000 (21:24 +0300)]
Add disclaimer to README to favor C11/C++14 atomics over libatomic_ops use
(Apply commit e78ba18 from 'master' branch.)

* README.md: 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.

8 years agoUpdate ChangeLog file (v7.2 - v7.4 changes only)
Ivan Maidanski [Tue, 26 Apr 2016 08:36:34 +0000 (11:36 +0300)]
Update ChangeLog file (v7.2 - v7.4 changes only)

8 years agoFix typo in configure.ac (in description of AO_ASM_X64_AVAILABLE)
Ivan Maidanski [Mon, 18 Apr 2016 21:42:30 +0000 (00:42 +0300)]
Fix typo in configure.ac (in description of AO_ASM_X64_AVAILABLE)

* configure.ac (AO_ASM_X64_AVAILABLE): Fix typo ("available").

8 years agoRemove obsolete information from README about C++0x standard future
Ivan Maidanski [Thu, 24 Mar 2016 20:32:39 +0000 (23:32 +0300)]
Remove obsolete information from README about C++0x standard future

* doc/README.txt (Future directions): Remove.

8 years agoUpdate ChangeLog file (v7.4 changes)
Ivan Maidanski [Thu, 17 Mar 2016 08:21:18 +0000 (11:21 +0300)]
Update ChangeLog file (v7.4 changes)

8 years agoRemove TODO file (items moved to Issues on Github)
Ivan Maidanski [Wed, 30 Sep 2015 23:35:07 +0000 (02:35 +0300)]
Remove TODO file (items moved to Issues on Github)

8 years agoUpdate AUTHORS file
Ivan Maidanski [Tue, 12 May 2015 21:46:40 +0000 (00:46 +0300)]
Update AUTHORS file

8 years agoFix GCC 5.x compatibility for AArch64 double-wide primitives
Frank Schaefer [Tue, 9 Jun 2015 22:10:00 +0000 (17:10 -0500)]
Fix GCC 5.x compatibility for AArch64 double-wide primitives

Small change to make aarch64 support work with gcc 5.x. Otherwise it
demands gcc -latomic and still fails test_stack.

* src/atomic_ops/sysdeps/gcc/aarch64.h (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):
Use assembly implementation even for GCC v5+ (not just GCC 4.x).

8 years agoUpdate ChangeLog file
Ivan Maidanski [Thu, 17 Mar 2016 07:23:42 +0000 (10:23 +0300)]
Update ChangeLog file
(v7.2 - v7.4 changes only)

8 years agoEliminate 'signed-to-unsigned value extension' compiler warning in AO_malloc
Ivan Maidanski [Mon, 8 Feb 2016 07:13:47 +0000 (10:13 +0300)]
Eliminate 'signed-to-unsigned value extension' compiler warning in AO_malloc

* src/atomic_ops_malloc.c (msbs): Change type from int to unsigned
char.
* src/atomic_ops_malloc.c (msb): Change return type from int to
unsigned.
* src/atomic_ops_malloc.c (msb, AO_malloc): Change type of v, result,
log_sz local variables from int to unsigned.

9 years agoUpdate ChangeLog file
Ivan Maidanski [Fri, 30 Jan 2015 16:59:54 +0000 (19:59 +0300)]
Update ChangeLog file
(v7.2 - v7.4 changes only)

9 years agoUpdate AUTHORS file
Ivan Maidanski [Fri, 30 Jan 2015 16:47:35 +0000 (19:47 +0300)]
Update AUTHORS file

9 years agoUpdate AUTHORS file
Ivan Maidanski [Fri, 9 Jan 2015 20:26:46 +0000 (23:26 +0300)]
Update AUTHORS file

9 years agoMinor fix of code alignment in mips AO_compare_and_swap
James Cowgill [Thu, 8 Jan 2015 16:14:22 +0000 (16:14 +0000)]
Minor fix of code alignment in mips AO_compare_and_swap
(Apply commit 22ca163 from 'master' branch.)

Conflicts:

    src/atomic_ops/sysdeps/gcc/mips.h

9 years agoRemove inclusion of acquire_release_volatile.h on mips
James Cowgill [Thu, 8 Jan 2015 16:05:57 +0000 (16:05 +0000)]
Remove inclusion of acquire_release_volatile.h on mips
(Apply commit 0f838de from 'master' branch, fix typos in commit message.)

I'm not entirely sure how this ended up here. It might have been the case
that MIPS processors used to do this, but the ISA manuals don't say anything
about volatile loads / stores having acquire / release semantics, so just
remove it to be safe.

9 years agoFix missing output folder on making auto-generated test files (Automake)
Ivan Maidanski [Sat, 25 Oct 2014 16:58:06 +0000 (20:58 +0400)]
Fix missing output folder on making auto-generated test files (Automake)

* tests/Makefile.am (test_atomic_include.h, list_atomic.c,
list_atomic.i): Add mkdir for output folder.

9 years agoUpdate AUTHORS file
Ivan Maidanski [Sat, 25 Oct 2014 07:37:41 +0000 (11:37 +0400)]
Update AUTHORS file

9 years agoFix missing output folder on making auto-generated headers (Automake)
Kochin Chang [Fri, 12 Sep 2014 17:35:53 +0000 (13:35 -0400)]
Fix missing output folder on making auto-generated headers (Automake)

Create the directories before sed needs them (otherwise build fails
when sed tries to redirect output to a non-existent directory in case
of build root folder is not identical to source root folder).

* src/Makefile.am (atomic_ops/generalize-small.h,
atomic_ops/generalize-arithm.h, atomic_ops/sysdeps/ao_t_is_int.h,
atomic_ops/sysdeps/gcc/generic-arithm.h,
atomic_ops/sysdeps/loadstore/*.h): Add mkdir for output folder.

9 years agoEliminate 'variable set but not used' Cppcheck warnings in test_stack
Ivan Maidanski [Fri, 13 Jun 2014 12:35:55 +0000 (16:35 +0400)]
Eliminate 'variable set but not used' Cppcheck warnings in test_stack

* tests/test_stack.c (run_one_test): Define "j" local variable only
if VERBOSE.
* tests/test_stack.c (main): Do not define "sum" local variable (and
don not compute the sum) if NO_TIMES.

9 years agoFix missing casts to match printf format specifier in test_atomic
Ivan Maidanski [Fri, 13 Jun 2014 08:17:08 +0000 (12:17 +0400)]
Fix missing casts to match printf format specifier in test_atomic

* tests/test_atomic.c (test_and_set_thr): Add missing casts to long
for locked_counter (which is unsigned long) to match printf format
specifier.

9 years ago.gitignore: Ignore .dirstamp
Ivan Maidanski [Mon, 26 May 2014 20:00:00 +0000 (00:00 +0400)]
.gitignore: Ignore .dirstamp

9 years ago.gitignore: Ignore tests/.libs (generated if configure --enable-shared)
Ivan Maidanski [Sun, 18 May 2014 13:28:54 +0000 (17:28 +0400)]
.gitignore: Ignore tests/.libs (generated if configure --enable-shared)

9 years agoFix makefile preventing AO_pause undefined in libatomic_ops_gpl
Pavel Raiskup [Tue, 13 May 2014 11:46:23 +0000 (13:46 +0200)]
Fix makefile preventing AO_pause undefined in libatomic_ops_gpl

* src/Makefile.am (libatomic_ops_gpl_la_LIBADD): New dependency.

9 years agoRestore contribution info in ChangeLog for authors not listed in git log
Ivan Maidanski [Sun, 4 May 2014 12:25:40 +0000 (16:25 +0400)]
Restore contribution info in ChangeLog for authors not listed in git log
(deleted in commit 36a9c66)

* ChangeLog (7.0, 1.0): Add information about contribution of persons
mentioned in AUTHORS but not recorded in git log.
* src/atomic_ops/sysdeps/gcc/cris.h: Move contribution information
from comment to ChangeLog.

10 years ago[7.4.2] libatomic_ops-7_4_2
Ivan Maidanski [Fri, 2 May 2014 15:51:11 +0000 (19:51 +0400)]
[7.4.2]

Bump libatomic_ops version to 7.4.2

* README.md: Bump version.
* configure.ac (AC_INIT): Likewise.
* src/atomic_ops/ao_version.h (AO_VERSION_MICRO): Likewise.

10 years agoUpdate ChangeLog file
Ivan Maidanski [Fri, 2 May 2014 07:07:20 +0000 (11:07 +0400)]
Update ChangeLog file

10 years agoFix a typo in doc/README.txt (remove redundant "an" article)
Jan-Erik Rediger [Fri, 28 Mar 2014 13:12:31 +0000 (14:12 +0100)]
Fix a typo in doc/README.txt (remove redundant "an" article)
(Apply commit 50beacd from 'master' branch.)

10 years agoUpdate emails/links due to project site transition
Ivan Maidanski [Thu, 20 Feb 2014 20:39:54 +0000 (00:39 +0400)]
Update emails/links due to project site transition
(Apply commit 686c70b from 'master' branch.)

* AUTHORS: Update email.
* README.md: Update links to BDWGC/libatomic_ops site.
* doc/README_stack.txt: Likewise.
* README.md: Update mailing list info.
* configure.ac: Likewise.

Conflicts:

    configure.ac

10 years ago[7.4.0] libatomic_ops-7_4_0
Ivan Maidanski [Sun, 17 Nov 2013 15:15:26 +0000 (19:15 +0400)]
[7.4.0]

Bump version to 7.4.0; change policy regarding version numbers

* ChangeLog: Update.
* README.md: Bump version.
* configure.ac (AC_INIT): Likewise.
* src/atomic_ops/ao_version.h (AO_VERSION_MINOR): Likewise.
* src/atomic_ops/ao_version.h (AO_VERSION_ALPHA): Replace to
AO_VERSION_MICRO; add comment.

10 years agoPut README.md to 'dist' package (Automake)
Ivan Maidanski [Sun, 17 Nov 2013 15:06:53 +0000 (19:06 +0400)]
Put README.md to 'dist' package (Automake)

* Makefile.am (dist_pkgdata_DATA): Add README.md item.

10 years agoUpdate ChangeLog file
Ivan Maidanski [Sun, 10 Nov 2013 10:23:23 +0000 (14:23 +0400)]
Update ChangeLog file

11 years agoConvert README to Markdown format
Ivan Maidanski [Thu, 12 Sep 2013 05:35:59 +0000 (09:35 +0400)]
Convert README to Markdown format

* README: Rename to README.md; adjust formatting to follow Markdown
syntax.

11 years agoRemove broken link to INSTALL file from README
Ivan Maidanski [Tue, 3 Sep 2013 04:50:55 +0000 (08:50 +0400)]
Remove broken link to INSTALL file from README

* README (Installation and Usage): Remove reference to INSTALL file
(not generated by autoreconf as AM_INIT_AUTOMAKE specifies "foreign"
strictness).
* .gitignore (INSTALL): Remove.

11 years agoPut autogen.sh to 'dist' package (Automake)
Ivan Maidanski [Sat, 31 Aug 2013 09:22:57 +0000 (13:22 +0400)]
Put autogen.sh to 'dist' package (Automake)

* Makefile.am (EXTRA_DIST): Add "autogen.sh" item.

11 years ago.gitignore: Ignore test-driver (generated by autoreconf)
Ivan Maidanski [Sat, 31 Aug 2013 08:04:20 +0000 (12:04 +0400)]
.gitignore: Ignore test-driver (generated by autoreconf)

11 years ago.gitignore: Ignore test*.log, test*.trs
Ivan Maidanski [Sat, 31 Aug 2013 07:16:19 +0000 (11:16 +0400)]
.gitignore: Ignore test*.log, test*.trs
(Apply commit 5cce9c5 from 'release-7_2' branch.)

Conflicts:

    .gitignore

11 years agoUpdate ChangeLog file
Ivan Maidanski [Wed, 21 Aug 2013 12:14:14 +0000 (16:14 +0400)]
Update ChangeLog file

11 years agoDo not use LDREXD/STREXD for Clang3.2/arm (and earlier)
Ivan Maidanski [Sat, 17 Aug 2013 11:05:36 +0000 (15:05 +0400)]
Do not use LDREXD/STREXD for Clang3.2/arm (and earlier)

* src/atomic_ops/sysdeps/gcc/arm.h (AO_ARM_HAVE_LDREXD): Do not define
for pre-Clang3.3 (since it does not allocate register pairs for
LDREXD/STREXD instructions properly); add comment.

11 years agoFix ARM char/short fetch_and_add and double-CAS operands width (GCC/Clang)
Ivan Maidanski [Sat, 17 Aug 2013 09:58:59 +0000 (13:58 +0400)]
Fix ARM char/short fetch_and_add and double-CAS operands width (GCC/Clang)

* src/atomic_ops/sysdeps/gcc/arm.h (AO_char_fetch_and_add,
AO_short_fetch_and_add): Use 32-bit int type for "tmp" and "result"
local variables instead of char/short type (resolve Clang3.3 warning
"size being stored is truncated, use a modifier to specify the size"
enabled by -Wasm-operand-widths compiler option); cast "incr"
argument to int to prevent Clang3.2 warning about value
truncation.
* src/atomic_ops/sysdeps/gcc/arm.h (AO_double_compare_and_swap): Swap
assembly code operands ("new_val.AO_whole" and "addr") to prevent
Clang3.3 warning about operand truncation.

11 years agoFix ARMv7 LDREXD/STREXD double-wide operand specification (GCC/Clang)
Ivan Maidanski [Sat, 17 Aug 2013 07:48:59 +0000 (11:48 +0400)]
Fix ARMv7 LDREXD/STREXD double-wide operand specification (GCC/Clang)

* src/atomic_ops/sysdeps/gcc/arm.h (AO_double_load, AO_double_store,
AO_double_compare_and_swap): Specify that LDREXD and STREXD use 2
adjacent registers (thus preventing Clang3.3 from register allocation
failures leading to "registers may not be the same" or
"even register required" GAS errors).

11 years agoTests: workaround GCC 4.4.3 warning reported for list_atomic.c 'val'
Ivan Maidanski [Sat, 17 Aug 2013 09:04:23 +0000 (13:04 +0400)]
Tests: workaround GCC 4.4.3 warning reported for list_atomic.c 'val'

* tests/list_atomic.template (XSIZE_list_atomicXX): Use "static"
modifier for "val" local variable to initialize it (cannot use direct
assignment to zero because "val" type could be a SIMD vector type if
XCTYPE is AO_double_t) to workaround GCC v4.4.3
"'val' is used uninitialized in this function" warning reported for
AO_load.

11 years agoSupport ARMv8 target (gcc/arm)
Ivan Maidanski [Sat, 17 Aug 2013 08:13:40 +0000 (12:13 +0400)]
Support ARMv8 target (gcc/arm)

* src/atomic_ops/sysdeps/gcc/arm.h (__ARM_ARCH_8A__): Detect new macro
(treated same as __ARM_ARCH_7A__).
* src/atomic_ops/sysdeps/gcc/arm.h (AO_ARM_HAVE_SWP): Do not define
for ARMv8 (since SWP{B} obsoleted); add comment.
* src/atomic_ops/sysdeps/gcc/arm.h (AO_compare_and_swap): Add TODO
item (for deprecated IT block containing wide Thumb instruction).

11 years agotests: Fix makefile sed rule for list_atomic
Ivan Maidanski [Fri, 16 Aug 2013 21:06:28 +0000 (01:06 +0400)]
tests: Fix makefile sed rule for list_atomic

* tests/Makefile.am (test_atomic_include.h, list_atomic.c): Replace
all occurrences of 'XX' (instead of only the first one) on every line.

11 years agotests: Add char/short/int/AO_double_t and dd_acquire cases to list_atomic
Ivan Maidanski [Tue, 13 Aug 2013 20:40:04 +0000 (00:40 +0400)]
tests: Add char/short/int/AO_double_t and dd_acquire cases to list_atomic

* tests/Makefile.am (list_atomic.c): Iterate over XSIZE/XCTYPE (in
addition to XX); expand XX also as _dd_acquire_read.
* tests/list_atomic.template (XSIZE_list_atomicXX): Define 'val' local
variable only if used (needed for AO_double_t case).

11 years agotests: Add and/or/xor entries to list_atomic
Ivan Maidanski [Sun, 11 Aug 2013 10:57:35 +0000 (14:57 +0400)]
tests: Add and/or/xor entries to list_atomic

* tests/list_atomic.template (list_atomicXX): Add AO_XSIZE_andXX,
AO_XSIZE_orXX, AO_XSIZE_xorXX invocations.

11 years agotests: Parameterize list_atomic template with XSIZE
Ivan Maidanski [Sun, 11 Aug 2013 10:49:05 +0000 (14:49 +0400)]
tests: Parameterize list_atomic template with XSIZE

* tests/Makefile.am (list_atomic.c): Substitute XSIZE/XCTYPE for AO_t.
* tests/list_atomic.template (list_atomicXX): Parameterize with XSIZE
and XCTYPE (except for AO_nop and AO_test_and_set).

11 years agolist_atomic: Add makefile rule to test list_atomic.template syntax
Ivan Maidanski [Sun, 11 Aug 2013 07:33:12 +0000 (11:33 +0400)]
list_atomic: Add makefile rule to test list_atomic.template syntax

* tests/Makefile.am (BUILT_SOURCES, CLEANFILES): Add "list_atomic.o".
* tests/Makefile.am (list_atomic.o): New rule (to verify list_atomic.c
is valid C code).
* tests/list_atomic.template (list_atomicXX): Use "volatile" for "val"
local variable.
* tests/list_atomic.template (list_atomicXX): Define "oldval", "newval",
"ts" and "incr" local variables only if used; cast string literals to
void (to prevent compiler warnings).
* tests/list_atomic.template (list_atomicXX): Use AO_t type for "incr"
local variable instead of C long type.
* tests/list_atomic.template (list_atomicXX): Define "oldval",
"newval", "incr" as statitc local variables, and remove explicit
initialization to zero (to void problems with initialization of these
variables for AO_double_t case if the latter is a struct).

11 years agotests: Do not use deprecated AO_T and AO_TS_T
Ivan Maidanski [Sun, 11 Aug 2013 07:21:20 +0000 (11:21 +0400)]
tests: Do not use deprecated AO_T and AO_TS_T

* tests/list_atomic.template (list_atomicXX): Use AO_t instead of
deprecated AO_T.
* tests/list_atomic.template (list_atomicXX): Use AO_TS_t instead of
deprecated AO_TS_T.
* tests/test_atomic.c (lock): Likewise.

11 years agoFix typo in comment of generalize-small.template
Ivan Maidanski [Mon, 29 Jul 2013 21:18:38 +0000 (01:18 +0400)]
Fix typo in comment of generalize-small.template

* src/atomic_ops/generalize-arithm.template: Fix a typo in comment
("acquire").
* src/atomic_ops/generalize-arithm.h: Regenerate.

11 years agoAdd comment about store_full implementation for x86
Ivan Maidanski [Sun, 26 May 2013 13:16:20 +0000 (17:16 +0400)]
Add comment about store_full implementation for x86

* src/atomic_ops/sysdeps/gcc/x86.h: Add comment about AO_store_full
generalization.

11 years agoAdd non-generalized double-CAS-full implementation for AArch64
Ivan Maidanski [Sun, 26 May 2013 13:08:27 +0000 (17:08 +0400)]
Add non-generalized double-CAS-full implementation for AArch64

* src/atomic_ops/sysdeps/gcc/aarch64.h
(AO_double_compare_and_swap_full): New function.

11 years agoDefine AO_NO_PTHREADS in configure if no pthreads (Win32 and VxWorks)
Ivan Maidanski [Sun, 26 May 2013 12:32:32 +0000 (16:32 +0400)]
Define AO_NO_PTHREADS in configure if no pthreads (Win32 and VxWorks)

* configure.ac (have_pthreads): Do not define to true if check for
pthread_self failed.
* configure.ac (AO_NO_PTHREADS): Define if not have_pthreads.

11 years agoBetter document configure THREADDLLIBS variable
Ivan Maidanski [Sun, 26 May 2013 09:01:27 +0000 (13:01 +0400)]
Better document configure THREADDLLIBS variable

* configure.ac (THREADDLLIBS, have_pthreads): Add comments.

11 years agoUpdate AUTHORS
Ivan Maidanski [Sun, 26 May 2013 08:11:34 +0000 (12:11 +0400)]
Update AUTHORS

11 years agoEnable build using toolchain without pthreads
Gilles Talis [Sun, 26 May 2013 08:08:18 +0000 (12:08 +0400)]
Enable build using toolchain without pthreads

* src/atomic_ops.c: Include pthread.h only if not AO_NO_PTHREADS (new
macro).
* src/atomic_ops.c (AO_pt_lock): Define only unless AO_NO_PTHREADS.
* tests/test_atomic.c (main): Skip test_atomic_pthreads if both
AO_NO_PTHREADS and AO_USE_PTHREAD_DEFS are defined (preventing test
link failure if AO_NO_PTHREADS passed via CFLAGS).