Interpreter: Set the FPCC bits correctly for ordered/unordered FP compares

Setting the whole FPRF is slightly incorrect, this should only modify the FPCC bits; the class bit should be preserved.
This commit is contained in:
Lioncash 2015-02-21 22:56:22 -05:00
parent 09319a1e11
commit bfa5dcc891
1 changed files with 6 additions and 2 deletions

View File

@ -52,7 +52,9 @@ void Interpreter::Helper_FloatCompareOrdered(UGeckoInstruction _inst, double fa,
compareResult = FPCC::FE; compareResult = FPCC::FE;
} }
FPSCR.FPRF = compareResult; // Clear and set the FPCC bits accordingly.
FPSCR.FPRF = (FPSCR.FPRF & ~0xF) | compareResult;
SetCRField(_inst.CRFD, compareResult); SetCRField(_inst.CRFD, compareResult);
} }
@ -83,7 +85,9 @@ void Interpreter::Helper_FloatCompareUnordered(UGeckoInstruction _inst, double f
compareResult = FPCC::FE; compareResult = FPCC::FE;
} }
FPSCR.FPRF = compareResult; // Clear and set the FPCC bits accordingly.
FPSCR.FPRF = (FPSCR.FPRF & ~0xF) | compareResult;
SetCRField(_inst.CRFD, compareResult); SetCRField(_inst.CRFD, compareResult);
} }