Optimized CFROUND

Shorter version using BMI2 instructionns
This commit is contained in:
SChernykh 2020-02-21 19:00:58 +01:00
parent 12081e4f5b
commit 131085be80
3 changed files with 35 additions and 1 deletions

View file

@ -279,7 +279,17 @@ void RandomX_ConfigurationBase::Apply()
INST_HANDLE(FDIV_M, FMUL_R);
INST_HANDLE(FSQRT_R, FDIV_M);
INST_HANDLE(CBRANCH, FSQRT_R);
INST_HANDLE(CFROUND, CBRANCH);
#if defined(_M_X64) || defined(__x86_64__)
if (xmrig::Cpu::info()->hasBMI2()) {
INST_HANDLE2(CFROUND, CFROUND_BMI2, CBRANCH);
}
else
#endif
{
INST_HANDLE(CFROUND, CBRANCH);
}
INST_HANDLE(ISTORE, CFROUND);
INST_HANDLE(NOP, ISTORE);
#undef INST_HANDLE