Jit_Integer: negx

This commit is contained in:
MerryMage 2018-10-15 21:01:10 +01:00
parent 42614ede16
commit 4a97f31aa2
1 changed files with 10 additions and 9 deletions

View File

@ -1725,25 +1725,26 @@ void Jit64::negx(UGeckoInstruction inst)
int a = inst.RA; int a = inst.RA;
int d = inst.RD; int d = inst.RD;
if (gpr.R(a).IsImm()) if (gpr.IsImm(a))
{ {
gpr.SetImmediate32(d, ~(gpr.R(a).Imm32()) + 1); gpr.SetImmediate32(d, ~(gpr.Imm32(a)) + 1);
if (inst.OE) if (inst.OE)
GenerateConstantOverflow(gpr.R(d).Imm32() == 0x80000000); GenerateConstantOverflow(gpr.Imm32(d) == 0x80000000);
} }
else else
{ {
gpr.Lock(a, d); RCOpArg Ra = gpr.Use(a, RCMode::Read);
gpr.BindToRegister(d, a == d, true); RCX64Reg Rd = gpr.Bind(d, RCMode::Write);
RegCache::Realize(Ra, Rd);
if (a != d) if (a != d)
MOV(32, gpr.R(d), gpr.R(a)); MOV(32, Rd, Ra);
NEG(32, gpr.R(d)); NEG(32, Rd);
if (inst.OE) if (inst.OE)
GenerateOverflow(); GenerateOverflow();
} }
if (inst.Rc) if (inst.Rc)
ComputeRC(gpr.R(d), false); ComputeRC(d, false);
gpr.UnlockAll();
} }
void Jit64::srwx(UGeckoInstruction inst) void Jit64::srwx(UGeckoInstruction inst)