diff options
author | Paul Duncan <pabs@pablotron.org> | 2024-05-08 16:50:37 -0400 |
---|---|---|
committer | Paul Duncan <pabs@pablotron.org> | 2024-05-08 16:50:37 -0400 |
commit | 227a2451aff412f7741f439c6f0e3eebcf97024f (patch) | |
tree | f7e077ec273882b074ed8eaf3dcaa2dd198a2529 | |
parent | 0b15ca789c4692b6f06f687ba08f69532e6e0bd8 (diff) | |
download | sha3-227a2451aff412f7741f439c6f0e3eebcf97024f.tar.bz2 sha3-227a2451aff412f7741f439c6f0e3eebcf97024f.zip |
sha3.c: neon, diet-neon: use replace vorrq(vshlq, vshrq) and vorr(vshl,vshr) with vsri(vshlq) and vsri(vshl), respectively
-rw-r--r-- | sha3.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 <arm_neon.h> +// 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 <arm_neon.h> // 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 // |