Add Dataset prefetch in interpreted VM (#52)

- to formally match the specification
- a small increase in interpreted mining speed (~4%)
This commit is contained in:
tevador
2019-06-10 16:00:04 +02:00
committed by GitHub
parent eb6f6bb041
commit 52aa36249e
3 changed files with 8 additions and 0 deletions
+6
View File
@@ -246,6 +246,7 @@ namespace randomx {
mem.mx ^= r[config.readReg2] ^ r[config.readReg3];
mem.mx &= CacheLineAlignMask;
datasetPrefetch(datasetOffset + mem.mx);
datasetRead(datasetOffset + mem.ma, r);
std::swap(mem.mx, mem.ma);
@@ -279,6 +280,11 @@ namespace randomx {
r[i] ^= datasetLine[i];
}
template<class Allocator, bool softAes>
void InterpretedVm<Allocator, softAes>::datasetPrefetch(uint64_t address) {
rx_prefetch_nta(mem.memory + address);
}
#include "instruction_weights.hpp"
template<class Allocator, bool softAes>