aboutsummaryrefslogtreecommitdiff
path: root/m4/iem_simd.m4
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2015-03-05 15:09:05 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2015-03-05 15:09:05 +0000
commit3620a1ce26b6a139e3bc6b0f13f6fe9e85ff7c4a (patch)
treeb03e9788817a686b6bd271c8c24c9a03333360c7 /m4/iem_simd.m4
parent05f71533d872a0dfd055ef36125e1492ef438468 (diff)
added missing files for autotools migration
svn path=/trunk/externals/iem/iemmatrix/; revision=17433
Diffstat (limited to 'm4/iem_simd.m4')
-rw-r--r--m4/iem_simd.m439
1 files changed, 39 insertions, 0 deletions
diff --git a/m4/iem_simd.m4 b/m4/iem_simd.m4
new file mode 100644
index 0000000..6ae4c2e
--- /dev/null
+++ b/m4/iem_simd.m4
@@ -0,0 +1,39 @@
+dnl Copyright (C) 2005-2006 IOhannes m zmölnig
+dnl This file is free software; IOhannes m zmölnig
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([IEM_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
+
+ for smd in $SIMD
+ do
+ case "${smd}" in
+ SSE2|sse2)
+ AC_MSG_RESULT([SSE2])
+ IEM_CHECK_CFLAGS([-mfpmath=sse -msse])
+ IEM_CHECK_CXXFLAGS([-mfpmath=sse -msse])
+ ;;
+ *)
+ AC_MSG_RESULT([unknown SIMD instructions: ${smd}])
+ ;;
+ esac
+ done
+fi
+])# IEM_CHECK_SIMD