[PATCH v2 1/2] Move VPUSH_API/VPOP_API macros to common header

Tianjia Zhang tianjia.zhang at linux.alibaba.com
Tue Feb 22 13:18:27 CET 2022


* cipher/asm-common-aarch64.h: Add VPUSH_API/VPOP_API/CLEAR_REG macros.
* cipher/cipher-gcm-armv8-aarch64-ce.S: Remove common macros.
--

Signed-off-by: Tianjia Zhang <tianjia.zhang at linux.alibaba.com>
---
 cipher/asm-common-aarch64.h          | 22 ++++++++++++++++++++++
 cipher/cipher-gcm-armv8-aarch64-ce.S | 22 ----------------------
 2 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/cipher/asm-common-aarch64.h b/cipher/asm-common-aarch64.h
index 451539e8..d3f7801c 100644
--- a/cipher/asm-common-aarch64.h
+++ b/cipher/asm-common-aarch64.h
@@ -105,4 +105,26 @@
 #define ret_spec_stop \
 	ret; dsb sy; isb;
 
+#define CLEAR_REG(reg) movi reg.16b, #0;
+
+#define VPUSH_ABI \
+	stp d8, d9, [sp, #-16]!; \
+	CFI_ADJUST_CFA_OFFSET(16); \
+	stp d10, d11, [sp, #-16]!; \
+	CFI_ADJUST_CFA_OFFSET(16); \
+	stp d12, d13, [sp, #-16]!; \
+	CFI_ADJUST_CFA_OFFSET(16); \
+	stp d14, d15, [sp, #-16]!; \
+	CFI_ADJUST_CFA_OFFSET(16);
+
+#define VPOP_ABI \
+	ldp d14, d15, [sp], #16; \
+	CFI_ADJUST_CFA_OFFSET(-16); \
+	ldp d12, d13, [sp], #16; \
+	CFI_ADJUST_CFA_OFFSET(-16); \
+	ldp d10, d11, [sp], #16; \
+	CFI_ADJUST_CFA_OFFSET(-16); \
+	ldp d8, d9, [sp], #16; \
+	CFI_ADJUST_CFA_OFFSET(-16);
+
 #endif /* GCRY_ASM_COMMON_AARCH64_H */
diff --git a/cipher/cipher-gcm-armv8-aarch64-ce.S b/cipher/cipher-gcm-armv8-aarch64-ce.S
index e6714249..687fabe3 100644
--- a/cipher/cipher-gcm-armv8-aarch64-ce.S
+++ b/cipher/cipher-gcm-armv8-aarch64-ce.S
@@ -149,28 +149,6 @@ gcry_gcm_reduction_constant:
 #define _(...) __VA_ARGS__
 #define __ _()
 
-#define CLEAR_REG(reg) movi reg.16b, #0;
-
-#define VPUSH_ABI \
-        stp d8, d9, [sp, #-16]!; \
-        CFI_ADJUST_CFA_OFFSET(16); \
-        stp d10, d11, [sp, #-16]!; \
-        CFI_ADJUST_CFA_OFFSET(16); \
-        stp d12, d13, [sp, #-16]!; \
-        CFI_ADJUST_CFA_OFFSET(16); \
-        stp d14, d15, [sp, #-16]!; \
-        CFI_ADJUST_CFA_OFFSET(16);
-
-#define VPOP_ABI \
-        ldp d14, d15, [sp], #16; \
-        CFI_ADJUST_CFA_OFFSET(-16); \
-        ldp d12, d13, [sp], #16; \
-        CFI_ADJUST_CFA_OFFSET(-16); \
-        ldp d10, d11, [sp], #16; \
-        CFI_ADJUST_CFA_OFFSET(-16); \
-        ldp d8, d9, [sp], #16; \
-        CFI_ADJUST_CFA_OFFSET(-16);
-
 /*
  * unsigned int _gcry_ghash_armv8_ce_pmull (void *gcm_key, byte *result,
  *                                          const byte *buf, size_t nblocks,
-- 
2.34.1




More information about the Gcrypt-devel mailing list