Jit_Integer: srawx: Handle a != b case with SARX
Suggested by @Sintendo Co-authored-by: Sintendo <bram.speeckaert@gmail.com>
This commit is contained in:
parent
d3ca5d812b
commit
71a996e33b
|
@ -2052,17 +2052,21 @@ void Jit64::srawx(UGeckoInstruction inst)
|
||||||
gpr.SetImmediate32(a, 0);
|
gpr.SetImmediate32(a, 0);
|
||||||
FinalizeCarry(false);
|
FinalizeCarry(false);
|
||||||
}
|
}
|
||||||
else if (cpu_info.bBMI2 && a != b)
|
else if (cpu_info.bBMI2)
|
||||||
{
|
{
|
||||||
RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
|
RCX64Reg Ra = gpr.Bind(a, RCMode::Write);
|
||||||
RCX64Reg Rb = gpr.Bind(b, RCMode::Read);
|
RCX64Reg Rb = gpr.Bind(b, RCMode::Read);
|
||||||
RCOpArg Rs = gpr.UseNoImm(s, RCMode::Read);
|
RCOpArg Rs = gpr.Use(s, RCMode::Read);
|
||||||
RegCache::Realize(Ra, Rb, Rs);
|
RegCache::Realize(Ra, Rb, Rs);
|
||||||
|
|
||||||
if (a != s)
|
X64Reg tmp = RSCRATCH;
|
||||||
MOV(32, Ra, Rs);
|
if (a == s && a != b)
|
||||||
SHL(64, Ra, Imm8(32));
|
tmp = Ra;
|
||||||
SARX(64, Ra, Ra, Rb);
|
else
|
||||||
|
MOV(32, R(tmp), Rs);
|
||||||
|
|
||||||
|
SHL(64, R(tmp), Imm8(32));
|
||||||
|
SARX(64, Ra, R(tmp), Rb);
|
||||||
if (js.op->wantsCA)
|
if (js.op->wantsCA)
|
||||||
{
|
{
|
||||||
MOV(32, R(RSCRATCH), Ra);
|
MOV(32, R(RSCRATCH), Ra);
|
||||||
|
|
Loading…
Reference in New Issue