[vorbis-dev] Re: SIMD instructions

Segher Boessenkool segher at koffie.nl
Sat Feb 8 04:51:55 PST 2003



Felix von Leitner wrote:

> -msse) for gcc 3.  Please note that you need a bleeding edge gcc version
> to use the SSE stuff, I just noticed that my gcc 3.1.1 is still broken
> in this respect.

Try 3.2, this week saw the birth of 3.2.2.  3.1 is ancient.

> I only hacked the decoder, I have not looked at the encoder at all.
> The SSE code is about thrice as large and complex as it needs to because
> the passed data structures are not 16-byte aligned.  That really is a
> big hindrance, and I suggest libvorbis should make sure its data is
> 16-byte aligned anyway, for cache efficiency reasons.

That's non-logical; I could just as well say that all data should be
aligned to 512 bytes, for cache efficiency reasons, as that optimizes
cache latency on my favourite platform.  But of course it doesn't
optimize cache throughput, and it's system dependent.

> The easiest way is to malloc 12 bytes more and then add (16-(ptr&15)) to
> the char* ptr.

malloc()'s return values are always correctly aligned for all
data types; if not, that's a bug in your libc.  Also, if you
change a pointer with this trick, be sure to keep the original
pointer around for free()'ing ;)

<p>Segher

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