Use the SSSE3 implementation only on x86_64

This commit is contained in:
Frank Denis 2015-11-01 16:49:24 +01:00
parent 55a9a745e6
commit f801afd3d4
3 changed files with 4 additions and 4 deletions

View File

@ -6,7 +6,7 @@
#include <string.h> #include <string.h>
#if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H)) && \ #if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H)) && \
(defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))) (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64)))
#pragma GCC target("sse2") #pragma GCC target("sse2")
#pragma GCC target("ssse3") #pragma GCC target("ssse3")

View File

@ -5,7 +5,7 @@
#include <string.h> #include <string.h>
#if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H)) || \ #if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H)) || \
(defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))) (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64)))
#pragma GCC target("sse2") #pragma GCC target("sse2")
#pragma GCC target("ssse3") #pragma GCC target("ssse3")

View File

@ -406,14 +406,14 @@ int
blake2b_pick_best_implementation(void) blake2b_pick_best_implementation(void)
{ {
#if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H)) || \ #if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H) && defined(HAVE_SMMINTRIN_H)) || \
(defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))) (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64)))
if (sodium_runtime_has_sse41()) { if (sodium_runtime_has_sse41()) {
blake2b_compress = blake2b_compress_sse41; blake2b_compress = blake2b_compress_sse41;
return 0; return 0;
} }
#endif #endif
#if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H)) || \ #if (defined(HAVE_EMMINTRIN_H) && defined(HAVE_TMMINTRIN_H)) || \
(defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64) || defined(_M_IX86))) (defined(_MSC_VER) && (defined(_M_X64) || defined(_M_AMD64)))
if (sodium_runtime_has_ssse3()) { if (sodium_runtime_has_ssse3()) {
blake2b_compress = blake2b_compress_ssse3; blake2b_compress = blake2b_compress_ssse3;
return 0; return 0;