mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Optimizes ARMv7 andi{s,}_rc implementations.
Cuts down from a 3 instruction max implementation down to 1 instruction if the immediate can fit in to the instruction encoding.
This commit is contained in:
parent
64b09582c6
commit
86ca63658b
@ -275,7 +275,7 @@ void JitArm::arith(UGeckoInstruction inst)
|
|||||||
Imm[0] = gpr.GetImm(s);
|
Imm[0] = gpr.GetImm(s);
|
||||||
}
|
}
|
||||||
isImm[1] = true;
|
isImm[1] = true;
|
||||||
Imm[1] = inst.UIMM << (shiftedImm ? 16 : 0);
|
Imm[1] = inst.UIMM;
|
||||||
Rc = true;
|
Rc = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -364,7 +364,7 @@ void JitArm::arith(UGeckoInstruction inst)
|
|||||||
break;
|
break;
|
||||||
case 28:
|
case 28:
|
||||||
case 29:
|
case 29:
|
||||||
gpr.SetImmediate(a, And(Imm[0], Imm[1]));
|
gpr.SetImmediate(a, And(Imm[0], Imm[1] << (shiftedImm ? 16 : 0)));
|
||||||
dest = a;
|
dest = a;
|
||||||
break;
|
break;
|
||||||
case 31: // addcx, addx, subfx
|
case 31: // addcx, addx, subfx
|
||||||
@ -542,12 +542,22 @@ void JitArm::arith(UGeckoInstruction inst)
|
|||||||
{
|
{
|
||||||
dest = a;
|
dest = a;
|
||||||
gpr.BindToRegister(a, s == a);
|
gpr.BindToRegister(a, s == a);
|
||||||
ARMReg rA = gpr.GetReg();
|
|
||||||
RS = gpr.R(s);
|
RS = gpr.R(s);
|
||||||
RA = gpr.R(a);
|
RA = gpr.R(a);
|
||||||
MOVI2R(rA, Imm[1]);
|
|
||||||
ANDS(RA, RS, rA);
|
Operand2 imm_val;
|
||||||
gpr.Unlock(rA);
|
if (TryMakeOperand2(Imm[1] << (shiftedImm ? 16 : 0), imm_val))
|
||||||
|
{
|
||||||
|
AND(RA, RS, imm_val);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ARMReg rA = gpr.GetReg();
|
||||||
|
MOVI2R(rA, Imm[1]);
|
||||||
|
Operand2 rotated_reg(rA, ST_ROR, shiftedImm ? 16 : 0);
|
||||||
|
AND(RA, RS, rotated_reg);
|
||||||
|
gpr.Unlock(rA);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user