diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e85b9ef..23cd2c4 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2002-07-29 Alan Modra <amodra@bigpond.net.au> + + * config/cpu/powerpc/cpu_limits.h (__glibcpp_long_bits): Define. + * configure.target (cpu_include_dir): Use cpu/powerpc for powerpc64. + * config/cpu/powerpc/atomicity.h (__always_swap): Remove. + (__test_and_set): Remove. + (_STWCX): Define and use. + 2002-07-26 Phil Edwards <pme@gcc.gnu.org> * libsupc++/new (placement delete): Remove unused paramater names. diff --git a/libstdc++-v3/config/cpu/powerpc/atomicity.h b/libstdc++-v3/config/cpu/powerpc/atomicity.h index 05addba..b5370fc 100644 --- a/libstdc++-v3/config/cpu/powerpc/atomicity.h +++ b/libstdc++-v3/config/cpu/powerpc/atomicity.h @@ -30,6 +30,12 @@ #ifndef _BITS_ATOMICITY_H #define _BITS_ATOMICITY_H 1 +#ifdef __PPC405__ +#define _STWCX "sync \n\tstwcx. " +#else +#define _STWCX "stwcx. " +#endif + typedef int _Atomic_word; static inline _Atomic_word @@ -42,7 +48,7 @@ __exchange_and_add (volatile _Atomic_word* __mem, int __val) "0:\t" "lwarx %0,0,%2 \n\t" "add%I3 %1,%0,%3 \n\t" - "stwcx. %1,0,%2 \n\t" + _STWCX " %1,0,%2 \n\t" "bne- 0b \n\t" "/* End exchange & add */" : "=&b"(__res), "=&r"(__tmp) @@ -61,7 +67,7 @@ __atomic_add (volatile _Atomic_word *__mem, int __val) "0:\t" "lwarx %0,0,%1 \n\t" "add%I2 %0,%0,%2 \n\t" - "stwcx. %0,0,%1 \n\t" + _STWCX " %0,0,%1 \n\t" "bne- 0b \n\t" "/* End atomic add */" : "=&b"(__tmp) @@ -69,44 +75,4 @@ __atomic_add (volatile _Atomic_word *__mem, int __val) : "cr0", "memory"); } -static inline long -__attribute__ ((__unused__)) -__always_swap (volatile long *__p, long int __newval) -{ - long __res; - __asm__ __volatile__ ( - "/* Inline always swap */\n" - "0:\t" - "lwarx %0,0,%1 \n\t" - "stwcx. %2,0,%1 \n\t" - "bne- 0b \n\t" - "/* End always swap */" - : "=&r"(__res) - : "r"(__p), "r"(__newval) - : "cr0", "memory"); - return __res; -} - -static inline int -__attribute__ ((__unused__)) -__test_and_set (volatile long *__p, long int __newval) -{ - int __res; - __asm__ __volatile__ ( - "/* Inline test & set */\n" - "0:\t" - "lwarx %0,0,%1 \n\t" - "cmpwi %0,0 \n\t" - "bne- 1f \n\t" - "stwcx. %2,0,%1 \n\t" - "bne- 0b \n" - "1:\n\t" - "/* End test & set */" - : "=&r"(__res) - : "r"(__p), "r"(__newval) - : "cr0", "memory"); - return __res; -} - #endif /* atomicity.h */ - diff --git a/libstdc++-v3/config/cpu/powerpc/cpu_limits.h b/libstdc++-v3/config/cpu/powerpc/cpu_limits.h index 87d7883..42cffa9 100644 --- a/libstdc++-v3/config/cpu/powerpc/cpu_limits.h +++ b/libstdc++-v3/config/cpu/powerpc/cpu_limits.h @@ -28,6 +28,10 @@ #ifndef _GLIBCPP_CPU_LIMITS #define _GLIBCPP_CPU_LIMITS 1 +#ifdef __powerpc64__ +#define __glibcpp_long_bits 64 +#endif + #ifndef __LONG_DOUBLE_128__ #define __glibcpp_long_double_bits 64 #endif diff --git a/libstdc++-v3/configure.target b/libstdc++-v3/configure.target index a672e87..e202185 100644 --- a/libstdc++-v3/configure.target +++ b/libstdc++-v3/configure.target @@ -85,7 +85,7 @@ case "${target_cpu}" in mmix) ATOMICITYH="cpu/generic" ;; - powerpc | rs6000) + powerpc* | rs6000) cpu_include_dir="cpu/powerpc" ;; s390 | s390x)