mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-12-16 04:09:39 +00:00
Jit: Move srwx to ConstantPropagation
This commit is contained in:
parent
bb645e6cbb
commit
c136fd9807
@ -2204,12 +2204,7 @@ void Jit64::srwx(UGeckoInstruction inst)
|
|||||||
int b = inst.RB;
|
int b = inst.RB;
|
||||||
int s = inst.RS;
|
int s = inst.RS;
|
||||||
|
|
||||||
if (gpr.IsImm(b, s))
|
if (gpr.IsImm(b))
|
||||||
{
|
|
||||||
u32 amount = gpr.Imm32(b);
|
|
||||||
gpr.SetImmediate32(a, (amount & 0x20) ? 0 : (gpr.Imm32(s) >> (amount & 0x1f)));
|
|
||||||
}
|
|
||||||
else if (gpr.IsImm(b))
|
|
||||||
{
|
{
|
||||||
u32 amount = gpr.Imm32(b);
|
u32 amount = gpr.Imm32(b);
|
||||||
if (amount & 0x20)
|
if (amount & 0x20)
|
||||||
|
|||||||
@ -1836,15 +1836,7 @@ void JitArm64::srwx(UGeckoInstruction inst)
|
|||||||
|
|
||||||
int a = inst.RA, b = inst.RB, s = inst.RS;
|
int a = inst.RA, b = inst.RB, s = inst.RS;
|
||||||
|
|
||||||
if (gpr.IsImm(b) && gpr.IsImm(s))
|
if (gpr.IsImm(b))
|
||||||
{
|
|
||||||
u32 i = gpr.GetImm(s), amount = gpr.GetImm(b);
|
|
||||||
gpr.SetImmediate(a, (amount & 0x20) ? 0 : i >> (amount & 0x1F));
|
|
||||||
|
|
||||||
if (inst.Rc)
|
|
||||||
ComputeRC0(gpr.GetImm(a));
|
|
||||||
}
|
|
||||||
else if (gpr.IsImm(b))
|
|
||||||
{
|
{
|
||||||
u32 amount = gpr.GetImm(b);
|
u32 amount = gpr.GetImm(b);
|
||||||
if (amount & 0x20)
|
if (amount & 0x20)
|
||||||
|
|||||||
@ -398,6 +398,9 @@ ConstantPropagationResult ConstantPropagation::EvaluateTable31SB(UGeckoInstructi
|
|||||||
case 476: // nandx
|
case 476: // nandx
|
||||||
a = ~(s & b);
|
a = ~(s & b);
|
||||||
break;
|
break;
|
||||||
|
case 536: // srwx
|
||||||
|
a = u32(u64(s) >> (b & 0x3f));
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -413,7 +416,8 @@ ConstantPropagation::EvaluateTable31SBOneRegisterKnown(UGeckoInstruction inst, u
|
|||||||
|
|
||||||
switch (inst.SUBOP10)
|
switch (inst.SUBOP10)
|
||||||
{
|
{
|
||||||
case 24: // slwx
|
case 24: // slwx
|
||||||
|
case 536: // srwx
|
||||||
if (!known_reg_is_b && value == 0)
|
if (!known_reg_is_b && value == 0)
|
||||||
a = 0;
|
a = 0;
|
||||||
else if (known_reg_is_b && (value & 0x20))
|
else if (known_reg_is_b && (value & 0x20))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user