summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-02 22:48:21 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>2003-01-02 22:48:21 +0000
commit4c5b22f515e60e1cc0eb818f1614a8058d72b09d (patch)
tree1bae956d87bd80989971abd9e506767e59028764 /libstdc++-v3
parent37ef0e43884ff848ae325311bf59021c53991745 (diff)
downloadgcc-4c5b22f515e60e1cc0eb818f1614a8058d72b09d.tar.gz
* config/cpu/i486/atomicity.h (__exchange_and_add, __atomic_add):
*__mem is also an output. * config/cpu/m68k/atomicity.h (__exchange_and_add): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60807 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog6
-rw-r--r--libstdc++-v3/config/cpu/i486/atomicity.h10
-rw-r--r--libstdc++-v3/config/cpu/m68k/atomicity.h8
3 files changed, 15 insertions, 9 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 337056ec8cc..ba62559eae5 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,9 @@
+2003-01-02 Jason Merrill <jason@redhat.com>
+
+ * config/cpu/i486/atomicity.h (__exchange_and_add, __atomic_add):
+ *__mem is also an output.
+ * config/cpu/m68k/atomicity.h (__exchange_and_add): Likewise.
+
2002-12-30 Loren J. Rittle <ljrittle@acm.org>
* src/Makefile.am: Resolve non-portable use of $<.
diff --git a/libstdc++-v3/config/cpu/i486/atomicity.h b/libstdc++-v3/config/cpu/i486/atomicity.h
index 92f5011c3a1..73dedf10d9d 100644
--- a/libstdc++-v3/config/cpu/i486/atomicity.h
+++ b/libstdc++-v3/config/cpu/i486/atomicity.h
@@ -37,9 +37,9 @@ __attribute__ ((__unused__))
__exchange_and_add (volatile _Atomic_word *__mem, int __val)
{
register _Atomic_word __result;
- __asm__ __volatile__ ("lock; xaddl %0,%2"
- : "=r" (__result)
- : "0" (__val), "m" (*__mem)
+ __asm__ __volatile__ ("lock; xaddl %0,%1"
+ : "=r" (__result), "+m" (*__mem)
+ : "0" (__val)
: "memory");
return __result;
}
@@ -48,8 +48,8 @@ static inline void
__attribute__ ((__unused__))
__atomic_add (volatile _Atomic_word* __mem, int __val)
{
- __asm__ __volatile__ ("lock; addl %0,%1"
- : : "ir" (__val), "m" (*__mem) : "memory");
+ __asm__ __volatile__ ("lock; addl %1,%0"
+ : "+m" (*__mem) : "ir" (__val) : "memory");
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/m68k/atomicity.h b/libstdc++-v3/config/cpu/m68k/atomicity.h
index db327355954..5a2dda3228c 100644
--- a/libstdc++-v3/config/cpu/m68k/atomicity.h
+++ b/libstdc++-v3/config/cpu/m68k/atomicity.h
@@ -43,11 +43,11 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
register _Atomic_word __result = *__mem;
register _Atomic_word __temp;
__asm__ __volatile__ ("1: move%.l %0,%1\n\t"
- "add%.l %2,%1\n\t"
- "cas%.l %0,%1,%3\n\t"
+ "add%.l %3,%1\n\t"
+ "cas%.l %0,%1,%2\n\t"
"jne 1b"
- : "=d" (__result), "=&d" (__temp)
- : "d" (__val), "m" (*__mem), "0" (__result)
+ : "=d" (__result), "=&d" (__temp), "+m" (*__mem)
+ : "d" (__val), "0" (__result)
: "memory");
return __result;
}