Skip to content

Commit

Permalink
JitArm64: simplify fcmpX
Browse files Browse the repository at this point in the history
  • Loading branch information
Tilka committed Dec 16, 2015
1 parent 94f0e24 commit 659b42b
Showing 1 changed file with 6 additions and 29 deletions.
35 changes: 6 additions & 29 deletions Source/Core/Core/PowerPC/JitArm64/JitArm64_FloatingPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
Expand All @@ -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));

Expand Down

0 comments on commit 659b42b

Please sign in to comment.