diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2015-08-11 22:57:08 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2015-08-11 23:00:13 -0400 |
commit | 3a69ff680e190bb9377e4bc13e65cb3981c64c60 (patch) | |
tree | 29a5c60c4514045349a22a1a54908e4b344a053a | |
parent | 41ccfee7a41c81d09d388ccdf9a20da30c49043b (diff) |
use new FPU singleton pattern in libs/ardour
-rw-r--r-- | libs/ardour/ardour/ardour.h | 4 | ||||
-rw-r--r-- | libs/ardour/globals.cc | 24 |
2 files changed, 14 insertions, 14 deletions
diff --git a/libs/ardour/ardour/ardour.h b/libs/ardour/ardour/ardour.h index 8be99a4aba..31565336d4 100644 --- a/libs/ardour/ardour/ardour.h +++ b/libs/ardour/ardour/ardour.h @@ -38,6 +38,10 @@ #include "ardour/types.h" #include "ardour/libardour_visibility.h" +namespace PBD { + class FPU; +} + namespace MIDI { class MachineControl; class Port; diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc index f0c1da683b..4951161a72 100644 --- a/libs/ardour/globals.cc +++ b/libs/ardour/globals.cc @@ -160,13 +160,13 @@ setup_hardware_optimization (bool try_optimization) if (try_optimization) { - FPU fpu; + FPU* fpu = FPU::instance(); #if defined (ARCH_X86) && defined (BUILD_SSE_OPTIMIZATIONS) #if 0 /* AVX code doesn't compile on Linux yet, don't use generic code instead */ - if (fpu.has_avx()) { + if (fpu->has_avx()) { info << "Using AVX optimized routines" << endmsg; @@ -182,7 +182,7 @@ setup_hardware_optimization (bool try_optimization) } else #endif - if (fpu.has_sse()) { + if (fpu->has_sse()) { info << "Using SSE optimized routines" << endmsg; @@ -585,7 +585,8 @@ ARDOUR::no_auto_connect() void ARDOUR::setup_fpu () { - + FPU* fpu = FPU::instance (); + if (getenv ("ARDOUR_RUNNING_UNDER_VALGRIND")) { // valgrind doesn't understand this assembler stuff // September 10th, 2007 @@ -595,13 +596,8 @@ ARDOUR::setup_fpu () #if defined(ARCH_X86) && defined(USE_XMMINTRIN) int MXCSR; - FPU fpu; - - /* XXX use real code to determine if the processor supports - DenormalsAreZero and FlushToZero - */ - if (!fpu.has_flush_to_zero() && !fpu.has_denormals_are_zero()) { + if (!fpu->has_flush_to_zero() && !fpu->has_denormals_are_zero()) { return; } @@ -618,21 +614,21 @@ ARDOUR::setup_fpu () break; case DenormalFTZ: - if (fpu.has_flush_to_zero()) { + if (fpu->has_flush_to_zero()) { MXCSR |= _MM_FLUSH_ZERO_ON; } break; case DenormalDAZ: MXCSR &= ~_MM_FLUSH_ZERO_ON; - if (fpu.has_denormals_are_zero()) { + if (fpu->has_denormals_are_zero()) { MXCSR |= 0x40; } break; case DenormalFTZDAZ: - if (fpu.has_flush_to_zero()) { - if (fpu.has_denormals_are_zero()) { + if (fpu->has_flush_to_zero()) { + if (fpu->has_denormals_are_zero()) { MXCSR |= _MM_FLUSH_ZERO_ON | 0x40; } else { MXCSR |= _MM_FLUSH_ZERO_ON; |