Add denormals stripping to the main thread as well as workerthreads

Conflicts:

	src/core/main.cpp
This commit is contained in:
Vesa
2014-11-16 15:19:54 +02:00
parent baf7c74ad7
commit 4b4469d6c2
2 changed files with 20 additions and 2 deletions

View File

@@ -22,8 +22,8 @@
*
*/
#ifndef _MIXER_WORKER_THREAD_H
#define _MIXER_WORKER_THREAD_H
#ifndef MIXER_WORKER_THREAD_H
#define MIXER_WORKER_THREAD_H
#include <QtCore/QAtomicPointer>
#include <QtCore/QThread>

View File

@@ -27,6 +27,14 @@
#include "lmmsversion.h"
#include "versioninfo.h"
// denormals stripping
#ifdef __SSE__
#include <xmmintrin.h>
#endif
#ifdef __SSE3__
#include <pmmintrin.h>
#endif
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtCore/QLocale>
@@ -92,6 +100,16 @@ int main( int argc, char * * argv )
// intialize RNG
srand( getpid() + time( 0 ) );
// 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
bool core_only = false;
bool fullscreen = true;
bool exit_after_import = false;