From 04ed890ca8d59f1f93e30a04182d07c261bdcced Mon Sep 17 00:00:00 2001 From: bsp2 Date: Sat, 27 Oct 2018 14:29:05 +0200 Subject: [PATCH] Linux: set FPU rounding mode (zero) --- src/engine.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/engine.cpp b/src/engine.cpp index 609cb2a8..d15a8bab 100644 --- a/src/engine.cpp +++ b/src/engine.cpp @@ -17,6 +17,9 @@ #include "global.hpp" #include "global_ui.hpp" +#ifdef __GNUC__ +#include +#endif namespace rack { @@ -121,6 +124,10 @@ static void engineRun() { _MM_SET_DENORMALS_ZERO_MODE(_MM_DENORMALS_ZERO_ON); #endif // _MSC_VER +#if defined(__GNUC__) && (defined(ARCH_X64) || defined(ARCH_X86)) + ::fesetround(FE_TOWARDZERO); +#endif // __GNUC__ + // Every time the engine waits and locks a mutex, it steps this many frames const int mutexSteps = 64; // Time in seconds that the engine is rushing ahead of the estimated clock time