]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
cpu_limits.h (__glibcpp_long_bits): Define.
authorAlan Modra <amodra@bigpond.net.au>
Mon, 29 Jul 2002 23:26:00 +0000 (23:26 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Mon, 29 Jul 2002 23:26:00 +0000 (08:56 +0930)
* 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.

From-SVN: r55854

libstdc++-v3/ChangeLog
libstdc++-v3/config/cpu/powerpc/atomicity.h
libstdc++-v3/config/cpu/powerpc/cpu_limits.h
libstdc++-v3/configure.target

index e85b9ef414bbceb70f75b2bef2d0e491dd1aa31a..23cd2c47210757dd5045104af2185fcdbd7e6f64 100644 (file)
@@ -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.
index 05addba57850a9096cc6d28de4ebf6dc5893ef3d..b5370fcc642cbf1d5caf567ad4a0d7bc8e91b933 100644 (file)
 #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 */
-
index 87d7883bb02bf206db9daa132b1bbf038097e124..42cffa91441d7ccf0cece06053002dc28657e42a 100644 (file)
 #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
index a672e87dbcff0b0157bbaf61ec9bdfd04b5980e0..e202185e57a3a0e06093c8294958992172c10a07 100644 (file)
@@ -85,7 +85,7 @@ case "${target_cpu}" in
   mmix)
     ATOMICITYH="cpu/generic"
     ;;
-  powerpc | rs6000)
+  powerpc* | rs6000)
     cpu_include_dir="cpu/powerpc"
     ;;
   s390 | s390x)