mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +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
b1570e8a1c
commit
a9a949c4ef
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>
|
2010-04-23 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/Additions/NSFileHandle+GNUstepBase.m: fix to only build on OSX
|
* Source/Additions/NSFileHandle+GNUstepBase.m: fix to only build on OSX
|
||||||
|
|
|
@ -244,7 +244,7 @@ GSAtomicDecrement(gsatomic_t X)
|
||||||
return *X;
|
return *X;
|
||||||
}
|
}
|
||||||
|
|
||||||
#elif defined(__PPC__)
|
#elif defined(__PPC__) || defined(__POWERPC__)
|
||||||
|
|
||||||
typedef int32_t volatile *gsatomic_t;
|
typedef int32_t volatile *gsatomic_t;
|
||||||
|
|
||||||
|
@ -255,11 +255,11 @@ GSAtomicIncrement(gsatomic_t X)
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"incmodified:"
|
"0:"
|
||||||
"lwarx %0,0,%1 \n"
|
"lwarx %0,0,%1 \n"
|
||||||
"addic %0,%0,1 \n"
|
"addic %0,%0,1 \n"
|
||||||
"stwcx. %0,0,%1 \n"
|
"stwcx. %0,0,%1 \n"
|
||||||
"bne- incmodified \n"
|
"bne- 0b \n"
|
||||||
:"=&r" (tmp)
|
:"=&r" (tmp)
|
||||||
:"r" (X)
|
:"r" (X)
|
||||||
:"cc", "memory");
|
:"cc", "memory");
|
||||||
|
@ -271,11 +271,11 @@ GSAtomicDecrement(gsatomic_t X)
|
||||||
{
|
{
|
||||||
int tmp;
|
int tmp;
|
||||||
__asm__ __volatile__ (
|
__asm__ __volatile__ (
|
||||||
"decmodified:"
|
"0:"
|
||||||
"lwarx %0,0,%1 \n"
|
"lwarx %0,0,%1 \n"
|
||||||
"addic %0,%0,-1 \n"
|
"addic %0,%0,-1 \n"
|
||||||
"stwcx. %0,0,%1 \n"
|
"stwcx. %0,0,%1 \n"
|
||||||
"bne- decmodified \n"
|
"bne- 0b \n"
|
||||||
:"=&r" (tmp)
|
:"=&r" (tmp)
|
||||||
:"r" (X)
|
:"r" (X)
|
||||||
:"cc", "memory");
|
:"cc", "memory");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue