[vorbis-dev] optimization patches

Firelight Multimedia support at fmod.org
Sat Sep 9 06:44:41 PDT 2000



2 if statements is not faster than 1 fabs and 1 if statement.   A floating
point compare is very slow, and is subject to branch mispredictions.   fabs
is a 1 cycle operation (it just clears the sign bit in the fpu), and only
incurs one floating point compare.

>>
>> > envelope.c
>> > if (fabs(...) < min) creates horrible assembler (gcc 2.95, x86),
>> > so changed to if (... < min && ... > -min). muchos faster.
>>
>> Intersting. I'll keep it in mind.
>
>I added -mno-ieee-fp to the compile flags; I _think_ fabs() is ok in
>this case. I'll test; no ieee is a huge speedup on x86 anyway.

--- >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 'vorbis-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 Vorbis-dev mailing list