Wow. I can't believe I got away for months without saving RBP.

Should fix linux crashes with 64-bit DRC.
This commit is contained in:
Aaron Giles 2008-01-09 06:35:07 +00:00
parent 90e0297191
commit 29f2a7862a

View File

@ -521,9 +521,10 @@ void drc_append_restore_sse_rounding(drc_core *drc)
static void append_entry_point(drc_core *drc) static void append_entry_point(drc_core *drc)
{ {
int pushbytes = 8 * (5 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE)); int pushbytes = 8 * (6 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE));
/* save non-volatile registers */ /* save non-volatile registers */
emit_push_r64(DRCTOP, REG_DRC); // push drc
emit_push_r64(DRCTOP, REG_NV0); // push nv0 emit_push_r64(DRCTOP, REG_NV0); // push nv0
emit_push_r64(DRCTOP, REG_NV1); // push nv1 emit_push_r64(DRCTOP, REG_NV1); // push nv1
emit_push_r64(DRCTOP, REG_NV2); // push nv2 emit_push_r64(DRCTOP, REG_NV2); // push nv2
@ -561,7 +562,7 @@ static void append_entry_point(drc_core *drc)
static void append_exit_point(drc_core *drc) static void append_exit_point(drc_core *drc)
{ {
int pushbytes = 8 * (5 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE)); int pushbytes = 8 * (6 + (REG_NV5 != REG_NONE) + (REG_NV6 != REG_NONE));
/* on exit, P1 must contain the final PC */ /* on exit, P1 must contain the final PC */
emit_mov_m32_r32(DRCTOP, MDRC(drc->pcptr), REG_P1); // mov [pc],p1 emit_mov_m32_r32(DRCTOP, MDRC(drc->pcptr), REG_P1); // mov [pc],p1
@ -580,6 +581,7 @@ static void append_exit_point(drc_core *drc)
emit_pop_r64(DRCTOP, REG_NV2); // pop nv2 emit_pop_r64(DRCTOP, REG_NV2); // pop nv2
emit_pop_r64(DRCTOP, REG_NV1); // pop nv1 emit_pop_r64(DRCTOP, REG_NV1); // pop nv1
emit_pop_r64(DRCTOP, REG_NV0); // pop nv0 emit_pop_r64(DRCTOP, REG_NV0); // pop nv0
emit_pop_r64(DRCTOP, REG_DRC); // pop drc
emit_ret(DRCTOP); // ret emit_ret(DRCTOP); // ret
} }