Skip to content

Commit

Permalink
[supernova] use boost.predef for checking SIMD
Browse files Browse the repository at this point in the history
this fixes denormals on Windows
  • Loading branch information
jrsurge committed Aug 4, 2019
1 parent ba1d880 commit 514a0ab
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion server/supernova/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
# include <CoreAudio/CoreAudioTypes.h>
#endif

#include <boost/predef/architecture.hpp>
#include <boost/predef/hardware.hpp>

namespace nova {

class nova_server* instance = nullptr;
Expand Down Expand Up @@ -207,7 +210,7 @@ static void name_current_thread(int thread_index) {
}

static void set_daz_ftz(void) {
#ifdef __SSE__
#if defined(BOOST_ARCH_X86_64) || (BOOST_HW_SIMD_X86 >= BOOST_X86_SSE_VERSION)
/* denormal handling */
_MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON);
_mm_setcsr(_mm_getcsr() | 0x40);
Expand Down

0 comments on commit 514a0ab

Please sign in to comment.