From 13b70c2fbd384f81376052f7e16ce138a98aea02 Mon Sep 17 00:00:00 2001 From: Ryan Houdek Date: Fri, 19 Dec 2014 20:59:37 -0600 Subject: [PATCH] [AArch64] Add an exception exit function with the exit location already in PC. This will be used with idle skipping later. --- Source/Core/Core/PowerPC/JitArm64/Jit.cpp | 19 +++++++++++++++++++ Source/Core/Core/PowerPC/JitArm64/Jit.h | 5 +++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp index 8367fcca4e..acb772d422 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.cpp @@ -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)); diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.h b/Source/Core/Core/PowerPC/JitArm64/Jit.h index d52e7c5ba4..d8bde7dcfc 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.h +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.h @@ -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);