aboutsummaryrefslogtreecommitdiff
path: root/src/acinclude.m4
diff options
context:
space:
mode:
Diffstat (limited to 'src/acinclude.m4')
-rw-r--r--src/acinclude.m434
1 files changed, 34 insertions, 0 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