mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
Jit64: subfic - Handle constants
Occurs surprisingly often. Prevents generating silly code like this: BE 03 00 00 00 mov esi,3 83 EE 08 sub esi,8 0F 93 45 58 setae byte ptr [rbp+58h]
This commit is contained in:
parent
6ddf69d094
commit
2e4e2ad1ff
@ -862,13 +862,20 @@ void Jit64::subfic(UGeckoInstruction inst)
|
|||||||
{
|
{
|
||||||
INSTRUCTION_START
|
INSTRUCTION_START
|
||||||
JITDISABLE(bJITIntegerOff);
|
JITDISABLE(bJITIntegerOff);
|
||||||
int a = inst.RA, d = inst.RD;
|
int a = inst.RA, d = inst.RD, imm = inst.SIMM_16;
|
||||||
|
|
||||||
|
if (gpr.IsImm(a))
|
||||||
|
{
|
||||||
|
u32 i = imm, j = gpr.Imm32(a);
|
||||||
|
gpr.SetImmediate32(d, i - j);
|
||||||
|
FinalizeCarry(j == 0 || (i > j - 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RCOpArg Ra = gpr.Use(a, RCMode::Read);
|
RCOpArg Ra = gpr.Use(a, RCMode::Read);
|
||||||
RCX64Reg Rd = gpr.Bind(d, RCMode::Write);
|
RCX64Reg Rd = gpr.Bind(d, RCMode::Write);
|
||||||
RegCache::Realize(Ra, Rd);
|
RegCache::Realize(Ra, Rd);
|
||||||
|
|
||||||
int imm = inst.SIMM_16;
|
|
||||||
if (d == a)
|
if (d == a)
|
||||||
{
|
{
|
||||||
if (imm == 0)
|
if (imm == 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user