Handle NaN in fselx. Fixes issue 4106.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7200 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2011-02-19 09:56:54 +00:00
parent 050dcad9f8
commit 1f5d54f5a6
1 changed files with 3 additions and 1 deletions

View File

@ -242,7 +242,9 @@ void Interpreter::fnegx(UGeckoInstruction _inst)
void Interpreter::fselx(UGeckoInstruction _inst)
{
rPS0(_inst.FD) = (rPS0(_inst.FA) >= -0.0) ? rPS0(_inst.FC) : rPS0(_inst.FB);
// D = (A >= 0) ? C : B
rPS0(_inst.FD) = (rPS0(_inst.FA) < 0.0 || riPS0(_inst.FA) == PPC_NAN_U64) ?
rPS0(_inst.FB) : rPS0(_inst.FC);
// This is a binary instruction. Does not alter FPSCR
if (_inst.Rc) Helper_UpdateCR1(rPS0(_inst.FD));
}