mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Merge pull request #10040 from JosJuice/simplify-mcrfs
Interpreter: Simplify mcrfs implementation
This commit is contained in:
commit
c5becb4a7e
@ -565,34 +565,12 @@ void Interpreter::isync(UGeckoInstruction inst)
|
|||||||
void Interpreter::mcrfs(UGeckoInstruction inst)
|
void Interpreter::mcrfs(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
UpdateFPSCR(&FPSCR);
|
UpdateFPSCR(&FPSCR);
|
||||||
u32 fpflags = ((FPSCR.Hex >> (4 * (7 - inst.CRFS))) & 0xF);
|
const u32 shift = 4 * (7 - inst.CRFS);
|
||||||
switch (inst.CRFS)
|
const u32 fpflags = (FPSCR.Hex >> shift) & 0xF;
|
||||||
{
|
|
||||||
case 0:
|
// If any exception bits were read, clear them
|
||||||
FPSCR.FX = 0;
|
FPSCR.Hex &= ~((0xF << shift) & (FPSCR_FX | FPSCR_ANY_X));
|
||||||
FPSCR.OX = 0;
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
FPSCR.UX = 0;
|
|
||||||
FPSCR.ZX = 0;
|
|
||||||
FPSCR.XX = 0;
|
|
||||||
FPSCR.VXSNAN = 0;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
FPSCR.VXISI = 0;
|
|
||||||
FPSCR.VXIDI = 0;
|
|
||||||
FPSCR.VXZDZ = 0;
|
|
||||||
FPSCR.VXIMZ = 0;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
FPSCR.VXVC = 0;
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
FPSCR.VXSOFT = 0;
|
|
||||||
FPSCR.VXSQRT = 0;
|
|
||||||
FPSCR.VXCVI = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
PowerPC::ppcState.cr.SetField(inst.CRFD, fpflags);
|
PowerPC::ppcState.cr.SetField(inst.CRFD, fpflags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user