* src/vm/jit/powerpc64/arch.h: Reenabled platfrom features.
authortbfg <none@none>
Sat, 2 Sep 2006 14:26:04 +0000 (14:26 +0000)
committertbfg <none@none>
Sat, 2 Sep 2006 14:26:04 +0000 (14:26 +0000)
* src/vm/jit/powerpc64/codegen.c (codegen): Fixed native calls.
(createnativestub): Likewise.

src/vm/jit/powerpc64/arch.h
src/vm/jit/powerpc64/codegen.c

index e3f1ada3ef92859c7cf213ca2fc010aa3c934ecb..9733024936c58b104282f25e7f067f7f82b7b23a 100644 (file)
@@ -28,7 +28,7 @@
 
    Changes:
 
-   $Id: arch.h 5261 2006-08-22 15:49:25Z tbfg $
+   $Id: arch.h 5285 2006-09-02 14:26:04Z tbfg $
 
 */
 
 
 #define USEBUILTINTABLE
 
-#define SUPPORT_DIVISION                 0
-#define SUPPORT_LONG                     0
-#define SUPPORT_FLOAT                    0
-#define SUPPORT_DOUBLE                   0
+#define SUPPORT_DIVISION                 1
+#define SUPPORT_LONG                     1
+#define SUPPORT_FLOAT                    1
+#define SUPPORT_DOUBLE                   1
 
 #define SUPPORT_FMOD                     0
 #define SUPPORT_FICVT                    0
 #define SUPPORT_IFCVT                    0
 
-#define SUPPORT_LONG_ADD                 0
-#define SUPPORT_LONG_CMP                 0
-#define SUPPORT_LONG_CMP_CONST           0
-#define SUPPORT_LONG_LOGICAL             0
-#define SUPPORT_LONG_SHIFT               0
-#define SUPPORT_LONG_MUL                 0
-#define SUPPORT_LONG_DIV                 0
-#define SUPPORT_LONG_ICVT                0
-#define SUPPORT_LONG_FCVT                0
+#define SUPPORT_LONG_ADD                 1
+#define SUPPORT_LONG_CMP                 1
+#define SUPPORT_LONG_CMP_CONST           1
+#define SUPPORT_LONG_LOGICAL             1
+#define SUPPORT_LONG_SHIFT               1
+#define SUPPORT_LONG_MUL                 1
+#define SUPPORT_LONG_DIV                 1
+#define SUPPORT_LONG_ICVT                1
+#define SUPPORT_LONG_FCVT                1
 
 #define SUPPORT_CONST_LOGICAL            0  /* AND, OR, XOR with immediates   */
 #define SUPPORT_CONST_MUL                0  /* mutiply with immediate         */
index 4ba0a436abe9ee70ff5a753dd67bb700b4ca17bd..662bb2e18aa549ae9a5c8e284ed883d7dcc9ff4d 100644 (file)
@@ -31,7 +31,7 @@
             Christian Ullrich
             Edwin Steiner
 
-   $Id: codegen.c 5283 2006-08-31 13:32:19Z tbfg $
+   $Id: codegen.c 5285 2006-09-02 14:26:04Z tbfg $
 
 */
 
@@ -121,7 +121,7 @@ bool codegen(jitdata *jd)
        /* space to save used callee saved registers */
 
        savedregs_num += (INT_SAV_CNT - rd->savintreguse);
-       savedregs_num += (FLT_SAV_CNT - rd->savfltreguse) * 2;
+       savedregs_num += (FLT_SAV_CNT - rd->savfltreguse);
 
        stackframesize = rd->memuse + savedregs_num;
 
@@ -152,7 +152,7 @@ bool codegen(jitdata *jd)
 /*             stackframesize = 0; */
 
        (void) dseg_addaddress(cd, code);                      /* CodeinfoPointer */
-       (void) dseg_adds4(cd, stackframesize * 4);             /* FrameSize       */
+       (void) dseg_adds4(cd, stackframesize * 8);             /* FrameSize       */
 
 #if defined(ENABLE_THREADS)
        /* IsSync contains the offset relative to the stack pointer for the
@@ -3707,8 +3707,9 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
        M_AST_INTERN(REG_ZERO, REG_SP, LA_LR_OFFSET);
        M_STDU(REG_SP, REG_SP, -(stackframesize * 8));
 
-       if (JITDATA_HAS_FLAG_VERBOSECALL(jd))
+       if (JITDATA_HAS_FLAG_VERBOSECALL(jd)) {
                emit_verbosecall_enter(jd);
+       }
 
        /* get function address (this must happen before the stackframeinfo) */
 
@@ -3757,6 +3758,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
        M_ALD(rd->argintregs[3], REG_SP, stackframesize * 8 + LA_LR_OFFSET);
        disp = dseg_addaddress(cd, codegen_start_native_call);
        M_ALD(REG_ITMP1, REG_PV, disp);
+       M_ALD(REG_ITMP1, REG_ITMP1, 0); /* FIXME what about TOC? */
        M_MTCTR(REG_ITMP1);
        M_JSR;
 
@@ -3846,6 +3848,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
        /* generate the actual native call */
 
        M_ALD(REG_ITMP3, REG_PV, funcdisp);
+       M_ALD(REG_ITMP3, REG_ITMP3, 0);         /* XXX what about TOC ? */
        M_MTCTR(REG_ITMP3);
        M_JSR;
 
@@ -3867,63 +3870,6 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
 
        if (JITDATA_HAS_FLAG_VERBOSECALL(jd)) {
                emit_verbosecall_exit(jd);
-#if 0
-                /* just restore the value we need, don't care about the other */
-
-               if (md->returntype.type != TYPE_VOID) {
-                       if (IS_INT_LNG_TYPE(md->returntype.type)) {
-                               M_LLD(REG_RESULT, REG_SP, LA_SIZE + PA_SIZE + 1 * 8);
-                       }
-                       else {
-                               if (IS_2_WORD_TYPE(md->returntype.type))
-                                       M_DLD(REG_FRESULT, REG_SP, LA_SIZE + PA_SIZE + 1 * 8);
-                               else
-                                       M_FLD(REG_FRESULT, REG_SP, LA_SIZE + PA_SIZE + 1 * 8);  /* FIXME, needed ? */
-                       }
-               }
-
-               M_LDA(REG_SP, REG_SP, -(LA_SIZE + PA_SIZE + (1 + 1 + 1 + 1) * 8));
-
-#if 0
-               /* keep this order */
-               switch (md->returntype.type) {
-               case TYPE_INT:
-               case TYPE_ADR:
-#if defined(__DARWIN__)
-                       M_MOV(REG_RESULT, rd->argintregs[2]);
-                       M_CLR(rd->argintregs[1]);
-#else
-                       M_MOV(REG_RESULT, rd->argintregs[3]);
-                       M_CLR(rd->argintregs[2]);
-#endif
-                       break;
-
-               case TYPE_LNG:
-#if defined(__DARWIN__)
-                       M_MOV(REG_RESULT, rd->argintregs[1]);
-#else
-                       M_MOV(REG_RESULT, rd->argintregs[2]);
-#endif
-                       break;
-               }
-#endif
-#endif
-               /* result as first argument for builtin_displaymethodstop */
-               M_MOV(REG_RESULT, rd->argintregs[1]);
-
-               M_FLTMOVE(REG_FRESULT, rd->argfltregs[0]);
-               M_FLTMOVE(REG_FRESULT, rd->argfltregs[1]);
-               disp = dseg_addaddress(cd, m);
-               M_ALD(rd->argintregs[0], REG_PV, disp);
-
-               disp = dseg_addaddress(cd, builtin_displaymethodstop);
-               /* call via function descriptor, XXX: what about TOC ? */
-               M_ALD(REG_ITMP2, REG_PV, disp);
-               M_ALD(REG_ITMP2, REG_ITMP2, 0);
-               M_MTCTR(REG_ITMP2);
-               M_JSR;
-
-               M_LDA(REG_SP, REG_SP, LA_SIZE + PA_SIZE + (1 + 1+ 1 + 1) * 8);
        }
 
        /* remove native stackframe info */
@@ -3931,6 +3877,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
        M_AADD_IMM(REG_SP, stackframesize * 8, rd->argintregs[0]);
        disp = dseg_addaddress(cd, codegen_finish_native_call);
        M_ALD(REG_ITMP1, REG_PV, disp);
+       M_ALD(REG_ITMP1, REG_ITMP1, 0); /* XXX what about TOC? */
        M_MTCTR(REG_ITMP1);
        M_JSR;
        M_MOV(REG_RESULT, REG_ITMP1_XPTR);
@@ -4035,7 +3982,7 @@ u1 *createnativestub(functionptr f, jitdata *jd, methoddesc *nmd)
                        /* move data segment displacement onto stack */
 
                        disp = dseg_adds4(cd, pref->disp);
-                       M_LLD(REG_ITMP3, REG_PV, disp);
+                       M_ILD(REG_ITMP3, REG_PV, disp);
                        M_IST(REG_ITMP3, REG_SP, 1 * 8);
 
                        /* move patcher function pointer onto stack */