Re: [linux-audio-dev] Fixed vs. floating point

From: Jens M Andreasen <jens.andreasen@email-addr-hidden>
Date: Sun Oct 16 2005 - 05:39:27 EEST

On Fri, 2005-10-14 at 23:29 +0200, Albert Graef wrote:
> fons adriaensen wrote:
> > The bottom line is really quite simple: if your app is to run on a PC, use floats.
> > There are some very good reasons why floats were chosen as JACK's default audio
> > type.
>
> I agree with that conclusion. Just don't forget about the denormals
> issue on Intel (has this been mentioned in this thread before?).
> However, it's easy to work around this by adding a small amount of noise
> where necessary.
>

As an alternative you could also turn denormal handling off and flush to
zero.
 

#include <xmmintrin.h>
#define _MM_DENORM_ZERO_ON 0x0040

// Enable zeroing out denormal.
_mm_setcsr(_MM_FLUSH_ZERO_ON | _MM_MASK_UNDERFLOW | _mm_getcsr());
// Now, enable treating denormal as zero.
_mm_setcsr(_MM_DENORM_ZERO_ON | _mm_getcsr());

gcc -msse -mfpmath=sse
 
Received on Sun Oct 16 08:15:05 2005

This archive was generated by hypermail 2.1.8 : Sun Oct 16 2005 - 08:15:05 EEST