Merge pull request #9747 from JosJuice/jitarm64-sync

JitArm64: Jump to dispatcher on downcount <= 0, not < 0
This commit is contained in:
JosJuice 2021-05-24 12:02:20 +02:00 committed by GitHub
commit ed331291d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -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);
@ -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);

View File

@ -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();