*/
#include "gosthash2012.h"
-#ifdef __x86_64__
-# include <immintrin.h>
-# include <x86intrin.h>
+#if defined(__x86_64__) || defined(__e2k__)
+# ifdef _MSC_VER
+# include <intrin.h>
+# else
+# include <x86intrin.h>
+# endif
#endif
#if defined(_WIN32) || defined(_WINDOWS)
unsigned int CF = 0;
unsigned int i;
-# ifdef __x86_64__
+# ifdef HAVE_ADDCARRY_U64
for (i = 0; i < 8; i++)
CF = _addcarry_u64(CF, x->QWORD[i] , y->QWORD[i], &(x->QWORD[i]));
# else
X128R(xmm0, xmm2, xmm4, xmm6, xmm1, xmm3, xmm5, xmm7);
STORE(h, xmm0, xmm2, xmm4, xmm6);
+# ifndef __i386__
+ /* Restore the Floating-point status on the CPU */
+ /* This is only required on MMX, but EXTRACT32 is using MMX */
+ _mm_empty();
+# endif
#else
union uint512_u Ki, data;
unsigned int i;
void gost2012_hash_block(gost2012_hash_ctx * CTX,
const unsigned char *data, size_t len)
{
- register size_t chunksize;
register size_t bufsize = CTX->bufsize;
if (bufsize == 0) {
}
while (len) {
- chunksize = 64 - bufsize;
+ register size_t chunksize = 64 - bufsize;
if (chunksize > len)
chunksize = len;