changeset 923:053baea2cbef trunk

[svn] - replace SSE2 detection macro.
author yaz
date Mon, 09 Apr 2007 02:26:28 -0700
parents 7e14701aef54
children f931c9d744a5
files ChangeLog configure.ac
diffstat 2 files changed, 38 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sun Apr 08 21:30:22 2007 -0700
+++ b/ChangeLog	Mon Apr 09 02:26:28 2007 -0700
@@ -1,3 +1,23 @@
+2007-04-09 04:30:22 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
+  revision [1972]
+  - replace random number generator in dithering code with SIMD-oriented Fast Mersenne Twister (SFMT). it reduces CPU load on SSE2 or AltiVec capable platform.
+  
+  trunk/configure.ac                   |   22 +
+  trunk/mk/rules.mk.in                 |    1 
+  trunk/src/madplug/Makefile           |    2 
+  trunk/src/madplug/SFMT-alti.c        |  126 +++++++
+  trunk/src/madplug/SFMT-alti.h        |   40 ++
+  trunk/src/madplug/SFMT-params.h      |   90 +++++
+  trunk/src/madplug/SFMT-params19937.h |   22 +
+  trunk/src/madplug/SFMT-sse2.c        |  113 ++++++
+  trunk/src/madplug/SFMT-sse2.h        |   36 ++
+  trunk/src/madplug/SFMT.c             |  589 +++++++++++++++++++++++++++++++++++
+  trunk/src/madplug/SFMT.h             |  121 +++++++
+  trunk/src/madplug/dither.c           |  104 ------
+  trunk/src/madplug/plugin.c           |    4 
+  13 files changed, 1175 insertions(+), 95 deletions(-)
+
+
 2007-04-07 18:06:36 +0000  Yoshiki Yazawa <yaz@cc.rim.or.jp>
   revision [1970]
   - now wav plugin can handle remaining buffered data at the end of playing.
--- a/configure.ac	Sun Apr 08 21:30:22 2007 -0700
+++ b/configure.ac	Mon Apr 09 02:26:28 2007 -0700
@@ -259,21 +259,24 @@
 
 dnl *** SSE2
 
-AC_LANG(C)
-AC_LANG_CONFTEST([AC_LANG_SOURCE([[#include <xmmintrin.h>
-int main(){
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
-return 0;
-#else
-#error no vector builtins
-#endif
-}]])])
-gcc -E -dD -msse2 -o - conftest.c
-if test $? = 0 ; then
-   AC_DEFINE(HAVE_SSE2, 1, [Define to 1 if your system has SSE2])
-   SIMD_CFLAGS=-msse2
-   AC_SUBST(SIMD_CFLAGS)
-fi
+AC_MSG_CHECKING(SSE2)
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="-msse2"
+AC_TRY_RUN([
+#include <emmintrin.h>
+int main()
+{
+  _mm_setzero_pd();
+  return 0;
+}
+],
+[AC_MSG_RESULT(SSE2 yes)
+AC_DEFINE(HAVE_SSE2, 1, [Define to 1 if your system has SSE2])
+SIMD_CFLAGS=-msse2],
+[AC_MSG_RESULT(SSE2 no)],
+)
+AC_SUBST(SIMD_CFLAGS)
+CFLAGS="$ac_save_CFLAGS"
 
 dnl *** MP3