]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.h (TARGET_NO_LWSYNC): Define.
authorJoseph Myers <joseph@codesourcery.com>
Sat, 18 Nov 2006 00:22:45 +0000 (00:22 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Sat, 18 Nov 2006 00:22:45 +0000 (00:22 +0000)
gcc:
* config/rs6000/rs6000.h (TARGET_NO_LWSYNC): Define.
* config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define
__NO_LWSYNC__ if TARGET_NO_LWSYNC.
* config/rs6000/sync.md (lwsync): Emit plain sync if
TARGET_NO_LWSYNC.

libstdc++-v3:
* config/cpu/powerpc/atomic_word.h (_GLIBCXX_WRITE_MEM_BARRIER):
Use plain sync if __NO_LWSYNC__.

From-SVN: r118961

gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/sync.md
libstdc++-v3/ChangeLog
libstdc++-v3/config/cpu/powerpc/atomic_word.h

index f3c8b878653927abf4fe6225cce1101fc110fba0..01ed1bfe1f49c27d49a29594096c9b2d41786ba3 100644 (file)
@@ -1,3 +1,11 @@
+2006-11-18  Joseph Myers  <joseph@codesourcery.com>
+
+       * config/rs6000/rs6000.h (TARGET_NO_LWSYNC): Define.
+       * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define
+       __NO_LWSYNC__ if TARGET_NO_LWSYNC.
+       * config/rs6000/sync.md (lwsync): Emit plain sync if
+       TARGET_NO_LWSYNC.
+
 2006-11-17  DJ Delorie  <dj@redhat.com>
 
        * reload1.c (reloads_unique_chain): New.
index 94d4a6a8c3bf294bbe3b8a2692dd5b97fd1f2bf9..d4988bd3ffd43671ec2d8023da2b43d90a793ab6 100644 (file)
@@ -127,6 +127,9 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
   /* Used by lwarx/stwcx. errata work-around.  */
   if (rs6000_cpu == PROCESSOR_PPC405)
     builtin_define ("__PPC405__");
+  /* Used by libstdc++.  */
+  if (TARGET_NO_LWSYNC)
+    builtin_define ("__NO_LWSYNC__");
 
   /* May be overridden by target configuration.  */
   RS6000_CPU_CPP_ENDIAN_BUILTINS();
index 6ccc3c01ad4ee0b153b9551c46100e2bc064827c..0795e6ee63762aef688c8c84cb3f620a4abb3460 100644 (file)
@@ -342,6 +342,9 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
 #define TARGET_E500_SINGLE 0
 #define TARGET_E500_DOUBLE 0
 
+/* E500 processors only support plain "sync", not lwsync.  */
+#define TARGET_NO_LWSYNC TARGET_E500
+
 /* Sometimes certain combinations of command options do not make sense
    on a particular target machine.  You can define a macro
    `OVERRIDE_OPTIONS' to take account of this.  This macro, if
index b244ef639863a074929c1a3278c4b7d3580a75aa..b7166473efec6dfb372cddc33caa9d3be930da16 100644 (file)
   [(set (mem:BLK (match_scratch 0 "X"))
        (unspec_volatile:BLK [(mem:BLK (match_scratch 1 "X"))] UNSPEC_LWSYNC))]
   ""
-  ".long 0x7c2004ac"
+{
+  if (TARGET_NO_LWSYNC)
+    return "sync";
+  else
+    return ".long 0x7c2004ac";
+}
   [(set_attr "type" "sync")])
 
index 2118ba1bcc905c165c30f0e4cba015ff8f4c2b0e..a41049a7ff11492b07c024b3675933528fa17bb7 100644 (file)
@@ -1,3 +1,8 @@
+2006-11-18  Joseph Myers  <joseph@codesourcery.com>
+
+       * config/cpu/powerpc/atomic_word.h (_GLIBCXX_WRITE_MEM_BARRIER):
+       Use plain sync if __NO_LWSYNC__.
+
 2006-11-14  Joseph Myers  <joseph@codesourcery.com>
 
        * testsuite/26_numerics/complex/13450.cc: Do not test long double
index 2a5d192c54bb73060cdfa8ef28e08ea8643c49af..4f8c670d2a239003a880cfff324ae01ab6ebc1f4 100644 (file)
 typedef int _Atomic_word;
 
 #define _GLIBCXX_READ_MEM_BARRIER __asm __volatile ("isync":::"memory")
+#ifdef __NO_LWSYNC__
+#define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("sync":::"memory")
+#else
 #define _GLIBCXX_WRITE_MEM_BARRIER __asm __volatile ("lwsync":::"memory")
+#endif
 
 #endif