From ff90b22062c5a6f313aac95196323f14f1c2afbc Mon Sep 17 00:00:00 2001 From: Ben Elliston <bje@au.ibm.com> Date: Wed, 5 Sep 2007 01:22:05 +0000 Subject: [PATCH] ppu_intrinsics.h (__ldarx): Use `Z' constraint, not `m' for *ptrp. * 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 | 7 +++++++ gcc/config/rs6000/ppu_intrinsics.h | 8 ++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 59fbd3471967..acede3bfc33f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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: diff --git a/gcc/config/rs6000/ppu_intrinsics.h b/gcc/config/rs6000/ppu_intrinsics.h index 7a7551eaa544..2bfe4634389d 100644 --- a/gcc/config/rs6000/ppu_intrinsics.h +++ b/gcc/config/rs6000/ppu_intrinsics.h @@ -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__ \ -- GitLab