Jit64: really fix fmrx regression

This is more tricky than I thought!
This commit is contained in:
Tillmann Karras 2013-11-21 05:31:55 +01:00
parent 011fe86d01
commit ff91789773

View File

@ -224,15 +224,26 @@ void Jit64::fmrx(UGeckoInstruction inst)
{ {
INSTRUCTION_START INSTRUCTION_START
JITDISABLE(bJITFloatingPointOff) JITDISABLE(bJITFloatingPointOff)
if (inst.Rc) { if (inst.Rc)
{
Default(inst); return; Default(inst); return;
} }
int d = inst.FD; int d = inst.FD;
int b = inst.FB; int b = inst.FB;
if (d != b) { if (d != b)
{
fpr.Lock(b, d); fpr.Lock(b, d);
// we don't need to load d, but if it already is, it must be marked as dirty
if (fpr.IsBound(d))
{
fpr.BindToRegister(d); fpr.BindToRegister(d);
MOVSD(fpr.RX(d), fpr.R(b)); }
fpr.BindToRegister(b, true, false);
// caveat: the order of ModRM:r/m, ModRM:reg is deliberate!
// "MOVSD reg, mem" zeros out the upper half of the destination register
MOVSD(fpr.R(d), fpr.RX(b));
fpr.UnlockAll(); fpr.UnlockAll();
} }
} }