From Martin Storsjö:
* x86_64/machine.m4 (W64_ENTRY, W64_EXIT): New macros for
supporting W64 ABI.
+ * x86_64: Updated all assembly files to use them.
* configure.ac (W64_ABI): New variable, set when compiling for
W64 ABI (64-bit M$ windows).
.text
ALIGN(4)
PROLOGUE(_nettle_aes_decrypt)
+ W64_ENTRY(5, 0)
test PARAM_LENGTH, PARAM_LENGTH
jz .Lend
pop %rbp
pop %rbx
.Lend:
+ W64_EXIT(5, 0)
ret
EPILOGUE(_nettle_aes_decrypt)
.text
ALIGN(4)
PROLOGUE(_nettle_aes_encrypt)
+ W64_ENTRY(5, 0)
test PARAM_LENGTH, PARAM_LENGTH
jz .Lend
pop %rbp
pop %rbx
.Lend:
+ W64_EXIT(5, 0)
ret
EPILOGUE(_nettle_aes_encrypt)
ALIGN(4)
PROLOGUE(_nettle_camellia_crypt)
+ W64_ENTRY(5, 0)
test LENGTH, LENGTH
jz .Lend
pop %rbp
pop %rbx
.Lend:
+ W64_EXIT(5, 0)
ret
EPILOGUE(_nettle_camellia_crypt)
ALIGN(4)
PROLOGUE(memxor)
+ W64_ENTRY(3, 0)
mov %rdx, %r10
mov %rdi, %rdx
jmp .Lmemxor3_entry
ALIGN(4)
PROLOGUE(memxor3)
+ W64_ENTRY(4, 0)
C %cl needed for shift count, so move away N
mov %rcx, N
.Lmemxor3_entry:
xor (BP, N), TMP
mov TMP, (DST, N)
+ C ENTRY might have been 3 args, too, but it doesn't matter for the exit
+ W64_EXIT(4, 0)
ret
.Lfinal:
jnc .Lfinal_loop
.Ldone:
+ C ENTRY might have been 3 args, too, but it doesn't matter for the exit
+ W64_EXIT(4, 0)
ret
ifelse(USE_SSE2, yes, <
movdqu (BP), %xmm1
pxor %xmm0, %xmm1
movdqa %xmm1, (DST)
+ C ENTRY might have been 3 args, too, but it doesn't matter for the exit
+ W64_EXIT(4, 0)
ret
>)
ALIGN(4)
PROLOGUE(nettle_serpent_decrypt)
C save all registers that need to be saved
+ W64_ENTRY(4, 13)
push %rbx
push %rbp
push %r12
pop %r12
pop %rbp
pop %rbx
+ W64_EXIT(4, 13)
ret
ALIGN(4)
PROLOGUE(nettle_serpent_encrypt)
C save all registers that need to be saved
+ W64_ENTRY(4, 13)
push %rbx
push %rbp
push %r12
pop %r12
pop %rbp
pop %rbx
+ W64_EXIT(4, 13)
ret
ALIGN(4)
PROLOGUE(_nettle_sha1_compress)
C save all registers that need to be saved
+ W64_ENTRY(2, 0)
sub $68, %rsp C %rsp = W
addl SE, 16(STATE)
add $68, %rsp
+ W64_EXIT(2, 0)
ret
EPILOGUE(_nettle_sha1_compress)