Merge pull request #8992 from Sintendo/fselx-avx

Jit64: Avoid unnecessary MOVAPS instructions
This commit is contained in:
Tilka 2020-08-08 19:38:48 +01:00 committed by GitHub
commit 6d0bc03e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 3 deletions

View File

@ -437,8 +437,34 @@ void Jit64::fselx(UGeckoInstruction inst)
else
CMPSD(XMM0, Ra, CMP_NLE);
if (cpu_info.bSSE4_1)
if (cpu_info.bAVX)
{
X64Reg src1 = XMM1;
if (Rc.IsSimpleReg())
{
src1 = Rc.GetSimpleReg();
}
else
{
MOVAPD(XMM1, Rc);
}
if (packed)
{
VBLENDVPD(Rd, src1, Rb, XMM0);
return;
}
VBLENDVPD(XMM1, src1, Rb, XMM0);
}
else if (cpu_info.bSSE4_1)
{
if (packed && d == c)
{
BLENDVPD(Rd, Rb);
return;
}
MOVAPD(XMM1, Rc);
BLENDVPD(XMM1, Rb);
}

View File

@ -77,8 +77,7 @@ void CommonAsmRoutines::GenConvertDoubleToSingle()
else
{
// We want bits 0, 1
MOVAPD(XMM1, R(XMM0));
PAND(XMM1, MConst(double_top_two_bits));
avx_op(&XEmitter::VPAND, &XEmitter::PAND, XMM1, R(XMM0), MConst(double_top_two_bits));
PSRLQ(XMM1, 32);
// And 5 through to 34