commit 9a4a7d664e423ff714dd3bdf4b9887bac7b9ad88 parent e321958bfc3c3b7bab18f802c26aa524a1e174ff Author: Michael Savage <mikejsavage@gmail.com> Date: Sun Jan 17 23:14:42 +0000 Use FTZ/DAZ Diffstat:
main.cc | | | 13 | +++++++++++++ |
diff --git a/main.cc b/main.cc @@ -4,6 +4,9 @@ #include <dlfcn.h> #include <sys/stat.h> #include <sys/types.h> +// TODO: this won't work on windows +#include <xmmintrin.h> +#include <pmmintrin.h> #include "platform_opengl.h" #include <GLFW/glfw3.h> @@ -92,6 +95,10 @@ int main( int argc, char ** argv ) { float last_frame_time = program_start_time; u64 total_frames = 0; + // TODO: this won't work on windows + _MM_SET_DENORMALS_ZERO_MODE( _MM_DENORMALS_ZERO_ON ); + _MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON ); + while( !glfwWindowShouldClose( window ) ) { const float current_frame_time = glfwGetTime(); const float dt = current_frame_time - last_frame_time; @@ -134,6 +141,12 @@ int main( int argc, char ** argv ) { last_frame_time = current_frame_time; total_frames++; + + // TODO: this won't work on windows + unsigned int csr = _mm_getcsr(); + if( ( csr & _MM_FLUSH_ZERO_ON ) == 0 || ( csr & _MM_DENORMALS_ZERO_ON ) == 0 ) { + printf( "daz/ftz got switched off\n" ); + } } const float program_run_time = glfwGetTime() - program_start_time;