]> granicus.if.org Git - libatomic_ops/commitdiff
libatomic_ops-1.2 tarball import libatomic_ops-1_2
authorIvan Maidanski <ivmai@mail.ru>
Mon, 25 Jul 2011 12:00:43 +0000 (16:00 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 25 Jul 2011 12:00:43 +0000 (16:00 +0400)
13 files changed:
ChangeLog
compile
configure
configure.ac
src/atomic_ops/sysdeps/gcc/ia64.h
src/atomic_ops/sysdeps/gcc/powerpc.h
src/atomic_ops/sysdeps/gcc/x86.h
src/atomic_ops/sysdeps/gcc/x86_64.h
src/atomic_ops/sysdeps/hpc/ia64.h
tests/.deps/test_atomic.Po [deleted file]
tests/.deps/test_atomic_pthreads-test_atomic.Po [deleted file]
tests/.deps/test_malloc.Po [deleted file]
tests/.deps/test_stack.Po [deleted file]

index 77b9089df04a40438d969696fbe7e3dd9a39c8e8..9d05e5cb56da07862bd36802f2d2b2864d243a49 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,28 +1,34 @@
+[1.2 release]
+
+2006-07-11 Hans Boehm <Hans.Boehm@hp.com>
+       * src/atomic_ops/sysdeps/hpc/ia64.h: Fix typos.
+       
 2006-03-28 Earl Chew (Agilent)
-        * src/atomic_ops/sysdeps/gcc/powerpc.h: Remove unused variable cr.
-        * src/atomic_ops/sysdeps/msftc/x86.h:
-        Use new intrinsics available in MSVC 2003 and MSVC 2005.
-        Use inline assembler to generate mfence and byte sized xchg
-        Use correct prototype for InterlockedCompareExchange.
-        * src/atomic_ops.h: Add test for __PPC__ .
-        * tests/run_parallel.inc: Add simple VxWorks support.
-        * tests/test_atomic.c, tests/test_atomic_include.h: Add prototypes         to silence compiler warnings.
+       * src/atomic_ops/sysdeps/gcc/powerpc.h: Remove unused variable cr.
+       * src/atomic_ops/sysdeps/msftc/x86.h:
+       Use new intrinsics available in MSVC 2003 and MSVC 2005.
+       Use inline assembler to generate mfence and byte sized xchg
+       Use correct prototype for InterlockedCompareExchange.
+       * src/atomic_ops.h: Add test for __PPC__ .
+       * tests/run_parallel.inc: Add simple VxWorks support. 
+       * tests/test_atomic.c, tests/test_atomic_include.h: Add prototypes
+       to silence compiler warnings.
 
 2006-1-13 Hans Boehm <Hans.Boehm@hp.com>
-        *src/atomic_ops/sysdeps/gcc/powerpc.h: Beginnings of 64 bit support.
-        *src/atomic_ops/sysdeps/gcc/x86.h: Use "=q" for AO_test_and_set_full.
+       *src/atomic_ops/sysdeps/gcc/powerpc.h: Beginnings of 64 bit support.
+       *src/atomic_ops/sysdeps/gcc/x86.h: Use "=q" for AO_test_and_set_full.
 
 2005-11-4 Hans Boehm <Hans.Boehm@hp.com>
-        *src/atomic_ops/sysdeps/gcc/ia64.h: Include
-        all_acquire_release_volatile.h, instead of just the pointer-sized
-        version.
-        *src/atomic_ops/sysdeps/gcc/ia64.h: Include
-        all_acquire_release_volatile.h and all_atomic_load_store.h,
-        instead of just the pointer-sized versions.
+       *src/atomic_ops/sysdeps/gcc/ia64.h: Include
+       all_acquire_release_volatile.h, instead of just the pointer-sized
+       version.
+       *src/atomic_ops/sysdeps/gcc/ia64.h: Include
+       all_acquire_release_volatile.h and all_atomic_load_store.h,
+       instead of just the pointer-sized versions.
 
 [1.1 release]
 
-2003-09-27 Hans Boehm <Hans.Boehm@hp.com>
+2005-09-27 Hans Boehm <Hans.Boehm@hp.com>
        *src/atomic_ops.h: Define AO_CAN_EMUL_CAS for arm.
        *src/atomic_ops/sysdeps/read_ordered.h: New file, extracted from
        ordered_except_wr.h.
        instead of duplicating it.
        *src/atomic_ops/sysdeps/gcc/arm.h: Include read_ordered.h.
 
-2003-09-16 Hans Boehm <Hans.Boehm@hp.com>
+2005-09-16 Hans Boehm <Hans.Boehm@hp.com>
        *src/atomic_ops/sysdeps/gcc/arm.h: Replace the AO_test_and_set
        definition with one that might actually work.  (Thanks to Kazu
        Hirata and Paul Brook.)
 
-2003-08-01 Hans Boehm <Hans.Boehm@hp.com>
+2005-08-01 Hans Boehm <Hans.Boehm@hp.com>
        *src/atomic_ops/Makefile.am: Change function naming from "byte" to
        "char" (again).
 
diff --git a/compile b/compile
index 3d2170320efc07c320445d98bb4bfad1393a4e8d..1b1d232169586b87050f08c303ffcc44676da397 100755 (executable)
--- a/compile
+++ b/compile
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand `-c -o'.
 
-scriptversion=2004-10-12.08
+scriptversion=2005-05-14.22
 
-# Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -18,7 +18,7 @@ scriptversion=2004-10-12.08
 #
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -47,11 +47,11 @@ right script to run: please start by reading the file `INSTALL'.
 
 Report bugs to <bug-automake@gnu.org>.
 EOF
-    exit 0
+    exit $?
     ;;
   -v | --v*)
     echo "compile $scriptversion"
-    exit 0
+    exit $?
     ;;
 esac
 
index 941bfffbca8634ae739f842a811cdda6aa7a218f..2884582cff26bf25f9d693913abd511228d16c8f 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59 for libatomic_ops 1.1.
+# Generated by GNU Autoconf 2.59 for libatomic_ops 1.2.
 #
 # Copyright (C) 2003 Free Software Foundation, Inc.
 # This configure script is free software; the Free Software Foundation
@@ -267,8 +267,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='libatomic_ops'
 PACKAGE_TARNAME='libatomic_ops'
-PACKAGE_VERSION='1.1'
-PACKAGE_STRING='libatomic_ops 1.1'
+PACKAGE_VERSION='1.2'
+PACKAGE_STRING='libatomic_ops 1.2'
 PACKAGE_BUGREPORT=''
 
 ac_unique_file="src/atomic_ops.c"
@@ -786,7 +786,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libatomic_ops 1.1 to adapt to many kinds of systems.
+\`configure' configures libatomic_ops 1.2 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -853,7 +853,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libatomic_ops 1.1:";;
+     short | recursive ) echo "Configuration of libatomic_ops 1.2:";;
    esac
   cat <<\_ACEOF
 
@@ -972,7 +972,7 @@ fi
 test -n "$ac_init_help" && exit 0
 if $ac_init_version; then
   cat <<\_ACEOF
-libatomic_ops configure 1.1
+libatomic_ops configure 1.2
 generated by GNU Autoconf 2.59
 
 Copyright (C) 2003 Free Software Foundation, Inc.
@@ -986,7 +986,7 @@ cat >&5 <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libatomic_ops $as_me 1.1, which was
+It was created by libatomic_ops $as_me 1.2, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   $ $0 $@
@@ -1712,7 +1712,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='libatomic_ops'
- VERSION='1.1'
+ VERSION='1.2'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4559,7 +4559,7 @@ _ASBOX
 } >&5
 cat >&5 <<_CSEOF
 
-This file was extended by libatomic_ops $as_me 1.1, which was
+This file was extended by libatomic_ops $as_me 1.2, which was
 generated by GNU Autoconf 2.59.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4622,7 +4622,7 @@ _ACEOF
 
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-libatomic_ops config.status 1.1
+libatomic_ops config.status 1.2
 configured by $0, generated by GNU Autoconf 2.59,
   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
 
index 5d9d245450831fa2c6221d9c1230ac8e917ef1d5..3d0efe763859430ea74c551e5dff3ef68bca1e23 100644 (file)
@@ -1,5 +1,5 @@
 # Process this file with autoconf to produce a configure script.
-AC_INIT([libatomic_ops],[1.1])
+AC_INIT([libatomic_ops],[1.2])
 AC_CANONICAL_TARGET([])
 AC_CONFIG_SRCDIR(src/atomic_ops.c)
 AM_INIT_AUTOMAKE
index 522eaee7067f6efdf33981a26f7fb01f8de8acd6..119b9ed19d6527c092eb2e0417caceb067b7e36e 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "../all_atomic_load_store.h"
 
-#include "../acquire_release_volatile.h"
+#include "../all_acquire_release_volatile.h"
 
 #include "../test_and_set_t_is_char.h"
 
index cd5a534ee6a3ddb1cc997dff64307f5919f8649e..3ca39febabe648817701b41f48646178e541fdab 100644 (file)
@@ -97,6 +97,29 @@ AO_store_release(volatile AO_t *addr, AO_t value)
 /* This is similar to the code in the garbage collector.  Deleting     */
 /* this and having it synthesized from compare_and_swap would probably */
 /* only cost us a load immediate instruction.                          */
+#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
+/* Completely untested.  And we should be using smaller objects anyway. */
+AO_INLINE AO_TS_VAL_t
+AO_test_and_set(volatile AO_TS_t *addr) {
+  unsigned long oldval;
+  unsigned long temp = 1; /* locked value */
+
+  __asm__ __volatile__(
+               "1:ldarx %0,0,%1\n"   /* load and reserve               */
+               "cmpdi %0, 0\n"       /* if load is                     */
+               "bne 2f\n"            /*   non-zero, return already set */
+               "stdcx. %2,0,%1\n"    /* else store conditional         */
+               "bne- 1b\n"           /* retry if lost reservation      */
+               "2:\n"                /* oldval is zero if we set       */
+              : "=&r"(oldval)
+              : "r"(addr), "r"(temp)
+              : "memory", "cc");
+
+  return oldval;
+}
+
+#else
+
 AO_INLINE AO_TS_VAL_t
 AO_test_and_set(volatile AO_TS_t *addr) {
   int oldval;
@@ -116,6 +139,8 @@ AO_test_and_set(volatile AO_TS_t *addr) {
   return oldval;
 }
 
+#endif
+
 #define AO_have_test_and_set
 
 AO_INLINE AO_TS_VAL_t
@@ -146,6 +171,30 @@ AO_test_and_set_full(volatile AO_TS_t *addr) {
 
 #define AO_HAVE_test_and_set_full
 
+#if defined(__powerpc64__) || defined(__ppc64__) || defined(__64BIT__)
+/* FIXME: Completely untested. */
+AO_INLINE int
+AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) {
+  AO_t oldval;
+  int result = 0;
+
+  __asm__ __volatile__(
+               "1:ldarx %0,0,%2\n"   /* load and reserve              */
+               "cmpd %0, %4\n"      /* if load is not equal to         */
+               "bne 2f\n"            /*   old, fail                    */
+               "stdcx. %3,0,%2\n"    /* else store conditional         */
+               "bne- 1b\n"           /* retry if lost reservation      */
+              "li %1,1\n"           /* result = 1;                     */
+               "2:\n"
+              : "=&r"(oldval), "=&r"(result)
+              : "r"(addr), "r"(new_val), "r"(old), "1"(result)
+              : "memory", "cc");
+
+  return result;
+}
+
+#else
+
 AO_INLINE int
 AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) {
   AO_t oldval;
@@ -165,6 +214,7 @@ AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val) {
 
   return result;
 }
+#endif
 
 #define AO_HAVE_compare_and_swap
 
index 1f720a2c1715e540ca9a9ab8a191de0f765bd1bc..27e047e580231adfb5666b89f66b2109c1bafd16 100644 (file)
@@ -76,7 +76,7 @@ AO_char_fetch_and_add_full (volatile unsigned char *p, unsigned char incr)
   unsigned char result;
 
   __asm__ __volatile__ ("lock; xaddb %0, %1" :
-                       "=r" (result), "=m" (*p) : "0" (incr), "m" (*p)
+                       "=q" (result), "=m" (*p) : "0" (incr), "m" (*p)
                        : "memory");
   return result;
 }
index 356476fd56d2c0ecb9e56c71bd76e6dd1c1d8c05..75c2448cf1a2846dcad370b3d9c2032a7bede39d 100644 (file)
@@ -74,7 +74,7 @@ AO_char_fetch_and_add_full (volatile unsigned char *p, unsigned char incr)
   unsigned char result;
 
   __asm__ __volatile__ ("lock; xaddb %0, %1" :
-                       "=r" (result), "=m" (*p) : "0" (incr), "m" (*p)
+                       "=q" (result), "=m" (*p) : "0" (incr), "m" (*p)
                        : "memory");
   return result;
 }
@@ -123,7 +123,7 @@ AO_test_and_set_full(volatile AO_TS_t *addr)
   unsigned char oldval;
   /* Note: the "xchg" instruction does not need a "lock" prefix */
   __asm__ __volatile__("xchgb %0, %1"
-               : "=r"(oldval), "=m"(*addr)
+               : "=q"(oldval), "=m"(*addr)
                : "0"(0xff), "m"(*addr) : "memory");
   return (AO_TS_VAL_t)oldval;
 }
index b194e03e84b7e7d5fd07da5bc3cb79d24baba06b..99fdbb2634651fa43f36f4c5ca689428ff6da3ff 100644 (file)
@@ -26,9 +26,9 @@
  * gcc file.
  */
 
-#include "../atomic_load_store.h"
+#include "../all_atomic_load_store.h"
 
-#include "../acquire_release_volatile.h"
+#include "../all_acquire_release_volatile.h"
 
 #include "../test_and_set_t_is_char.h"
 
diff --git a/tests/.deps/test_atomic.Po b/tests/.deps/test_atomic.Po
deleted file mode 100644 (file)
index 9ce06a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/tests/.deps/test_atomic_pthreads-test_atomic.Po b/tests/.deps/test_atomic_pthreads-test_atomic.Po
deleted file mode 100644 (file)
index 9ce06a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/tests/.deps/test_malloc.Po b/tests/.deps/test_malloc.Po
deleted file mode 100644 (file)
index 9ce06a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# dummy
diff --git a/tests/.deps/test_stack.Po b/tests/.deps/test_stack.Po
deleted file mode 100644 (file)
index 9ce06a8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-# dummy