Browse Source

Enable denormals-are-zero (DAZ) mode in engine

tags/v0.6.0
Andrew Belt 6 years ago
parent
commit
f31c13270d
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      src/engine.cpp

+ 4
- 2
src/engine.cpp View File

@@ -7,6 +7,7 @@
#include <chrono>
#include <thread>
#include <xmmintrin.h>
#include <pmmintrin.h>

#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;


Loading…
Cancel
Save