[vorbis-dev] Optimisations

Segher Boessenkool segher at wanadoo.nl
Thu Nov 16 17:23:14 PST 2000



"Timothy J. Wood" wrote:
> 
> > Plan is, to rewrite critical parts of the C code, so to be more natural
> > to rewrite using a (possible assembler) vector implementation.
> > Nothing more; it's just simple unrolling && re-rolling. And the usual
> > putting-more-subroutines-into-one-and-refactoring-it-completely-different,
> > of course. make the code more natural to the machine, i.s.o. to the programmer.
> > I think Monty will hate me ;-)  (If not now, soon he will).
> 
>   It seems like we should have a general framework for this.  That is, say that we have a routine foo() that can be optimized various ways.  It would be good to have a runtime switch to enable different optimizations for testing.  For example, you might have foo_ppc() and foo_ppc_altivec() where the 'ppc' only takes advantage of instructions on all ppc machines while the ppc_altivec version uses PPC7440 specific instructions.

My first aim is to just make stuff usable at various vector register
widths; I hope
the ultimate goal will be  to have different selectable implementations for
critical stuff, that will be enabled on machine-per-machine basis (i.e.; runtime
(or possiby configuration) decisions).

>   Likewise you might have x86, x86_sse, x86_mmx, x86_3dnow, etc.
> 
>   So, it would be nice to compile in anything that is compilable on the target and have a runtime switch to select a particular optimization path (and possibly one to select the 'best' one for the current platform automatically).

Exactly.

>   One benefit of this approach would be to make it easier to compare the results of the C version with a particular
> optimization.

What would be the difference?

> Another would be that Monty, or whoever else, can modify the C version and not worry about the optimized version so much

That's why I'm trying to at his stage, not to modify too much of the
codec, especially
not to make any machine-specific implementations of routines that will
possibly be
dropped/mutilated in horrible ways.

> (leaving that to the maintainer of that function), and people can still compile stuff and just select the 'use only C' 

Leaving stuff to the maintainer of a particular function, will make
progress of
Vorbis as slow as the slowest of the developers (at least for some people).

Dagdag,

Segher

--- >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