From d4ff80e7a09d7c6ac272ed217aea96b56cece58d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 10 Oct 2015 18:32:10 +0200 Subject: [PATCH] Define __SSSE3__ if required --- configure.ac | 12 ++++++++++++ .../aes256gcm/aesni/aead_aes256gcm_aesni.c | 3 +++ 2 files changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 548b1a08..a307c135 100644 --- a/configure.ac +++ b/configure.ac @@ -265,6 +265,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_MSG_CHECKING(for MMX instructions set) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("mmx") +#ifndef __MMX__ +# define __MMX__ +#endif #include ]], [[ __m64 x = _mm_setzero_si64(); ]])], [AC_MSG_RESULT(yes) @@ -274,6 +277,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_MSG_CHECKING(for SSE2 instructions set) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("sse2") +#ifndef __SSE2__ +# define __SSE2__ +#endif #include ]], [[ __m128d x = _mm_setzero_pd(); ]])], [AC_MSG_RESULT(yes) @@ -283,6 +289,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_MSG_CHECKING(for SSE3 instructions set) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("sse3") +#ifndef __SSE3__ +# define __SSE3__ +#endif #include ]], [[ __m128 x = _mm_addsub_ps(_mm_cvtpd_ps(_mm_setzero_pd()), _mm_cvtpd_ps(_mm_setzero_pd())); ]])], @@ -293,6 +302,9 @@ AS_IF([test "x$EMSCRIPTEN" = "x"],[ AC_MSG_CHECKING(for SSSE3 instructions set) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #pragma GCC target("ssse3") +#ifndef __SSSE3__ +# define __SSSE3__ +#endif #include ]], [[ __m64 x = _mm_abs_pi32(_m_from_int(0)); ]])], [AC_MSG_RESULT(yes) diff --git a/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c b/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c index bc1780f1..37beab47 100644 --- a/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c +++ b/src/libsodium/crypto_aead/aes256gcm/aesni/aead_aes256gcm_aesni.c @@ -20,6 +20,9 @@ #pragma GCC target("aes") #pragma GCC target("pclmul") +#ifndef __SSSE3__ +# define __SSSE3__ +#endif #ifndef __SSE4_1__ # define __SSE4_1__ #endif