Fix CHAM build when SSSE3 not available
parent
8edc5cf2d5
commit
df47185573
|
|
@ -10,20 +10,14 @@
|
||||||
|
|
||||||
#include "cham.h"
|
#include "cham.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "adv_simd.h"
|
|
||||||
|
|
||||||
// Uncomment for benchmarking C++ against SSE or NEON.
|
// Uncomment for benchmarking C++ against SSE or NEON.
|
||||||
// Do so in both simon.cpp and simon-simd.cpp.
|
// Do so in both simon.cpp and simon-simd.cpp.
|
||||||
// #undef CRYPTOPP_SSSE3_AVAILABLE
|
// #undef CRYPTOPP_SSSE3_AVAILABLE
|
||||||
// #undef CRYPTOPP_ARM_NEON_AVAILABLE
|
// #undef CRYPTOPP_ARM_NEON_AVAILABLE
|
||||||
|
|
||||||
#if defined(CRYPTOPP_SSE2_AVAILABLE)
|
|
||||||
# define CRYPTOPP_AVX512_ROTATE 1
|
|
||||||
# include <xmmintrin.h>
|
|
||||||
# include <emmintrin.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (CRYPTOPP_SSSE3_AVAILABLE)
|
#if (CRYPTOPP_SSSE3_AVAILABLE)
|
||||||
|
#include "adv_simd.h"
|
||||||
# include <pmmintrin.h>
|
# include <pmmintrin.h>
|
||||||
# include <tmmintrin.h>
|
# include <tmmintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -32,6 +26,10 @@
|
||||||
# include <ammintrin.h>
|
# include <ammintrin.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __AVX512F__
|
||||||
|
# define CRYPTOPP_AVX512_ROTATE 1
|
||||||
|
#endif
|
||||||
|
|
||||||
// Squash MS LNK4221 and libtool warnings
|
// Squash MS LNK4221 and libtool warnings
|
||||||
extern const char CHAM_SIMD_FNAME[] = __FILE__;
|
extern const char CHAM_SIMD_FNAME[] = __FILE__;
|
||||||
|
|
||||||
|
|
@ -68,7 +66,6 @@ inline __m128i RotateRight16(const __m128i& val)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Faster than two Shifts and an Or. Thanks to Louis Wingers and Bryan Weeks.
|
|
||||||
template <>
|
template <>
|
||||||
inline __m128i RotateLeft16<8>(const __m128i& val)
|
inline __m128i RotateLeft16<8>(const __m128i& val)
|
||||||
{
|
{
|
||||||
|
|
@ -80,7 +77,6 @@ inline __m128i RotateLeft16<8>(const __m128i& val)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
// Faster than two Shifts and an Or. Thanks to Louis Wingers and Bryan Weeks.
|
|
||||||
template <>
|
template <>
|
||||||
inline __m128i RotateRight16<8>(const __m128i& val)
|
inline __m128i RotateRight16<8>(const __m128i& val)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue