[DYNAREC] Fixe a speed regression introduced with 3fe020572d (for #3038)

This commit is contained in:
ptitSeb
2025-10-03 10:35:08 +02:00
parent c4c9f1b8cd
commit 5768989e54
5 changed files with 6 additions and 11 deletions

View File

@@ -147,7 +147,6 @@ void DynaRun(x64emu_t* emu)
// prepare setjump for signal handling
JUMPBUFF jmpbuf[1] = {0};
int skip = 0;
int need_tf = 0;
JUMPBUFF *old_jmpbuf = emu->jmpbuf;
#ifdef RV64
uintptr_t old_savesp = emu->xSPSave;
@@ -185,7 +184,7 @@ void DynaRun(x64emu_t* emu)
#ifdef DYNAREC
if(!BOX64ENV(dynarec))
#endif
Run(emu, 0, 0);
Run(emu, 0);
#ifdef DYNAREC
else {
int newis32bits = (emu->segs[_CS]==0x23);
@@ -217,8 +216,7 @@ void DynaRun(x64emu_t* emu)
}
if (BOX64ENV(dynarec_test))
emu->test.clean = 0;
Run(emu, 1, need_tf);
need_tf = 0;
Run(emu, 1);
} else {
dynarec_log(LOG_DEBUG, "%04d|Running DynaRec Block @%p (%p) of %d x64 insts (hash=0x%x) emu=%p\n", GetTID(), (void*)R_RIP, block->block, block->isize, block->hash, emu);
if(!BOX64ENV(dynarec_df)) {
@@ -226,9 +224,6 @@ void DynaRun(x64emu_t* emu)
}
// block is here, let's run it!
native_prolog(emu, block->block);
if(ACCESS_FLAG(F_TF) && !emu->quit)
need_tf = 1;
skip = 1;
}
if(emu->fork) {
int forktype = emu->fork;

View File

@@ -560,7 +560,7 @@ void EmuCall(x64emu_t* emu, uintptr_t addr)
PushExit(emu);
R_RIP = addr;
emu->df = d_none;
Run(emu, 0, 0);
Run(emu, 0);
emu->quit = 0; // reset Quit flags...
emu->df = d_none;
if(emu->flags.quitonlongjmp && emu->flags.longjmp) {

View File

@@ -32,7 +32,7 @@
int RunTest(x64test_t *test)
#else
int running32bits = 0;
int Run(x64emu_t *emu, int step, int need_tf)
int Run(x64emu_t *emu, int step)
#endif
{
uint8_t opcode;

View File

@@ -3,7 +3,7 @@
typedef struct x64emu_s x64emu_t;
int Run(x64emu_t *emu, int step, int need_tf);
int Run(x64emu_t *emu, int step);
void EmuCall(x64emu_t* emu, uintptr_t addr);
void StopEmu(x64emu_t* emu, const char* reason, int is32bits);
void DynaRun(x64emu_t *emu);

View File

@@ -364,7 +364,7 @@ void WINAPI BTCpuSimulate(void)
if (box64env.dynarec)
DynaRun(emu);
else
Run(emu, 0, 0);
Run(emu, 0);
}
NTSTATUS WINAPI BTCpuThreadInit(void)