diff --git a/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.h b/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.h index 62968b19d..3ef984bff 100644 --- a/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.h +++ b/FEXCore/Source/Interface/Core/ArchHelpers/Arm64Emitter.h @@ -84,7 +84,8 @@ constexpr uint64_t EC_CODE_BITMAP_MAX_ADDRESS = 1ULL << 47; #endif // Will force one single instruction block to be generated first if set when entering the JIT filling SRA. -constexpr auto ENTRY_FILL_SRA_SINGLE_INST_REG = TMP1; +// FillStaticRegs must preserve this +constexpr auto ENTRY_FILL_SRA_SINGLE_INST_REG = TMP2; // Predicate to use in the X87 SVE optimization constexpr ARMEmitter::PRegister PRED_X87_SVEOPT = ARMEmitter::PReg::p2; diff --git a/Source/Windows/ARM64EC/Module.S b/Source/Windows/ARM64EC/Module.S index dcb01943c..499facf5a 100644 --- a/Source/Windows/ARM64EC/Module.S +++ b/Source/Windows/ARM64EC/Module.S @@ -49,7 +49,7 @@ BeginSimulation: bl "#SyncThreadContext" ldr x17, [x18, #0x1788] // TEB->ChpeV2CpuAreaInfo ldr x16, [x17, #0x48] // ChpeV2CpuAreaInfo->EmulatorData[3] - DispatcherLoopTopEnterECFillSRA - mov x10, #0 // Zero ENTRY_FILL_SRA_SINGLE_INST_REG to avoid single step + mov x11, #0 // Zero ENTRY_FILL_SRA_SINGLE_INST_REG to avoid single step br x16 // DispatcherLoopTopEnterECFillSRA(SingleInst:x10, CPUArea:x17) // Called into by FEXCore diff --git a/Source/Windows/ARM64EC/Module.cpp b/Source/Windows/ARM64EC/Module.cpp index c842e0d01..69c482c4b 100644 --- a/Source/Windows/ARM64EC/Module.cpp +++ b/Source/Windows/ARM64EC/Module.cpp @@ -716,7 +716,7 @@ bool ResetToConsistentStateImpl(EXCEPTION_RECORD* Exception, CONTEXT* GuestConte Thread->CurrentFrame->State.rip, FaultAddress); NativeContext->Pc = CPUArea.DispatcherLoopTopEnterECFillSRA(); NativeContext->Sp = CPUArea.EmulatorStackBase(); - NativeContext->X10 = 1; // Set ENTRY_FILL_SRA_SINGLE_INST_REG to force a single step + NativeContext->X11 = 1; // Set ENTRY_FILL_SRA_SINGLE_INST_REG to force a single step NativeContext->X17 = reinterpret_cast(CPUArea.Area); // Set EC_ENTRY_CPUAREA_REG } else { LogMan::Msg::DFmt("Handled self-modifying code: pc: {:X} fault: {:X}", NativeContext->Pc, FaultAddress);