Jit64: fselx - Skip MOVSD (AVX)

For the non-packed variant of this instruction, a MOVSD instruction was
generated to copy only the lower 64 bits of XMM1 to the destination
register. This was done in order to keep the destination register's
upper half intact.

However, when register c and the destination register are the same,
there is no need for this copy. Because the registers match and due to
the way the mask is generated, VBLENDVPD will end up taking the upper
half from the destination register, as intended.

Before:
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

After:
66 0F 57 C0          xorpd       xmm0,xmm0
F2 41 0F C2 C6 06    cmpnlesd    xmm0,xmm14
C4 43 09 4B F2 00    vblendvpd   xmm14,xmm14,xmm10,xmm0
This commit is contained in:
Sintendo 2020-10-03 16:32:40 +02:00
parent a8df2caba9
commit 9ac324aed3
1 changed files with 1 additions and 1 deletions

View File

@ -449,7 +449,7 @@ void Jit64::fselx(UGeckoInstruction inst)
MOVAPD(XMM1, Rc);
}
if (packed)
if (d == c || packed)
{
VBLENDVPD(Rd, src1, Rb, XMM0);
return;