[Gc] powerpc64 problems

Boehm, Hans hans.boehm at hp.com
Fri Jan 13 17:42:36 PST 2006


I merged this into my gc6.X tree.  The gc7 tree still needs work here,
though I just added a bit of ppc64 code to the atomic_ops package.

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Christian Thalinger
> Sent: Thursday, January 12, 2006 3:18 PM
> To: Boehm, Hans
> Cc: gc-ml
> Subject: RE: [Gc] powerpc64 problems
> 
> 
> On Tue, 2005-11-22 at 14:30 -0800, Boehm, Hans wrote:
> > Looking at the GC_test_and_set implementation for POWERPC, 
> starting at 
> > line around 157 in include/private/gc_locks.h, it looks to 
> me like the 
> > 64 bit implementation is bogus.  The argument is always a 
> pointer to a 
> > 4 byte quantity.  Hence I think the 32 bit code should work 
> fine (?) 
> > Could you try just deleting the 64 bit version, and getting 
> rid of the 
> > ifdef?
> 
> Sorry for the long delay.  But it took me some time to get 
> our new interpreter working.  Yes, removing the 64-bit part 
> works prefectly:
> 
> $ uname -m
> ppc64
> $ cacao GCBench 
> Garbage Collector Test
>  Stretching memory with a binary tree of depth 18
>  Total memory available=2162688 bytes  Free memory=1781760 
> bytes  Creating a long-lived binary tree of depth 16  
> Creating a long-lived array of 500000 doubles  Total memory 
> available=37310464 bytes  Free memory=1384448 bytes Creating 
> 33824 trees of depth 4
>         Top down construction took 1371msecs
>         Bottom up construction took 1362msecs
> Creating 8256 trees of depth 6
>         Top down construction took 1367msecs
>         Bottom up construction took 1351msecs
> Creating 2052 trees of depth 8
>         Top down construction took 1365msecs
>         Bottom up construction took 1350msecs
> Creating 512 trees of depth 10
>         Top down construction took 1364msecs
>         Bottom up construction took 1347msecs
> Creating 128 trees of depth 12
>         Top down construction took 1368msecs
>         Bottom up construction took 1271msecs
> Creating 32 trees of depth 14
>         Top down construction took 1379msecs
>         Bottom up construction took 1389msecs
> Creating 8 trees of depth 16
>         Top down construction took 1418msecs
>         Bottom up construction took 1387msecs
>  Total memory available=37310464 bytes  Free memory=1388544 
> bytes Completed in 20519ms.
> 
> A patch against 6.6 is attached.
> 
> TWISTI
> 
> 
> Index: include/private/gc_locks.h 
> ===================================================================
> RCS file: 
> /ahome/cacao/cacaocvs/cacao/src/boehm-gc/include/private/gc_locks.h,v
> retrieving revision 1.6
> diff -u -3 -p -r1.6 gc_locks.h
> --- include/private/gc_locks.h  27 Jun 2005 19:55:40 -0000      1.6
> +++ include/private/gc_locks.h  12 Jan 2006 23:17:57 -0000
> @@ -155,25 +155,6 @@
>  #      define GC_TEST_AND_SET_DEFINED
>  #    endif
>  #    if defined(POWERPC)
> -#     if CPP_WORDSZ == 64
> -        inline static int GC_test_and_set(volatile unsigned 
> int *addr) {
> -          unsigned long oldval;
> -          unsigned long temp = 1; /* locked value */
> -
> -          __asm__ __volatile__(
> -               "1:\tldarx %0,0,%3\n"   /* load and reserve   
>             */
> -               "\tcmpdi %0, 0\n"       /* if load is         
>             */
> -               "\tbne 2f\n"            /*   non-zero, return 
> already set */
> -               "\tstdcx. %2,0,%1\n"    /* else store 
> conditional         */
> -               "\tbne- 1b\n"           /* retry if lost 
> reservation      */
> -               "\tsync\n"              /* import barrier     
>             */
> -               "2:\t\n"                /* oldval is zero if 
> we set       */
> -              : "=&r"(oldval), "=p"(addr)
> -              : "r"(temp), "1"(addr)
> -              : "cr0","memory");
> -          return (int)oldval;
> -        }
> -#     else
>          inline static int GC_test_and_set(volatile unsigned 
> int *addr) {
>            int oldval;
>            int temp = 1; /* locked value */
> @@ -191,7 +172,6 @@
>                : "cr0","memory");
>            return oldval;
>          }
> -#     endif
>  #     define GC_TEST_AND_SET_DEFINED
>        inline static void GC_clear(volatile unsigned int *addr) {
>         __asm__ __volatile__("lwsync" : : : "memory");
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com 
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 



More information about the Gc mailing list