mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
* Source/NSObject.m: Correct asm for PPC.
Patch by Eric Wasylishen <ewasylishen@gmail.com> * Source/NSObject.m: Add support for new gcc atomic build ins. Currently still disabled. Patch by David Chisnall <theraven@sucs.org> M Source/NSObject.m M ChangeLog git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@28268 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a12d7ae190
commit
912f62759a
2 changed files with 23 additions and 6 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,4 +1,12 @@
|
|||
2009-03-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
2009-05-04 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSObject.m: Correct asm for PPC.
|
||||
Patch by Eric Wasylishen <ewasylishen@gmail.com>
|
||||
* Source/NSObject.m: Add support for new gcc atomic build
|
||||
ins. Currently still disabled.
|
||||
Patch by David Chisnall <theraven@sucs.org>
|
||||
|
||||
2009-05-04 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* NSCharacterSets/GNUmakefile:
|
||||
* Source/GNUmakefile:
|
||||
|
@ -16,7 +24,7 @@
|
|||
|
||||
* Source/NSURLProtocol.m: Removed c99-ism
|
||||
|
||||
2009-03-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
2009-05-03 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/GNUmakefile.postamble: remove generated files from pathconfig
|
||||
subdirectory on distclean.
|
||||
|
|
|
@ -219,6 +219,15 @@ typedef int32_t volatile *gsatomic_t;
|
|||
#define GSAtomicDecrement(X) InterlockedDecrement((LONG volatile*)X)
|
||||
|
||||
|
||||
#elif defined(USE_ATOMIC_BUILDINS) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1))
|
||||
/* Use the GCC atomic operations with recent GCC versions */
|
||||
|
||||
typedef int32_t volatile *gsatomic_t;
|
||||
#define GSATOMICREAD(X) (*(X))
|
||||
#define GSAtomicIncrement(X) __sync_fetch_and_add(X, 1)
|
||||
#define GSAtomicDecrement(X) __sync_fetch_and_sub(X, 1)
|
||||
|
||||
|
||||
#elif defined(__linux__) && (defined(__i386__) || defined(__x86_64__))
|
||||
/* Set up atomic read, increment and decrement for intel style linux
|
||||
*/
|
||||
|
@ -256,11 +265,11 @@ GSAtomicIncrement(gsatomic_t X)
|
|||
{
|
||||
int tmp;
|
||||
__asm__ __volatile__ (
|
||||
"modified:"
|
||||
"incmodified:"
|
||||
"lwarx %0,0,%1 \n"
|
||||
"addic %0,%0,1 \n"
|
||||
"stwcx. %0,0,%1 \n"
|
||||
"bne- modified \n"
|
||||
"bne- incmodified \n"
|
||||
:"=&r" (tmp)
|
||||
:"r" (X)
|
||||
:"cc", "memory");
|
||||
|
@ -272,11 +281,11 @@ GSAtomicDecrement(gsatomic_t X)
|
|||
{
|
||||
int tmp;
|
||||
__asm__ __volatile__ (
|
||||
"modified:"
|
||||
"decmodified:"
|
||||
"lwarx %0,0,%1 \n"
|
||||
"addic %0,%0,-1 \n"
|
||||
"stwcx. %0,0,%1 \n"
|
||||
"bne- modified \n"
|
||||
"bne- decmodified \n"
|
||||
:"=&r" (tmp)
|
||||
:"r" (X)
|
||||
:"cc", "memory");
|
||||
|
|
Loading…
Reference in a new issue