mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-08 15:20:45 +01:00
JitArm64_Integer: addzex - Optimize InPPCState case for 0
Before: 0x52800019 mov w25, #0x0 ; =0 0x394bd3b8 ldrb w24, [x29, #0x2f4] 0x2b180339 adds w25, w25, w24 After: 0x394bd3b9 ldrb w25, [x29, #0x2f4]
This commit is contained in:
parent
14641b06fc
commit
c817b4779d
@ -1129,13 +1129,21 @@ void JitArm64::addzex(UGeckoInstruction inst)
|
|||||||
|
|
||||||
int a = inst.RA, d = inst.RD;
|
int a = inst.RA, d = inst.RD;
|
||||||
|
|
||||||
if (gpr.IsImm(a) && HasConstantCarry())
|
if (gpr.IsImm(a) &&
|
||||||
|
(HasConstantCarry() || (js.carryFlag == CarryFlag::InPPCState && gpr.GetImm(a) == 0)))
|
||||||
{
|
{
|
||||||
const u32 imm = gpr.GetImm(a);
|
const u32 imm = gpr.GetImm(a);
|
||||||
const bool is_all_ones = imm == 0xFFFFFFFF;
|
const bool is_all_ones = imm == 0xFFFFFFFF;
|
||||||
|
|
||||||
switch (js.carryFlag)
|
switch (js.carryFlag)
|
||||||
{
|
{
|
||||||
|
case CarryFlag::InPPCState:
|
||||||
|
{
|
||||||
|
gpr.BindToRegister(d, false);
|
||||||
|
LDRB(IndexType::Unsigned, gpr.R(d), PPC_REG, PPCSTATE_OFF(xer_ca));
|
||||||
|
ComputeCarry(false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case CarryFlag::ConstantTrue:
|
case CarryFlag::ConstantTrue:
|
||||||
{
|
{
|
||||||
gpr.SetImmediate(d, imm + 1);
|
gpr.SetImmediate(d, imm + 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user