ppu_intrinsics.h (__ldarx): Use `Z' constraint, not `m' for *ptrp.
authorBen Elliston <bje@au.ibm.com>
Wed, 5 Sep 2007 01:22:05 +0000 (01:22 +0000)
committerBen Elliston <bje@gcc.gnu.org>
Wed, 5 Sep 2007 01:22:05 +0000 (11:22 +1000)
* config/rs6000/ppu_intrinsics.h (__ldarx): Use `Z' constraint,
not `m' for *ptrp.
(__stdcx): Make asm volatile.
(__stwcx, __stdcx): Return only 0 or 1.

From-SVN: r128116

gcc/ChangeLog
gcc/config/rs6000/ppu_intrinsics.h

index 59fbd34..acede3b 100644 (file)
@@ -1,3 +1,10 @@
+2007-09-05  Ben Elliston  <bje@au.ibm.com>
+
+       * config/rs6000/ppu_intrinsics.h (__ldarx): Use `Z' constraint,
+       not `m' for *ptrp.
+       (__stdcx): Make asm volatile.
+       (__stwcx, __stdcx): Return only 0 or 1.
+
 2007-09-05  Jan Hubicka  <jh@suse.cz>
 
        Revert:
index 7a7551e..2bfe463 100644 (file)
@@ -356,7 +356,7 @@ typedef int __V4SI __attribute__((vector_size(16)));
     doublewordsize *ptrp = (doublewordsize*)(void*)(base);     \
   __asm__ volatile ("ldarx %0,%y1"                     \
           : "=r" (result)                              \
-          : "m" (*ptrp));                              \
+          : "Z" (*ptrp));                              \
   result; })
 #endif /* __powerpc64__ */
 
@@ -369,7 +369,7 @@ typedef int __V4SI __attribute__((vector_size(16)));
           : "=r" (result),                     \
             "=Z" (*ptrp)                       \
           : "r" (value) : "cr0");              \
-  (result & 0x20000000); })
+  ((result & 0x20000000) >> 29); })
 
 
 #ifdef __powerpc64__
@@ -377,12 +377,12 @@ typedef int __V4SI __attribute__((vector_size(16)));
   ({unsigned long long result;                         \
     typedef  struct {char a[8];} doublewordsize;       \
     doublewordsize *ptrp = (doublewordsize*)(void*)(base);     \
-  __asm__ ("stdcx. %2,%y1\n"                           \
+  __asm__ volatile ("stdcx. %2,%y1\n"                  \
           "\tmfocrf %0,0x80"                           \
           : "=r" (result),                             \
             "=Z" (*ptrp)                               \
           : "r" (value) : "cr0");                      \
-  (result & 0x20000000); })
+  ((result & 0x20000000) >> 29); })
 #endif /* __powerpc64__ */
 
 #define __mffs() __extension__                 \