2010-02-02 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Tue, 2 Feb 2010 19:42:29 +0000 (19:42 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 25 Jul 2011 12:03:25 +0000 (16:03 +0400)
* 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).

ChangeLog
src/atomic_ops/sysdeps/sunc/x86.h
src/atomic_ops/sysdeps/sunc/x86_64.h

index e27588a..afa0ef3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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,
index a3236b5..96bbe12 100644 (file)
@@ -109,8 +109,7 @@ AO_test_and_set_full(volatile AO_TS_t *addr)
 {
   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");
@@ -133,6 +132,9 @@ AO_compare_and_swap_full(volatile AO_t *addr,
 
 #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
@@ -141,7 +143,6 @@ AO_compare_double_and_swap_double_full(volatile AO_double_t *addr,
                                        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
@@ -167,5 +168,6 @@ AO_compare_double_and_swap_double_full(volatile AO_double_t *addr,
 }
 
 #define AO_HAVE_compare_double_and_swap_double_full
+#endif
 
 #include "../ao_t_is_int.h"
index 9822833..ca5995a 100644 (file)
@@ -108,10 +108,9 @@ AO_or_full (volatile AO_t *p, AO_t incr)
 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");