Linux: fix compilation error on Streebog.c if SSE4.1 not enabled in compiler

This commit is contained in:
Mounir IDRASSI 2016-08-17 08:01:50 +02:00
parent 2780ac962e
commit a72c7bcd6a
No known key found for this signature in database
GPG Key ID: DD0C382D5FCFB8FC
2 changed files with 10 additions and 2 deletions

View File

@ -2229,6 +2229,7 @@ static void
g(unsigned long long *h, const unsigned long long *N, const unsigned char *m) g(unsigned long long *h, const unsigned long long *N, const unsigned char *m)
{ {
#if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE #if CRYPTOPP_BOOL_SSE2_INTRINSICS_AVAILABLE
#if CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE
if (HasSSE41()) { if (HasSSE41()) {
__m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */ __m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */
__m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */ __m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */
@ -2255,8 +2256,9 @@ g(unsigned long long *h, const unsigned long long *N, const unsigned char *m)
#if CRYPTOPP_BOOL_X86 #if CRYPTOPP_BOOL_X86
_mm_empty(); _mm_empty();
#endif #endif
} } else
else if (HasSSE2()) { #endif
if (HasSSE2()) {
__m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */ __m128i xmm0, xmm2, xmm4, xmm6; /* XMMR0-quadruple */
__m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */ __m128i xmm1, xmm3, xmm5, xmm7; /* XMMR1-quadruple */
unsigned int i; unsigned int i;

View File

@ -123,6 +123,12 @@
#define CRYPTOPP_BOOL_ALIGN16 0 #define CRYPTOPP_BOOL_ALIGN16 0
#endif #endif
#if CRYPTOPP_BOOL_AESNI_INTRINSICS_AVAILABLE && (defined(__SSE4_1__) || defined(__INTEL_COMPILER) || defined(_MSC_VER))
#define CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE 1
#else
#define CRYPTOPP_BOOL_SSE41_INTRINSICS_AVAILABLE 0
#endif
// how to allocate 16-byte aligned memory (for SSE2) // how to allocate 16-byte aligned memory (for SSE2)
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define CRYPTOPP_MM_MALLOC_AVAILABLE #define CRYPTOPP_MM_MALLOC_AVAILABLE