aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjia Zhang <[email protected]>2022-02-23 12:23:58 +0800
committerJussi Kivilinna <[email protected]>2022-02-23 18:50:27 +0200
commit83e1649edd5eedd8faf24e5c10cb643218ce3c6f (patch)
tree313282e1dfd7ef688a52fb2a43aac0ab8d7dbc85
parent2508b755608ce182a7e570dc2717a6a70346b927 (diff)
downloadlibgcrypt-83e1649edd5eedd8faf24e5c10cb643218ce3c6f.tar.gz
libgcrypt-83e1649edd5eedd8faf24e5c10cb643218ce3c6f.tar.bz2
libgcrypt-83e1649edd5eedd8faf24e5c10cb643218ce3c6f.zip
Move VPUSH_API/VPOP_API macros to common header
* 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 <[email protected]>
-rw-r--r--cipher/asm-common-aarch64.h22
-rw-r--r--cipher/cipher-gcm-armv8-aarch64-ce.S22
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,