diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-14 12:39:39 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-14 14:10:28 +0300 |
commit | 8d7de4dbf7732c6eb9e9853ad7c19c89075ace6f (patch) | |
tree | e6edfaad820279019bb0e2b705cbaee9086802c4 /cipher/poly1305-avx2-amd64.S | |
parent | b65e9e71d5ee992db5c96793c6af999545daad28 (diff) | |
download | libgcrypt-8d7de4dbf7732c6eb9e9853ad7c19c89075ace6f.tar.gz |
Enable AMD64 Poly1305 implementations on WIN64
* cipher/poly1305-avx2-amd64.S: Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(ELF): New macro to mask lines with ELF specific commands.
* cipher/poly1305-sse2-amd64.S: Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(ELF): New macro to mask lines with ELF specific commands.
* cipher/poly1305-internal.h (POLY1305_SYSV_FUNC_ABI): New.
(POLY1305_USE_SSE2, POLY1305_USE_AVX2): Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(OPS_FUNC_ABI): New.
(poly1305_ops_t): Use OPS_FUNC_ABI.
* cipher/poly1305.c (_gcry_poly1305_amd64_sse2_init_ext)
(_gcry_poly1305_amd64_sse2_finish_ext)
(_gcry_poly1305_amd64_sse2_blocks, _gcry_poly1305_amd64_avx2_init_ext)
(_gcry_poly1305_amd64_avx2_finish_ext)
(_gcry_poly1305_amd64_avx2_blocks, _gcry_poly1305_armv7_neon_init_ext)
(_gcry_poly1305_armv7_neon_finish_ext)
(_gcry_poly1305_armv7_neon_blocks, poly1305_init_ext_ref32)
(poly1305_blocks_ref32, poly1305_finish_ext_ref32)
(poly1305_init_ext_ref8, poly1305_blocks_ref8)
(poly1305_finish_ext_ref8): Use OPS_FUNC_ABI.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/poly1305-avx2-amd64.S')
-rw-r--r-- | cipher/poly1305-avx2-amd64.S | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/cipher/poly1305-avx2-amd64.S b/cipher/poly1305-avx2-amd64.S index 0ba7e761..9362a5ae 100644 --- a/cipher/poly1305-avx2-amd64.S +++ b/cipher/poly1305-avx2-amd64.S @@ -25,15 +25,23 @@ #include <config.h> -#if defined(__x86_64__) && defined(HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS) && \ +#if defined(__x86_64__) && (defined(HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS) || \ + defined(HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS)) && \ defined(ENABLE_AVX2_SUPPORT) +#ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS +# define ELF(...) __VA_ARGS__ +#else +# define ELF(...) /*_*/ +#endif + + .text .align 8 .globl _gcry_poly1305_amd64_avx2_init_ext -.type _gcry_poly1305_amd64_avx2_init_ext,@function; +ELF(.type _gcry_poly1305_amd64_avx2_init_ext,@function;) _gcry_poly1305_amd64_avx2_init_ext: .Lpoly1305_init_ext_avx2_local: xor %edx, %edx @@ -391,12 +399,12 @@ _gcry_poly1305_amd64_avx2_init_ext: popq %r13 popq %r12 ret -.size _gcry_poly1305_amd64_avx2_init_ext,.-_gcry_poly1305_amd64_avx2_init_ext; +ELF(.size _gcry_poly1305_amd64_avx2_init_ext,.-_gcry_poly1305_amd64_avx2_init_ext;) .align 8 .globl _gcry_poly1305_amd64_avx2_blocks -.type _gcry_poly1305_amd64_avx2_blocks,@function; +ELF(.type _gcry_poly1305_amd64_avx2_blocks,@function;) _gcry_poly1305_amd64_avx2_blocks: .Lpoly1305_blocks_avx2_local: vzeroupper @@ -717,12 +725,12 @@ _gcry_poly1305_amd64_avx2_blocks: leave addq $8, %rax ret -.size _gcry_poly1305_amd64_avx2_blocks,.-_gcry_poly1305_amd64_avx2_blocks; +ELF(.size _gcry_poly1305_amd64_avx2_blocks,.-_gcry_poly1305_amd64_avx2_blocks;) .align 8 .globl _gcry_poly1305_amd64_avx2_finish_ext -.type _gcry_poly1305_amd64_avx2_finish_ext,@function; +ELF(.type _gcry_poly1305_amd64_avx2_finish_ext,@function;) _gcry_poly1305_amd64_avx2_finish_ext: .Lpoly1305_finish_ext_avx2_local: vzeroupper @@ -949,6 +957,6 @@ _gcry_poly1305_amd64_avx2_finish_ext: popq %rbp addq $(8*5), %rax ret -.size _gcry_poly1305_amd64_avx2_finish_ext,.-_gcry_poly1305_amd64_avx2_finish_ext; +ELF(.size _gcry_poly1305_amd64_avx2_finish_ext,.-_gcry_poly1305_amd64_avx2_finish_ext;) #endif |