Minor armjit opt

This commit is contained in:
Henrik Rydgard 2013-01-30 20:01:26 +01:00
parent 6accbf81a3
commit c97f63a9d9
3 changed files with 19 additions and 10 deletions

View File

@ -83,18 +83,20 @@ void Jit::BranchRSRTComp(u32 op, ArmGen::CCFlags cc, bool likely)
gpr.ReleaseSpillLocks(); gpr.ReleaseSpillLocks();
CMP(gpr.R(rs), gpr.R(rt)); CMP(gpr.R(rs), gpr.R(rt));
} }
FlushAll();
ArmGen::FixupBranch ptr; ArmGen::FixupBranch ptr;
if (!likely) if (!likely)
{ {
if (!delaySlotIsNice) if (!delaySlotIsNice)
CompileDelaySlot(DELAYSLOT_SAFE_FLUSH); CompileDelaySlot(DELAYSLOT_SAFE_FLUSH);
else
FlushAll();
ptr = B_CC(cc); ptr = B_CC(cc);
} }
else else
{ {
ptr = B_CC(cc); FlushAll();
ptr = B_CC(cc);
CompileDelaySlot(DELAYSLOT_FLUSH); CompileDelaySlot(DELAYSLOT_FLUSH);
} }
@ -127,18 +129,20 @@ void Jit::BranchRSZeroComp(u32 op, ArmGen::CCFlags cc, bool andLink, bool likely
gpr.MapReg(rs); gpr.MapReg(rs);
CMP(gpr.R(rs), Operand2(0, TYPE_IMM)); CMP(gpr.R(rs), Operand2(0, TYPE_IMM));
FlushAll();
ArmGen::FixupBranch ptr; ArmGen::FixupBranch ptr;
if (!likely) if (!likely)
{ {
if (!delaySlotIsNice) if (!delaySlotIsNice)
CompileDelaySlot(DELAYSLOT_SAFE_FLUSH); CompileDelaySlot(DELAYSLOT_SAFE_FLUSH);
ptr = B_CC(cc); else
FlushAll();
ptr = B_CC(cc);
} }
else else
{ {
ptr = B_CC(cc); FlushAll();
ptr = B_CC(cc);
CompileDelaySlot(DELAYSLOT_FLUSH); CompileDelaySlot(DELAYSLOT_FLUSH);
} }

View File

@ -43,10 +43,12 @@ void ArmRegCache::Start(MIPSAnalyst::AnalysisResults &stats) {
} }
static const ARMReg *GetMIPSAllocationOrder(int &count) { static const ARMReg *GetMIPSAllocationOrder(int &count) {
// Note that R0 and R1 are reserved as scratch for now. We can probably free up R1 eventually. // Note that R0 is reserved as scratch for now.
// R1 could be used as it's only used for scratch outside "regalloc space" now.
// R12 is also potentially usable.
// R4-R7 are registers we could use for static allocation.
// R8 is used to preserve flags in nasty branches. // R8 is used to preserve flags in nasty branches.
// R9 and upwards are reserved for jit basics. // R9 and upwards are reserved for jit basics.
// Six allocated registers should be enough...
static const ARMReg allocationOrder[] = { static const ARMReg allocationOrder[] = {
R2, R3, R4, R5, R6, R7 R2, R3, R4, R5, R6, R7
}; };

View File

@ -152,21 +152,22 @@ void Jit::BranchRSRTComp(u32 op, Gen::CCFlags cc, bool likely)
gpr.BindToRegister(rs, true, false); gpr.BindToRegister(rs, true, false);
CMP(32, gpr.R(rs), rt == 0 ? Imm32(0) : gpr.R(rt)); CMP(32, gpr.R(rs), rt == 0 ? Imm32(0) : gpr.R(rt));
} }
FlushAll();
Gen::FixupBranch ptr; Gen::FixupBranch ptr;
if (!likely) if (!likely)
{ {
if (!delaySlotIsNice) if (!delaySlotIsNice)
CompileDelaySlot(DELAYSLOT_SAFE_FLUSH); CompileDelaySlot(DELAYSLOT_SAFE_FLUSH);
else
FlushAll();
ptr = J_CC(cc, true); ptr = J_CC(cc, true);
} }
else else
{ {
FlushAll();
ptr = J_CC(cc, true); ptr = J_CC(cc, true);
CompileDelaySlot(DELAYSLOT_FLUSH); CompileDelaySlot(DELAYSLOT_FLUSH);
} }
// Take the branch // Take the branch
CONDITIONAL_LOG_EXIT(targetAddr); CONDITIONAL_LOG_EXIT(targetAddr);
WriteExit(targetAddr, 0); WriteExit(targetAddr, 0);
@ -198,17 +199,19 @@ void Jit::BranchRSZeroComp(u32 op, Gen::CCFlags cc, bool andLink, bool likely)
gpr.BindToRegister(rs, true, false); gpr.BindToRegister(rs, true, false);
CMP(32, gpr.R(rs), Imm32(0)); CMP(32, gpr.R(rs), Imm32(0));
FlushAll();
Gen::FixupBranch ptr; Gen::FixupBranch ptr;
if (!likely) if (!likely)
{ {
if (!delaySlotIsNice) if (!delaySlotIsNice)
CompileDelaySlot(DELAYSLOT_SAFE_FLUSH); CompileDelaySlot(DELAYSLOT_SAFE_FLUSH);
else
FlushAll();
ptr = J_CC(cc, true); ptr = J_CC(cc, true);
} }
else else
{ {
FlushAll();
ptr = J_CC(cc, true); ptr = J_CC(cc, true);
CompileDelaySlot(DELAYSLOT_FLUSH); CompileDelaySlot(DELAYSLOT_FLUSH);
} }