`_addcarry_u64' is using `ADC' and does not require ADX extensions
(`-madx').
Committed-by: Vitaly Chikunov <vt@altlinux.org>
*/
#include "gosthash2012.h"
*/
#include "gosthash2012.h"
+#ifdef __x86_64__
+# include <immintrin.h>
+# include <x86intrin.h>
+#endif
#if defined(_WIN32) || defined(_WINDOWS)
# define INLINE __inline
#if defined(_WIN32) || defined(_WINDOWS)
# define INLINE __inline
const union uint512_u * RESTRICT y)
{
#ifndef __GOST3411_BIG_ENDIAN__
const union uint512_u * RESTRICT y)
{
#ifndef __GOST3411_BIG_ENDIAN__
+# ifdef __x86_64__
+ for (i = 0; i < 8; i++)
+ CF = _addcarry_u64(CF, x->QWORD[i] , y->QWORD[i], &(x->QWORD[i]));
+# else
for (i = 0; i < 8; i++) {
const unsigned long long left = x->QWORD[i];
unsigned long long sum;
for (i = 0; i < 8; i++) {
const unsigned long long left = x->QWORD[i];
unsigned long long sum;
CF = (sum < left);
x->QWORD[i] = sum;
}
CF = (sum < left);
x->QWORD[i] = sum;
}
+# endif /* !__x86_64__ */
+#else /* __GOST3411_BIG_ENDIAN__ */
const unsigned char *yp;
unsigned char *xp;
unsigned int i;
const unsigned char *yp;
unsigned char *xp;
unsigned int i;
buf = xp[i] + yp[i] + (buf >> 8);
xp[i] = (unsigned char)buf & 0xFF;
}
buf = xp[i] + yp[i] + (buf >> 8);
xp[i] = (unsigned char)buf & 0xFF;
}
+#endif /* __GOST3411_BIG_ENDIAN__ */
}
static void g(union uint512_u *h, const union uint512_u * RESTRICT N,
}
static void g(union uint512_u *h, const union uint512_u * RESTRICT N,