From 5ac0c33530b1e9362d7c002b838179da89de1d03 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Sun, 7 Sep 2008 07:04:41 +0000 Subject: [PATCH] Fixed "bcl" instruction in the case where the branch is always taken. The old code would emit a "jne" that can skip the updating of LR depending on the state the host CPU happens to be in. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@451 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/Jit64/Jit_Branch.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Branch.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Branch.cpp index 41cc76b644..ce5e2b2533 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Branch.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Branch.cpp @@ -161,7 +161,7 @@ namespace Jit64 if (doFullTest) { - TEST(32, R(EAX), R(ECX)); + TEST(32, R(EAX), R(ECX)); branch = CC_Z; } else @@ -176,7 +176,11 @@ namespace Jit64 { SUB(32, M(&CTR), Imm8(1)); } - FixupBranch skip = J_CC(branch); + FixupBranch skip; + if (inst.BO != 20) + { + skip = J_CC(branch); + } u32 destination; if (inst.LK) MOV(32, M(&LR), Imm32(js.compilerPC + 4)); @@ -185,8 +189,11 @@ namespace Jit64 else destination = js.compilerPC + SignExt16(inst.BD << 2); WriteExit(destination, 0); - SetJumpTarget(skip); - WriteExit(js.compilerPC + 4, 1); + if (inst.BO != 20) + { + SetJumpTarget(skip); + WriteExit(js.compilerPC + 4, 1); + } } void bcctrx(UGeckoInstruction inst)