Add denormal protection to Fifowriter thread

This commit is contained in:
Vesa
2014-11-18 09:19:56 +02:00
parent 78042ed4c5
commit eb7343e25a
2 changed files with 17 additions and 0 deletions

View File

@@ -25,6 +25,14 @@
#ifndef _MIXER_H
#define _MIXER_H
// denormals stripping
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#ifdef __SSE3__
#include <pmmintrin.h>
#endif
#include "lmmsconfig.h"
#ifndef LMMS_USE_3RDPARTY_LIBSRC

View File

@@ -902,6 +902,15 @@ Mixer::fifoWriter::fifoWriter( Mixer* mixer, fifo * _fifo ) :
m_fifo( _fifo ),
m_writing( true )
{
// set denormal protection for this thread
#ifdef __SSE3__
/* DAZ flag */
_MM_SET_DENORMALS_ZERO_MODE( _MM_DENORMALS_ZERO_ON );
#endif
#ifdef __SSE__
/* FTZ flag */
_MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON );
#endif
}