mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
Add JITTed version of subfex, disabled for now since it requires us to set the CR0 flag correctly, which I currently don't have working with 64bit build. It will improve performance in RE0 which will be nice. Can probably be done more efficiently as well
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5180 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -404,18 +404,71 @@ void Jit64::subfcx(UGeckoInstruction inst)
|
|||||||
void Jit64::subfex(UGeckoInstruction inst)
|
void Jit64::subfex(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
INSTRUCTION_START;
|
INSTRUCTION_START;
|
||||||
|
JITDISABLE(Integer)
|
||||||
Default(inst);
|
Default(inst);
|
||||||
return;
|
return;
|
||||||
/*
|
int a = inst.RA, b = inst.RB, d = inst.RD;
|
||||||
u32 a = m_GPR[_inst.RA];
|
gpr.FlushLockX(ECX);
|
||||||
u32 b = m_GPR[_inst.RB];
|
gpr.Lock(a, b, d);
|
||||||
int carry = GetCarry();
|
|
||||||
m_GPR[_inst.RD] = (~a) + b + carry;
|
|
||||||
SetCarry(Helper_Carry(~a, b) || Helper_Carry((~a) + b, carry));
|
|
||||||
|
|
||||||
if (_inst.OE) PanicAlert("OE: subfcx");
|
if(d != a && d != b)
|
||||||
if (_inst.Rc) Helper_UpdateCR0(m_GPR[_inst.RD]);
|
gpr.LoadToX64(d, false, true);
|
||||||
*/
|
else
|
||||||
|
gpr.LoadToX64(d, true, true);
|
||||||
|
|
||||||
|
MOV(32, R(EAX), gpr.R(b));
|
||||||
|
SUB(32, R(EAX), gpr.R(a));
|
||||||
|
MOV(32, gpr.R(d), R(EAX));
|
||||||
|
|
||||||
|
MOV(32, R(EAX), gpr.R(a));
|
||||||
|
MOV(32, R(ECX), gpr.R(b));
|
||||||
|
|
||||||
|
CMP(32, R(EAX), Imm8(0));
|
||||||
|
FixupBranch cpLesser = J_CC(CC_L);
|
||||||
|
FixupBranch cpGreater = J_CC(CC_G);
|
||||||
|
|
||||||
|
// Equal
|
||||||
|
JitSetCA();
|
||||||
|
FixupBranch continue1 = J();
|
||||||
|
|
||||||
|
// Lesser and greater
|
||||||
|
SetJumpTarget(cpGreater);
|
||||||
|
SetJumpTarget(cpLesser);
|
||||||
|
|
||||||
|
NEG(32, R(EAX));
|
||||||
|
NOT(32, R(ECX));
|
||||||
|
|
||||||
|
CMP(32, R(EAX), R(ECX));
|
||||||
|
FixupBranch pLesser = J_CC(CC_L);
|
||||||
|
FixupBranch pGreater = J_CC(CC_G);
|
||||||
|
|
||||||
|
// Equal
|
||||||
|
JitClearCA();
|
||||||
|
FixupBranch continue2 = J();
|
||||||
|
|
||||||
|
// Greater
|
||||||
|
SetJumpTarget(pGreater);
|
||||||
|
JitSetCA();
|
||||||
|
FixupBranch continue3 = J();
|
||||||
|
|
||||||
|
// Less than
|
||||||
|
SetJumpTarget(pLesser);
|
||||||
|
JitClearCA();
|
||||||
|
|
||||||
|
SetJumpTarget(continue1);
|
||||||
|
SetJumpTarget(continue2);
|
||||||
|
SetJumpTarget(continue3);
|
||||||
|
|
||||||
|
gpr.UnlockAll();
|
||||||
|
gpr.UnlockAllX();
|
||||||
|
if (inst.OE) PanicAlert("OE: subfcx");
|
||||||
|
if (inst.Rc) {
|
||||||
|
MOV(32, R(EAX), gpr.R(d));
|
||||||
|
CALL((u8*)asm_routines.computeRc);
|
||||||
|
|
||||||
|
// Doesn't yet work for 64bit machines
|
||||||
|
//CALL((u8*)asm_routines.computeCr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Jit64::subfx(UGeckoInstruction inst)
|
void Jit64::subfx(UGeckoInstruction inst)
|
||||||
|
Reference in New Issue
Block a user