diff options
author | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2011-09-21 12:32:44 +0000 |
---|---|---|
committer | IOhannes m zmölnig <zmoelnig@users.sourceforge.net> | 2011-09-21 12:32:44 +0000 |
commit | 671fe6ffb308a6d6057084e246e08e1555140b4c (patch) | |
tree | 0e7f34176a5cbb4201169bc9f9ccd3238f6a9c40 /src | |
parent | 2f5253000e9eccef40dd789a408744506981ce73 (diff) |
allow to set SIMD as cmdline arg
default is 'none'
svn path=/trunk/externals/zexy/; revision=15333
Diffstat (limited to 'src')
-rw-r--r-- | src/acinclude.m4 | 34 | ||||
-rw-r--r-- | src/configure.ac | 2 |
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} |