From 3d740e81a2175075f39d103c60a789c589ef02f0 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Sun, 5 Jul 2020 16:06:59 +0200 Subject: [PATCH] RandomX: tweaked Ryzen code Very small speedup --- src/crypto/randomx/asm/program_read_dataset_ryzen.inc | 3 +-- src/crypto/randomx/randomx.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/crypto/randomx/asm/program_read_dataset_ryzen.inc b/src/crypto/randomx/asm/program_read_dataset_ryzen.inc index 6bb87c8f9..9a3aec3d1 100644 --- a/src/crypto/randomx/asm/program_read_dataset_ryzen.inc +++ b/src/crypto/randomx/asm/program_read_dataset_ryzen.inc @@ -1,13 +1,12 @@ mov rcx, rbp ;# ecx = ma shr rcx, 32 and ecx, RANDOMX_DATASET_BASE_MASK + xor r8, qword ptr [rdi+rcx] xor rbp, rax ;# modify "mx" - mov rax, qword ptr [rdi+rcx] mov edx, ebp ;# edx = mx and edx, RANDOMX_DATASET_BASE_MASK prefetchnta byte ptr [rdi+rdx] ror rbp, 32 ;# swap "ma" and "mx" - xor r8, rax xor r9, qword ptr [rdi+rcx+8] xor r10, qword ptr [rdi+rcx+16] xor r11, qword ptr [rdi+rcx+24] diff --git a/src/crypto/randomx/randomx.h b/src/crypto/randomx/randomx.h index e82a46c3e..96b67cd1c 100644 --- a/src/crypto/randomx/randomx.h +++ b/src/crypto/randomx/randomx.h @@ -121,7 +121,7 @@ struct RandomX_ConfigurationBase uint8_t codeShhPrefetchTweaked[20]; uint8_t codeReadDatasetTweaked[64]; uint32_t codeReadDatasetTweakedSize; - uint8_t codeReadDatasetRyzenTweaked[76]; + uint8_t codeReadDatasetRyzenTweaked[72]; uint32_t codeReadDatasetRyzenTweakedSize; uint8_t codeReadDatasetLightSshInitTweaked[68]; uint8_t codePrefetchScratchpadTweaked[32];