From 4ef14d36191c16b84ddc5cc51b9e8ec872a3b04b Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 27 Dec 2024 14:05:54 +0100 Subject: [PATCH] JitArm64: Document an assumption we've been making in EmitBackpatchRoutine The next commit will add another piece of code that depends on this assumption that we've been making. Good opportunity to document it. In practice, all callers of EmitBackpatchRoutine are locking X30. --- Source/Core/Core/PowerPC/JitArm64/Jit.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/JitArm64/Jit.h b/Source/Core/Core/PowerPC/JitArm64/Jit.h index 0c1ea0d647..8ca685b1d3 100644 --- a/Source/Core/Core/PowerPC/JitArm64/Jit.h +++ b/Source/Core/Core/PowerPC/JitArm64/Jit.h @@ -273,8 +273,11 @@ protected: // !emitting_routine && mode != AlwaysSlowAccess && !jo.fastmem: X30 // !emitting_routine && mode == Auto && jo.fastmem: X30 // - // Furthermore, any callee-saved register which isn't marked in gprs_to_push/fprs_to_push - // may be clobbered if mode != AlwaysFastAccess. + // Furthermore: + // - Any callee-saved register which isn't marked in gprs_to_push/fprs_to_push may be + // clobbered if mode != AlwaysFastAccess. + // - If !emitting_routine && mode != AlwaysFastAccess && jo.memcheck, X30 must not + // contain a guest register. void EmitBackpatchRoutine(u32 flags, MemAccessMode mode, Arm64Gen::ARM64Reg RS, Arm64Gen::ARM64Reg addr, BitSet32 gprs_to_push = BitSet32(0), BitSet32 fprs_to_push = BitSet32(0), bool emitting_routine = false);