On that note, I'd also suggest trying the following compilation flags. They seemed to help me get speex (at least on Athlon) to go from Encode/Decode = 31.9x / 146x realtime to Encode/Decode = 53.4x / 361x realtime The flags I used are -O3 -ffast-math -funroll-all-loops -march=pentium3 -fprefetch-loop-arrays -fsingle-precision-constant You might also try -mcpu=pentium3 instead; that will make your code not require pentium3. This was based on work I was doing with the preprocessor; interestingly, -fsingle-precision-constant alone gave me about 40% improvement on P4s this way. (from 78X realtime to 109X realtime). But, the preprocessor still needs lots of work, especially on P4; it's actually significantly faster to execute on Athlon 1.4Ghz (XP 1700+) than P4 2.8Ghz HT. -SteveK <p><p>Michael T. Dean wrote:> When compiling Speex 1.1.4 with GCC 3.3.2, the option -msse must be > added to the CFLAGS in libspeex/Makefile. > > GCC 3.1.1 added a new option "-msse" (see > http://gcc.gnu.org/gcc-3.1/changes.html , specifically under "New > Targets and Target Specific Improvements") to enable SSE instructions > within the compiler's output (for appropriate architectures). > > Compiling speex on GCC 3.3.2 without the -msse option yields the error > message shown at bottom. The referenced file (xmmintrin.h) contains a > check to ensure that SSE is enabled (via -msse) before use: > > #ifndef __SSE__ > # error "SSE instruction set not enabled" > #else > > This check seems to have been added to the GCC 3.3.x series. > > Once the option is added to CFLAGS, libspeex (and the rest of the > speex package) compiles cleanly and executes properly. > > Thanks, > Mike Dean > > > gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" > -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 > -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 > -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 > -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 > -DHAVE_DLFCN_H=1 -DHAVE_SYS_SOUNDCARD_H=1 -DHAVE_LIBOGG=1 > -DHAVE_LIBM=1 -DVERSION=\"1.1.4\" -D_USE_SSE=1 -I. -I. -g -O2 -MT > nb_celp.lo -MD -MP -MF .deps/nb_celp.Tpo -c nb_celp.c -fPIC -DPIC -o > .libs/nb_celp.o > In file included from vq.h:43, > from nb_celp.c:41: > /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/xmmintrin.h:34:3: > #error "SSE instruction set not enabled" > In file included from nb_celp.c:41: > vq.h:44: error: parse error before '*' token > vq.h:46: error: parse error before '*' token > make[1]: *** [nb_celp.lo] Error 1 > make[1]: Leaving directory `/usr/local/src/mdean/speex-1.1.4/libspeex' > make: *** [all-recursive] Error 1 > > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > Ogg project homepage: http://www.xiph.org/ogg/ > To unsubscribe from this list, send a message to > 'speex-dev-request@xiph.org' > containing only the word 'unsubscribe' in the body. No subject is > needed. > Unsubscribe messages sent to the list will be ignored/filtered. >--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
I'm aware of the problem, but I don't know how to get autoconf to handle that properly. If someone knows how to make that work with autoconf even with non-gcc compilers and with default CFLAGS, I'm interested. Jean-Marc Le jeu 01/04/2004 à 17:21, Michael T. Dean a écrit :> When compiling Speex 1.1.4 with GCC 3.3.2, the option -msse must be > added to the CFLAGS in libspeex/Makefile. > > GCC 3.1.1 added a new option "-msse" (see > http://gcc.gnu.org/gcc-3.1/changes.html , specifically under "New > Targets and Target Specific Improvements") to enable SSE instructions > within the compiler's output (for appropriate architectures). > > Compiling speex on GCC 3.3.2 without the -msse option yields the error > message shown at bottom. The referenced file (xmmintrin.h) contains a > check to ensure that SSE is enabled (via -msse) before use: > > #ifndef __SSE__ > # error "SSE instruction set not enabled" > #else > > This check seems to have been added to the GCC 3.3.x series. > > Once the option is added to CFLAGS, libspeex (and the rest of the speex > package) compiles cleanly and executes properly. > > Thanks, > Mike Dean > > > gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" > -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 > -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 > -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 > -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 > -DHAVE_SYS_SOUNDCARD_H=1 -DHAVE_LIBOGG=1 -DHAVE_LIBM=1 > -DVERSION=\"1.1.4\" -D_USE_SSE=1 -I. -I. -g -O2 -MT nb_celp.lo -MD -MP > -MF .deps/nb_celp.Tpo -c nb_celp.c -fPIC -DPIC -o .libs/nb_celp.o > In file included from vq.h:43, > from nb_celp.c:41: > /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/xmmintrin.h:34:3: > #error "SSE instruction set not enabled" > In file included from nb_celp.c:41: > vq.h:44: error: parse error before '*' token > vq.h:46: error: parse error before '*' token > make[1]: *** [nb_celp.lo] Error 1 > make[1]: Leaving directory `/usr/local/src/mdean/speex-1.1.4/libspeex' > make: *** [all-recursive] Error 1 > > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > Ogg project homepage: http://www.xiph.org/ogg/ > To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' > containing only the word 'unsubscribe' in the body. No subject is needed. > Unsubscribe messages sent to the list will be ignored/filtered.-- Jean-Marc Valin http://www.xiph.org/~jm/ LABORIUS Université de Sherbrooke, Québec, Canada -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 190 bytes Desc: Ceci est une partie de message numériquement signée. Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20040402/1bb9958e/signature-0001.pgp
Here is code to add to configure.in to do what you want. It preserves CFLAGS and uses that var to hold the sse enable flags. You can subset this under the exisiting AC_ARG for sse or just make it do it all the time. If you notice the i?86, that means any x86 platform target will have it enabled. You can change that i686, but keep in mind that some distros compile/target for i386 on the glibc / gcc compiles and you will sometimes get i386 as the target even though you are on a pentium 3/4 box. Aron Rosenberg SightSpeed +++++ Add to configure.in ++++++++ echo -n "Checking for Platform ASM Speedups..." case "$target" in i?86*) CFLAGS="$CFLAGS -D_USE_SSE -O3 -msse" echo "Found and Activating SSE" ;; powerpc-apple-darwin*) CFLAGS="-faltivec" echo "Found and Activating Altivec" ;; *) echo "None Found" ;; esac <p>At 09:08 PM 4/1/2004, you wrote:>I'm aware of the problem, but I don't know how to get autoconf to handle >that properly. If someone knows how to make that work with autoconf even >with non-gcc compilers and with default CFLAGS, I'm interested. > > Jean-Marc > >Le jeu 01/04/2004 à 17:21, Michael T. Dean a écrit : > > When compiling Speex 1.1.4 with GCC 3.3.2, the option -msse must be > > added to the CFLAGS in libspeex/Makefile. > > > > GCC 3.1.1 added a new option "-msse" (see > > http://gcc.gnu.org/gcc-3.1/changes.html , specifically under "New > > Targets and Target Specific Improvements") to enable SSE instructions > > within the compiler's output (for appropriate architectures). > > > > Compiling speex on GCC 3.3.2 without the -msse option yields the error > > message shown at bottom. The referenced file (xmmintrin.h) contains a > > check to ensure that SSE is enabled (via -msse) before use: > > > > #ifndef __SSE__ > > # error "SSE instruction set not enabled" > > #else > > > > This check seems to have been added to the GCC 3.3.x series. > > > > Once the option is added to CFLAGS, libspeex (and the rest of the speex > > package) compiles cleanly and executes properly. > > > > Thanks, > > Mike Dean > > > > > > gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" > > -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 > > -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 > > -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 > > -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 > > -DHAVE_SYS_SOUNDCARD_H=1 -DHAVE_LIBOGG=1 -DHAVE_LIBM=1 > > -DVERSION=\"1.1.4\" -D_USE_SSE=1 -I. -I. -g -O2 -MT nb_celp.lo -MD -MP > > -MF .deps/nb_celp.Tpo -c nb_celp.c -fPIC -DPIC -o .libs/nb_celp.o > > In file included from vq.h:43, > > from nb_celp.c:41: > > /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/xmmintrin.h:34:3: > > #error "SSE instruction set not enabled" > > In file included from nb_celp.c:41: > > vq.h:44: error: parse error before '*' token > > vq.h:46: error: parse error before '*' token > > make[1]: *** [nb_celp.lo] Error 1 > > make[1]: Leaving directory `/usr/local/src/mdean/speex-1.1.4/libspeex' > > make: *** [all-recursive] Error 1 > > > > > > --- >8 ---- > > List archives: http://www.xiph.org/archives/ > > Ogg project homepage: http://www.xiph.org/ogg/ > > To unsubscribe from this list, send a message to > 'speex-dev-request@xiph.org' > > containing only the word 'unsubscribe' in the body. No subject is needed. > > Unsubscribe messages sent to the list will be ignored/filtered. >-- >Jean-Marc Valin >http://www.xiph.org/~jm/ >LABORIUS >Université de Sherbrooke, Québec, Canada--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
When compiling Speex 1.1.4 with GCC 3.3.2, the option -msse must be added to the CFLAGS in libspeex/Makefile. GCC 3.1.1 added a new option "-msse" (see http://gcc.gnu.org/gcc-3.1/changes.html , specifically under "New Targets and Target Specific Improvements") to enable SSE instructions within the compiler's output (for appropriate architectures). Compiling speex on GCC 3.3.2 without the -msse option yields the error message shown at bottom. The referenced file (xmmintrin.h) contains a check to ensure that SSE is enabled (via -msse) before use: #ifndef __SSE__ # error "SSE instruction set not enabled" #else This check seems to have been added to the GCC 3.3.x series. Once the option is added to CFLAGS, libspeex (and the rest of the speex package) compiles cleanly and executes properly. Thanks, Mike Dean <p> gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DHAVE_SYS_SOUNDCARD_H=1 -DHAVE_LIBOGG=1 -DHAVE_LIBM=1 -DVERSION=\"1.1.4\" -D_USE_SSE=1 -I. -I. -g -O2 -MT nb_celp.lo -MD -MP -MF .deps/nb_celp.Tpo -c nb_celp.c -fPIC -DPIC -o .libs/nb_celp.o In file included from vq.h:43, from nb_celp.c:41: /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/include/xmmintrin.h:34:3: #error "SSE instruction set not enabled" In file included from nb_celp.c:41: vq.h:44: error: parse error before '*' token vq.h:46: error: parse error before '*' token make[1]: *** [nb_celp.lo] Error 1 make[1]: Leaving directory `/usr/local/src/mdean/speex-1.1.4/libspeex' make: *** [all-recursive] Error 1 <p>--- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.
On Fri, Apr 02, 2004 at 12:08:52AM -0500, Jean-Marc Valin wrote:> I'm aware of the problem, but I don't know how to get autoconf to handle > that properly. If someone knows how to make that work with autoconf even > with non-gcc compilers and with default CFLAGS, I'm interested.It's easy enough to test whether gcc will accept -msse and ifdef out the intrinsics code otherwise. I suppose you could also just try compiling a sample of the intrinsics in case, but gcc and MSVC are the only two targets you're likely to need to support in the near future. -r --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/ To unsubscribe from this list, send a message to 'speex-dev-request@xiph.org' containing only the word 'unsubscribe' in the body. No subject is needed. Unsubscribe messages sent to the list will be ignored/filtered.