summaryrefslogtreecommitdiff
path: root/cham_simd.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2019-10-28 01:12:58 -0400
committerGitHub <noreply@github.com>2019-10-28 01:12:58 -0400
commitc831d6ffeeb80ea805502e62ad795afb8ef6fdff (patch)
tree01361e7f350be558699c1cec28d1780c693a9836 /cham_simd.cpp
parent6da6b7f5ace3d342942a2f5aa39fe8542da798c7 (diff)
downloadcryptopp-git-c831d6ffeeb80ea805502e62ad795afb8ef6fdff.tar.gz
Pre-splat SIMON and SPECK keys when appropriate for Altivec (PR #910)
SIMON and SPECK keys can be pre-splatted in the forward direction when Altivec instructions will be used. Pre-splatting does not work for the reverse transformation. It breaks modes like CBC, so the speed-up is only applied to the forward transformation.
Diffstat (limited to 'cham_simd.cpp')
-rw-r--r--cham_simd.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/cham_simd.cpp b/cham_simd.cpp
index 414cc594..4438d0ed 100644
--- a/cham_simd.cpp
+++ b/cham_simd.cpp
@@ -29,11 +29,6 @@
# endif
#endif
-#if defined(__AVX512F__)
-# define CRYPTOPP_AVX512_ROTATE 1
-# include <immintrin.h>
-#endif
-
// Clang intrinsic casts, http://bugs.llvm.org/show_bug.cgi?id=20670
#define DOUBLE_CAST(x) ((double*)(void*)(x))
#define CONST_DOUBLE_CAST(x) ((const double*)(const void*)(x))
@@ -649,9 +644,7 @@ NAMESPACE_BEGIN(W32) // CHAM128, 32-bit word size
template <unsigned int R>
inline __m128i RotateLeft32(const __m128i& val)
{
-#if defined(CRYPTOPP_AVX512_ROTATE)
- return _mm_rol_epi32(val, R);
-#elif defined(__XOP__)
+#if defined(__XOP__)
return _mm_roti_epi32(val, R);
#else
return _mm_or_si128(
@@ -662,9 +655,7 @@ inline __m128i RotateLeft32(const __m128i& val)
template <unsigned int R>
inline __m128i RotateRight32(const __m128i& val)
{
-#if defined(CRYPTOPP_AVX512_ROTATE)
- return _mm_ror_epi32(val, R);
-#elif defined(__XOP__)
+#if defined(__XOP__)
return _mm_roti_epi32(val, 32-R);
#else
return _mm_or_si128(