Use ProcessThread::init () to set up denormal protection
authorRobin Gareus <robin@gareus.org>
Mon, 9 Sep 2019 16:48:16 +0000 (18:48 +0200)
committerRobin Gareus <robin@gareus.org>
Mon, 9 Sep 2019 16:48:16 +0000 (18:48 +0200)
Modifying the MXCSR register only affects the current thread.

libs/ardour/ardour/process_thread.h
libs/ardour/process_thread.cc

index d4cda5b472f378efe8d14fc4126f6dcaa25ad507..a4ca646d4b5109995deaf27c46d0b877aff60709 100644 (file)
@@ -37,7 +37,7 @@ public:
        ProcessThread ();
        ~ProcessThread ();
 
-       static void init();
+       void init();
 
        void get_buffers ();
        void drop_buffers ();
index 0cf4bc6f39c13cddf4c5639b3cbdfde73ddd7349..196b88410004b2601c35095669bd5a333ec9f059 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <iostream>
 
+#include "ardour/ardour.h"
 #include "ardour/buffer.h"
 #include "ardour/buffer_manager.h"
 #include "ardour/buffer_set.h"
@@ -41,10 +42,13 @@ Glib::Threads::Private<ThreadBuffers> ProcessThread::_private_thread_buffers (re
 void
 ProcessThread::init ()
 {
+       /* denormal protection is per thread */
+       ARDOUR::setup_fpu ();
 }
 
 ProcessThread::ProcessThread ()
 {
+       init ();
 }
 
 ProcessThread::~ProcessThread ()