denormal floats (was Re: [linux-audio-dev] XAP spec - early scribbles)
David Olofson
david at olofson.net
Fri Feb 7 08:24:01 UTC 2003
On Friday 07 February 2003 10.55, Steve Harris wrote:
> On Thu, Feb 06, 2003 at 11:13:45 +0100, David Olofson wrote:
> > On Thursday 06 February 2003 16.28, Steve Harris wrote:
> > [...]
> >
> > > #define FLUSH_TO_ZERO(fv) (((*(unsigned
> > > int*)&(fv))&0x7f800000)==0)?0.0f:(fv) I think it came from the
> > > music-dsp list.
> >
> > There's a conditional in there, though.
>
> Yes, but its not in a float context so it wont get
> denormallised(?).
Well, casting to int avoids getting the denormal into the FPU. This is
probably the only safe way to deal with a denormal without forcing
the FPU to burn cycles evaluating it. I don't see how this has
anything to do with the conditional, though. It's a potential
misprediction + pipeline flush regardless of whether the controlling
input comes from the FPU or the ALU.
//David Olofson - Programmer, Composer, Open Source Advocate
.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`---------------------------> http://olofson.net/audiality -'
--- http://olofson.net --- http://www.reologica.se ---
More information about the Linux-audio-dev
mailing list