1
0
mirror of https://github.com/xmrig/xmrig.git synced 2026-04-17 04:59:28 -04:00

Fixed initial dataset prefetch for RandomX v2

This commit is contained in:
SChernykh
2026-02-15 21:18:52 +01:00
parent 17aa97e543
commit 976a08efb4
4 changed files with 16 additions and 12 deletions

View File

@@ -61,6 +61,17 @@ namespace randomx {
# if defined(XMRIG_ARM) || defined(XMRIG_RISCV)
memcpy(reg.f, config.eMask, sizeof(config.eMask));
# endif
const uint8_t* p = mem.memory;
// dataset prefetch for the first iteration of the main loop
rx_prefetch_nta(p + (mem.ma & (RandomX_ConfigurationBase::DatasetBaseSize - 64)));
// dataset prefetch for the second iteration of the main loop (RandomX v2)
if (RandomX_CurrentConfig.Tweak_V2_PREFETCH) {
rx_prefetch_nta(p + (mem.mx & (RandomX_ConfigurationBase::DatasetBaseSize - 64)));
}
compiler.getProgramFunc()(reg, mem, scratchpad, RandomX_CurrentConfig.ProgramIterations);
}