From 01a780eb4d533465e94825b65a3f3d4216900832 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 1 Jun 2007 20:29:36 +0000 Subject: round 2 of denormal handling changes - detect DAZ support at runtime, and use accordingly. move all FPU feature detection into PBD::FPU git-svn-id: svn://localhost/ardour2/trunk@1939 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/pbd/pbd/fpu.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 libs/pbd/pbd/fpu.h (limited to 'libs/pbd/pbd/fpu.h') diff --git a/libs/pbd/pbd/fpu.h b/libs/pbd/pbd/fpu.h new file mode 100644 index 0000000000..617dcdf3da --- /dev/null +++ b/libs/pbd/pbd/fpu.h @@ -0,0 +1,31 @@ +#ifndef __pbd_fpu_h__ +#define __pbd_fpu_h__ + +namespace PBD { + + +class FPU { + private: + enum Flags { + HasFlushToZero = 0x1, + HasDenormalsAreZero = 0x2, + HasSSE = 0x4, + HasSSE2 = 0x8 + }; + + public: + FPU (); + ~FPU (); + + bool has_flush_to_zero () const { return _flags & HasFlushToZero; } + bool has_denormals_are_zero () const { return _flags & HasDenormalsAreZero; } + bool has_sse () const { return _flags & HasSSE; } + bool has_sse2 () const { return _flags & HasSSE2; } + + private: + Flags _flags; +}; + +} + +#endif /* __pbd_fpu_h__ */ -- cgit v1.2.3