diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-07-21 22:04:58 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-07-21 22:04:58 +0200 |
commit | dd7bfa5b86e350c8b789380949cde3bb013b33b0 (patch) | |
tree | 5742e2cb5829affb3e45627dbff6493fec31140e | |
parent | 1ede7bf288fc5ee27d6c60a7b62ff9bcf03c88a3 (diff) | |
download | dabmod-dd7bfa5b86e350c8b789380949cde3bb013b33b0.tar.gz dabmod-dd7bfa5b86e350c8b789380949cde3bb013b33b0.tar.bz2 dabmod-dd7bfa5b86e350c8b789380949cde3bb013b33b0.zip |
Add flags to improve SSE detection
-rw-r--r-- | Makefile.am | 8 | ||||
-rw-r--r-- | configure.ac | 19 |
2 files changed, 12 insertions, 15 deletions
diff --git a/Makefile.am b/Makefile.am index 5f73f3b..65c48c5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,12 +31,6 @@ else GITVERSION_FLAGS = endif -if HAVE_SSE -SIMD_CFLAGS = -msse -msse2 -else -SIMD_CFLAGS = -endif - bin_PROGRAMS = odr-dabmod FFT_DIR=lib/kiss_fft129 @@ -71,7 +65,7 @@ FFT_FLG= endif odr_dabmod_CPPFLAGS = -Wall -Isrc \ - $(FFT_INC) $(FFT_FLG) $(SIMD_CFLAGS) $(GITVERSION_FLAGS) + $(FFT_INC) $(FFT_FLG) $(GITVERSION_FLAGS) odr_dabmod_LDADD = $(FFT_LDADD) odr_dabmod_SOURCES = src/DabMod.cpp \ src/PcDebug.h \ 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"]) |