+[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).
#! /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
#
# 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
Report bugs to <bug-automake@gnu.org>.
EOF
- exit 0
+ exit $?
;;
-v | --v*)
echo "compile $scriptversion"
- exit 0
+ exit $?
;;
esac
#! /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
# 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"
# 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]...
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
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.
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 $@
# Define the identity of the package.
PACKAGE='libatomic_ops'
- VERSION='1.1'
+ VERSION='1.2'
cat >>confdefs.h <<_ACEOF
} >&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
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'`\\"
# 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
#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"
/* 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;
return oldval;
}
+#endif
+
#define AO_have_test_and_set
AO_INLINE AO_TS_VAL_t
#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;
return result;
}
+#endif
#define AO_HAVE_compare_and_swap
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;
}
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;
}
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;
}
* 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"