diff --git a/src/asm/program_prologue_linux.inc b/src/asm/program_prologue_linux.inc index bdde664..e487c58 100644 --- a/src/asm/program_prologue_linux.inc +++ b/src/asm/program_prologue_linux.inc @@ -12,8 +12,28 @@ mov rcx, rdi mov rbp, qword ptr [rsi] ;# "mx", "ma" mov rdi, qword ptr [rsi+8] ;# uint8_t* dataset - mov rsi, rdx ;# convertible_t* scratchpad + mov rsi, rdx ;# uint8_t* scratchpad - #include "program_prologue_load.inc" + mov rax, rbp + + ;# zero integer registers + xor r8, r8 + xor r9, r9 + xor r10, r10 + xor r11, r11 + xor r12, r12 + xor r13, r13 + xor r14, r14 + xor r15, r15 + + ;# load constant registers + lea rcx, [rcx+120] + movapd xmm8, xmmword ptr [rcx+72] + movapd xmm9, xmmword ptr [rcx+88] + movapd xmm10, xmmword ptr [rcx+104] + movapd xmm11, xmmword ptr [rcx+120] + movapd xmm13, xmmword ptr minDbl[rip] + movapd xmm14, xmmword ptr absMask[rip] + movapd xmm15, xmmword ptr signMask[rip] jmp DECL(randomx_program_loop_begin) \ No newline at end of file diff --git a/src/asm/program_prologue_win64.inc b/src/asm/program_prologue_win64.inc index b1da4d7..f91cca2 100644 --- a/src/asm/program_prologue_win64.inc +++ b/src/asm/program_prologue_win64.inc @@ -20,13 +20,33 @@ movdqu xmmword ptr [rsp+16], xmm14 movdqu xmmword ptr [rsp+0], xmm15 - ; function arguments - push rcx ; RegisterFile& registerFile - mov rbp, qword ptr [rdx] ; "mx", "ma" - mov rdi, qword ptr [rdx+8] ; uint8_t* dataset - mov rsi, r8 ; convertible_t* scratchpad - mov rbx, r9 ; loop counter + ;# function arguments + push rcx ;# RegisterFile& registerFile + mov rbp, qword ptr [rdx] ;# "mx", "ma" + mov rdi, qword ptr [rdx+8] ;# uint8_t* dataset + mov rsi, r8 ;# uint8_t* scratchpad + mov rbx, r9 ;# loop counter - include program_prologue_load.inc + mov rax, rbp + + ;# zero integer registers + xor r8, r8 + xor r9, r9 + xor r10, r10 + xor r11, r11 + xor r12, r12 + xor r13, r13 + xor r14, r14 + xor r15, r15 + + ;# load constant registers + lea rcx, [rcx+120] + movapd xmm8, xmmword ptr [rcx+72] + movapd xmm9, xmmword ptr [rcx+88] + movapd xmm10, xmmword ptr [rcx+104] + movapd xmm11, xmmword ptr [rcx+120] + movapd xmm13, xmmword ptr [minDbl] + movapd xmm14, xmmword ptr [absMask] + movapd xmm15, xmmword ptr [signMask] jmp randomx_program_loop_begin \ No newline at end of file