summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-21 22:04:58 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2015-07-21 22:04:58 +0200
commitdd7bfa5b86e350c8b789380949cde3bb013b33b0 (patch)
tree5742e2cb5829affb3e45627dbff6493fec31140e /configure.ac
parent1ede7bf288fc5ee27d6c60a7b62ff9bcf03c88a3 (diff)
downloaddabmod-dd7bfa5b86e350c8b789380949cde3bb013b33b0.tar.gz
dabmod-dd7bfa5b86e350c8b789380949cde3bb013b33b0.tar.bz2
dabmod-dd7bfa5b86e350c8b789380949cde3bb013b33b0.zip
Add flags to improve SSE detection
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 11 insertions, 8 deletions
diff --git a/configure.ac b/configure.ac
index 821ba1f..5c3235c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,21 +164,24 @@ AC_LANG_POP([C++])
# Check for SSE
AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
-AC_LINK_IFELSE([
-AC_LANG_PROGRAM([[
+
+save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -msse"
+AC_MSG_CHECKING([whether we need to add -msse])
+AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([[
#include <xmmintrin.h>
__m128 testfunc(float *a, float *b) {
return _mm_add_ps(_mm_loadu_ps(a), _mm_loadu_ps(b));
}
]])],
-[
-has_sse=yes
-],
-[
-has_sse=no
-]
+[has_sse=yes],
+[has_sse=no]
)
AC_MSG_RESULT($has_sse)
+if test x"$has_sse" = xno; then
+ CXXFLAGS="$save_CXXFLAGS"
+fi
+
AM_CONDITIONAL([HAVE_SSE], [test "x$has_sse" = "xyes"])