Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xiph/speex.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2008-04-26 14:03:23 +0400
committerjm <jm@0101bb08-14d6-0310-b084-bc0e0c8e3800>2008-04-26 14:03:23 +0400
commit156702b1a204cfd3b223ee661c418ae0e6ca1828 (patch)
tree7ab6027b2e35fbc9cefa6f8da74f500b9beff2e3
parente3b7dceb4e2c291031a400992e0ae40b92666ab5 (diff)
Patch by Thorvald Natvig to detect when SSE can be safely used with the selected
arch. git-svn-id: http://svn.xiph.org/trunk/speex@14802 0101bb08-14d6-0310-b084-bc0e0c8e3800
-rw-r--r--configure.ac28
1 files changed, 26 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index cbfa2d4..e23bf64 100644
--- a/configure.ac
+++ b/configure.ac
@@ -72,6 +72,23 @@ has_alloca=no
)
AC_MSG_RESULT($has_alloca)
+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)
+
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -fvisibility=hidden"
AC_MSG_CHECKING(for ELF visibility)
@@ -123,12 +140,19 @@ AC_ARG_ENABLE(valgrind, [ --enable-valgrind Enable valgrind extra checks]
AC_DEFINE([ENABLE_VALGRIND], , [Enable valgrind extra checks])
fi])
-AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support], [if test "$enableval" = yes; then
-AC_DEFINE([_USE_SSE], , [Enable SSE support])
+AC_ARG_ENABLE(sse, [ --enable-sse Enable SSE support], [
+if test "x$enableval" != xno; then
+has_sse=yes
CFLAGS="$CFLAGS -O3 -msse"
+else
+has_sse=no
fi
])
+if test "$has_sse" = yes; then
+ AC_DEFINE([_USE_SSE], , [Enable SSE support])
+fi
+
AC_ARG_ENABLE(fixed-point, [ --enable-fixed-point Compile as fixed-point],
[if test "$enableval" = yes; then
AC_DEFINE([FIXED_POINT], , [Compile as fixed-point])