From 3a942d6ceaf409874906408edc3e47de20157198 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Tue, 17 May 2011 21:26:00 +0200 Subject: [PATCH] Portability cleanups for assembler backend. --- src/lj_asm.c | 6 +++--- src/lj_emit_x86.h | 5 +++-- src/lj_target_x86.h | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lj_asm.c b/src/lj_asm.c index 37b7e3f5..e2c14872 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c @@ -987,7 +987,7 @@ static void asm_head_root(ASMState *as) { int32_t spadj; asm_head_root_base(as); - emit_setgli(as, vmstate, (int32_t)as->T->traceno); + emit_setvmstate(as, (int32_t)as->T->traceno); spadj = asm_stack_adjust(as); as->T->spadjust = (uint16_t)spadj; emit_spsub(as, spadj); @@ -1082,7 +1082,7 @@ static void asm_head_side(ASMState *as) } /* Store trace number and adjust stack frame relative to the parent. */ - emit_setgli(as, vmstate, (int32_t)as->T->traceno); + emit_setvmstate(as, (int32_t)as->T->traceno); emit_spsub(as, spdelta); /* Restore target registers from parent spill slots. */ @@ -1169,7 +1169,7 @@ static void asm_tail_link(ASMState *as) pc = retpc; } emit_loada(as, RID_DISPATCH, J2GG(as->J)->dispatch); - emit_loada(as, RID_PC, pc); + emit_loada(as, RID_LPC, pc); mres = (int32_t)(snap->nslots - baseslot); switch (bc_op(*pc)) { case BC_CALLM: case BC_CALLMT: diff --git a/src/lj_emit_x86.h b/src/lj_emit_x86.h index c781e3d3..6c06184d 100644 --- a/src/lj_emit_x86.h +++ b/src/lj_emit_x86.h @@ -261,8 +261,9 @@ static void emit_movmroi(ASMState *as, Reg base, int32_t ofs, int32_t i) emit_rma(as, (xo), (r), (void *)&J2G(as->J)->field) #define emit_getgl(as, r, field) emit_opgl(as, XO_MOV, (r), field) #define emit_setgl(as, r, field) emit_opgl(as, XO_MOVto, (r), field) -#define emit_setgli(as, field, i) \ - (emit_i32(as, i), emit_opgl(as, XO_MOVmi, 0, field)) + +#define emit_setvmstate(as, i) \ + (emit_i32(as, i), emit_opgl(as, XO_MOVmi, 0, vmstate)) /* mov r, i / xor r, r */ static void emit_loadi(ASMState *as, Reg r, int32_t i) diff --git a/src/lj_target_x86.h b/src/lj_target_x86.h index fd2a32fe..34b247d4 100644 --- a/src/lj_target_x86.h +++ b/src/lj_target_x86.h @@ -43,10 +43,10 @@ enum { /* These definitions must match with the *.dasc file(s): */ RID_BASE = RID_EDX, /* Interpreter BASE. */ #if LJ_64 && !LJ_ABI_WIN - RID_PC = RID_EBX, /* Interpreter PC. */ + RID_LPC = RID_EBX, /* Interpreter PC. */ RID_DISPATCH = RID_R14D, /* Interpreter DISPATCH table. */ #else - RID_PC = RID_ESI, /* Interpreter PC. */ + RID_LPC = RID_ESI, /* Interpreter PC. */ RID_DISPATCH = RID_EBX, /* Interpreter DISPATCH table. */ #endif