[speex-dev] Speex 1.1.4 is out
Aron Rosenberg
aron at sightspeed.com
Wed Jan 21 13:06:36 PST 2004
A few things -
1. I think that run-time processor detection should not be included in Speex.
2. There a few ways of doing per-file compiling flags.
a. Make a new static library that is just the files that have the
SSE / Altivec code in them. You can then use target_CFLAGS in the
Makefile.am script to set what you need
b. Do tricks with file extensions. CFLAGS applies to files that
have a .c ending. CXXFLAGS applies to files that have .cpp . If you place
all the SSE intrinics into .cpp files, then you can add in
libspeex\Makefile.am a line like: libspeex_la_CXXFLAGS = -march=pentium3.
Even better, you can use the configure.in magic from our patch. You define
the CXXFLAGS to add based upon the target architecture. (Note, you will
need to add AC_PROG_CXX into configure.in). That way you add both #ifdef
inside those files and you have runtime selection of the function to use.
ex (configure.in):
echo -n "Checking for Platform ASM Speedups..."
case "$target" in
i?86*)
CFLAGS="$CFLAGS -D_USE_SSE"
CXXFLAGS="$CXXFLAGS -march=pentium3 -D_USE_SSE"
echo "Found x86 - Adding SSE."
;;
powerpc-apple-darwin*)
CFLAGS="-D_USE_ALTIVEC"
CXXFLAGS="$CXXFLAGS -faltivec -O3 -fPIC -D_USE_ALTIVEC"
echo "Found Altivec"
;;
*)
echo "None Found"
;;
esac
<p>Since speex only uses .c files, 2b is a viable option.
Aron Rosenberg
SightSpeed
At 12:28 PM 1/21/2004, you wrote:
> > Is it a problem if all the files are compiled with
> -march=pentium3
> > ? The patch that we sent in already detects in the configure.in script
> > which system you are on and sets a define correctly, i.e. _USE_SSE.
>
>Well, if what you want is auto-detection, turning on -march=pentium3
>means that the code will crash on anything lower than a pentium3. Not
>really useful. Of course, you can make it auto-detect at compile-time,
>but that means you can't use the same binary on SSE and non-SSE
>machines.
>
> Jean-Marc
>
>--
>Jean-Marc Valin, M.Sc.A., ing. jr.
>LABORIUS (http://www.gel.usherb.ca/laborius)
>Université de Sherbrooke, Québec, Canada
<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 at xiph.org'
containing only the word 'unsubscribe' in the body. No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.
More information about the Speex-dev
mailing list