[vorbis-dev] Optimisations
Timothy J. Wood
tjw at omnigroup.com
Thu Nov 16 17:02:16 PST 2000
> 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.
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).
One benefit of this approach would be to make it easier to compare the results of the C version with a particular optimization. Another would be that Monty, or whoever else, can modify the C version and not worry about the optimized version so much (leaving that to the maintainer of that function), and people can still compile stuff and just select the 'use only C' optimization to always (well, usually :) get valid results.
-tim
--- >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