From f31c13270d72d07dfa58173e410c554f0ace7cd4 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 20 Jan 2018 15:11:24 -0500 Subject: [PATCH] Enable denormals-are-zero (DAZ) mode in engine --- src/engine.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/engine.cpp b/src/engine.cpp index d7097e4b..7dd2fd07 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include "engine.hpp" #include "util.hpp" @@ -113,9 +114,10 @@ static void engineStep() { } static void engineRun() { - // Set CPU to denormals-are-zero mode - // http://carlh.net/plugins/denormals.php + // Set CPU to flush-to-zero (FTZ) and denormals-are-zero (DAZ) mode + // https://software.intel.com/en-us/node/682949 _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); + _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); // Every time the engine waits and locks a mutex, it steps this many frames const int mutexSteps = 64;