mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-24 23:03:35 +01:00
armjit: Tiny optimization for cast to short.
See these sometimes in code, skip the load of R0 when we can.
This commit is contained in:
1 parent
76305130ee
commit
628390f3fa
1 file changed
+6
-1
@@ -60,6 +60,11 @@ namespace MIPSComp
|
||||
Operand2 op2;
|
||||
if (TryMakeOperand2(uimm, op2)) {
|
||||
(this->*arith)(gpr.R(rt), gpr.R(rs), op2);
|
||||
#ifdef HAVE_ARMV7
|
||||
} else if (eval == &EvalAnd && uimm == 0xFFFF) {
|
||||
// This is common (e.g. a cast to a short.)
|
||||
UBFX(gpr.R(rt), gpr.R(rs), 0, 16);
|
||||
#endif
|
||||
} else {
|
||||
gpr.SetRegImm(R0, (u32)uimm);
|
||||
(this->*arith)(gpr.R(rt), gpr.R(rs), R0);
|
||||
@@ -115,7 +120,7 @@ namespace MIPSComp
|
||||
}
|
||||
break;
|
||||
|
||||
case 11: // R(rt) = R(rs) < uimm; break; //sltiu
|
||||
case 11: // R(rt) = R(rs) < suimm; break; //sltiu
|
||||
{
|
||||
if (gpr.IsImm(rs)) {
|
||||
gpr.SetImm(rt, gpr.GetImm(rs) < suimm ? 1 : 0);
|
||||
|
||||
Reference in new issue
Block a user