Update of /cvsroot/fink/experimental/jfmertens/main/finkinfo/sci
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9753

Modified Files:
        saclib.info 
Added Files:
        saclib.patch 
Log Message:
improvement from upstream on GC patch

--- NEW FILE: saclib.patch ---
/*======================================================================
                           GC()

Garbage collection entry-point.

This is a system- and compiler-dependent function which ensures that all
registers get pushed onto the stack. This is necessary since the GC-proper
GCSI() assumes that all GC roots are either located on the stack or in the
global variables.  The idea here is to declare enough "register" vars
that any other values in registers have to be flushed to the stack.
Then GCSI gets called with a pointer to something that is the top of
the stack ... or close enough.  The use of functions gd_dummy and
gc_dummy2 is to make it so the compiler can't optimize away the rxx
variables ... though the system would probably be better if they sat
in different files, so separate compilation would make interprocedural
optimization impossible.
======================================================================*/

#include "saclib.h"

static int gc_dummy(int i);
static int gc_dummy2(int r00,int r01,int r02,int r03,int r04,
                     int r05,int r06,int r07,int r08,int r09,
                     int r10,int r11,int r12,int r13,int r14,
                     int r15,int r16,int r17,int r18,int r19,
                     int r20,int r21,int r22,int r23,int r24,
                     int r25,int r26,int r27,int r28,int r29,
                     int r30,int r31);
void GC(void)
{

     Word top_of_stack;
     register int r00 = gc_dummy(0);
     register int r01 = gc_dummy(1);
     register int r02 = gc_dummy(2);
     register int r03 = gc_dummy(3);
     register int r04 = gc_dummy(4);
     register int r05 = gc_dummy(5);
     register int r06 = gc_dummy(6);
     register int r07 = gc_dummy(7);
     register int r08 = gc_dummy(8);
     register int r09 = gc_dummy(9);
     register int r10 = gc_dummy(10);
     register int r11 = gc_dummy(11);
     register int r12 = gc_dummy(12);
     register int r13 = gc_dummy(13);
     register int r14 = gc_dummy(14);
     register int r15 = gc_dummy(15);
     register int r16 = gc_dummy(16);
     register int r17 = gc_dummy(17);
     register int r18 = gc_dummy(18);
     register int r19 = gc_dummy(19);
     register int r20 = gc_dummy(20);
     register int r21 = gc_dummy(21);
     register int r22 = gc_dummy(22);
     register int r23 = gc_dummy(23);
     register int r24 = gc_dummy(24);
     register int r25 = gc_dummy(25);
     register int r26 = gc_dummy(26);
     register int r27 = gc_dummy(27);
     register int r28 = gc_dummy(28);
     register int r29 = gc_dummy(29);
     register int r30 = gc_dummy(30);
     register int r31 = gc_dummy(31);
     top_of_stack = gc_dummy2(r00,r01,r02,r03,r04,r05,r06,r07,r08,r09,
                              r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,
                              r20,r21,r22,r23,r24,r25,r26,r27,r28,r29,
                              r30,r31);
     GCSI(sizeof(Word),(char *)&top_of_stack);
}


static int gc_dummy(int i)
{
  int k;
  return (int)&k & (9*i);
}

static int gc_dummy2(int r00,int r01,int r02,int r03,int r04,
                     int r05,int r06,int r07,int r08,int r09,
                     int r10,int r11,int r12,int r13,int r14,
                     int r15,int r16,int r17,int r18,int r19,
                     int r20,int r21,int r22,int r23,int r24,
                     int r25,int r26,int r27,int r28,int r29,
                     int r30,int r31)
{
  return
    r00+r01+r02+r03+r04+r05+r06+r07+r08+r09+
    r10+r11+r12+r13+r14+r15+r16+r17+r18+r19+
    r20+r21+r22+r23+r24+r25+r26+r27+r28+r29+
    r30+r31;
}

Index: saclib.info
===================================================================
RCS file: /cvsroot/fink/experimental/jfmertens/main/finkinfo/sci/saclib.info,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- saclib.info 20 Nov 2008 23:13:35 -0000      1.13
+++ saclib.info 21 Nov 2008 15:47:59 -0000      1.14
@@ -33,17 +33,19 @@
                s,[(],((,
                s,[)]$,) || $ostype eq "darwin"),
                }' bin/mksysdep.pl
-  ###  PPC has 32 registers (at least G5. G4 ? G3 ?)
-  sed -i'' -e '/register int/a\
-#ifdef __POWERPC__\
-       r(r1); r(r2); r(r3); r(r4); r(r5); r(r6); r(r7); r(r8);\
-       r(r9); r(r10); r(r11); r(r12); r(r13); r(r14); r(r15); r(r16);\
-       r(r17); r(r18); r(r19); r(r20); r(r21); r(r22); r(r23); r(r24);\
-       r(r25); r(r26); r(r27); r(r28); r(r29); r(r30); r(r31); r(r32);\
-       r1 = 
gc_dummy(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25,r26,r27,r28,r29,r30,r31,r32);\
-#else' \
-       -e '/gc_dummy.*r16);$/a\
-#endif' sysdep/linuxX86/GC.c
+#  ###  PPC has 32 registers (at least G5. G4 ? G3 ?)
+#  sed -i'' -e '/register int/a\
+##ifdef __POWERPC__\
+#      r(r1); r(r2); r(r3); r(r4); r(r5); r(r6); r(r7); r(r8);\
+#      r(r9); r(r10); r(r11); r(r12); r(r13); r(r14); r(r15); r(r16);\
+#      r(r17); r(r18); r(r19); r(r20); r(r21); r(r22); r(r23); r(r24);\
+#      r(r25); r(r26); r(r27); r(r28); r(r29); r(r30); r(r31); r(r32);\
+#      r1 = 
gc_dummy(r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18,r19,r20,r21,r22,r23,r24,r25,r26,r27,r28,r29,r30,r31,r32);\
+##else' \
+#      -e '/gc_dummy.*r16);$/a\
+##endif' sysdep/linuxX86/GC.c
+### Improvement from Chris Brown on the above :
+  cp -p %a/%{Ni}.patch sysdep/linuxX86/GC.c
 ###  
 ## malloc.h and ieee754.h don't exist in darwin :
   ## for __APPLE__ , same remark as for  __foo_ENDIAN__  above.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to