mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
x64Emitter: J_CC: use 32 bit offset automatically
This commit is contained in:
parent
3a06907653
commit
f8280401f6
@ -447,27 +447,25 @@ FixupBranch XEmitter::J_CC(CCFlags conditionCode, bool force5bytes)
|
||||
return branch;
|
||||
}
|
||||
|
||||
void XEmitter::J_CC(CCFlags conditionCode, const u8 * addr, bool force5Bytes)
|
||||
void XEmitter::J_CC(CCFlags conditionCode, const u8* addr)
|
||||
{
|
||||
u64 fn = (u64)addr;
|
||||
if (!force5Bytes)
|
||||
s64 distance = (s64)(fn - ((u64)code + 2));
|
||||
if (distance < -0x80 || distance >= 0x80)
|
||||
{
|
||||
s64 distance = (s64)(fn - ((u64)code + 2));
|
||||
_assert_msg_(DYNA_REC, distance >= -0x80 && distance < 0x80, "Jump target too far away, needs force5Bytes = true");
|
||||
//8 bits will do
|
||||
Write8(0x70 + conditionCode);
|
||||
Write8((u8)(s8)distance);
|
||||
}
|
||||
else
|
||||
{
|
||||
s64 distance = (s64)(fn - ((u64)code + 6));
|
||||
distance = (s64)(fn - ((u64)code + 6));
|
||||
_assert_msg_(DYNA_REC,
|
||||
distance >= -0x80000000LL && distance < 0x80000000LL,
|
||||
"Jump target too far away, needs indirect register");
|
||||
"Jump target too far away, needs indirect register");
|
||||
Write8(0x0F);
|
||||
Write8(0x80 + conditionCode);
|
||||
Write32((u32)(s32)distance);
|
||||
}
|
||||
else
|
||||
{
|
||||
Write8(0x70 + conditionCode);
|
||||
Write8((u8)(s8)distance);
|
||||
}
|
||||
}
|
||||
|
||||
void XEmitter::SetJumpTarget(const FixupBranch &branch)
|
||||
|
@ -331,7 +331,7 @@ public:
|
||||
|
||||
FixupBranch J_CC(CCFlags conditionCode, bool force5bytes = false);
|
||||
//void J_CC(CCFlags conditionCode, JumpTarget target);
|
||||
void J_CC(CCFlags conditionCode, const u8 * addr, bool force5Bytes = false);
|
||||
void J_CC(CCFlags conditionCode, const u8* addr);
|
||||
|
||||
void SetJumpTarget(const FixupBranch &branch);
|
||||
|
||||
|
@ -168,7 +168,7 @@ void Jit64AsmRoutineManager::Generate()
|
||||
SetJumpTarget(noExtException);
|
||||
|
||||
TEST(32, M((void*)PowerPC::GetStatePtr()), Imm32(0xFFFFFFFF));
|
||||
J_CC(CC_Z, outerLoop, true);
|
||||
J_CC(CC_Z, outerLoop);
|
||||
|
||||
//Landing pad for drec space
|
||||
ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
||||
|
@ -769,7 +769,7 @@ void VertexLoader::CompileVertexTranslator()
|
||||
SUB(32, M(&loop_counter), Imm8(1));
|
||||
#endif
|
||||
|
||||
J_CC(CC_NZ, loop_start, true);
|
||||
J_CC(CC_NZ, loop_start);
|
||||
ABI_PopAllCalleeSavedRegsAndAdjustStack();
|
||||
RET();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user