Text archives Help
- From: sparker@sci.utah.edu
- To: manta@sci.utah.edu
- Subject: [MANTA] r1043 - in trunk: Engine/Control StandAlone
- Date: Thu, 4 May 2006 19:16:01 -0600 (MDT)
Author: sparker
Date: Thu May 4 19:16:00 2006
New Revision: 1043
Modified:
trunk/Engine/Control/RTRT.cc
trunk/StandAlone/manta.cc
Log:
Move setting of floating point rounding modes so that it will be set for all
threads and will get set
even in embedded mode. Also restore the flags to their original value when
returning.
Modified: trunk/Engine/Control/RTRT.cc
==============================================================================
--- trunk/Engine/Control/RTRT.cc (original)
+++ trunk/Engine/Control/RTRT.cc Thu May 4 19:16:00 2006
@@ -28,6 +28,7 @@
#include <Core/Thread/Time.h>
#include <Core/Util/Assert.h>
#include <Core/Util/NotFinished.h>
+#include <MantaSSE.h>
#include <sgi_stl_warnings_off.h>
#include <sstream>
@@ -257,6 +258,13 @@
void RTRT::internalRenderLoop(int proc, bool lateComerFlag)
{
+#ifdef MANTA_SSE
+ // Disables denormal handling and set flush to zero
+ int oldMXCSR = _mm_getcsr(); //read the old MXCSR setting
+ int newMXCSR = oldMXCSR | 0x8040; // set DAZ and FZ bits
+ _mm_setcsr( newMXCSR ); //write the new MXCSR setting to the MXCSR
+#endif
+
bool changed = true;
bool firstFrame = true;
if(lateComerFlag){
@@ -478,6 +486,11 @@
// }
//#endif
}
+
+#ifdef MANTA_SSE
+ // Restore floating point register flags
+ _mm_setcsr( oldMXCSR ); //write the new MXCSR setting to the MXCSR
+#endif
}
///////////////////////////////////////////////////////////////////////////////
Modified: trunk/StandAlone/manta.cc
==============================================================================
--- trunk/StandAlone/manta.cc (original)
+++ trunk/StandAlone/manta.cc Thu May 4 19:16:00 2006
@@ -59,7 +59,6 @@
#include <Model/Primitives/Sphere.h>
#include <Model/TexCoordMappers/UniformMapper.h>
#include <SCIRun/Core/Thread/Thread.h>
-#include <MantaSSE.h>
#include <strings.h>
@@ -174,13 +173,6 @@
#endif
#if HAVE_IEEEFP_H
fpsetmask(FP_X_OFL|FP_X_DZ|FP_X_INV);
-#endif
-
-#ifdef MANTA_SSE
- // Disables denormal handling and set flush to zero
- int oldMXCSR = _mm_getcsr(); //read the old MXCSR setting
- int newMXCSR = oldMXCSR | 0x8040; // set DAZ and FZ bits
- _mm_setcsr( newMXCSR ); //write the new MXCSR setting to the MXCSR
#endif
// Copy args into a vector<string>
- [MANTA] r1043 - in trunk: Engine/Control StandAlone, sparker, 05/04/2006
Archive powered by MHonArc 2.6.16.