diff --git a/src/jit_compiler_a64_static.S b/src/jit_compiler_a64_static.S index bad9db88..ce1a690f 100644 --- a/src/jit_compiler_a64_static.S +++ b/src/jit_compiler_a64_static.S @@ -160,8 +160,8 @@ DECL(randomx_program_aarch64): mrs x8, fpcr rbit x8, x8 - # Save x0 - str x0, [sp, -16]! + # Save x0 and reserve stack space for light mode + str x0, [sp, -112]! # Read literals ldr x0, literal_x0 @@ -366,7 +366,7 @@ DECL(randomx_program_aarch64_update_spMix1): bne DECL(randomx_program_aarch64_main_loop) # Restore x0 - ldr x0, [sp], 16 + ldr x0, [sp], 112 # Store integer registers stp x4, x5, [x0, 0] @@ -398,9 +398,8 @@ DECL(randomx_program_aarch64_update_spMix1): ret DECL(randomx_program_aarch64_vm_instructions_end_light): - sub sp, sp, 96 - stp x0, x1, [sp, 64] - stp x2, x30, [sp, 80] + stp x0, x1, [sp, 80] + stp x2, x30, [sp, 96] # mx ^= r[readReg2] ^ r[readReg3]; eor x9, x9, x20 @@ -412,7 +411,7 @@ DECL(randomx_program_aarch64_vm_instructions_end_light): mov x0, x1 # x1 -> pointer to output - mov x1, sp + add x1, sp, 16 DECL(randomx_program_aarch64_light_cacheline_align_mask): # Actual mask will be inserted by JIT compiler @@ -428,10 +427,9 @@ DECL(randomx_program_aarch64_light_dataset_offset): bl rx_calc_dataset_item - mov x10, sp - ldp x0, x1, [sp, 64] - ldp x2, x30, [sp, 80] - add sp, sp, 96 + add x10, sp, 16 + ldp x0, x1, [sp, 80] + ldp x2, x30, [sp, 96] b rx_program_xor_with_dataset_line