[vorbis-dev] Optimisations

David Riley oscar at the-rileys.net
Thu Nov 16 21:00:50 PST 2000



"Timothy J. Wood" wrote:
>   Probably, but it will probably be hard for the compiler to do some optimizations.  For example, if your C code has needless conversions back and forth between ints and floats, the compiler really doesn't know whether you meant to loose precision or whether you are just being silly.  If you take it down to the C Altivec bindings then you get some of the best of both worlds.  You know the general instruction flow and can see where you have a lot of instructions.  But, you don't have to worry about exact instruction selection, register assignment (which can be a real bear when you have 32 floats, 32 ints and 32 vectors to worry about), or instruction ordering for pipelining.

Slightly off topic, but I personally find it easier to manage large
numbers of registers than the eight (or really 6 because ebp and esp
aren't really general purpose) one gets stuck with when using Intel
assembly.  There's a lot less moving things about in memory especially
(and I know Intel and other CISC architectures have direct addressing
rather than load-store register based, but it's slower because loading
and storing is occuring behind the scenes).

Personally, I believe assembly is best left straight without C bindings
(but that's mainly because I could never really get the labelling of
registers to work for C bindings... it just didn't make sense).  But I
think that's probably more of a coder preference than a real issue of
efficiency (after all, if your code is worse one way than for another,
it's not more efficient).  The biggest problem I have with straight
assembly is the compiler compatibility across platforms.  For example,
on PPC, gcc uses the standard GNU assembler format.  Metrowerks uses
either inline assembly (which may actually be more portable, but I
recall it being a mess in gcc) or a completely different assembler
format (which may be the same as the MPW assembler format, but it might
be entirely different) which is not documented at all in the included
documentation (all it says is that syntax will be different for each
compiler but gives no accurate docs for the PPC assembler).  Anyone know
how well inline assembly works in gcc?  I seem to recall it only really
worked with any great success in C++, but that was a long time ago and
the source may have been incorrect.

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