Commit 1b3e0686 authored by Martin Storsjö's avatar Martin Storsjö Committed by Niels Möller

Updated x86_64 assembler for W64 support.

Rev: nettle/ChangeLog:1.242
Rev: nettle/x86_64/aes-decrypt-internal.asm:1.4
Rev: nettle/x86_64/aes-encrypt-internal.asm:1.11
Rev: nettle/x86_64/camellia-crypt-internal.asm:1.3
Rev: nettle/x86_64/memxor.asm:1.4
Rev: nettle/x86_64/serpent-decrypt.asm:1.4
Rev: nettle/x86_64/serpent-encrypt.asm:1.6
Rev: nettle/x86_64/sha1-compress.asm:1.3
parent f6afb987
......@@ -3,6 +3,7 @@
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).
......
......@@ -55,6 +55,7 @@ define(<TMP>,<%rbp>)
.text
ALIGN(4)
PROLOGUE(_nettle_aes_decrypt)
W64_ENTRY(5, 0)
test PARAM_LENGTH, PARAM_LENGTH
jz .Lend
......@@ -129,5 +130,6 @@ PROLOGUE(_nettle_aes_decrypt)
pop %rbp
pop %rbx
.Lend:
W64_EXIT(5, 0)
ret
EPILOGUE(_nettle_aes_decrypt)
......@@ -55,6 +55,7 @@ define(<TMP>,<%rbp>)
.text
ALIGN(4)
PROLOGUE(_nettle_aes_encrypt)
W64_ENTRY(5, 0)
test PARAM_LENGTH, PARAM_LENGTH
jz .Lend
......@@ -129,5 +130,6 @@ PROLOGUE(_nettle_aes_encrypt)
pop %rbp
pop %rbx
.Lend:
W64_EXIT(5, 0)
ret
EPILOGUE(_nettle_aes_encrypt)
......@@ -125,6 +125,7 @@ C xorl XREG(TMP), XREG($1)
ALIGN(4)
PROLOGUE(_nettle_camellia_crypt)
W64_ENTRY(5, 0)
test LENGTH, LENGTH
jz .Lend
......@@ -182,5 +183,6 @@ PROLOGUE(_nettle_camellia_crypt)
pop %rbp
pop %rbx
.Lend:
W64_EXIT(5, 0)
ret
EPILOGUE(_nettle_camellia_crypt)
......@@ -40,6 +40,7 @@ define(<USE_SSE2>, <no>)
ALIGN(4)
PROLOGUE(memxor)
W64_ENTRY(3, 0)
mov %rdx, %r10
mov %rdi, %rdx
jmp .Lmemxor3_entry
......@@ -50,6 +51,7 @@ EPILOGUE(memxor)
ALIGN(4)
PROLOGUE(memxor3)
W64_ENTRY(4, 0)
C %cl needed for shift count, so move away N
mov %rcx, N
.Lmemxor3_entry:
......@@ -200,6 +202,8 @@ C jz .Ldone
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:
......@@ -214,6 +218,8 @@ C jz .Ldone
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, <
......@@ -247,6 +253,8 @@ 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
>)
......
......@@ -525,6 +525,7 @@ define(<WLTI>, <
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
......@@ -697,4 +698,5 @@ PROLOGUE(nettle_serpent_decrypt)
pop %r12
pop %rbp
pop %rbx
W64_EXIT(4, 13)
ret
......@@ -552,6 +552,7 @@ define(<WLT>, <
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
......@@ -732,4 +733,5 @@ C parallell.
pop %r12
pop %rbp
pop %rbx
W64_EXIT(4, 13)
ret
......@@ -126,6 +126,7 @@ C adding, and then rotating back.
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
......@@ -250,5 +251,6 @@ PROLOGUE(_nettle_sha1_compress)
addl SE, 16(STATE)
add $68, %rsp
W64_EXIT(2, 0)
ret
EPILOGUE(_nettle_sha1_compress)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment