diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-14 13:33:07 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2015-05-14 13:43:57 +0300 |
commit | 9a4fb3709864bf3e3918800d44ff576590cd4e92 (patch) | |
tree | f5d7b5ea5a7117d5871f8e598e71b921e6d96caa /cipher/camellia-aesni-avx-amd64.S | |
parent | e05682093ffb003b589a697428d918d755ac631d (diff) | |
download | libgcrypt-9a4fb3709864bf3e3918800d44ff576590cd4e92.tar.gz |
Enable AMD64 Camellia implementations on WIN64
* cipher/camellia-aesni-avx-amd64.S: Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(ELF): New macro to mask lines with ELF specific commands.
* cipher/camellia-aesni-avx2-amd64.S: Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
(ELF): New macro to mask lines with ELF specific commands.
* cipher/camellia-glue.c (USE_AESNI_AVX, USE_AESNI_AVX2): Enable when
HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS defined.
[USE_AESNI_AVX || USE_AESNI_AVX2] (ASM_FUNC_ABI, ASM_EXTRA_STACK): New.
(_gcry_camellia_aesni_avx_ctr_enc, _gcry_camellia_aesni_avx_cbc_dec)
(_gcry_camellia_aesni_avx_cfb_dec, _gcry_camellia_aesni_avx_keygen)
(_gcry_camellia_aesni_avx2_ctr_enc, _gcry_camellia_aesni_avx2_cbc_dec)
(_gcry_camellia_aesni_avx2_cfb_dec): Add ASM_FUNC_ABI.
--
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/camellia-aesni-avx-amd64.S')
-rw-r--r-- | cipher/camellia-aesni-avx-amd64.S | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/cipher/camellia-aesni-avx-amd64.S b/cipher/camellia-aesni-avx-amd64.S index 6d157a7f..c047a21e 100644 --- a/cipher/camellia-aesni-avx-amd64.S +++ b/cipher/camellia-aesni-avx-amd64.S @@ -20,7 +20,8 @@ #ifdef __x86_64 #include <config.h> -#if defined(HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS) && \ +#if (defined(HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS) || \ + defined(HAVE_COMPATIBLE_GCC_WIN64_PLATFORM_AS)) && \ defined(ENABLE_AESNI_SUPPORT) && defined(ENABLE_AVX_SUPPORT) #ifdef __PIC__ @@ -29,6 +30,12 @@ # define RIP #endif +#ifdef HAVE_COMPATIBLE_GCC_AMD64_PLATFORM_AS +# define ELF(...) __VA_ARGS__ +#else +# define ELF(...) /*_*/ +#endif + #define CAMELLIA_TABLE_BYTE_LEN 272 /* struct CAMELLIA_context: */ @@ -769,7 +776,7 @@ .text .align 8 -.type __camellia_enc_blk16,@function; +ELF(.type __camellia_enc_blk16,@function;) __camellia_enc_blk16: /* input: @@ -853,10 +860,10 @@ __camellia_enc_blk16: %xmm15, %rax, %rcx, 24); jmp .Lenc_done; -.size __camellia_enc_blk16,.-__camellia_enc_blk16; +ELF(.size __camellia_enc_blk16,.-__camellia_enc_blk16;) .align 8 -.type __camellia_dec_blk16,@function; +ELF(.type __camellia_dec_blk16,@function;) __camellia_dec_blk16: /* input: @@ -938,7 +945,7 @@ __camellia_dec_blk16: ((key_table + (24) * 8) + 4)(CTX)); jmp .Ldec_max24; -.size __camellia_dec_blk16,.-__camellia_dec_blk16; +ELF(.size __camellia_dec_blk16,.-__camellia_dec_blk16;) #define inc_le128(x, minus_one, tmp) \ vpcmpeqq minus_one, x, tmp; \ @@ -948,7 +955,7 @@ __camellia_dec_blk16: .align 8 .globl _gcry_camellia_aesni_avx_ctr_enc -.type _gcry_camellia_aesni_avx_ctr_enc,@function; +ELF(.type _gcry_camellia_aesni_avx_ctr_enc,@function;) _gcry_camellia_aesni_avx_ctr_enc: /* input: @@ -1062,11 +1069,11 @@ _gcry_camellia_aesni_avx_ctr_enc: leave; ret; -.size _gcry_camellia_aesni_avx_ctr_enc,.-_gcry_camellia_aesni_avx_ctr_enc; +ELF(.size _gcry_camellia_aesni_avx_ctr_enc,.-_gcry_camellia_aesni_avx_ctr_enc;) .align 8 .globl _gcry_camellia_aesni_avx_cbc_dec -.type _gcry_camellia_aesni_avx_cbc_dec,@function; +ELF(.type _gcry_camellia_aesni_avx_cbc_dec,@function;) _gcry_camellia_aesni_avx_cbc_dec: /* input: @@ -1130,11 +1137,11 @@ _gcry_camellia_aesni_avx_cbc_dec: leave; ret; -.size _gcry_camellia_aesni_avx_cbc_dec,.-_gcry_camellia_aesni_avx_cbc_dec; +ELF(.size _gcry_camellia_aesni_avx_cbc_dec,.-_gcry_camellia_aesni_avx_cbc_dec;) .align 8 .globl _gcry_camellia_aesni_avx_cfb_dec -.type _gcry_camellia_aesni_avx_cfb_dec,@function; +ELF(.type _gcry_camellia_aesni_avx_cfb_dec,@function;) _gcry_camellia_aesni_avx_cfb_dec: /* input: @@ -1202,7 +1209,7 @@ _gcry_camellia_aesni_avx_cfb_dec: leave; ret; -.size _gcry_camellia_aesni_avx_cfb_dec,.-_gcry_camellia_aesni_avx_cfb_dec; +ELF(.size _gcry_camellia_aesni_avx_cfb_dec,.-_gcry_camellia_aesni_avx_cfb_dec;) /* * IN: @@ -1309,7 +1316,7 @@ _gcry_camellia_aesni_avx_cfb_dec: .text .align 8 -.type __camellia_avx_setup128,@function; +ELF(.type __camellia_avx_setup128,@function;) __camellia_avx_setup128: /* input: * %rdi: ctx, CTX; subkey storage at key_table(CTX) @@ -1650,10 +1657,10 @@ __camellia_avx_setup128: vzeroall; ret; -.size __camellia_avx_setup128,.-__camellia_avx_setup128; +ELF(.size __camellia_avx_setup128,.-__camellia_avx_setup128;) .align 8 -.type __camellia_avx_setup256,@function; +ELF(.type __camellia_avx_setup256,@function;) __camellia_avx_setup256: /* input: @@ -2127,11 +2134,11 @@ __camellia_avx_setup256: vzeroall; ret; -.size __camellia_avx_setup256,.-__camellia_avx_setup256; +ELF(.size __camellia_avx_setup256,.-__camellia_avx_setup256;) .align 8 .globl _gcry_camellia_aesni_avx_keygen -.type _gcry_camellia_aesni_avx_keygen,@function; +ELF(.type _gcry_camellia_aesni_avx_keygen,@function;) _gcry_camellia_aesni_avx_keygen: /* input: @@ -2159,7 +2166,7 @@ _gcry_camellia_aesni_avx_keygen: vpor %xmm2, %xmm1, %xmm1; jmp __camellia_avx_setup256; -.size _gcry_camellia_aesni_avx_keygen,.-_gcry_camellia_aesni_avx_keygen; +ELF(.size _gcry_camellia_aesni_avx_keygen,.-_gcry_camellia_aesni_avx_keygen;) #endif /*defined(ENABLE_AESNI_SUPPORT) && defined(ENABLE_AVX_SUPPORT)*/ #endif /*__x86_64*/ |