aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--configure.ac20
-rw-r--r--src/Buffer.cpp2
-rw-r--r--src/DabMod.cpp4
-rw-r--r--src/Flowgraph.cpp6
-rw-r--r--src/Makefile.am8
-rw-r--r--src/Resampler.cpp6
6 files changed, 36 insertions, 10 deletions
diff --git a/configure.ac b/configure.ac
index 9b8bcb7..07d6195 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,26 @@ AC_COMPILE_IFELSE(
[AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no]) AC_DEFINE([M_PIl], [M_PI], [Replacing define])])
AC_LANG_POP([C++])
+# Check for SSE
+AC_MSG_CHECKING(for SSE in current arch/CFLAGS)
+AC_LINK_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
+]
+)
+AC_MSG_RESULT($has_sse)
+
+AM_CONDITIONAL([HAVE_SSE], [test "x$has_sse" = "xyes"])
+
AM_CONDITIONAL([IS_GIT_REPO], [test -d '.git'])
AC_TYPE_SIGNAL
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index dff2623..aa0ef4c 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -26,7 +26,7 @@
#include <stdlib.h>
#include <string.h>
#include <malloc.h>
-#ifdef HAVE_DECL__MM_MALLOC
+#if HAVE_DECL__MM_MALLOC
# include <mm_malloc.h>
#else
# define memalign(a, b) malloc(b)
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index 7ee65dc..67ad12d 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -56,11 +56,11 @@
#include <stdexcept>
#include <signal.h>
-#ifdef HAVE_NETINET_IN_H
+#if HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif
-#ifdef HAVE_DECL__MM_MALLOC
+#if HAVE_DECL__MM_MALLOC
# include <mm_malloc.h>
#else
# define memalign(a, b) malloc(b)
diff --git a/src/Flowgraph.cpp b/src/Flowgraph.cpp
index 4e44f28..dd9c68b 100644
--- a/src/Flowgraph.cpp
+++ b/src/Flowgraph.cpp
@@ -23,10 +23,10 @@
#include "PcDebug.h"
-#ifdef __ppc__
-# define memalign(a, b) malloc(b)
-#else // !__ppc__
+#if HAVE_DECL__MM_MALLOC
# include <mm_malloc.h>
+#else
+# define memalign(a, b) malloc(b)
#endif
#include <sys/types.h>
#include <stdexcept>
diff --git a/src/Makefile.am b/src/Makefile.am
index 3e851c4..f6102e9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -34,6 +34,12 @@ else
UHD_SOURCES =
endif
+if HAVE_SSE
+SIMD_CFLAGS = -msse -msse2
+else
+SIMD_CFLAGS =
+endif
+
FFT_DIR=$(top_builddir)/lib/kiss_fft129
FFT_INC=-I$(FFT_DIR) -I$(FFT_DIR)/tools
FFT_SRC=$(FFT_DIR)/kiss_fft.c $(FFT_DIR)/kiss_fft.h $(FFT_DIR)/tools/kiss_fftr.c $(FFT_DIR)/tools/kiss_fftr.h kiss_fftsimd.c kiss_fftsimd.h
@@ -52,7 +58,7 @@ $(FFT_DIR):
tar xzf $(top_srcdir)/lib/kiss_fft129.tar.gz -C $(top_builddir)/lib; \
fi
-odr_dabmod_CPPFLAGS = -Wall $(FFT_INC) $(FFT_FLG) -msse -msse2 $(GITVERSION_FLAGS)
+odr_dabmod_CPPFLAGS = -Wall $(FFT_INC) $(FFT_FLG) $(SIMD_CFLAGS) $(GITVERSION_FLAGS)
odr_dabmod_LDADD = $(ZMQ_LIBS)
odr_dabmod_SOURCES = DabMod.cpp \
PcDebug.h \
diff --git a/src/Resampler.cpp b/src/Resampler.cpp
index 773b9cc..334be99 100644
--- a/src/Resampler.cpp
+++ b/src/Resampler.cpp
@@ -23,10 +23,10 @@
#include "PcDebug.h"
-#ifdef __ppc__
-# define memalign(a, b) malloc(b)
-#else // !__ppc__
+#if HAVE_DECL__MM_MALLOC
# include <mm_malloc.h>
+#else
+# define memalign(a, b) malloc(b)
#endif
#include <sys/types.h>
#include <string.h>