[AArch64] Add an exception exit function with the exit location already in PC.

This will be used with idle skipping later.
This commit is contained in:
Ryan Houdek 2014-12-19 20:59:37 -06:00
parent 32eb0a9d68
commit 13b70c2fbd
2 changed files with 22 additions and 2 deletions

View File

@ -149,6 +149,25 @@ void JitArm64::WriteExceptionExit(ARM64Reg dest)
BR(EncodeRegTo64(dest));
}
void JitArm64::WriteExceptionExit()
{
DoDownCount();
ARM64Reg WA = gpr.GetReg();
ARM64Reg XA = EncodeRegTo64(WA);
LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(pc));
STR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(npc));
MOVI2R(XA, (u64)&PowerPC::CheckExceptions);
BLR(XA);
LDR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(npc));
STR(INDEX_UNSIGNED, WA, X29, PPCSTATE_OFF(pc));
MOVI2R(XA, (u64)asm_routines.dispatcher);
BR(XA);
gpr.Unlock(WA);
}
void JitArm64::WriteExitDestInR(ARM64Reg Reg)
{
STR(INDEX_UNSIGNED, Reg, X29, PPCSTATE_OFF(pc));

View File

@ -112,8 +112,9 @@ private:
// Exits
void WriteExit(u32 destination);
void WriteExceptionExit(ARM64Reg dest);
void WriteExitDestInR(ARM64Reg dest);
void WriteExceptionExit(Arm64Gen::ARM64Reg dest);
void WriteExceptionExit();
void WriteExitDestInR(Arm64Gen::ARM64Reg dest);
FixupBranch JumpIfCRFieldBit(int field, int bit, bool jump_if_set);