From 672132eb84c8aa3e287d686c17721e0fc154021e Mon Sep 17 00:00:00 2001 From: Shawn Hoffman Date: Sat, 27 Mar 2010 19:48:34 +0000 Subject: [PATCH] fix setting of cr in jit64 for divwux (when div by 0) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5244 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp | 5 ++--- Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp | 1 + 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp index c27c2f32af..ae0dc998af 100644 --- a/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -505,10 +505,9 @@ void divwux(UGeckoInstruction _inst) m_GPR[_inst.RD] = 0; } else - { m_GPR[_inst.RD] = a / b; - if (_inst.Rc) Helper_UpdateCR0(m_GPR[_inst.RD]); - } + + if (_inst.Rc) Helper_UpdateCR0(m_GPR[_inst.RD]); } void mulhwx(UGeckoInstruction _inst) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp index 62c9c1f3fe..841f7c8d8c 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp @@ -649,6 +649,7 @@ void Jit64::divwux(UGeckoInstruction inst) // doesn't handle if OE is set, but int doesn't either... FixupBranch not_div_by_zero = J_CC(CC_NZ); MOV(32, gpr.R(d), Imm32(0)); + MOV(32, R(EAX), gpr.R(d)); FixupBranch end = J(); SetJumpTarget(not_div_by_zero); DIV(32, gpr.R(b));