+2010-02-02 Ivan Maidanski <ivmai@mail.ru>
+
+ * src/atomic_ops/sysdeps/sunc/x86.h (AO_test_and_set_full): Fix
+ "xchg" data size (remove "l" suffix).
+ * src/atomic_ops/sysdeps/sunc/x86_64.h (AO_test_and_set_full):
+ Ditto.
+ * src/atomic_ops/sysdeps/sunc/x86_64.h (AO_test_and_set_full): Use
+ AO_TS_t for oldval.
+ * src/atomic_ops/sysdeps/sunc/x86.h
+ (AO_compare_double_and_swap_double_full,
+ AO_HAVE_compare_double_and_swap_double_full): Comment out (since
+ not tested, might be wrong, and tickles a bug in some Sun CC
+ versions; besides, __PIC__ macro is never predefined by Sun CC).
+
2010-01-29 Ivan Maidanski <ivmai@mail.ru>
* INSTALL: Regenerate (by autoreconf -vif using libtool-2.2.6b,
{
AO_TS_t oldval;
/* Note: the "xchg" instruction does not need a "lock" prefix */
- /* Note 2: "xchgb" is not recognized by Sun CC assembler yet. */
- __asm__ __volatile__("xchgl %0, %1"
+ __asm__ __volatile__("xchg %0, %1"
: "=q"(oldval), "=m"(*addr)
: "0"(0xff) /* , "m"(*addr) */
: "memory");
#define AO_HAVE_compare_and_swap_full
+#if 0
+/* FIXME: not tested (and probably wrong). Besides, */
+/* it tickles a bug in Sun C 5.10 (when optimizing). */
/* Returns nonzero if the comparison succeeded. */
/* Really requires at least a Pentium. */
AO_INLINE int
AO_t new_val1, AO_t new_val2)
{
char result;
- /* FIXME: not tested */
#if __PIC__
/* If PIC is turned on, we can't use %ebx as it is reserved for the
GOT pointer. We can save and restore %ebx because GCC won't be
}
#define AO_HAVE_compare_double_and_swap_double_full
+#endif
#include "../ao_t_is_int.h"
AO_INLINE AO_TS_VAL_t
AO_test_and_set_full(volatile AO_TS_t *addr)
{
- unsigned int oldval;
+ AO_TS_t oldval;
/* Note: the "xchg" instruction does not need a "lock" prefix */
- /* Note 2: "xchgb" is not recognized by Sun CC assembler yet. */
- __asm__ __volatile__("xchgl %0, %1"
+ __asm__ __volatile__("xchg %0, %1"
: "=q"(oldval), "=m"(*addr)
: "0"(0xff) /* , "m"(*addr) */
: "memory");