Ardour  8.12
fpu.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2015 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2015 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __pbd_fpu_h__
21 #define __pbd_fpu_h__
22 
23 #include "pbd/libpbd_visibility.h"
24 
25 namespace PBD {
26 
27 class LIBPBD_API FPU {
28  private:
29  enum Flags {
30  HasFlushToZero = 0x1,
31  HasDenormalsAreZero = 0x2,
32  HasSSE = 0x4,
33  HasSSE2 = 0x8,
34  HasAVX = 0x10,
35  HasNEON = 0x20,
36  HasFMA = 0x40,
37  HasAVX512F = 0x80,
38  };
39 
40  public:
41  ~FPU ();
42 
43  static FPU* instance();
44  static void destroy();
45 
46  bool has_flush_to_zero () const { return _flags & HasFlushToZero; }
47  bool has_denormals_are_zero () const { return _flags & HasDenormalsAreZero; }
48  bool has_sse () const { return _flags & HasSSE; }
49  bool has_sse2 () const { return _flags & HasSSE2; }
50  bool has_avx () const { return _flags & HasAVX; }
51  bool has_avx512f () const { return _flags & HasAVX512F; }
52  bool has_fma() const { return _flags & HasFMA; }
53  bool has_neon () const { return _flags & HasNEON; }
54 
55  private:
57 
58  static FPU* _instance;
59 
60  FPU ();
61 };
62 
63 }
64 
65 #endif /* __pbd_fpu_h__ */
Definition: fpu.h:27
Flags _flags
Definition: fpu.h:56
static void destroy()
bool has_sse() const
Definition: fpu.h:48
bool has_avx() const
Definition: fpu.h:50
static FPU * instance()
bool has_fma() const
Definition: fpu.h:52
bool has_avx512f() const
Definition: fpu.h:51
bool has_sse2() const
Definition: fpu.h:49
bool has_denormals_are_zero() const
Definition: fpu.h:47
Flags
Definition: fpu.h:29
bool has_flush_to_zero() const
Definition: fpu.h:46
bool has_neon() const
Definition: fpu.h:53
static FPU * _instance
Definition: fpu.h:58
#define LIBPBD_API
Definition: axis_view.h:42