mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 22:56:52 +01:00
Jit: Move mulli to ConstantPropagation
This commit is contained in:
parent
4392ef174d
commit
3f12145f50
@ -1262,14 +1262,7 @@ void Jit64::mulli(UGeckoInstruction inst)
|
||||
int a = inst.RA, d = inst.RD;
|
||||
u32 imm = inst.SIMM_16;
|
||||
|
||||
if (gpr.IsImm(a))
|
||||
{
|
||||
gpr.SetImmediate32(d, gpr.Imm32(a) * imm);
|
||||
}
|
||||
else
|
||||
{
|
||||
MultiplyImmediate(imm, a, d, false);
|
||||
}
|
||||
MultiplyImmediate(imm, a, d, false);
|
||||
}
|
||||
|
||||
void Jit64::mullwx(UGeckoInstruction inst)
|
||||
|
@ -906,12 +906,7 @@ void JitArm64::mulli(UGeckoInstruction inst)
|
||||
|
||||
int a = inst.RA, d = inst.RD;
|
||||
|
||||
if (gpr.IsImm(a))
|
||||
{
|
||||
s32 i = (s32)gpr.GetImm(a);
|
||||
gpr.SetImmediate(d, i * inst.SIMM_16);
|
||||
}
|
||||
else if (MultiplyImmediate((u32)(s32)inst.SIMM_16, a, d, false))
|
||||
if (MultiplyImmediate((u32)(s32)inst.SIMM_16, a, d, false))
|
||||
{
|
||||
// Code is generated inside MultiplyImmediate, nothing to be done here.
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ ConstantPropagationResult ConstantPropagation::EvaluateInstruction(UGeckoInstruc
|
||||
{
|
||||
switch (inst.OPCD)
|
||||
{
|
||||
case 7: // mulli
|
||||
return EvaluateMulImm(inst);
|
||||
case 12: // addic
|
||||
case 13: // addic.
|
||||
return EvaluateAddImmCarry(inst);
|
||||
@ -60,6 +62,14 @@ ConstantPropagationResult ConstantPropagation::EvaluateInstruction(UGeckoInstruc
|
||||
}
|
||||
}
|
||||
|
||||
ConstantPropagationResult ConstantPropagation::EvaluateMulImm(UGeckoInstruction inst) const
|
||||
{
|
||||
if (!HasGPR(inst.RA))
|
||||
return {};
|
||||
|
||||
return ConstantPropagationResult(inst.RD, m_gpr_values[inst.RA] * inst.SIMM_16);
|
||||
}
|
||||
|
||||
ConstantPropagationResult ConstantPropagation::EvaluateAddImm(UGeckoInstruction inst) const
|
||||
{
|
||||
const s32 immediate = inst.OPCD & 1 ? inst.SIMM_16 << 16 : inst.SIMM_16;
|
||||
|
@ -77,6 +77,7 @@ public:
|
||||
void Clear() { m_gpr_values_known = BitSet32{}; }
|
||||
|
||||
private:
|
||||
ConstantPropagationResult EvaluateMulImm(UGeckoInstruction inst) const;
|
||||
ConstantPropagationResult EvaluateAddImm(UGeckoInstruction inst) const;
|
||||
ConstantPropagationResult EvaluateAddImmCarry(UGeckoInstruction inst) const;
|
||||
ConstantPropagationResult EvaluateRlwinmxRlwnmx(UGeckoInstruction inst, u32 shift) const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user