JitArm64: simplify fcmpX

This commit is contained in:
Tillmann Karras 2015-12-14 10:19:16 +01:00
parent 94f0e2493c
commit 659b42b614
1 changed files with 6 additions and 29 deletions

View File

@ -355,27 +355,12 @@ void JitArm64::fcmpX(UGeckoInstruction inst)
ARM64Reg WA = gpr.GetReg();
ARM64Reg XA = EncodeRegTo64(WA);
FixupBranch pNaN1, pNaN2, pNaN3, pLesser, pGreater;
FixupBranch pNaN, pLesser, pGreater;
FixupBranch continue1, continue2, continue3;
ORR(XA, ZR, 32, 0, true);
if (a != b)
{
m_float_emit.FCMP(EncodeRegToDouble(VA), EncodeRegToDouble(VA));
// if (B != B) or (A != A), goto NaN's jump target
pNaN1 = B(CC_NEQ);
m_float_emit.FCMP(EncodeRegToDouble(VB), EncodeRegToDouble(VB));
pNaN2 = B(CC_NEQ);
}
m_float_emit.FCMP(EncodeRegToDouble(VA), EncodeRegToDouble(VB));
if (a == b)
pNaN3 = B(CC_NEQ);
if (a != b)
{
// if B > A goto Greater's jump target
@ -384,18 +369,13 @@ void JitArm64::fcmpX(UGeckoInstruction inst)
pLesser = B(CC_MI);
}
pNaN = B(CC_VS);
// A == B
ORR(XA, XA, 64 - 63, 0, true);
continue1 = B();
if (a != b)
{
SetJumpTarget(pNaN1);
SetJumpTarget(pNaN2);
}
else
{
SetJumpTarget(pNaN3);
}
SetJumpTarget(pNaN);
ORR(XA, XA, 64 - 61, 0, true);
ORR(XA, XA, 0, 0, true);
@ -412,14 +392,11 @@ void JitArm64::fcmpX(UGeckoInstruction inst)
SetJumpTarget(pLesser);
ORR(XA, XA, 64 - 62, 1, true);
ORR(XA, XA, 0, 0, true);
}
SetJumpTarget(continue1);
if (a != b)
{
SetJumpTarget(continue2);
SetJumpTarget(continue3);
}
SetJumpTarget(continue1);
STR(INDEX_UNSIGNED, XA, X29, PPCSTATE_OFF(cr_val[0]) + (sizeof(PowerPC::ppcState.cr_val[0]) * crf));