]> source.dussan.org Git - rspamd.git/commitdiff
Reorganize assembler macro sightly.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 8 Apr 2015 10:02:26 +0000 (11:02 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 8 Apr 2015 10:02:26 +0000 (11:02 +0100)
src/libcryptobox/chacha20/avx.S
src/libcryptobox/chacha20/avx2.S
src/libcryptobox/chacha20/macro.S [deleted file]
src/libcryptobox/chacha20/sse2.S
src/libcryptobox/macro.S [new file with mode: 0644]
src/libcryptobox/poly1305/avx.S
src/libcryptobox/poly1305/avx2.S
src/libcryptobox/poly1305/sse2.S

index 926613510e30e5a60f4f25a40628934e7f93cfe8..7689b84cd2921a93150b04ca308d213cb2cc98b0 100644 (file)
@@ -1,4 +1,4 @@
-#include "macro.S"
+#include "../macro.S"
 #include "constants.S"
 SECTION_TEXT
 
index 71b333045aa9e1e700753397ec901b06773d2683..efd0f54711ff15db042e6daaf5e9628cbeaafa13 100644 (file)
@@ -1,4 +1,4 @@
-#include "macro.S"
+#include "../macro.S"
 #include "constants.S"
 SECTION_TEXT
 
diff --git a/src/libcryptobox/chacha20/macro.S b/src/libcryptobox/chacha20/macro.S
deleted file mode 100644 (file)
index e498f8c..0000000
+++ /dev/null
@@ -1,178 +0,0 @@
-#include "platform_config.h"
-
-#define IS_MACH (defined(__MACH__))
-
-#if !defined(HAVE_SLASHMACRO) && !defined(HAVE_DOLLARMACRO)
-       #error Unknown gnu as macro parameter convention! Run ./configure
-#endif
-
-#if (IS_MACH)
-       .macro FN name
-       #if defined(HAVE_SLASHMACRO)
-               \name:
-               _\name:
-       #elif defined(HAVE_DOLLARMACRO)
-               $0:
-               _$0:
-       #endif
-       .endm
-
-       .macro FN_EXT name, args, xmmused
-       #if defined(HAVE_SLASHMACRO)
-               FN \name
-       #elif defined(HAVE_DOLLARMACRO)
-               FN $0
-       #endif
-       .endm
-
-       .macro FN_END name
-       .endm
-
-       .macro HIDDEN name
-       #if defined(HAVE_AS_PRIVATE_EXTERN)
-       #if defined(HAVE_SLASHMACRO)
-               .private_extern \name
-               .private_extern _\name
-       #elif defined(HAVE_DOLLARMACRO)
-               .private_extern $0
-               .private_extern _$0
-       #endif
-       #endif
-       .endm
-#else
-       .macro FN name
-               \name:
-               _\name:
-       .endm
-
-       .macro FN_EXT name, args, xmmused
-               FN \name
-       .endm
-
-       .macro FN_END name
-               .size \name, .-\name
-               .size _\name, .-_\name
-               .type \name, @function
-               .type _\name, @function
-       .endm
-
-       .macro HIDDEN name
-       #if defined(HAVE_AS_HIDDEN)
-               .hidden \name
-               .hidden _\name
-       #endif
-       .endm
-
-       /* set NX for stack */
-       .section .note.GNU-stack,"",@progbits
-#endif
-#if (IS_MACH)
-       .macro SECTION_TEXT
-               .section __TEXT,__text,regular
-       .endm
-
-       .macro SECTION_RODATA
-               .section __TEXT,__text,regular
-       .endm
-#else
-       /* put everything in the code segment to simplify things */
-       .macro SECTION_TEXT
-               .text
-       .endm
-
-       .macro SECTION_RODATA
-               .text
-       .endm
-#endif
-
-/* declare a global function */
-.macro GLOBAL name
-#if defined(HAVE_SLASHMACRO)
-       .globl \name
-       .globl _\name
-#elif defined(HAVE_DOLLARMACRO)
-       .globl $0
-       .globl _$0
-#endif
-.endm
-
-.macro FN_LOCAL_PREFIX name
-#if defined(HAVE_SLASHMACRO)
-       FN LOCAL_PREFIX(\name)
-#elif defined(HAVE_DOLLARMACRO)
-       FN LOCAL_PREFIX($0)
-#endif
-.endm
-
-.macro FN_EXT_LOCAL_PREFIX name, args, xmmused
-#if defined(HAVE_SLASHMACRO)
-       FN_EXT LOCAL_PREFIX(\name), \args, \xmmused
-#elif defined(HAVE_DOLLARMACRO)
-       FN_EXT LOCAL_PREFIX($0), $1, $2
-#endif
-.endm
-
-.macro FN_END_LOCAL_PREFIX name
-#if defined(HAVE_SLASHMACRO)
-       FN_END LOCAL_PREFIX(\name)
-#elif defined(HAVE_DOLLARMACRO)
-       FN_END LOCAL_PREFIX($0)
-#endif
-.endm
-
-.macro GLOBAL_LOCAL_PREFIX name
-#if defined(HAVE_SLASHMACRO)
-       GLOBAL LOCAL_PREFIX(\name)
-       HIDDEN LOCAL_PREFIX(\name)
-#elif defined(HAVE_DOLLARMACRO)
-       GLOBAL LOCAL_PREFIX($0)
-       HIDDEN LOCAL_PREFIX($0)
-#endif
-.endm
-
-.macro GLOBAL_HIDDEN_FN name
-#if defined(HAVE_SLASHMACRO)
-       GLOBAL \name
-       HIDDEN \name
-       FN \name
-#elif defined(HAVE_DOLLARMACRO)
-       GLOBAL $0
-       HIDDEN $0
-       FN $0
-#endif
-.endm
-
-.macro GLOBAL_HIDDEN_FN_EXT name, args, xmmused
-#if defined(HAVE_SLASHMACRO)
-       GLOBAL \name
-       HIDDEN \name
-       FN_EXT \name, \args, \xmmused
-#elif defined(HAVE_DOLLARMACRO)
-       GLOBAL $0
-       HIDDEN $0
-       FN_EXT $0, $1, $2
-#endif
-.endm
-
-/* pic support */
-.macro LOAD_VAR_PIC var, reg
-#if (IS_X86_32)
-       #if defined(HAVE_SLASHMACRO)
-               call 1f
-               1:
-               popl \reg
-               leal \var - 1b(\reg), \reg
-       #elif defined(HAVE_DOLLARMACRO)
-               call 1f
-               1:
-               popl $1
-               leal $0 - 1b($1), $1
-       #endif
-#else
-       #if defined(HAVE_SLASHMACRO)
-               leaq \var(%rip), \reg
-       #elif defined(HAVE_DOLLARMACRO)
-               leaq $0(%rip), $1
-       #endif
-#endif
-.endm
index a896b93be7a523c32be73ffa2d4ea62980c1e94d..a91d095e067b6772ed232763f59c2f344b6fd34b 100644 (file)
@@ -1,4 +1,4 @@
-#include "macro.S"
+#include "../macro.S"
 #include "constants.S"
 SECTION_TEXT
 
diff --git a/src/libcryptobox/macro.S b/src/libcryptobox/macro.S
new file mode 100644 (file)
index 0000000..e498f8c
--- /dev/null
@@ -0,0 +1,178 @@
+#include "platform_config.h"
+
+#define IS_MACH (defined(__MACH__))
+
+#if !defined(HAVE_SLASHMACRO) && !defined(HAVE_DOLLARMACRO)
+       #error Unknown gnu as macro parameter convention! Run ./configure
+#endif
+
+#if (IS_MACH)
+       .macro FN name
+       #if defined(HAVE_SLASHMACRO)
+               \name:
+               _\name:
+       #elif defined(HAVE_DOLLARMACRO)
+               $0:
+               _$0:
+       #endif
+       .endm
+
+       .macro FN_EXT name, args, xmmused
+       #if defined(HAVE_SLASHMACRO)
+               FN \name
+       #elif defined(HAVE_DOLLARMACRO)
+               FN $0
+       #endif
+       .endm
+
+       .macro FN_END name
+       .endm
+
+       .macro HIDDEN name
+       #if defined(HAVE_AS_PRIVATE_EXTERN)
+       #if defined(HAVE_SLASHMACRO)
+               .private_extern \name
+               .private_extern _\name
+       #elif defined(HAVE_DOLLARMACRO)
+               .private_extern $0
+               .private_extern _$0
+       #endif
+       #endif
+       .endm
+#else
+       .macro FN name
+               \name:
+               _\name:
+       .endm
+
+       .macro FN_EXT name, args, xmmused
+               FN \name
+       .endm
+
+       .macro FN_END name
+               .size \name, .-\name
+               .size _\name, .-_\name
+               .type \name, @function
+               .type _\name, @function
+       .endm
+
+       .macro HIDDEN name
+       #if defined(HAVE_AS_HIDDEN)
+               .hidden \name
+               .hidden _\name
+       #endif
+       .endm
+
+       /* set NX for stack */
+       .section .note.GNU-stack,"",@progbits
+#endif
+#if (IS_MACH)
+       .macro SECTION_TEXT
+               .section __TEXT,__text,regular
+       .endm
+
+       .macro SECTION_RODATA
+               .section __TEXT,__text,regular
+       .endm
+#else
+       /* put everything in the code segment to simplify things */
+       .macro SECTION_TEXT
+               .text
+       .endm
+
+       .macro SECTION_RODATA
+               .text
+       .endm
+#endif
+
+/* declare a global function */
+.macro GLOBAL name
+#if defined(HAVE_SLASHMACRO)
+       .globl \name
+       .globl _\name
+#elif defined(HAVE_DOLLARMACRO)
+       .globl $0
+       .globl _$0
+#endif
+.endm
+
+.macro FN_LOCAL_PREFIX name
+#if defined(HAVE_SLASHMACRO)
+       FN LOCAL_PREFIX(\name)
+#elif defined(HAVE_DOLLARMACRO)
+       FN LOCAL_PREFIX($0)
+#endif
+.endm
+
+.macro FN_EXT_LOCAL_PREFIX name, args, xmmused
+#if defined(HAVE_SLASHMACRO)
+       FN_EXT LOCAL_PREFIX(\name), \args, \xmmused
+#elif defined(HAVE_DOLLARMACRO)
+       FN_EXT LOCAL_PREFIX($0), $1, $2
+#endif
+.endm
+
+.macro FN_END_LOCAL_PREFIX name
+#if defined(HAVE_SLASHMACRO)
+       FN_END LOCAL_PREFIX(\name)
+#elif defined(HAVE_DOLLARMACRO)
+       FN_END LOCAL_PREFIX($0)
+#endif
+.endm
+
+.macro GLOBAL_LOCAL_PREFIX name
+#if defined(HAVE_SLASHMACRO)
+       GLOBAL LOCAL_PREFIX(\name)
+       HIDDEN LOCAL_PREFIX(\name)
+#elif defined(HAVE_DOLLARMACRO)
+       GLOBAL LOCAL_PREFIX($0)
+       HIDDEN LOCAL_PREFIX($0)
+#endif
+.endm
+
+.macro GLOBAL_HIDDEN_FN name
+#if defined(HAVE_SLASHMACRO)
+       GLOBAL \name
+       HIDDEN \name
+       FN \name
+#elif defined(HAVE_DOLLARMACRO)
+       GLOBAL $0
+       HIDDEN $0
+       FN $0
+#endif
+.endm
+
+.macro GLOBAL_HIDDEN_FN_EXT name, args, xmmused
+#if defined(HAVE_SLASHMACRO)
+       GLOBAL \name
+       HIDDEN \name
+       FN_EXT \name, \args, \xmmused
+#elif defined(HAVE_DOLLARMACRO)
+       GLOBAL $0
+       HIDDEN $0
+       FN_EXT $0, $1, $2
+#endif
+.endm
+
+/* pic support */
+.macro LOAD_VAR_PIC var, reg
+#if (IS_X86_32)
+       #if defined(HAVE_SLASHMACRO)
+               call 1f
+               1:
+               popl \reg
+               leal \var - 1b(\reg), \reg
+       #elif defined(HAVE_DOLLARMACRO)
+               call 1f
+               1:
+               popl $1
+               leal $0 - 1b($1), $1
+       #endif
+#else
+       #if defined(HAVE_SLASHMACRO)
+               leaq \var(%rip), \reg
+       #elif defined(HAVE_DOLLARMACRO)
+               leaq $0(%rip), $1
+       #endif
+#endif
+.endm
index b64d4ca2d16f346d94425a94bc538972285431ad..bf7390888f6a0e8cd0852292406ac71b29d74b13 100644 (file)
@@ -1,4 +1,4 @@
-#include "../chacha20/macro.S"
+#include "../macro.S"
 #include "constants.S"
 
 SECTION_TEXT
index b1ab0d61a5f53b050ac89ff0a5830710510b03e8..5aa5851d6dfd725ea22d26c9505716cf23cb18b8 100644 (file)
@@ -1,4 +1,4 @@
-#include "../chacha20/macro.S"
+#include "../macro.S"
 #include "constants.S"
 SECTION_TEXT
 
index 1ca4139ced1c62927bbca126cde25c0cc26b65d5..038961899cece957d887d72bf984531357414fa4 100644 (file)
@@ -1,4 +1,4 @@
-#include "../chacha20/macro.S"
+#include "../macro.S"
 #include "constants.S"
 
 SECTION_TEXT