I saw some mail go by a bit ago about doubles-vs-floats, but I seem to have lost it. I'm interested in rewriting the mdct code using Altivec on MacOS X. Altivec doesn't support doubles, though -- the only floating point vector type is single precision floats. Vorbis currently has doubles everywhere -- is this really necessary? Doubles are supposedly faster than floats in the PPC FPU, but the Altivec unit is definitely going to be faster. -tim --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
On 29 Aug, Timothy J. Wood wrote:> > > I saw some mail go by a bit ago about doubles-vs-floats, but I seem > to have lost it. > > I'm interested in rewriting the mdct code using Altivec on MacOS X. > Altivec doesn't support doubles, though -- the only floating point > vector type is single precision floats. Vorbis currently has > doubles everywhere -- is this really necessary? Doubles are > supposedly faster than floats in the PPC FPU, but the Altivec unit > is definitely going to be faster. > > -tim > > --- >8 ---- > List archives: http://www.xiph.org/archives/ > Ogg project homepage: http://www.xiph.org/ogg/#define double float hould be all you need. Taral --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
> I saw some mail go by a bit ago about doubles-vs-floats, but I seem to have lost it. > > I'm interested in rewriting the mdct code using Altivec on MacOS X. Altivec doesn't support doubles, though -- the only floating point vector type is single precision floats. Vorbis currently has doubles everywhere -- is this really necessary? Doubles are supposedly faster than floats in the PPC FPU, but the Altivec unit is definitely going to be faster.The mdct will be ok using floats. Don't know if all the rest of vorbis likes floats, though. Which algo are you planning to use for the mdct? Oh, and Altivec is 128 bit, right? Ciao, Segher --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
>The mdct will be ok using floats. Don't know if all the rest of vorbis likes >floats, though.Well, that is sort of what I'm wondering. I don't want to have to take doubles as input to the MDCT, convert them to floats, do the operations, and convert back to doubles. It sounds like I can just always use float, though (at least according to Taral).>Which algo are you planning to use for the mdct? Oh, and Altivec is 128 bit, >right?I'll probably start with what Takehiro Tominaga mailed out (haven't looked at it yet) or whatever ends up on the head of the repository. Yeah, Altivec is 128 bit, so you can issue 4 floating point ops (including mult/add) per cycle, assuming you don't run out of memory bandwidth, completion slots, etc. -tim --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
From: Segher Boessenkool <segher@eastsite.nl>>Except, of course, your code doesn't compile anymore 'cause your header >files need double to be double. And anyway, what he wants is not float, >but Altivec.Is there some reason there isn't a 'VorbisFloat' typedef that can be switched between float and double (and obviously this would need to be used instead of 'double' everywhere)? Well, I do want floats as far as memory layout goes (they should also be 16-byte aligned for the maximum ease of use). -tim --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/
On Tuesday, August 29, 2000, at 02:31 PM, Segher Boessenkool wrote:>Those 4 ops have to be the same, and the data must be in the right order >in your registers (or I don't know Altivec well enough; that's quite >realistic).Yes. The ordering is a little flexible since the Altivec unit can pair a normal operation with a vector permute operation in a single cycle. So, if your data isn't to far out of order, you can reorder it for 'free'.>Because of this, the choice of mdct algo gets different. >Even a plain matrix mult can be fast, you know...I need to look around at the various Altivec resources on the net again -- I think there was an implementation out there already (although it probably isn't under the right license). Obviously I'm still in the research phase :) -tim --- >8 ---- List archives: http://www.xiph.org/archives/ Ogg project homepage: http://www.xiph.org/ogg/