mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Use local labels in PowerPC assembler code of GSAtomic{In,De}crement
to avoid a compile error when this code is inlined more than once. In addition, use the optimized assembler definitions also on PowerPC machines running Darwin/Mac OS X. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@30239 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
e57aa98a34
commit
2057a4b58f
2 changed files with 13 additions and 5 deletions
|
@ -1,3 +1,11 @@
|
|||
2010-04-26 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||
|
||||
* Source/NSObject.m (GSAtomicIncrement, GSAtomicDecrement): Use
|
||||
local labels in PowerPC assembler code to avoid a compile error
|
||||
when this code is inlined more than once. In addition, use the
|
||||
optimized assembler definitions also on PowerPC machines running
|
||||
Darwin/Mac OS X.
|
||||
|
||||
2010-04-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/Additions/NSFileHandle+GNUstepBase.m: fix to only build on OSX
|
||||
|
|
|
@ -244,7 +244,7 @@ GSAtomicDecrement(gsatomic_t X)
|
|||
return *X;
|
||||
}
|
||||
|
||||
#elif defined(__PPC__)
|
||||
#elif defined(__PPC__) || defined(__POWERPC__)
|
||||
|
||||
typedef int32_t volatile *gsatomic_t;
|
||||
|
||||
|
@ -255,11 +255,11 @@ GSAtomicIncrement(gsatomic_t X)
|
|||
{
|
||||
int tmp;
|
||||
__asm__ __volatile__ (
|
||||
"incmodified:"
|
||||
"0:"
|
||||
"lwarx %0,0,%1 \n"
|
||||
"addic %0,%0,1 \n"
|
||||
"stwcx. %0,0,%1 \n"
|
||||
"bne- incmodified \n"
|
||||
"bne- 0b \n"
|
||||
:"=&r" (tmp)
|
||||
:"r" (X)
|
||||
:"cc", "memory");
|
||||
|
@ -271,11 +271,11 @@ GSAtomicDecrement(gsatomic_t X)
|
|||
{
|
||||
int tmp;
|
||||
__asm__ __volatile__ (
|
||||
"decmodified:"
|
||||
"0:"
|
||||
"lwarx %0,0,%1 \n"
|
||||
"addic %0,%0,-1 \n"
|
||||
"stwcx. %0,0,%1 \n"
|
||||
"bne- decmodified \n"
|
||||
"bne- 0b \n"
|
||||
:"=&r" (tmp)
|
||||
:"r" (X)
|
||||
:"cc", "memory");
|
||||
|
|
Loading…
Reference in a new issue