From 227a2451aff412f7741f439c6f0e3eebcf97024f Mon Sep 17 00:00:00 2001 From: Paul Duncan Date: Wed, 8 May 2024 16:50:37 -0400 Subject: sha3.c: neon, diet-neon: use replace vorrq(vshlq, vshrq) and vorr(vshl,vshr) with vsri(vshlq) and vsri(vshl), respectively --- sha3.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sha3.c b/sha3.c index 76ee7fa..0107dcb 100644 --- a/sha3.c +++ b/sha3.c @@ -477,8 +477,9 @@ static inline void permute_n_avx512(uint64_t s[static 25], const size_t num_roun #if SHA3_BACKEND == BACKEND_NEON #include +// rotate elements in uint64x2_t left by N bits // vrax1q_u64() not supported on pizza -#define VROLQ(A, N) (vorrq_u64(vshlq_n_u64((A), (N)), vshrq_n_u64((A), 64-(N)))) +#define VROLQ(A, N) vsriq_n_u64(vshlq_n_u64((A), (N)), (A), 64-(N)) // keccak row, represented as 3 128-bit vector registers // @@ -784,11 +785,11 @@ static inline void permute_n_neon(uint64_t a[static 25], const size_t num_rounds #include // rotate element in uint64x1_t left by N bits -#define VROL(A, N) (vorr_u64(vshl_n_u64((A), (N)), vshr_n_u64((A), 64-(N)))) +#define VROL(A, N) vsri_n_u64(vshl_n_u64((A), (N)), (A), 64-(N)) // rotate elements in uint64x2_t left by N bits // note: vrax1q_u64() not supported on pizza -#define VROLQ(A, N) (vorrq_u64(vshlq_n_u64((A), (N)), vshrq_n_u64((A), 64-(N)))) +#define VROLQ(A, N) vsriq_n_u64(vshlq_n_u64((A), (N)), (A), 64-(N)) // keccak row, represented as 3 128-bit vector registers // -- cgit v1.2.3