platform/upstream/libatomic_ops.git
7 years agoFix 'Cannot implement CAS_full on this architecture' build error (cris)
Ivan Maidanski [Tue, 21 Feb 2017 21:05:11 +0000 (00:05 +0300)]
Fix 'Cannot implement CAS_full on this architecture' build error (cris)

* src/atomic_ops.h [__cris__ || CRIS] (AO_CAN_EMUL_CAS): Define.
* src/atomic_ops/sysdeps/gcc/cris.h: Add TODO to implement CAS.

7 years agoFix typo in comments in gcc/arm.h
Ivan Maidanski [Mon, 20 Feb 2017 08:19:54 +0000 (11:19 +0300)]
Fix typo in comments in gcc/arm.h
(Cherry-pick commit 83e184f from 'release-7_4' branch.)

* src/atomic_ops/sysdeps/gcc/arm.h
(AO_compare_and_swap): Fix typo ("succeeded") and add "then" in comment.
* src/atomic_ops/sysdeps/gcc/arm.h
(AO_compare_double_and_swap_double): Likewise.

7 years ago.gitignore: Ignore *.sancov (generated by ASan)
Ivan Maidanski [Wed, 15 Feb 2017 21:41:00 +0000 (00:41 +0300)]
.gitignore: Ignore *.sancov (generated by ASan)

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: run also test_atomic[_w95]
Ivan Maidanski [Mon, 6 Feb 2017 13:52:17 +0000 (16:52 +0300)]
Appveyor CI: run also test_atomic[_w95]

7 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 6 Feb 2017 13:42:41 +0000 (16:42 +0300)]
Update ChangeLog

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 5417195 from 'release-7_4' 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
(Cherry-pick commit c386add from 'release-7_4' branch.)

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.template (test_atomicXX): Define w
local variable as static (as otherwise, e.g., it could have 4-byte
alignment on x86); add comment.
* tests/test_atomic_include.h: Regenerate.

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

8 years agoFix AppVeyor CI configuration for release-7_2 branch
Ivan Maidanski [Fri, 4 Nov 2016 12:15:54 +0000 (15:15 +0300)]
Fix AppVeyor CI configuration for release-7_2 branch

Remove 'test_stack' build goal (no such rule in Makefile.msft).

8 years agoUpdate ChangeLog
Ivan Maidanski [Fri, 4 Nov 2016 11:21:47 +0000 (14:21 +0300)]
Update ChangeLog

8 years agoEnable Makefile.msft for Win64
Ivan Maidanski [Mon, 8 Oct 2012 08:15:48 +0000 (12:15 +0400)]
Enable Makefile.msft for Win64
(Cherry-pick commit 3556ba3 from 'release-7_4' branch.)

* src/Makefile.msft (libatomic_ops_gpl.lib): Do not pass
"/MACHINE:i386" option to "lib" tool (to select the proper target
architecture automatically).

8 years agoMakefile.msft: Add 'clean' target (Improve Makefile for MS VC++)
Ivan Maidanski [Tue, 9 Aug 2011 16:42:05 +0000 (20:42 +0400)]
Makefile.msft: Add 'clean' target (Improve Makefile for MS VC++)
(Cherry-pick part of commit 9302b46 from 'release-7_4' branch.)

* src/Makefile.msft: Replace -o option with /Fo.
* src/Makefile.msft (clean): New target.

8 years agoMakefile.msft: exclude 'check' from nmake all
Ivan Maidanski [Tue, 9 Aug 2011 15:26:42 +0000 (19:26 +0400)]
Makefile.msft: exclude 'check' from nmake all
(Cherry-pick part of commit d21a5af from 'release-7_4' branch.)

* src/Makefile.msft (all): Build "libatomic_ops_gpl.lib" instead of
"check".
* src/Makefile.msft (test_malloc): Wrap long lines.

8 years agoFix Travis CI configuration for release-7_2 branch
Ivan Maidanski [Thu, 3 Nov 2016 20:20:44 +0000 (23:20 +0300)]
Fix Travis CI configuration for release-7_2 branch

"./autogen.sh" replaced with "autoreconf -vif";
"--enable-werror" removed (not supported).

8 years agoUpdate ChangeLog
Ivan Maidanski [Thu, 3 Nov 2016 15:19:16 +0000 (18:19 +0300)]
Update ChangeLog

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 075a104 from 'release-7_4' branch.)

Note: builds version is set to 7.2.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 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
(Cherry-pick commit 1921896 from 'release-7_4' branch.)

Use TA_assert consistently (not assert).

* tests/test_atomic.template (test_atomicXX): Replace assert()
calls with TA_assert().
* test_atomic_include.h: Regenerate.

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 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 ago[7.2g] libatomic_ops-7_2g
Ivan Maidanski [Mon, 23 May 2016 19:03:11 +0000 (22:03 +0300)]
[7.2g]

Bump version to 7.2g in README; update ChangeLog

8 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 23 May 2016 18:57:46 +0000 (21:57 +0300)]
Update ChangeLog

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 fe16265 from 'release-7_4' branch.)

* README: 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 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 8c9da2d from 'release-7_4' branch.)

* README: Update links to BDWGC/libatomic_ops site.
* doc/README_stack.txt: Likewise.

8 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 26 Apr 2016 08:22:58 +0000 (11:22 +0300)]
Update ChangeLog

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 agoFix incorrectly regenerated Makefile.in
Ivan Maidanski [Tue, 22 Mar 2016 20:33:55 +0000 (23:33 +0300)]
Fix incorrectly regenerated Makefile.in
(revert part of commit aae1c04)

* Makefile.in: Regenerate properly (remove ltmain.sh from DIST_COMMON).

8 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 22 Mar 2016 07:45:49 +0000 (10:45 +0300)]
Update ChangeLog

8 years agoRegenerate configure files using official libtool release (v2.4.2)
Ivan Maidanski [Tue, 22 Mar 2016 07:24:02 +0000 (10:24 +0300)]
Regenerate configure files using official libtool release (v2.4.2)

libtool 2.4.2 is an official release unlike libtool 2.4.2.418.

* Makefile.in: Regenerate (by autoreconf -vif using autoconf-2.69,
automake-1.14.1 and libtool-2.4.2).
* config.guess: Likewise.
* config.sub: Likewise.

9 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 3 Feb 2015 07:53:07 +0000 (10:53 +0300)]
Update ChangeLog

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 6fefba1 from 'release-7_4' branch.)

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.

Conflicts:

    src/atomic_ops/sysdeps/gcc/mips.h

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)

10 years ago[7.2f] libatomic_ops-7_2f
Ivan Maidanski [Fri, 2 May 2014 15:12:50 +0000 (19:12 +0400)]
[7.2f]

Bump version to 7.2f in README; update ChangeLog

10 years agoRegenerate configure files by new automake (v1.14.1), libtool (v2.4.2.418)
Ivan Maidanski [Fri, 2 May 2014 14:47:26 +0000 (18:47 +0400)]
Regenerate configure files by new automake (v1.14.1), libtool (v2.4.2.418)

* configure: Regenerate (by autoreconf -vif using autoconf-2.69,
automake-1.14.1 and libtool-2.4.2.418).
* INSTALL: Likewise.
* Makefile.in: Likewise.
* aclocal.m4: Likewise.
* config.guess: Likewise.
* config.sub: Likewise.
* doc/Makefile.in: Likewise.
* missing: Likewise.
* src/Makefile.in: Likewise.
* src/atomic_ops/Makefile.in: Likewise.
* src/atomic_ops/sysdeps/Makefile.in: Likewise.
* src/config.h.in: Likewise.
* test-driver: Likewise.
* tests/Makefile.in: Likewise.

10 years agoUpdate ChangeLog
Ivan Maidanski [Fri, 2 May 2014 06:24:35 +0000 (10:24 +0400)]
Update ChangeLog

10 years agoRemoved unnecessary "an"
Jan-Erik Rediger [Fri, 28 Mar 2014 13:12:31 +0000 (14:12 +0100)]
Removed unnecessary "an"

10 years ago[7.2e] libatomic_ops-7_2e
Ivan Maidanski [Sun, 10 Nov 2013 08:23:38 +0000 (12:23 +0400)]
[7.2e]

Bump version to 7.2e in README; update ChangeLog

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

11 years agoRegenerate configure files by autoconf-2.69, automake-1.13.4
Ivan Maidanski [Sat, 31 Aug 2013 07:00:25 +0000 (11:00 +0400)]
Regenerate configure files by autoconf-2.69, automake-1.13.4

* configure: Regenerate (by autoreconf -vif using autoconf-2.69,
automake-1.13.4 and libtool-2.4.2).
* INSTALL: Likewise.
* Makefile.in: Likewise.
* aclocal.m4: Likewise.
* compile: Likewise.
* config.guess: Likewise.
* config.sub: Likewise.
* depcomp: Likewise.
* doc/Makefile.in: Likewise.
* install-sh: Likewise.
* missing: Likewise.
* mkinstalldirs: Likewise.
* src/Makefile.in: Likewise.
* src/atomic_ops/Makefile.in: Likewise.
* src/atomic_ops/sysdeps/Makefile.in: Likewise.
* tests/Makefile.in: Likewise.
* test-driver: New generated file.

11 years agoRegenerate aclocal.m4; update ChangeLog
Ivan Maidanski [Sun, 18 Aug 2013 09:04:57 +0000 (13:04 +0400)]
Regenerate aclocal.m4; update ChangeLog

11 years agoFix: Do not use LDREXD/STREXD for Clang3.2/arm (and earlier)
Ivan Maidanski [Sat, 17 Aug 2013 11:05:36 +0000 (15:05 +0400)]
Fix: Do not use LDREXD/STREXD for Clang3.2/arm (and earlier)
(Apply commit 2daf685 from 'master' branch.)

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

Conflicts:

    src/atomic_ops/sysdeps/gcc/arm.h

11 years agoFix ARM double-CAS operands width (GCC/Clang)
Ivan Maidanski [Sat, 17 Aug 2013 09:58:59 +0000 (13:58 +0400)]
Fix ARM double-CAS operands width (GCC/Clang)
(Apply commit a81940c from 'master' branch.)

* src/atomic_ops/sysdeps/gcc/arm.h (AO_double_compare_and_swap): Swap
assembly code operands ("new_val" and "addr") to prevent
Clang3.3 warning about operand truncation.

Conflicts:

    src/atomic_ops/sysdeps/gcc/arm.h

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)
(Apply commit db2eef2 from 'master' branch.)

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

Conflicts:

    src/atomic_ops/sysdeps/gcc/arm.h

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
(Apply commit 22d7c97 from 'master' branch.)

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

Conflicts:

    src/atomic_ops/generalize-arithm.h
    src/atomic_ops/generalize-arithm.template

11 years agoFix AM_CONFIG_HEADER in configure for autoconf-2.69-1
Manuel Serrano [Wed, 3 Apr 2013 03:58:27 +0000 (07:58 +0400)]
Fix AM_CONFIG_HEADER in configure for autoconf-2.69-1

* configure.ac (AM_CONFIG_HEADER): Replace obsolete macro with with
AC_CONFIG_HEADERS one.

11 years agoUpdate ChangeLog
Ivan Maidanski [Fri, 29 Mar 2013 04:53:22 +0000 (08:53 +0400)]
Update ChangeLog

11 years agoFix generalized fetch_and_add function
Ivan Maidanski [Fri, 29 Mar 2013 04:50:51 +0000 (08:50 +0400)]
Fix generalized fetch_and_add function

* src/atomic_ops/generalize-small.template (AO_XSIZE_fetch_and_add):
Do not use AO_EXPECT_FALSE (since defined only in v7.3+).
* src/atomic_ops/generalize-small.h: Regenerate.

11 years agoFix asm constraints of primitives in sunc/x86.h
Ivan Maidanski [Fri, 29 Mar 2013 03:31:06 +0000 (07:31 +0400)]
Fix asm constraints of primitives in sunc/x86.h
(Apply commit 31df7fa from 'master' branch.)

* src/atomic_ops/sysdeps/sunc/x86.h (AO_fetch_and_add_full,
AO_char_fetch_and_add_full, AO_short_fetch_and_add_full, AO_or_full,
AO_test_and_set_full,
AO_compare_and_swap_full): Use "+m" asm constraint for *addr instead
of "=m" (because the value pointed by addr is read and written by the
code).

Conflicts:

    src/atomic_ops/sysdeps/sunc/x86.h

11 years agoFix asm constraint of CAS memory operand for gcc/alpha
Ivan Maidanski [Wed, 13 Mar 2013 18:46:24 +0000 (22:46 +0400)]
Fix asm constraint of CAS memory operand for gcc/alpha

* src/atomic_ops/sysdeps/gcc/alpha.h (AO_compare_and_swap): Use "+m"
asm constraint for *addr instead of "=m" (because the value pointed by
addr is read and written by the code).

11 years agoFix asm constraint of compare_and_swap for clang-3.1/mips
Ivan Maidanski [Tue, 12 Mar 2013 18:29:33 +0000 (22:29 +0400)]
Fix asm constraint of compare_and_swap for clang-3.1/mips
(Apply commit 3e4c369 from 'master' branch.)

* src/atomic_ops/sysdeps/gcc/mips.h (AO_compare_and_swap): Use "+m"
asm constraint for *addr instead of "+R" (the letter is unsupported
by clang3.1 resulting in "invalid output constraint in asm" error).

Conflicts:

    src/atomic_ops/sysdeps/gcc/mips.h

11 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 25 Feb 2013 15:06:22 +0000 (19:06 +0400)]
Update ChangeLog

11 years agoFix (remove) invalid include of read_ordered.h for ARM
Ivan Maidanski [Thu, 14 Feb 2013 10:08:47 +0000 (14:08 +0400)]
Fix (remove) invalid include of read_ordered.h for ARM
(fix commit 2df9c1e partially)

* src/atomic_ops/sysdeps/gcc/arm.h: Do not include read_ordered.h
(because load_acquire should contain a DMB instruction in a multi-core
case, new load_acquire/read primitives implementation is generalized
using nop_full/read which either contain a DMB instruction, or is just
a compiler barrier for uniprocessor).
* src/atomic_ops/sysdeps/armcc/arm_v6.h: Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h: Likewise.

11 years agoRevert "Fix read_ordered.h inclusion for ARM"
Ivan Maidanski [Mon, 25 Feb 2013 15:00:03 +0000 (19:00 +0400)]
Revert "Fix read_ordered.h inclusion for ARM"
(because it makes load_acquire/read incorrect for multi-core ARM)

This reverts commit 53f2152e00d4bf7d395f9de408c71ee2aa9a9bc4.

11 years agoUpdate ChangeLog
Ivan Maidanski [Sat, 2 Feb 2013 11:20:12 +0000 (15:20 +0400)]
Update ChangeLog

11 years agoFix README regarding _acquire_read barrier
Ivan Maidanski [Mon, 14 Jan 2013 20:56:35 +0000 (00:56 +0400)]
Fix README regarding _acquire_read barrier

* doc/README.txt (_acquire_read): Add information about memory
barrier (similar as in atomic_ops.h).
* doc/README.txt (_release_read): Remove information about
non-existing barrier.

11 years agoFix a typo in ao_t_is_int.h comment
Ivan Maidanski [Sun, 13 Jan 2013 20:10:48 +0000 (00:10 +0400)]
Fix a typo in ao_t_is_int.h comment

* src/atomic_ops/sysdeps/ao_t_is_int.h: Fix a typo in comment.

11 years agoFix return type of AO_int_X primitives defined in ao_t_is_int header
Ivan Maidanski [Sun, 13 Jan 2013 18:42:52 +0000 (22:42 +0400)]
Fix return type of AO_int_X primitives defined in ao_t_is_int header
(Apply commit 3e9fc4f from 'add-dbl-load-store' branch.)

* src/atomic_ops/sysdeps/ao_t_is_int.h
(AO_int_load_acquire, AO_int_fetch_and_add_full,
AO_int_fetch_and_add1_acquire, AO_int_fetch_and_add1_release,
AO_int_fetch_and_sub1_acquire, AO_int_fetch_and_sub1_release): Cast
result to unsigned int instead of signed int.

Conflicts:

    src/atomic_ops/sysdeps/ao_t_is_int.h

11 years agoFix ordered_except_wr header inclusion for s390
Ivan Maidanski [Sun, 13 Jan 2013 16:19:51 +0000 (20:19 +0400)]
Fix ordered_except_wr header inclusion for s390

* src/atomic_ops/sysdeps/gcc/s390.h: Move include of
ordered_except_wr.h down to be after all_aligned_atomic_load_store.h
inclusion (since the latter defines AO_X_load/store primitives used by
the former header).

11 years agoFix read_ordered.h inclusion for ARM
Ivan Maidanski [Sun, 13 Jan 2013 16:04:36 +0000 (20:04 +0400)]
Fix read_ordered.h inclusion for ARM

* src/atomic_ops/sysdeps/armcc/arm_v6.h: Move include of read_ordered.h
down to the end of the file to be after AO_load/store definition
(since read_ordered.h depends on these primitives).
* src/atomic_ops/sysdeps/gcc/arm.h: Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h: Likewise.

Conflicts:

src/atomic_ops/sysdeps/armcc/arm_v6.h
src/atomic_ops/sysdeps/gcc/arm.h
src/atomic_ops/sysdeps/msftc/arm.h

11 years agoFix a typo in comment in msftc/arm.h
Ivan Maidanski [Sun, 13 Jan 2013 12:08:12 +0000 (16:08 +0400)]
Fix a typo in comment in msftc/arm.h

* src/atomic_ops/sysdeps/msftc/arm.h: Fix a typo in comment (about
SWP).

11 years ago.gitignore: Ignore .gch files
Ivan Maidanski [Sun, 27 Jan 2013 10:33:01 +0000 (14:33 +0400)]
.gitignore: Ignore .gch files

11 years agoUpdate ChangeLog
Ivan Maidanski [Fri, 11 Jan 2013 18:52:59 +0000 (22:52 +0400)]
Update ChangeLog

11 years agoFix return type of AO_char/short/int_load_read() in read_ordered.h
Ivan Maidanski [Mon, 7 Jan 2013 15:24:02 +0000 (19:24 +0400)]
Fix return type of AO_char/short/int_load_read() in read_ordered.h

* src/atomic_ops/sysdeps/read_ordered.h (AO_char_load_read,
AO_short_load_read, AO_int_load_read): Change return type (and the
type of "result" local variable) from AO_t to the type matching the
name of the function (i.e., unsigned char/short/int, respectively).

11 years agoFix missing compiler barrier in AO_nop_full for uniprocessor ARM
Ivan Maidanski [Sun, 6 Jan 2013 18:04:48 +0000 (22:04 +0400)]
Fix missing compiler barrier in AO_nop_full for uniprocessor ARM
(Apply commit b78058a from 'add-dbl-load-store' branch.)

* src/atomic_ops/sysdeps/armcc/arm_v6.h (AO_nop_full): Insert
AO_compiler_barrier for AO_UNIPROCESSOR case.
* src/atomic_ops/sysdeps/gcc/arm.h (AO_nop_full): Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h (AO_nop_full): Likewise.
* src/atomic_ops/sysdeps/msftc/arm.h (AO_nop_full): Refine comment.

Conflicts:

src/atomic_ops/sysdeps/msftc/arm.h

11 years agoRegenerate Makefile.in; update ChangeLog
Ivan Maidanski [Sat, 5 Jan 2013 06:23:27 +0000 (10:23 +0400)]
Regenerate Makefile.in; update ChangeLog

11 years agoFix template-based headers regeneration order in src/Makefile
Ivan Maidanski [Fri, 4 Jan 2013 19:28:42 +0000 (23:28 +0400)]
Fix template-based headers regeneration order in src/Makefile

* src/atomic_ops/Makefile.am (BUILT_SOURCES): Define to force
regeneration of generalize-small.h (if the corresponding
source template is changed) before compilation of .c files (that use
atomic_ops.h).

Conflicts:

    src/Makefile.am

11 years agoUpdate ChangeLog
Ivan Maidanski [Thu, 3 Jan 2013 08:30:14 +0000 (12:30 +0400)]
Update ChangeLog

11 years agoFix generalize-small template adding missed CAS-based fetch_and_add
Ivan Maidanski [Wed, 2 Jan 2013 09:10:34 +0000 (13:10 +0400)]
Fix generalize-small template adding missed CAS-based fetch_and_add

* src/atomic_ops/generalize-small.template (AO_XSIZE_fetch_and_add):
Add missed definition based on CAS.
* src/atomic_ops/generalize-small.h: Regenerate.

11 years agoFix AO_XSIZE_load/store definition order in generalize-small template
Ivan Maidanski [Wed, 2 Jan 2013 08:31:08 +0000 (12:31 +0400)]
Fix AO_XSIZE_load/store definition order in generalize-small template

* src/atomic_ops/generalize-small.template (AO_XSIZE_load): Move
definition (which is based on AO_XSIZE_load_acquire) down to be after
AO_XSIZE_load_acquire definition.
* src/atomic_ops/generalize-small.template (AO_XSIZE_store): Move
definition (which is based on AO_XSIZE_store_release) down to be after
AO_XSIZE_store_release definition.
* src/atomic_ops/generalize-small.h : Regenerate.

12 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 8 Oct 2012 20:23:21 +0000 (00:23 +0400)]
Update ChangeLog

12 years agoFix variable type to match printf format specifier in test_stack
Ivan Maidanski [Mon, 8 Oct 2012 20:06:19 +0000 (00:06 +0400)]
Fix variable type to match printf format specifier in test_stack

* tests/test_stack.c (run_one_test): Change type of "index" local
variable from long to int to match printf format specifier (when
VERBOSE defined); cast from "arg" pointer to integer via size_t (to
avoid 64-bit compiler warning).

12 years agoUpdate ChangeLog
Ivan Maidanski [Mon, 8 Oct 2012 18:37:30 +0000 (22:37 +0400)]
Update ChangeLog

12 years agoProperly fix compare_double_and_swap_double for gcc/x32 (use built-in CAS)
Ivan Maidanski [Mon, 8 Oct 2012 10:51:30 +0000 (14:51 +0400)]
Properly fix compare_double_and_swap_double for gcc/x32 (use built-in CAS)
(Apply commit cbe517e from 'master' branch.)

* src/atomic_ops/sysdeps/gcc/x86.h (AO_double_compare_and_swap_full):
New function (only if __x86_64__) implemented using GCC built-in
__sync CAS primitive available for x32.
* src/atomic_ops/sysdeps/gcc/x86.h
(AO_HAVE_double_compare_and_swap_full): New macro (for x32 only).
* src/atomic_ops/sysdeps/gcc/x86.h
(AO_compare_double_and_swap_double_full): Implement using
double_compare_and_swap_full instead of cmpxchg8b for x32 (since
x86_64 has cmpxchg and cmpxchg16b but not cmpxchg8b).

Conflicts:

    src/atomic_ops/sysdeps/gcc/x86.h

12 years agoFix double_ptr_storage definition for gcc/x32
Ivan Maidanski [Mon, 1 Oct 2012 10:48:43 +0000 (14:48 +0400)]
Fix double_ptr_storage definition for gcc/x32
(Apply commit 9957645 from 'master' branch.)

* src/atomic_ops/sysdeps/standard_ao_double_t.h (double_ptr_storage):
Define as "unsigned long long" instead of __m128 for gcc/x32 (i.e.,
ILP32 on x86_64); update and reformat comment.

Conflicts:

    src/atomic_ops/sysdeps/standard_ao_double_t.h

12 years agoFix compare_double_and_swap_double_full for gcc/x32
Ivan Maidanski [Tue, 18 Sep 2012 16:48:08 +0000 (20:48 +0400)]
Fix compare_double_and_swap_double_full for gcc/x32

* src/atomic_ops.h: Include gcc/x86.h instead of gcc/x86_64.h if
gcc/x32 (i.e., GCC (or Intel compiler), __x86_64__ is defined, and
__ILP32__ is defined) to have AO_compare_double_and_swap_double_full
defined properly (based on cmpxchg8b); explicitly define
AO_USE_PENTIUM4_INSTRS for gcc/x32.
* src/atomic_ops/sysdeps/gcc/x86_64.h: Remove ILP32-specific code
(AO_T_IS_INT definition).

12 years agoFix typos in atomic_ops.h comments
Ivan Maidanski [Fri, 5 Oct 2012 17:12:47 +0000 (21:12 +0400)]
Fix typos in atomic_ops.h comments

* src/atomic_ops.h: Fix typos in comments (update generalize.h
filename).

12 years ago.gitignore: Ignore .dll, .so files and pthreads-w32* library folder
Ivan Maidanski [Thu, 4 Oct 2012 11:08:57 +0000 (15:08 +0400)]
.gitignore: Ignore .dll, .so files and pthreads-w32* library folder
(Apply commit 4692f84 from 'master' branch.)

Conflicts:

    .gitignore

12 years agoFix AO_pause sleep delay for particular argument values (Win32)
Ivan Maidanski [Wed, 3 Oct 2012 14:02:03 +0000 (18:02 +0400)]
Fix AO_pause sleep delay for particular argument values (Win32)

* src/atomic_ops.c (AO_pause): Fix millis value (passed to Win32
Sleep) for the case of 'n' argument in range between 12 and 21,
inclusive if AO_USE_WIN32_PTHREADS (sleep for 1 ms in this case).
* src/atomic_ops_stack.c (AO_pause): Evaluate 'msecs' value using the
same algorithm as in atomic_ops.c (Win32 only).

12 years agoFix visibility and initial value of 'dummy' variable in atomic_ops_stack
Ivan Maidanski [Wed, 3 Oct 2012 07:59:33 +0000 (11:59 +0400)]
Fix visibility and initial value of 'dummy' variable in atomic_ops_stack

* src/atomic_ops_stack.c (dummy): Define as static (to make symbol
without AO_ prefix visible only within this file); initialize to 1
(same as in atomic_ops.c, so that AO_spin would never really alter
its value).

12 years agoFix AO_load primitive name in comment
Ivan Maidanski [Tue, 2 Oct 2012 12:59:58 +0000 (16:59 +0400)]
Fix AO_load primitive name in comment

* src/atomic_ops.h: Fix 'load' primitive name in comment (replace
AO_load_release_read with AO_load_acquire_read).

12 years agoFix compare_double_and_swap_double_full definition condition in emul_cas
Ivan Maidanski [Tue, 2 Oct 2012 07:12:24 +0000 (11:12 +0400)]
Fix compare_double_and_swap_double_full definition condition in emul_cas

* src/atomic_ops/sysdeps/emul_cas.h
(AO_compare_double_and_swap_double_full): Test (define if)
AO_HAVE_compare_double_and_swap_double_full macro instead of
AO_HAVE_compare_double_and_swap_double.

12 years agoFix cmpxchg16b-based compare_double_and_swap_double for SunCC/x86_64
Ivan Maidanski [Tue, 18 Sep 2012 15:03:19 +0000 (19:03 +0400)]
Fix cmpxchg16b-based compare_double_and_swap_double for SunCC/x86_64

* src/atomic_ops/sysdeps/sunc/x86_64.h
(AO_compare_double_and_swap_double_full): Fix inline assembly
arguments commenting out "m"(*addr) one (similar to that in
sunc/x86.h) if AO_CMPXCHG16B_AVAILABLE defined.

12 years agoMerge branch 'libatomic_ops-7_2-hotfix-2' into release-7_2
Ivan Maidanski [Sat, 22 Sep 2012 07:47:37 +0000 (11:47 +0400)]
Merge branch 'libatomic_ops-7_2-hotfix-2' into release-7_2

12 years agoUpdate (regenerate) configure files; update ChangeLog
Ivan Maidanski [Wed, 19 Sep 2012 04:49:18 +0000 (08:49 +0400)]
Update (regenerate) configure files; update ChangeLog

* configure: Regenerate (by autoreconf -vif using autoconf-2.68,
automake-1.11.3 and libtool-2.4.2).
* INSTALL: Likewise.
* Makefile.in: Likewise.
* aclocal.m4: Likewise.
* compile: Likewise.
* config.guess: Likewise.
* config.sub: Likewise.
* depcomp: Likewise.
* doc/Makefile.in: Likewise.
* install-sh: Likewise.
* missing: Likewise.
* src/Makefile.in: Likewise.
* src/atomic_ops/Makefile.in: Likewise.
* src/atomic_ops/sysdeps/Makefile.in: Likewise.
* tests/Makefile.in: Likewise.

12 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 18 Sep 2012 17:24:11 +0000 (21:24 +0400)]
Update ChangeLog

12 years agoFix a typo in comment of compare_double_and_swap_double (x86_64)
Ivan Maidanski [Tue, 18 Sep 2012 17:21:47 +0000 (21:21 +0400)]
Fix a typo in comment of compare_double_and_swap_double (x86_64)

* src/atomic_ops/sysdeps/gcc/x86_64.h
(AO_compare_double_and_swap_double_full): Fix a typo in comment.
* src/atomic_ops/sysdeps/sunc/x86_64.h
(AO_compare_double_and_swap_double_full): Likewise.

12 years agoUpdate ChangeLog
Ivan Maidanski [Tue, 18 Sep 2012 12:01:46 +0000 (16:01 +0400)]
Update ChangeLog

12 years agoTerminate tests with abort after error reported
Ivan Maidanski [Tue, 18 Sep 2012 10:54:48 +0000 (14:54 +0400)]
Terminate tests with abort after error reported
(Apply commit ebaf32f from 'master' branch)

* tests/test_atomic.c (acqrel_thr): Call abort() after fprintf(stderr).
* tests/test_malloc.c (run_one_test): Likewise.
* tests/test_stack.c (check_list, main): Likewise.

Conflicts:

    tests/test_atomic.c
    tests/test_stack.c

12 years agoUpdate ChangeLog
Ivan Maidanski [Wed, 5 Sep 2012 04:51:21 +0000 (08:51 +0400)]
Update ChangeLog

12 years agoFix compare_double_and_swap_double for clang/x86 in PIC mode
Ivan Maidanski [Wed, 5 Sep 2012 04:25:24 +0000 (08:25 +0400)]
Fix compare_double_and_swap_double for clang/x86 in PIC mode

* src/atomic_ops/sysdeps/gcc/x86.h
(AO_compare_double_and_swap_double_full): Re-implement for PIC mode
saving EBX to a local variable (instead of pushing it to stack) and
saving memory operand address to a register (edi which is manually
preserved), so that the whole code could also work even if EBX points
to memory operand (e.g., in Clang); test __PIC__ using ifdef (instead
of "if"); update comments; reformat code.

12 years ago[7.2d] libatomic_ops-7_2d
Ivan Maidanski [Thu, 9 Aug 2012 19:48:31 +0000 (23:48 +0400)]
[7.2d]

Change version in README to 7.2d; update ChangeLog

12 years agoMerge branch 'libatomic_ops-7_2-hotfix-1' into release-7_2
Ivan Maidanski [Thu, 9 Aug 2012 19:40:56 +0000 (23:40 +0400)]
Merge branch 'libatomic_ops-7_2-hotfix-1' into release-7_2