* mini-ppc.c, tramp-ppc.c: save FP arguments in the trampoline.
More FP-related fixes.
svn path=/trunk/mono/; revision=20668
+Mon Dec 1 16:54:05 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, tramp-ppc.c: save FP arguments in the trampoline.
+ More FP-related fixes.
+
+Sun Nov 30 19:13:52 CET 2003 Paolo Molaro <lupus@ximian.com>
+
+ * mini-ppc.c, cpu-g4.md, inssel-ppc.brg: fixed finally handlers
+ and register allocation buglet. Hello world now runs.
+
Fri Nov 28 23:03:05 CET 2003 Paolo Molaro <lupus@ximian.com>
* cpu-g4.md, inssel-ppc.brg, mini-ppc.c: better long return support.
Fri Nov 28 23:03:05 CET 2003 Paolo Molaro <lupus@ximian.com>
* cpu-g4.md, inssel-ppc.brg, mini-ppc.c: better long return support.
arg->opcode = OP_OUTARG_R8;
arg->unused = ainfo->reg;
call->used_fregs |= 1 << ainfo->reg;
arg->opcode = OP_OUTARG_R8;
arg->unused = ainfo->reg;
call->used_fregs |= 1 << ainfo->reg;
+ if (ainfo->size == 4) {
+ /* we reduce the precision */
+ MonoInst *conv;
+ MONO_INST_NEW (cfg, conv, OP_FCONV_TO_R4);
+ conv->inst_left = arg->inst_left;
+ arg->inst_left = conv;
+ }
} else {
g_assert_not_reached ();
}
} else {
g_assert_not_reached ();
}
ppc_li (code, ins->dreg, 0);
break;
case OP_FCGT:
ppc_li (code, ins->dreg, 0);
break;
case OP_FCGT:
- ppc_fcmpu (code, 0, ins->sreg1, ins->sreg2);
+ ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
ppc_li (code, ins->dreg, 1);
ppc_li (code, ins->dreg, 1);
- ppc_bc (code, PPC_BR_TRUE, PPC_BR_LT, 2);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_GT, 2);
ppc_li (code, ins->dreg, 0);
break;
case OP_FCGT_UN:
ppc_li (code, ins->dreg, 0);
break;
case OP_FCGT_UN:
- ppc_fcmpo (code, 0, ins->sreg1, ins->sreg2);
+ ppc_fcmpu (code, 0, ins->sreg1, ins->sreg2);
ppc_li (code, ins->dreg, 1);
ppc_li (code, ins->dreg, 1);
- ppc_bc (code, PPC_BR_TRUE, PPC_BR_LT, 2);
+ ppc_bc (code, PPC_BR_TRUE, PPC_BR_GT, 2);
ppc_li (code, ins->dreg, 0);
break;
case OP_FBEQ:
ppc_li (code, ins->dreg, 0);
break;
case OP_FBEQ:
}
/* Stack size for trampoline function */
}
/* Stack size for trampoline function */
+#define STACK (144 + 8*8)
/* Method-specific trampoline code framgment size */
#define METHOD_TRAMPOLINE_SIZE 64
/* Method-specific trampoline code framgment size */
#define METHOD_TRAMPOLINE_SIZE 64
guint8 *buf, *code = NULL;
static guint8* generic_jump_trampoline = NULL;
static guint8 *generic_class_init_trampoline = NULL;
guint8 *buf, *code = NULL;
static guint8* generic_jump_trampoline = NULL;
static guint8 *generic_class_init_trampoline = NULL;
switch (tramp_type) {
case MONO_TRAMPOLINE_GENERIC:
switch (tramp_type) {
case MONO_TRAMPOLINE_GENERIC:
/* Save 'method' pseudo-parameter - the one passed in r11 */
ppc_stw (buf, ppc_r11, STACK - 124, ppc_r1);
/* Save 'method' pseudo-parameter - the one passed in r11 */
ppc_stw (buf, ppc_r11, STACK - 124, ppc_r1);
+ /* Save the FP registers */
+ offset = 124 + 4 + 8;
+ for (i = ppc_f1; i <= ppc_f8; ++i) {
+ ppc_stfd (buf, i, STACK - offset, ppc_r1);
+ offset += 8;
+ }
+
/*----------------------------------------------------------
STEP 1: call 'mono_get_lmf_addr()' to get the address of our
LMF. We'll need to restore it after the call to
/*----------------------------------------------------------
STEP 1: call 'mono_get_lmf_addr()' to get the address of our
LMF. We'll need to restore it after the call to
ppc_lwz (buf, ppc_r9, STACK - 36, ppc_r1);
ppc_lwz (buf, ppc_r10, STACK - 40, ppc_r1);
ppc_lwz (buf, ppc_r9, STACK - 36, ppc_r1);
ppc_lwz (buf, ppc_r10, STACK - 40, ppc_r1);
+ /* Restore the FP registers */
+ offset = 124 + 4 + 8;
+ for (i = ppc_f1; i <= ppc_f8; ++i) {
+ ppc_lfd (buf, i, STACK - offset, ppc_r1);
+ offset += 8;
+ }
/* We haven't touched any of these, so there's no need to
restore them */
/*
/* We haven't touched any of these, so there's no need to
restore them */
/*