RandomX optimizations

- Optimized soft AES code, up to +30% hashrate on CPU without AES support
- Added prefetch for the first dataset access, up to +0.1% hashrate
This commit is contained in:
SChernykh 2019-09-04 19:24:12 +02:00
parent a8c2e908a2
commit d3f98ef7bc
5 changed files with 171 additions and 335 deletions

View file

@ -12,6 +12,13 @@
mov rcx, rdi
mov rbp, qword ptr [rsi] ;# "mx", "ma"
mov rdi, qword ptr [rsi+8] ;# uint8_t* dataset
;# dataset prefetch for the first iteration of the main loop
mov rax, rbp
shr rax, 32
and eax, RANDOMX_DATASET_BASE_MASK
prefetchnta byte ptr [rdi+rax]
mov rsi, rdx ;# uint8_t* scratchpad
mov rax, rbp

View file

@ -24,6 +24,13 @@
push rcx ;# RegisterFile& registerFile
mov rbp, qword ptr [rdx] ;# "mx", "ma"
mov rdi, qword ptr [rdx+8] ;# uint8_t* dataset
;# dataset prefetch for the first iteration of the main loop
mov rax, rbp
shr rax, 32
and eax, RANDOMX_DATASET_BASE_MASK
prefetchnta byte ptr [rdi+rax]
mov rsi, r8 ;# uint8_t* scratchpad
mov rbx, r9 ;# loop counter