]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/config/rs6000/sync.md
Step 1 of VSX changes: Powerpc infrstructure changes
[thirdparty/gcc.git] / gcc / config / rs6000 / sync.md
index 0adc23cfc04bb36a3825717c485ecf1f4f3bb5dc..f6cc91d3d56add23b3c0bb4faf73057982cb2e48 100644 (file)
@@ -1,5 +1,5 @@
 ;; Machine description for PowerPC synchronization instructions.
-;; Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+;; Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
 ;; Contributed by Geoffrey Keating.
 
 ;; This file is part of GCC.
@@ -33,8 +33,8 @@
   [(plus "rIL") (minus "r") (ior "rKJF") (xor "rKJF") (and "rSTKJ")])
 
 (define_expand "memory_barrier"
-  [(set (mem:BLK (match_dup 0))
-       (unspec:BLK [(mem:BLK (match_dup 0))] UNSPEC_SYNC))]
+  [(set (match_dup 0)
+       (unspec:BLK [(match_dup 0)] UNSPEC_SYNC))]
   ""
 {
   operands[0] = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (Pmode));
@@ -43,7 +43,7 @@
 
 (define_insn "*sync_internal"
   [(set (match_operand:BLK 0 "" "")
-       (unspec:BLK [(match_operand:BLK 1 "" "")] UNSPEC_SYNC))]
+       (unspec:BLK [(match_dup 0)] UNSPEC_SYNC))]
   ""
   "{dcs|sync}"
   [(set_attr "type" "sync")])
   if (TARGET_NO_LWSYNC)
     return "sync";
   else
-    return ".long 0x7c2004ac";
+    return (TARGET_LWSYNC_INSTRUCTION) ? "lwsync" : ".long 0x7c2004ac";
 }
   [(set_attr "type" "sync")])