Skip to content

Commit

Permalink
arm64jit: Use TBZ/TBNZ for fp branches.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownbrackets committed Dec 30, 2017
1 parent c71285c commit 3b4917a
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions Core/MIPS/ARM64/Arm64CompBranch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,19 +353,24 @@ void Arm64Jit::BranchFPFlag(MIPSOpcode op, CCFlags cc, bool likely) {
if (!likely && delaySlotIsNice)
CompileDelaySlot(DELAYSLOT_NICE);

// TODO: Maybe we could use TBZ here?
gpr.MapReg(MIPS_REG_FPCOND);
TSTI2R(gpr.R(MIPS_REG_FPCOND), 1, SCRATCH1);
Arm64Gen::FixupBranch ptr;
if (!likely) {
if (!delaySlotIsNice)
CompileDelaySlot(DELAYSLOT_SAFE_FLUSH);
else
FlushAll();
ptr = B(cc);
} else {
if (likely || delaySlotIsNice) {
// FlushAll() won't actually change the reg.
ARM64Reg ar = gpr.R(MIPS_REG_FPCOND);
FlushAll();
if (cc == CC_EQ) {
ptr = TBZ(ar, 0);
} else {
ptr = TBNZ(ar, 0);
}
} else {
TSTI2R(gpr.R(MIPS_REG_FPCOND), 1, SCRATCH1);
CompileDelaySlot(DELAYSLOT_SAFE_FLUSH);
ptr = B(cc);
}

if (likely) {
CompileDelaySlot(DELAYSLOT_FLUSH);
}

Expand Down

0 comments on commit 3b4917a

Please sign in to comment.