From 4b6bad2f9e7fdf2b3ef2721167e6087728b5ea5e Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 20 Nov 2022 10:23:43 +0100 Subject: [PATCH] Jit64: Use MOV instead of ADD for updating imm Ra The old code would first MOV the old imm into Ra and then do an ADD. We can skip the ADD and just MOV the new imm. --- Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp | 4 ++-- Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp index 3bd24baa22..046a0d6d94 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStore.cpp @@ -505,10 +505,10 @@ void Jit64::stX(UGeckoInstruction inst) } else { - RCOpArg Ra = gpr.UseNoImm(a, RCMode::ReadWrite); + RCOpArg Ra = gpr.UseNoImm(a, RCMode::Write); RegCache::Realize(Ra); MemoryExceptionCheck(); - ADD(32, Ra, Imm32((u32)offset)); + MOV(32, Ra, Imm32(addr)); } } } diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp index 44cdd3c125..0af85a9f26 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_LoadStoreFloating.cpp @@ -144,10 +144,10 @@ void Jit64::stfXXX(UGeckoInstruction inst) } else { - RCOpArg Ra = gpr.UseNoImm(a, RCMode::ReadWrite); + RCOpArg Ra = gpr.UseNoImm(a, RCMode::Write); RegCache::Realize(Ra); MemoryExceptionCheck(); - ADD(32, Ra, Imm32((u32)imm)); + MOV(32, Ra, Imm32(addr)); } } return;