diff options
author | Jason Merrill <jason@redhat.com> | 2003-12-19 22:08:42 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2003-12-19 22:08:42 -0500 |
commit | 46eb4b398948ddef881e51b9c49d96e242d56002 (patch) | |
tree | 536adb8ba0344092c4b99ba083903902491e9068 | |
parent | a06f01ba1e9b964c14ed6c63b56102d34ec6c45f (diff) | |
download | gcc-46eb4b398948ddef881e51b9c49d96e242d56002.zip gcc-46eb4b398948ddef881e51b9c49d96e242d56002.tar.gz gcc-46eb4b398948ddef881e51b9c49d96e242d56002.tar.bz2 |
atomicity.h: Remove memory clobbers.
* config/cpu/cris/atomicity.h: Remove memory clobbers.
* config/cpu/mips/atomicity.h: Likewise.
* config/cpu/i486/atomicity.h: Remove memory clobbers.
Split up read-write memory operand.
* config/cpu/m68k/atomicity.h: Likewise.
* config/cpu/powerpc/atomicity.h: Make memory I/O explicit.
* config/cpu/s390/atomicity.h: Likewise.
* config/cpu/sparc/atomicity.h: Likewise.
From-SVN: r74870
-rw-r--r-- | libstdc++-v3/ChangeLog | 11 | ||||
-rw-r--r-- | libstdc++-v3/config/cpu/cris/atomicity.h | 5 | ||||
-rw-r--r-- | libstdc++-v3/config/cpu/i486/atomicity.h | 7 | ||||
-rw-r--r-- | libstdc++-v3/config/cpu/m68k/atomicity.h | 5 | ||||
-rw-r--r-- | libstdc++-v3/config/cpu/mips/atomicity.h | 6 | ||||
-rw-r--r-- | libstdc++-v3/config/cpu/powerpc/atomicity.h | 24 | ||||
-rw-r--r-- | libstdc++-v3/config/cpu/s390/atomicity.h | 10 | ||||
-rw-r--r-- | libstdc++-v3/config/cpu/sparc/atomicity.h | 22 |
8 files changed, 47 insertions, 43 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 1aeecd1..e2d1924 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,14 @@ +2003-12-19 Jason Merrill <jason@redhat.com> + + * config/cpu/cris/atomicity.h: Remove memory clobbers. + * config/cpu/mips/atomicity.h: Likewise. + * config/cpu/i486/atomicity.h: Remove memory clobbers. + Split up read-write memory operand. + * config/cpu/m68k/atomicity.h: Likewise. + * config/cpu/powerpc/atomicity.h: Make memory I/O explicit. + * config/cpu/s390/atomicity.h: Likewise. + * config/cpu/sparc/atomicity.h: Likewise. + 2003-12-20 Carlo Wood <carlo@alinoe.com> * bits/demangle.h diff --git a/libstdc++-v3/config/cpu/cris/atomicity.h b/libstdc++-v3/config/cpu/cris/atomicity.h index f254c76..fecb9dc 100644 --- a/libstdc++-v3/config/cpu/cris/atomicity.h +++ b/libstdc++-v3/config/cpu/cris/atomicity.h @@ -51,8 +51,7 @@ __exchange_and_add(_Atomic_word* __mem, int __val) " bwf 0b \n" " clearf \n" : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp) - : "r" (__mem), "g" (__val), "m" (*__mem) - : "memory"); + : "r" (__mem), "g" (__val), "m" (*__mem)); #else __asm__ __volatile__ (" move $ccr,$r9 \n" " di \n" @@ -63,7 +62,7 @@ __exchange_and_add(_Atomic_word* __mem, int __val) " move $r9,$ccr \n" : "=&r" (__result), "=m" (*__mem), "=&r" (__tmp) : "r" (__mem), "g" (__val), "m" (*__mem) - : "memory", "r9"); + : "r9"); #endif return __result; diff --git a/libstdc++-v3/config/cpu/i486/atomicity.h b/libstdc++-v3/config/cpu/i486/atomicity.h index eab0f3d..06ab866 100644 --- a/libstdc++-v3/config/cpu/i486/atomicity.h +++ b/libstdc++-v3/config/cpu/i486/atomicity.h @@ -38,9 +38,8 @@ __exchange_and_add(volatile _Atomic_word* __mem, int __val) { register _Atomic_word __result; __asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}" - : "=r" (__result), "+m" (*__mem) - : "0" (__val) - : "memory"); + : "=r" (__result), "=m" (*__mem) + : "0" (__val), "m" (*__mem)); return __result; } @@ -49,7 +48,7 @@ __attribute__ ((__unused__)) __atomic_add(volatile _Atomic_word* __mem, int __val) { __asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}" - : "+m" (*__mem) : "ir" (__val) : "memory"); + : "=m" (*__mem) : "ir" (__val), "m" (*__mem)); } #endif /* atomicity.h */ diff --git a/libstdc++-v3/config/cpu/m68k/atomicity.h b/libstdc++-v3/config/cpu/m68k/atomicity.h index 0c7b189..eb801de 100644 --- a/libstdc++-v3/config/cpu/m68k/atomicity.h +++ b/libstdc++-v3/config/cpu/m68k/atomicity.h @@ -47,9 +47,8 @@ __exchange_and_add(volatile _Atomic_word* __mem, int __val) "add%.l %3,%1\n\t" "cas%.l %0,%1,%2\n\t" "jne 1b" - : "=d" (__result), "=&d" (__temp), "+m" (*__mem) - : "d" (__val), "0" (__result) - : "memory"); + : "=d" (__result), "=&d" (__temp), "=m" (*__mem) + : "d" (__val), "0" (__result), "m" (*__mem)); return __result; } diff --git a/libstdc++-v3/config/cpu/mips/atomicity.h b/libstdc++-v3/config/cpu/mips/atomicity.h index 919bba7..3d0c7a1 100644 --- a/libstdc++-v3/config/cpu/mips/atomicity.h +++ b/libstdc++-v3/config/cpu/mips/atomicity.h @@ -52,8 +52,7 @@ __exchange_and_add(volatile _Atomic_word* __mem, int __val) "beqz %1,1b\n\t" "/* End exchange & add */" : "=&r"(__result), "=&r"(__tmp), "=m"(*__mem) - : "m" (*__mem), "r"(__val) - : "memory"); + : "m" (*__mem), "r"(__val)); return __result; } @@ -78,8 +77,7 @@ __atomic_add(volatile _Atomic_word* __mem, int __val) "beqz %0,1b\n\t" "/* End atomic add */" : "=&r"(__result), "=m"(*__mem) - : "m" (*__mem), "r"(__val) - : "memory"); + : "m" (*__mem), "r"(__val)); } #endif /* atomicity.h */ diff --git a/libstdc++-v3/config/cpu/powerpc/atomicity.h b/libstdc++-v3/config/cpu/powerpc/atomicity.h index 518fd62..6c474b4 100644 --- a/libstdc++-v3/config/cpu/powerpc/atomicity.h +++ b/libstdc++-v3/config/cpu/powerpc/atomicity.h @@ -46,14 +46,14 @@ __exchange_and_add(volatile _Atomic_word* __mem, int __val) __asm__ __volatile__ ( "/* Inline exchange & add */\n" "0:\t" - "lwarx %0,0,%2 \n\t" - "add%I3 %1,%0,%3 \n\t" - _STWCX " %1,0,%2 \n\t" + "lwarx %0,0,%3 \n\t" + "add%I3 %1,%0,%4 \n\t" + _STWCX " %1,0,%3 \n\t" "bne- 0b \n\t" "/* End exchange & add */" - : "=&b"(__res), "=&r"(__tmp) - : "r" (__mem), "Ir"(__val) - : "cr0", "memory"); + : "=&b"(__res), "=&r"(__tmp), "=m" (*__mem) + : "r" (__mem), "Ir"(__val), "m" (*__mem) + : "cr0"); return __res; } @@ -65,14 +65,14 @@ __atomic_add(volatile _Atomic_word* __mem, int __val) __asm__ __volatile__ ( "/* Inline atomic add */\n" "0:\t" - "lwarx %0,0,%1 \n\t" - "add%I2 %0,%0,%2 \n\t" - _STWCX " %0,0,%1 \n\t" + "lwarx %0,0,%2 \n\t" + "add%I2 %0,%0,%3 \n\t" + _STWCX " %0,0,%2 \n\t" "bne- 0b \n\t" "/* End atomic add */" - : "=&b"(__tmp) - : "r" (__mem), "Ir"(__val) - : "cr0", "memory"); + : "=&b"(__tmp), "=m" (*__mem) + : "r" (__mem), "Ir"(__val), "m" (*__mem) + : "cr0"); } #endif /* atomicity.h */ diff --git a/libstdc++-v3/config/cpu/s390/atomicity.h b/libstdc++-v3/config/cpu/s390/atomicity.h index 5c5254c..8647c76 100644 --- a/libstdc++-v3/config/cpu/s390/atomicity.h +++ b/libstdc++-v3/config/cpu/s390/atomicity.h @@ -38,13 +38,13 @@ __exchange_and_add(volatile _Atomic_word* __mem, int __val) { register _Atomic_word __old_val, __new_val; - __asm__ __volatile__ (" l %0,0(%2)\n" + __asm__ __volatile__ (" l %0,0(%3)\n" "0: lr %1,%0\n" - " ar %1,%3\n" - " cs %0,%1,0(%2)\n" + " ar %1,%4\n" + " cs %0,%1,0(%3)\n" " jl 0b" - : "=&d" (__old_val), "=&d" (__new_val) - : "a" (__mem), "d" (__val) : "cc", "memory" ); + : "=&d" (__old_val), "=&d" (__new_val), "=m" (*__mem) + : "a" (__mem), "d" (__val), "m" (*__mem) : "cc"); return __old_val; } diff --git a/libstdc++-v3/config/cpu/sparc/atomicity.h b/libstdc++-v3/config/cpu/sparc/atomicity.h index 1caf344..2db079c 100644 --- a/libstdc++-v3/config/cpu/sparc/atomicity.h +++ b/libstdc++-v3/config/cpu/sparc/atomicity.h @@ -41,15 +41,14 @@ __exchange_and_add(volatile _Atomic_word* __mem, int __val) _Atomic_word __tmp1, __tmp2; _Atomic_word __val_extended = __val; - __asm__ __volatile__("1: ldx [%2], %0\n\t" - " add %0, %3, %1\n\t" - " casx [%2], %0, %1\n\t" + __asm__ __volatile__("1: ldx [%3], %0\n\t" + " add %0, %4, %1\n\t" + " casx [%3], %0, %1\n\t" " sub %0, %1, %0\n\t" " brnz,pn %0, 1b\n\t" " nop" - : "=&r" (__tmp1), "=&r" (__tmp2) - : "r" (__mem), "r" (__val_extended) - : "memory"); + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem) + : "r" (__mem), "r" (__val_extended), "m" (*__mem)); return __tmp2; } @@ -60,15 +59,14 @@ __atomic_add(volatile _Atomic_word* __mem, int __val) _Atomic_word __tmp1, __tmp2; _Atomic_word __val_extended = __val; - __asm__ __volatile__("1: ldx [%2], %0\n\t" - " add %0, %3, %1\n\t" - " casx [%2], %0, %1\n\t" + __asm__ __volatile__("1: ldx [%3], %0\n\t" + " add %0, %4, %1\n\t" + " casx [%3], %0, %1\n\t" " sub %0, %1, %0\n\t" " brnz,pn %0, 1b\n\t" " nop" - : "=&r" (__tmp1), "=&r" (__tmp2) - : "r" (__mem), "r" (__val_extended) - : "memory"); + : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem) + : "r" (__mem), "r" (__val_extended), "m" (*__mem)); } #else /* __arch32__ */ |