Jit64AsmCommon: Use PEXT in GenConvertDoubleToSingle

This commit is contained in:
MerryMage 2019-05-25 23:01:06 +01:00
parent 12314577c1
commit f6afce781f
1 changed files with 19 additions and 10 deletions

View File

@ -68,18 +68,27 @@ void CommonAsmRoutines::GenConvertDoubleToSingle()
// Don't Denormalize
// We want bits 0, 1
MOVAPD(XMM1, R(XMM0));
PAND(XMM1, MConst(double_top_two_bits));
PSRLQ(XMM1, 32);
if (cpu_info.bBMI2)
{
// Extract bits 0-1 and 5-34
MOV(64, R(RSCRATCH), Imm64(0xc7ffffffe0000000));
PEXT(64, RSCRATCH, RSCRATCH2, R(RSCRATCH));
}
else
{
// We want bits 0, 1
MOVAPD(XMM1, R(XMM0));
PAND(XMM1, MConst(double_top_two_bits));
PSRLQ(XMM1, 32);
// And 5 through to 34
PAND(XMM0, MConst(double_bottom_bits));
PSRLQ(XMM0, 29);
// And 5 through to 34
PAND(XMM0, MConst(double_bottom_bits));
PSRLQ(XMM0, 29);
// OR them togther
POR(XMM0, R(XMM1));
MOVD_xmm(R(RSCRATCH), XMM0);
// OR them togther
POR(XMM0, R(XMM1));
MOVD_xmm(R(RSCRATCH), XMM0);
}
RET();
// Denormalise