diff options
author | Vitaly Chikunov <vt@altlinux.org> | 2020-02-04 05:41:53 +0300 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@users.noreply.github.com> | 2020-02-04 09:56:31 +0300 |
commit | ed0f8fbedf438e0ed1f6da9e829a932881695175 (patch) | |
tree | 0dc35419f98e8c49c879df6f82345c422dc6e820 /gosthash2012.c | |
parent | a81a9a6a70dadf23ea9173f1af6ea8e58cfde659 (diff) | |
download | gost-engine-ed0f8fbedf438e0ed1f6da9e829a932881695175.zip gost-engine-ed0f8fbedf438e0ed1f6da9e829a932881695175.tar.gz gost-engine-ed0f8fbedf438e0ed1f6da9e829a932881695175.tar.bz2 |
gosthash2012: Provide cmake test for _addcarry_u64
Also, simple check if `_addcarry_u64' works correctly.
Diffstat (limited to 'gosthash2012.c')
-rw-r--r-- | gosthash2012.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gosthash2012.c b/gosthash2012.c index 6399a9e..5a4c64e 100644 --- a/gosthash2012.c +++ b/gosthash2012.c @@ -10,8 +10,11 @@ #include "gosthash2012.h" #ifdef __x86_64__ -# include <immintrin.h> -# include <x86intrin.h> +# ifdef _MSC_VER +# include <intrin.h> +# else +# include <x86intrin.h> +# endif #endif #if defined(_WIN32) || defined(_WINDOWS) @@ -64,7 +67,7 @@ static INLINE void add512(union uint512_u * RESTRICT x, 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 |