improve timings for S variants of multiply instructions on arm9

behavior seems to be a quirk of the way they made the interlock cycle mandatory
This commit is contained in:
Jaklyy
2024-07-12 22:46:22 -04:00
parent 4fcd52ed16
commit 789ef21c70
2 changed files with 70 additions and 24 deletions

View File

@ -272,12 +272,23 @@ public:
void AddCycles_CI(s32 numI) override
{
// code+internal
// code||internal
s32 numC = CodeCycles;
numI += 1;
Cycles += std::max(numC, numI);
}
void AddCycles_CIL(s32 numI, s32 numL)
{
// (code||internal)+forced interlock
// used by S variants of multiply instructions on the ARM9
// seems that instead of adding extra hardware logic to allow for handling the memory stage of the instructions during the execute stage
// it instead seems to force a two cycle interlock allowing for the interlocked cycle to be executed without any special logic + presumably an extra cycle to set flags
s32 numC = CodeCycles;
numI += 1;
Cycles += std::max(numC, numI) + numL;
}
void AddCycles_CDI_LDR() override;
void AddCycles_CDI_LDM() override;
void AddCycles_CDI_SWP() override { AddCycles_CD_STR(); } // uses the same behavior as str