Skip to content

Commit

Permalink
Merge pull request tevador#201 from cryptonote-social/removecode
Browse files Browse the repository at this point in the history
remove unnecessary first-load initialization code
  • Loading branch information
tevador authored Jan 28, 2021
2 parents 5bfd021 + 529b933 commit a44d07c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
4 changes: 0 additions & 4 deletions src/jit_compiler_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,6 @@ namespace randomx {
registerUsage[i] = -1;
}

codePos = ((uint8_t*)randomx_program_prologue_first_load) - ((uint8_t*)randomx_program_prologue);
code[codePos + sizeof(REX_XOR_RAX_R64)] = 0xc0 + pcfg.readReg0;
code[codePos + sizeof(REX_XOR_RAX_R64) * 2 + 1] = 0xc0 + pcfg.readReg1;

codePos = prologueSize;
memcpy(code + codePos - 48, &pcfg.eMask, sizeof(pcfg.eMask));
memcpy(code + codePos, codeLoopLoad, loopLoadSize);
Expand Down
5 changes: 0 additions & 5 deletions src/jit_compiler_x86_static.S
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
.global DECL(randomx_prefetch_scratchpad)
.global DECL(randomx_prefetch_scratchpad_end)
.global DECL(randomx_program_prologue)
.global DECL(randomx_program_prologue_first_load)
.global DECL(randomx_program_loop_begin)
.global DECL(randomx_program_loop_load)
.global DECL(randomx_program_start)
Expand Down Expand Up @@ -88,10 +87,6 @@ DECL(randomx_program_prologue):
movapd xmm13, xmmword ptr [mantissaMask+rip]
movapd xmm14, xmmword ptr [exp240+rip]
movapd xmm15, xmmword ptr [scaleMask+rip]

DECL(randomx_program_prologue_first_load):
xor rax, r8
xor rax, r8
mov rdx, rax
and eax, RANDOMX_SCRATCHPAD_MASK
ror rdx, 32
Expand Down
10 changes: 2 additions & 8 deletions src/jit_compiler_x86_static.asm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ _RANDOMX_JITX86_STATIC SEGMENT PAGE READ EXECUTE
PUBLIC randomx_prefetch_scratchpad
PUBLIC randomx_prefetch_scratchpad_end
PUBLIC randomx_program_prologue
PUBLIC randomx_program_prologue_first_load
PUBLIC randomx_program_loop_begin
PUBLIC randomx_program_loop_load
PUBLIC randomx_program_start
Expand Down Expand Up @@ -75,17 +74,12 @@ randomx_program_prologue PROC
movapd xmm13, xmmword ptr [mantissaMask]
movapd xmm14, xmmword ptr [exp240]
movapd xmm15, xmmword ptr [scaleMask]
randomx_program_prologue ENDP

randomx_program_prologue_first_load PROC
xor rax, r8
xor rax, r8
mov rdx, rax
and eax, RANDOMX_SCRATCHPAD_MASK
ror rdx, 32
and edx, RANDOMX_SCRATCHPAD_MASK
jmp randomx_program_loop_begin
randomx_program_prologue_first_load ENDP
randomx_program_prologue ENDP

ALIGN 64
include asm/program_xmm_constants.inc
Expand Down Expand Up @@ -224,4 +218,4 @@ _RANDOMX_JITX86_STATIC ENDS

ENDIF

END
END
1 change: 0 additions & 1 deletion src/jit_compiler_x86_static.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ extern "C" {
void randomx_prefetch_scratchpad();
void randomx_prefetch_scratchpad_end();
void randomx_program_prologue();
void randomx_program_prologue_first_load();
void randomx_program_loop_begin();
void randomx_program_loop_load();
void randomx_program_start();
Expand Down

0 comments on commit a44d07c

Please sign in to comment.