Added recompiled versions of JMP, CALL, RET, PUSH and POP.
This commit is contained in:
parent
4ada3382b4
commit
f1df9be8f6
33 changed files with 1062 additions and 102 deletions
43
src/codegen_ops_helpers.h
Normal file
43
src/codegen_ops_helpers.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
static inline int LOAD_SP_WITH_OFFSET(ir_data_t *ir, int offset)
|
||||
{
|
||||
if (stack32)
|
||||
{
|
||||
if (offset)
|
||||
{
|
||||
uop_ADD_IMM(ir, IREG_eaaddr, IREG_ESP, offset);
|
||||
return IREG_eaaddr;
|
||||
}
|
||||
else
|
||||
return IREG_ESP;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (offset)
|
||||
{
|
||||
uop_ADD_IMM(ir, IREG_eaaddr_W, IREG_SP, offset);
|
||||
uop_MOVZX(ir, IREG_eaaddr, IREG_eaaddr_W);
|
||||
return IREG_eaaddr;
|
||||
}
|
||||
else
|
||||
{
|
||||
uop_MOVZX(ir, IREG_eaaddr, IREG_SP);
|
||||
return IREG_eaaddr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static inline void ADD_SP(ir_data_t *ir, int offset)
|
||||
{
|
||||
if (stack32)
|
||||
uop_ADD_IMM(ir, IREG_ESP, IREG_ESP, offset);
|
||||
else
|
||||
uop_ADD_IMM(ir, IREG_SP, IREG_SP, offset);
|
||||
}
|
||||
static inline void SUB_SP(ir_data_t *ir, int offset)
|
||||
{
|
||||
if (stack32)
|
||||
uop_SUB_IMM(ir, IREG_ESP, IREG_ESP, offset);
|
||||
else
|
||||
uop_SUB_IMM(ir, IREG_SP, IREG_SP, offset);
|
||||
}
|
||||
Loading…
Reference in a new issue