diff --git a/include/Mixer.h b/include/Mixer.h index 76257618a..9319959b6 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -25,6 +25,14 @@ #ifndef _MIXER_H #define _MIXER_H +// denormals stripping +#ifdef __SSE__ +#include +#endif +#ifdef __SSE3__ +#include +#endif + #include "lmmsconfig.h" #ifndef LMMS_USE_3RDPARTY_LIBSRC diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index ae17e08ec..488ea3138 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -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 }