fixup for jit64 divwux: avoid trying to divide by 0

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5226 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2010-03-24 02:42:09 +00:00
parent 9fc6383a94
commit 6481b3d899
2 changed files with 6 additions and 0 deletions

View File

@ -479,6 +479,7 @@ void divwx(UGeckoInstruction _inst)
{
if (_inst.OE)
PanicAlert("OE: divwx");
// should set OV
//else PanicAlert("Div by zero", "divwx");
}
else
@ -497,6 +498,7 @@ void divwux(UGeckoInstruction _inst)
{
if (_inst.OE)
PanicAlert("OE: divwux");
// should set OV
//else PanicAlert("Div by zero", "divwux");
}
else

View File

@ -572,8 +572,12 @@ void Jit64::divwux(UGeckoInstruction inst)
MOV(32, R(EAX), gpr.R(a));
XOR(32, R(EDX), R(EDX));
gpr.KillImmediate(b);
CMP(32, gpr.R(b), R(EDX));
// doesn't handle if OE is set, but int doesn't either...
FixupBranch branch = J_CC(CC_Z);
DIV(32, gpr.R(b));
MOV(32, gpr.R(d), R(EAX));
SetJumpTarget(branch);
gpr.UnlockAll();
gpr.UnlockAllX();
if (inst.Rc) {