mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
Jit: Move srawix to ConstantPropagation
This commit is contained in:
parent
0b6b494b8b
commit
42d74f83db
Source/Core/Core/PowerPC
@ -2561,13 +2561,7 @@ void Jit64::srawix(UGeckoInstruction inst)
|
|||||||
int s = inst.RS;
|
int s = inst.RS;
|
||||||
int amount = inst.SH;
|
int amount = inst.SH;
|
||||||
|
|
||||||
if (gpr.IsImm(s))
|
if (amount != 0)
|
||||||
{
|
|
||||||
s32 imm = gpr.SImm32(s);
|
|
||||||
gpr.SetImmediate32(a, imm >> amount);
|
|
||||||
FinalizeCarry(amount != 0 && imm < 0 && (u32(imm) << (32 - amount)));
|
|
||||||
}
|
|
||||||
else if (amount != 0)
|
|
||||||
{
|
{
|
||||||
RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
|
RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
|
||||||
RCOpArg Rs = gpr.Use(s, RCMode::Read);
|
RCOpArg Rs = gpr.Use(s, RCMode::Read);
|
||||||
|
@ -757,17 +757,7 @@ void JitArm64::srawix(UGeckoInstruction inst)
|
|||||||
int amount = inst.SH;
|
int amount = inst.SH;
|
||||||
bool inplace_carry = CanMergeNextInstructions(1) && js.op[1].wantsCAInFlags;
|
bool inplace_carry = CanMergeNextInstructions(1) && js.op[1].wantsCAInFlags;
|
||||||
|
|
||||||
if (gpr.IsImm(s))
|
if (amount == 0)
|
||||||
{
|
|
||||||
s32 imm = (s32)gpr.GetImm(s);
|
|
||||||
gpr.SetImmediate(a, imm >> amount);
|
|
||||||
|
|
||||||
ComputeCarry(amount != 0 && (imm < 0) && (u32(imm) << (32 - amount)));
|
|
||||||
|
|
||||||
if (inst.Rc)
|
|
||||||
ComputeRC0(gpr.GetImm(a));
|
|
||||||
}
|
|
||||||
else if (amount == 0)
|
|
||||||
{
|
{
|
||||||
gpr.BindToRegister(a, a == s);
|
gpr.BindToRegister(a, a == s);
|
||||||
ARM64Reg RA = gpr.R(a);
|
ARM64Reg RA = gpr.R(a);
|
||||||
|
@ -144,6 +144,7 @@ ConstantPropagationResult ConstantPropagation::EvaluateTable31S(UGeckoInstructio
|
|||||||
if (!HasGPR(inst.RS))
|
if (!HasGPR(inst.RS))
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
|
std::optional<bool> carry;
|
||||||
u32 a;
|
u32 a;
|
||||||
const u32 s = GetGPR(inst.RS);
|
const u32 s = GetGPR(inst.RS);
|
||||||
|
|
||||||
@ -152,6 +153,10 @@ ConstantPropagationResult ConstantPropagation::EvaluateTable31S(UGeckoInstructio
|
|||||||
case 26: // cntlzwx
|
case 26: // cntlzwx
|
||||||
a = std::countl_zero(s);
|
a = std::countl_zero(s);
|
||||||
break;
|
break;
|
||||||
|
case 824: // srawix
|
||||||
|
a = s32(s) >> inst.SH;
|
||||||
|
carry = inst.SH != 0 && s32(s) < 0 && (s << (32 - inst.SH));
|
||||||
|
break;
|
||||||
case 922: // extshx
|
case 922: // extshx
|
||||||
a = s32(s16(s));
|
a = s32(s16(s));
|
||||||
break;
|
break;
|
||||||
@ -162,7 +167,9 @@ ConstantPropagationResult ConstantPropagation::EvaluateTable31S(UGeckoInstructio
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
return ConstantPropagationResult(inst.RA, a, inst.Rc);
|
ConstantPropagationResult result(ConstantPropagationResult(inst.RA, a, inst.Rc));
|
||||||
|
result.carry = carry;
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConstantPropagationResult ConstantPropagation::EvaluateTable31AB(UGeckoInstruction inst,
|
ConstantPropagationResult ConstantPropagation::EvaluateTable31AB(UGeckoInstruction inst,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user