aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2011-09-21 12:32:44 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2011-09-21 12:32:44 +0000
commit671fe6ffb308a6d6057084e246e08e1555140b4c (patch)
tree0e7f34176a5cbb4201169bc9f9ccd3238f6a9c40
parent2f5253000e9eccef40dd789a408744506981ce73 (diff)
allow to set SIMD as cmdline arg
default is 'none' svn path=/trunk/externals/zexy/; revision=15333
-rw-r--r--src/acinclude.m434
-rw-r--r--src/configure.ac2
2 files changed, 35 insertions, 1 deletions
diff --git a/src/acinclude.m4 b/src/acinclude.m4
index daf0c11..7922bc8 100644
--- a/src/acinclude.m4
+++ b/src/acinclude.m4
@@ -160,3 +160,37 @@ if test "$fat_binary" != no; then
undefine([Name])
fi
])# AC_CHECK_FAT
+
+AC_DEFUN([AC_CHECK_SIMD],
+[
+AC_ARG_ENABLE(simd,
+ [ --enable-simd=ARCHS
+ enable SIMD optimization;
+ valid arguments are: SSE2
+ ],
+ [simd=$enableval], [simd=no])
+if test "$simd" != no; then
+ AC_MSG_CHECKING([SIMD optimization])
+
+ # Respect SIMD given to --enable-simd if present.
+ if test "$simd" != yes; then
+ SIMD=`echo "$simd" | tr ',' ' '`
+ else
+ # Choose a default set of architectures based upon platform.
+ SIMD="SSE2"
+ fi
+ AC_MSG_RESULT([$SIMD])
+
+ for smd in $SIMD
+ do
+ case "${smd}" in
+ SSE2|sse2)
+ AC_CHECK_CFLAGS([-mfpmath=sse -msse])
+ ;;
+ *)
+ AC_MSG_RESULT([unknown SIMD instructions: ${smd}])
+ ;;
+ esac
+ done
+fi
+])# AC_CHECK_SIMD
diff --git a/src/configure.ac b/src/configure.ac
index d0fc17e..f015216 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -164,7 +164,7 @@ if test "x$enable_PIC" != "xno"; then
AC_CHECK_CFLAGS([-fPIC])
fi
-AC_CHECK_CFLAGS([-mfpmath=sse -msse])
+AC_CHECK_SIMD
dnl if we don't have $LD set, we set it to $(CC)
dnl LD=${LD:=$CC}