Jit_Integer: srawx

This commit is contained in:
MerryMage 2018-10-15 21:01:14 +01:00
parent 32572dd639
commit 817fddf734
1 changed files with 23 additions and 20 deletions

View File

@ -1827,29 +1827,32 @@ void Jit64::srawx(UGeckoInstruction inst)
int b = inst.RB; int b = inst.RB;
int s = inst.RS; int s = inst.RS;
gpr.FlushLockX(ECX); {
gpr.Lock(a, s, b); RCX64Reg ecx = gpr.Scratch(ECX); // no register choice
gpr.BindToRegister(a, (a == s || a == b), true); RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
MOV(32, R(ECX), gpr.R(b)); RCOpArg Rb = gpr.Use(b, RCMode::Read);
RCOpArg Rs = gpr.Use(s, RCMode::Read);
RegCache::Realize(ecx, Ra, Rb, Rs);
MOV(32, ecx, Rb);
if (a != s) if (a != s)
MOV(32, gpr.R(a), gpr.R(s)); MOV(32, Ra, Rs);
SHL(64, gpr.R(a), Imm8(32)); SHL(64, Ra, Imm8(32));
SAR(64, gpr.R(a), R(ECX)); SAR(64, Ra, ecx);
if (js.op->wantsCA) if (js.op->wantsCA)
{ {
MOV(32, R(RSCRATCH), gpr.R(a)); MOV(32, R(RSCRATCH), Ra);
SHR(64, gpr.R(a), Imm8(32)); SHR(64, Ra, Imm8(32));
TEST(32, gpr.R(a), R(RSCRATCH)); TEST(32, Ra, R(RSCRATCH));
} }
else else
{ {
SHR(64, gpr.R(a), Imm8(32)); SHR(64, Ra, Imm8(32));
} }
FinalizeCarry(CC_NZ); FinalizeCarry(CC_NZ);
}
if (inst.Rc) if (inst.Rc)
ComputeRC(gpr.R(a)); ComputeRC(a);
gpr.UnlockAll();
gpr.UnlockAllX();
} }
void Jit64::srawix(UGeckoInstruction inst) void Jit64::srawix(UGeckoInstruction inst)