[PATCH 3/4] Move data pointer macro for 64-bit ARM assembly to common header

Jussi Kivilinna jussi.kivilinna at iki.fi
Fri Apr 26 18:33:41 CEST 2019


* cipher/asm-common-aarch64.h (GET_DATA_POINTER): New.
* cipher/chacha20-aarch64.S (GET_DATA_POINTER): Remove.
* cipher/cipher-gcm-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove.
* cipher/crc-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove.
* cipher/rijndael-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove.
* cipher/sha1-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove.
* cipher/sha256-armv8-aarch64-ce.S (GET_DATA_POINTER): Remove.
--

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 0 files changed

diff --git a/cipher/asm-common-aarch64.h b/cipher/asm-common-aarch64.h
index 502c35aeb..4ffc1b711 100644
--- a/cipher/asm-common-aarch64.h
+++ b/cipher/asm-common-aarch64.h
@@ -29,6 +29,16 @@
 # define ELF(...) /*_*/
 #endif
 
+#ifdef _WIN32
+#define GET_DATA_POINTER(reg, name) \
+	adrp    reg, name ; \
+	add     reg, reg, #:lo12:name ;
+#else
+#define GET_DATA_POINTER(reg, name) \
+	adrp    reg, :got:name ; \
+	ldr     reg, [reg, #:got_lo12:name] ;
+#endif
+
 #ifdef HAVE_GCC_ASM_CFI_DIRECTIVES
 /* CFI directives to emit DWARF stack unwinding information. */
 # define CFI_STARTPROC()            .cfi_startproc
diff --git a/cipher/chacha20-aarch64.S b/cipher/chacha20-aarch64.S
index adb9b1f29..07b4bb5c0 100644
--- a/cipher/chacha20-aarch64.S
+++ b/cipher/chacha20-aarch64.S
@@ -38,15 +38,6 @@
 
 .text
 
-#ifdef _WIN32
-#define GET_DATA_POINTER(reg, name) \
-	adrp    reg, name ; \
-	add     reg, reg, #:lo12:name ;
-#else
-#define GET_DATA_POINTER(reg, name) \
-	adrp    reg, :got:name ; \
-	ldr     reg, [reg, #:got_lo12:name] ;
-#endif
 
 /* register macros */
 #define INPUT     x0
diff --git a/cipher/cipher-gcm-armv8-aarch64-ce.S b/cipher/cipher-gcm-armv8-aarch64-ce.S
index 7c6be94ed..b0c2cccc6 100644
--- a/cipher/cipher-gcm-armv8-aarch64-ce.S
+++ b/cipher/cipher-gcm-armv8-aarch64-ce.S
@@ -27,10 +27,6 @@
 
 .text
 
-#define GET_DATA_POINTER(reg, name) \
-		adrp    reg, :got:name ; \
-		ldr     reg, [reg, #:got_lo12:name] ;
-
 
 /* Constants */
 
diff --git a/cipher/crc-armv8-aarch64-ce.S b/cipher/crc-armv8-aarch64-ce.S
index f269b74a3..060abdfe9 100644
--- a/cipher/crc-armv8-aarch64-ce.S
+++ b/cipher/crc-armv8-aarch64-ce.S
@@ -27,9 +27,6 @@
 
 .text
 
-#define GET_DATA_POINTER(reg, name) \
-		adrp    reg, :got:name ; \
-		ldr     reg, [reg, #:got_lo12:name] ;
 
 /* Structure of crc32_consts_s */
 
diff --git a/cipher/rijndael-armv8-aarch64-ce.S b/cipher/rijndael-armv8-aarch64-ce.S
index 71b45b856..3af29e0d0 100644
--- a/cipher/rijndael-armv8-aarch64-ce.S
+++ b/cipher/rijndael-armv8-aarch64-ce.S
@@ -28,11 +28,6 @@
 .text
 
 
-#define GET_DATA_POINTER(reg, name) \
-	adrp    reg, :got:name ; \
-	ldr     reg, [reg, #:got_lo12:name] ;
-
-
 /* Register macros */
 
 #define vk0 v17
diff --git a/cipher/sha1-armv8-aarch64-ce.S b/cipher/sha1-armv8-aarch64-ce.S
index 7dc26c0f1..223268cad 100644
--- a/cipher/sha1-armv8-aarch64-ce.S
+++ b/cipher/sha1-armv8-aarch64-ce.S
@@ -28,11 +28,6 @@
 .text
 
 
-#define GET_DATA_POINTER(reg, name) \
-		adrp    reg, :got:name ; \
-		ldr     reg, [reg, #:got_lo12:name] ;
-
-
 /* Constants */
 
 #define K1  0x5A827999
diff --git a/cipher/sha256-armv8-aarch64-ce.S b/cipher/sha256-armv8-aarch64-ce.S
index 706e0dfd9..f57cae290 100644
--- a/cipher/sha256-armv8-aarch64-ce.S
+++ b/cipher/sha256-armv8-aarch64-ce.S
@@ -28,11 +28,6 @@
 .text
 
 
-#define GET_DATA_POINTER(reg, name) \
-		adrp    reg, :got:name ; \
-		ldr     reg, [reg, #:got_lo12:name] ;
-
-
 /* Constants */
 
 .align 4




More information about the Gcrypt-devel mailing list