Skip to content

Commit 414183d

Browse files
committed
simx86: no need to use TheCPU.eip for far jmp/call/int
We can use eax instead of storing and then reloading.
1 parent d18f5fa commit 414183d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/base/emu-i386/simx86/interp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,9 +323,9 @@ static unsigned int JumpGen(unsigned int P2, unsigned int Interp_LONG_CS,
323323
Gen(JMP_LINK, mode, j_t, InstrMeta[0].npc);
324324
break;
325325
case RETl: case RETlisp: case IRET: // far ret, indirect
326-
case JMPli: case CALLli: case INT: // far jmp/call, indirect
327326
Gen(L_REG, mode, Ofs_EIP);
328327
/* fall through */
328+
case JMPli: case CALLli: case INT: // far jmp/call, indirect
329329
case RET: case RETisp: case JMPi: case CALLi: // ret, indirect
330330
Gen(JMP_INDIRECT, mode);
331331
break;
@@ -1733,7 +1733,7 @@ intop3b: { int op = ArOpsFR[D_MO(opc)];
17331733
Gen(O_PUSHI, _mode, PC + 2 - Interp_LONG_CS);
17341734
Gen(L_LXS2, _mode);
17351735
AddrGen(A_SR_SH4, _mode, Ofs_CS, Ofs_XCS);
1736-
Gen(L_LXS1, _mode, Ofs_EIP);
1736+
Gen(L_DI_R1, _mode);
17371737
PC = JumpGen(PC, Interp_LONG_CS, _mode, opc, 2);
17381738
if (debug_level('e')>1)
17391739
dbug_printf("EMU86: directly called int %#x ax=%#x at %#x:%#x\n",
@@ -2205,7 +2205,7 @@ intop3b: { int op = ArOpsFR[D_MO(opc)];
22052205
Gen(O_PUSH, _mode);
22062206
Gen(O_PUSHI, _mode, oip);
22072207
}
2208-
Gen(L_LXS1, _mode, Ofs_EIP);
2208+
Gen(L_DI_R1, _mode);
22092209
PC = JumpGen(PC, Interp_LONG_CS, _mode,
22102210
(opc<<8)|REG1, len);
22112211
if (debug_level('e')>2) {

0 commit comments

Comments
 (0)