mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-10-07 07:43:36 +00:00
Merge pull request #9817 from Sintendo/jit64subfic
Jit64: subfic - Optimize constants for d != a
This commit is contained in:
commit
b530d9b8c2
@ -898,10 +898,11 @@ void Jit64::subfic(UGeckoInstruction inst)
|
|||||||
RCX64Reg Rd = gpr.Bind(d, RCMode::Write);
|
RCX64Reg Rd = gpr.Bind(d, RCMode::Write);
|
||||||
RegCache::Realize(Ra, Rd);
|
RegCache::Realize(Ra, Rd);
|
||||||
|
|
||||||
if (d == a)
|
|
||||||
{
|
|
||||||
if (imm == 0)
|
if (imm == 0)
|
||||||
{
|
{
|
||||||
|
if (d != a)
|
||||||
|
MOV(32, Rd, Ra);
|
||||||
|
|
||||||
// Flags act exactly like subtracting from 0
|
// Flags act exactly like subtracting from 0
|
||||||
NEG(32, Rd);
|
NEG(32, Rd);
|
||||||
// Output carry is inverted
|
// Output carry is inverted
|
||||||
@ -909,18 +910,20 @@ void Jit64::subfic(UGeckoInstruction inst)
|
|||||||
}
|
}
|
||||||
else if (imm == -1)
|
else if (imm == -1)
|
||||||
{
|
{
|
||||||
|
if (d != a)
|
||||||
|
MOV(32, Rd, Ra);
|
||||||
|
|
||||||
NOT(32, Rd);
|
NOT(32, Rd);
|
||||||
// CA is always set in this case
|
// CA is always set in this case
|
||||||
FinalizeCarry(true);
|
FinalizeCarry(true);
|
||||||
}
|
}
|
||||||
else
|
else if (d == a)
|
||||||
{
|
{
|
||||||
NOT(32, Rd);
|
NOT(32, Rd);
|
||||||
ADD(32, Rd, Imm32(imm + 1));
|
ADD(32, Rd, Imm32(imm + 1));
|
||||||
// Output carry is normal
|
// Output carry is normal
|
||||||
FinalizeCarry(CC_C);
|
FinalizeCarry(CC_C);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
MOV(32, Rd, Imm32(imm));
|
MOV(32, Rd, Imm32(imm));
|
||||||
|
Loading…
Reference in New Issue
Block a user