Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9747 from JosJuice/jitarm64-sync
JitArm64: Jump to dispatcher on downcount <= 0, not < 0
  • Loading branch information
JosJuice committed May 24, 2021
2 parents 96c1f62 + 86d2c2a commit ed33129
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Source/Core/Core/PowerPC/JitArm64/JitArm64Cache.cpp
Expand Up @@ -34,7 +34,7 @@ void JitArm64BlockCache::WriteLinkBlock(Arm64Gen::ARM64XEmitter& emit,
// The "fast" BL must be the third instruction. So just use the former two to inline the
// downcount check here. It's better to do this near jump before the long jump to the other
// block.
FixupBranch fast_link = emit.B(CC_PL);
FixupBranch fast_link = emit.B(CC_GT);
emit.BL(dest->checkedEntry);
emit.SetJumpTarget(fast_link);
emit.BL(dest->normalEntry);
Expand All @@ -45,13 +45,13 @@ void JitArm64BlockCache::WriteLinkBlock(Arm64Gen::ARM64XEmitter& emit,
s64 distance = ((s64)dest->normalEntry - (s64)emit.GetCodePtr()) >> 2;
if (distance >= -0x40000 && distance <= 0x3FFFF)
{
emit.B(CC_PL, dest->normalEntry);
emit.B(CC_GT, dest->normalEntry);
emit.B(dest->checkedEntry);
emit.BRK(101);
return;
}

FixupBranch fast_link = emit.B(CC_PL);
FixupBranch fast_link = emit.B(CC_GT);
emit.B(dest->checkedEntry);
emit.SetJumpTarget(fast_link);
emit.B(dest->normalEntry);
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/Core/PowerPC/JitArm64/JitAsm.cpp
Expand Up @@ -80,8 +80,7 @@ void JitArm64::GenerateAsm()

// Downcount Check
// The result of slice decrementation should be in flags if somebody jumped here
// IMPORTANT - We jump on negative, not carry!!!
FixupBranch bail = B(CC_MI);
FixupBranch bail = B(CC_LE);

dispatcher_no_check = GetCodePtr();

Expand Down

0 comments on commit ed33129

Please sign in to comment.