diff --git a/FDTD/engine_multithread.cpp b/FDTD/engine_multithread.cpp index 96273de..0bc3d68 100644 --- a/FDTD/engine_multithread.cpp +++ b/FDTD/engine_multithread.cpp @@ -251,6 +251,13 @@ void thread::operator()() //std::cout << "thread::operator() Parameters: " << m_start << " " << m_stop << std::endl; //DBG().cout() << "Thread " << m_threadID << " (" << boost::this_thread::get_id() << ") started." << endl; + // speed up the calculation of denormal floating point values (flush-to-zero) +#ifndef SSE_CORRECT_DENORMALS + unsigned int oldMXCSR = _mm_getcsr(); //read the old MXCSR setting + unsigned int newMXCSR = oldMXCSR | 0x8040; // set DAZ and FZ bits + _mm_setcsr( newMXCSR ); //write the new MXCSR setting to the MXCSR +#endif + while (!m_enginePtr->m_stopThreads) { // wait for start diff --git a/FDTD/engine_sse.cpp b/FDTD/engine_sse.cpp index b075a49..660e6d6 100644 --- a/FDTD/engine_sse.cpp +++ b/FDTD/engine_sse.cpp @@ -38,8 +38,8 @@ Engine_sse::Engine_sse(const Operator_sse* op) : Engine(op) // speed up the calculation of denormal floating point values (flush-to-zero) #ifndef SSE_CORRECT_DENORMALS - int oldMXCSR = _mm_getcsr(); //read the old MXCSR setting - int newMXCSR = oldMXCSR | 0x8040; // set DAZ and FZ bits + unsigned int oldMXCSR = _mm_getcsr(); //read the old MXCSR setting + unsigned int newMXCSR = oldMXCSR | 0x8040; // set DAZ and FZ bits _mm_setcsr( newMXCSR ); //write the new MXCSR setting to the MXCSR #endif }