Dalibor Topic wrote:
Yoshiharu Oba wrote:

Hi Dalibor

I appreciate your advice very much. Now I'm writing a changelog and
remake a new patch, It's also included.


Hi Yoshiharu,

thanks for the updated patch and the ChangeLog. I've started to merge parts of it in. Since Dylan Schell's port to PS2Linux is already in the CVS, it would be nice if you could try to see if the CVS head builds for you, too, on ps2linux, and adapt yout patch accordingly. I'll comment to the changelog on what I've checked in & how it has been adapated.

Actually, I went ahead and adapated the patch myself ;) I've attached the adapted patch that can applied against CVS head. It'd be nice if you could give it a try with a fresh CVS check out, too see if it still works. I don't have a ps2-linux cross-toolchain (nor do I have a PS2 :) atm, so I can't test it myself.


cheers,
dalibor topic
? po/fr.gmo
? po/zh_TW.gmo
Index: config/mips/jit.h
===================================================================
RCS file: /cvs/kaffe/kaffe/config/mips/jit.h,v
retrieving revision 1.12
diff -u -r1.12 jit.h
--- config/mips/jit.h   7 Jul 2004 19:34:25 -0000       1.12
+++ config/mips/jit.h   8 Jul 2004 13:34:07 -0000
@@ -35,12 +35,13 @@
 typedef struct _exceptionFrame {
        char*   return_frame;
        char*   return_pc;
+       char*   return_sp;
 } exceptionFrame;
 
 extern void __mipsGetNextFrame(struct _exceptionFrame*);
 
 #define        STACK_NEXT_FRAME(F)     __mipsGetNextFrame(F)
-#define        FIRSTFRAME(F,O)         (F).return_frame = 0; \
+#define        FIRSTFRAME(F,O)         (F).return_frame = (F).return_sp = 0; \
                                __mipsGetNextFrame(&F)
 #define        NEXTFRAME(F)            ((F)->return_frame)
 #define        PCFRAME(F)              ((F)->return_pc)
Index: config/mips/jit3-icode.h
===================================================================
RCS file: /cvs/kaffe/kaffe/config/mips/jit3-icode.h,v
retrieving revision 1.4
diff -u -r1.4 jit3-icode.h
--- config/mips/jit3-icode.h    17 Jun 2001 16:39:11 -0000      1.4
+++ config/mips/jit3-icode.h    8 Jul 2004 13:34:07 -0000
@@ -50,7 +50,11 @@
 #define        HAVE_move_int_const             move_RxC
 #define        HAVE_move_int                   move_RxR
 #define        HAVE_move_float                 fmove_RxR
+#ifdef PS2LINUX
+#undef HAVE_move_double
+#else
 #define        HAVE_move_double                fmovel_RxR
+#endif
 #define        HAVE_move_label_const           move_RxL
 #define        HAVE_move_ref                   move_RxR
 #define        HAVE_move_any                   move_RxR
@@ -79,9 +83,15 @@
 #define        HAVE_mul_float                  fmul_RRR
 #undef HAVE_div_float
 
+#ifdef PS2LINUX
+#undef HAVE_add_double
+#undef HAVE_sub_double
+#undef HAVE_mul_double
+#else
 #define        HAVE_add_double                 faddl_RRR
 #define        HAVE_sub_double                 fsubl_RRR
 #define        HAVE_mul_double                 fmull_RRR
+#endif
 #undef HAVE_div_double
 
 #define        HAVE_add_ref                    addu_RRR /* new */
@@ -94,12 +104,21 @@
 
 #define        HAVE_load_float                 fload_RRx
 #define        HAVE_store_float                fstore_RRx
+#ifdef PS2LINUX
+#undef HAVE_load_double
+#undef HAVE_store_double
+#else
 #define        HAVE_load_double                floadl_RRx
 #define        HAVE_store_double               fstorel_RRx
+#endif
 
 #define        HAVE_pusharg_int                push_xRC
 #define        HAVE_pusharg_float              fpush_xRC
+#ifdef PS2LINUX
+#undef HAVE_pusharg_double
+#else
 #define        HAVE_pusharg_double             fpushl_xRC
+#endif
 #define        HAVE_pusharg_ref                push_xRC
 #define        HAVE_pusharg_long               pushl_xRC
 #define        HAVE_popargs                    popargs_xxC
@@ -119,12 +138,20 @@
 #define        HAVE_return_int                 return_Rxx
 #define        HAVE_return_long                returnl_Rxx
 #define        HAVE_return_float               freturn_Rxx
+#ifdef PS2LINUX
+#undef HAVE_return_double
+#else
 #define        HAVE_return_double              freturnl_Rxx
+#endif
 #define        HAVE_return_ref                 return_Rxx
 #define        HAVE_returnarg_int              returnarg_xxR
 #define        HAVE_returnarg_long             returnargl_xxR
 #define        HAVE_returnarg_float            freturnarg_xxR
+#ifdef PS2LINUX
+#undef HAVE_returnarg_double
+#else
 #define        HAVE_returnarg_double           freturnargl_xxR
+#endif
 #define        HAVE_returnarg_ref              returnarg_xxR
 
 #define        HAVE_set_label                  set_label_xxC
@@ -251,7 +278,11 @@
 #undef HAVE_cmp_long                   /* no */
 
 #define        HAVE_neg_float                  fneg_RRR
+#ifdef PS2LINUX
+#undef HAVE_neg_double 
+#else
 #define        HAVE_neg_double                 fnegl_RRR
+#endif
 #undef HAVE_rem_float                  /* no */
 #undef HAVE_rem_double                 /* no */
 
Index: config/mips/jit3-mips.def
===================================================================
RCS file: /cvs/kaffe/kaffe/config/mips/jit3-mips.def,v
retrieving revision 1.12
diff -u -r1.12 jit3-mips.def
--- config/mips/jit3-mips.def   9 Mar 2004 15:15:35 -0000       1.12
+++ config/mips/jit3-mips.def   8 Jul 2004 13:34:07 -0000
@@ -27,7 +27,6 @@
 #endif
 
 #ifdef KAFFE_VMDEBUG
-extern uint pc;
 int jit_debug = 0;
 /* int dbmsg = 0; */
 #define        debug_name(x)   debug(x)
@@ -337,6 +336,7 @@
                }
                 switch (ch) {
                case 'D':
+#ifndef PS2LINUX
                        if (haveint == 0 && fi < 2) {
                                preloadRegister(slot_data(localinfo[i]), Rdouble, 
REG_f12+2*fi);
                                i += 2;
@@ -344,6 +344,7 @@
                                fi++;
                                break;
                        }
+#endif
                        /* Fall through ... */
                case 'J':
        /* dbmsg = 1; */
@@ -1950,8 +1951,8 @@
        /* Else we actually put the value in a float point register f12-f14.
         */
        else {
-               r = rreg_ideal_float(1, REG_f12+2*fp_idx);
-               assert(r == 12+2*fp_idx);
+               r = rreg_ideal_float(1, REG_f12+2*fp_idx) + REG_f0;
+               assert(r == REG_f12+2*fp_idx);
                register_reserve(r);
                resreg[res_idx++] = r;
        }
@@ -2004,8 +2005,8 @@
        /* Else we actually put the value in a float point register f12-f14.
         */
        else {
-               r = rreg_ideal_double(1, REG_f12+2*fp_idx);
-               assert(r == 12+2*fp_idx);
+               r = rreg_ideal_double(1, REG_f12+2*fp_idx) + REG_f0;
+               assert(r == REG_f12+2*fp_idx);
                register_reserve(r);
                register_reserve(r+1);
                resreg[res_idx++] = r;
Index: config/mips/mips.c
===================================================================
RCS file: /cvs/kaffe/kaffe/config/mips/mips.c,v
retrieving revision 1.12
diff -u -r1.12 mips.c
--- config/mips/mips.c  23 Jun 2004 16:35:29 -0000      1.12
+++ config/mips/mips.c  8 Jul 2004 13:34:07 -0000
@@ -50,6 +50,7 @@
        int* fp;
        int* ppc;
        int* pfp;
+       int* stackp = 0;
 
        if (fm->return_frame == 0) {
 here:;
@@ -57,8 +58,9 @@
                asm("move %0,$fp" : "=r" (fp));
        }
        else {
-               fp = (int*)fm->return_frame;
-               spc = (int*)fm->return_pc;
+               spc    = (int*)fm->return_pc;
+               fp         = (int*)fm->return_frame;
+               stackp = (int*)fm->return_sp;
        }
 
 #if 0
@@ -96,12 +98,15 @@
        /* Walk backwards down the code looking for where the return
         * pc is stored.
         */
-       TDBG(kprintf("starting search at %p\n", spc);)
+       TDBG(kprintf("[1] starting search at %p\n", spc);)
        for (pc = spc;; pc--) {
                unsigned short high = (unsigned short)((*pc) >> 16);
                short low = (short)*pc;
                switch (high) {
                case 0xafbf:    /* sw $ra,i($sp) */
+               if( stackp != (int*)0) {
+                        fp = stackp;
+               }
                        TDBG(kprintf(" &ra = %p\n", pc);)
                        ppc = (int*)fp[low / sizeof(int)];
                        TDBG(kprintf(" prev pc = %p\n", ppc);)
@@ -141,7 +146,7 @@
        /* Walk backwards down the code looking for where we stored the
         * previous frame pointer.
         */
-       TDBG(kprintf("starting search at %p\n", spc);)
+       TDBG(kprintf("[2] starting search at %p\n", spc);)
        for (pc = spc;; pc--) {
                unsigned short high = (unsigned short)((*pc) >> 16);
                short low = (short)*pc;
@@ -172,6 +177,7 @@
        else {
                fm->return_pc = (char*)ppc;
                fm->return_frame = (char*)pfp;
+               fm->return_sp = (char*)0;
        }
 }
 
Index: config/mips/linux/jit-md.h
===================================================================
RCS file: /cvs/kaffe/kaffe/config/mips/linux/jit-md.h,v
retrieving revision 1.3
diff -u -r1.3 jit-md.h
--- config/mips/linux/jit-md.h  13 Dec 2003 18:03:53 -0000      1.3
+++ config/mips/linux/jit-md.h  8 Jul 2004 13:34:07 -0000
@@ -30,9 +30,11 @@
 #define EXCEPTIONPROTO  int sig, int cause, struct sigcontext *ctx
 
 /* Get the first exception frame from a signal handler */
+#define MIPS_SP 29
 #define MIPS_FP 30
 #define EXCEPTIONFRAME(f, c) \
        (f).return_frame = (void *)(unsigned long)(c)->sc_regs[MIPS_FP]; \
+       (f).return_sp    = (void *)(unsigned long)(c)->sc_regs[MIPS_SP]; \
        (f).return_pc = (void *)(unsigned long)(c)->sc_pc
 
 #endif
Index: kaffe/kaffevm/jit3/icode.c
===================================================================
RCS file: /cvs/kaffe/kaffe/kaffe/kaffevm/jit3/icode.c,v
retrieving revision 1.42
diff -u -r1.42 icode.c
--- kaffe/kaffevm/jit3/icode.c  6 Jul 2004 15:57:15 -0000       1.42
+++ kaffe/kaffevm/jit3/icode.c  8 Jul 2004 13:34:08 -0000
@@ -907,7 +907,7 @@
        else if (isGlobal(dst->slot)) {
 #if defined(HAVE_move_double)
                lslot_lslot_lslot(dst, 0, src, HAVE_move_double, Tcopy);
-#elif defined(HAVE_NO_FLOATING_POINT)
+#elif defined(HAVE_NO_FLOATING_POINT) || defined(PS2LINUX)
                move_long(dst, src);
 #else
                ABORT();
@@ -2325,7 +2325,7 @@
 {
 #if defined(HAVE_load_double)
        lslot_lslot_slot(dst, 0, src, HAVE_load_double, Tload);
-#elif defined(HAVE_NO_FLOATING_POINT)
+#elif defined(HAVE_NO_FLOATING_POINT) || defined(PS2LINUX)
        load_long(dst, src);
 #else
        ABORT();
@@ -2934,7 +2934,7 @@
 {
 #if defined(HAVE_store_double)
        slot_slot_lslot(0, dst, src, HAVE_store_double, Tstore);
-#elif defined(HAVE_NO_FLOATING_POINT)
+#elif defined(HAVE_NO_FLOATING_POINT) || defined(PS2LINUX)
        store_long(dst, src);
 #else
        ABORT();
@@ -3498,7 +3498,7 @@
 #if defined(HAVE_pusharg_double)
        lslot_lslot_const(0, src, idx, HAVE_pusharg_double, Tnull);
        argcount += pusharg_long_idx_inc;
-#elif defined(HAVE_NO_FLOATING_POINT)
+#elif defined(HAVE_NO_FLOATING_POINT) || defined(PS2LINUX)
        pusharg_long(src, idx);
 #else
        ABORT();
@@ -3800,7 +3800,7 @@
        begin_sync();
        end_sync();
 #endif
-#elif defined(HAVE_NO_FLOATING_POINT)
+#elif defined(HAVE_NO_FLOATING_POINT) || defined(PS2LINUX)
        return_long(dst);
 #else
        ABORT();
@@ -3868,7 +3868,7 @@
 
 #if defined(HAVE_returnarg_double)
        lslot_lslot_lslot(0, 0, src, HAVE_returnarg_double, Tcopy);
-#elif defined(HAVE_NO_FLOATING_POINT)
+#elif defined(HAVE_NO_FLOATING_POINT) || defined(PS2LINUX)
        returnarg_long(src);
 #else
        ABORT();
_______________________________________________
kaffe mailing list
[EMAIL PROTECTED]
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe

Reply via email to