Jit64: fselx - Add AVX path

AVX has a four-operand VBLENDVPD instruction, which allows for the first
input and the destination to be different. By taking advantage of this,
we no longer need to copy one of the inputs around and we can just
reference it directly, provided it's already in a register (I have yet
to see this not be the case).

Before:
66 0F 57 C0          xorpd       xmm0,xmm0
F2 41 0F C2 C6 06    cmpnlesd    xmm0,xmm14
41 0F 28 CE          movaps      xmm1,xmm14
66 41 0F 38 15 CA    blendvpd    xmm1,xmm10,xmm0
F2 44 0F 10 F1       movsd       xmm14,xmm1

After:
66 0F 57 C0          xorpd       xmm0,xmm0
F2 41 0F C2 C6 06    cmpnlesd    xmm0,xmm14
C4 C3 09 4B CA 00    vblendvpd   xmm1,xmm14,xmm10,xmm0
F2 44 0F 10 F1       movsd       xmm14,xmm1
This commit is contained in:
Sintendo 2020-07-21 22:46:10 +02:00
parent b5d97561be
commit a52774ca63
1 changed files with 15 additions and 1 deletions

View File

@ -437,7 +437,21 @@ void Jit64::fselx(UGeckoInstruction inst)
else else
CMPSD(XMM0, Ra, CMP_NLE); 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);
}
VBLENDVPD(XMM1, src1, Rb, XMM0);
}
else if (cpu_info.bSSE4_1)
{ {
MOVAPD(XMM1, Rc); MOVAPD(XMM1, Rc);
BLENDVPD(XMM1, Rb); BLENDVPD(XMM1, Rb);