From dd7bfa5b86e350c8b789380949cde3bb013b33b0 Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 21 Jul 2015 22:04:58 +0200 Subject: Add flags to improve SSE detection --- configure.ac | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'configure.ac') 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 __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"]) -- cgit v1.2.3