summaryrefslogtreecommitdiff
path: root/libs/pbd/fpu.cc
diff options
context:
space:
mode:
authorDoug McLain <doug@nostar.net>2008-06-02 05:02:28 +0000
committerDoug McLain <doug@nostar.net>2008-06-02 05:02:28 +0000
commit9c0d7d72d70082a54f823cd44c0ccda5da64bb6f (patch)
tree96ec400b83b8c1c06852b1936f684b5fbcd47a79 /libs/pbd/fpu.cc
parent2f3f697bb8e185eb43c2c50b4eefc2bcb937f269 (diff)
remove empty sigc++2 directory
git-svn-id: svn://localhost/ardour2/branches/3.0@3432 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/pbd/fpu.cc')
-rw-r--r--libs/pbd/fpu.cc97
1 files changed, 0 insertions, 97 deletions
diff --git a/libs/pbd/fpu.cc b/libs/pbd/fpu.cc
deleted file mode 100644
index f6850a57dc..0000000000
--- a/libs/pbd/fpu.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-#define _XOPEN_SOURCE 600
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <pbd/fpu.h>
-#include <pbd/error.h>
-
-#include "i18n.h"
-
-using namespace PBD;
-using namespace std;
-
-FPU::FPU ()
-{
- unsigned long cpuflags = 0;
-
- _flags = Flags (0);
-
-#ifndef ARCH_X86
- return;
-#endif
-
-#ifndef USE_X86_64_ASM
- asm volatile (
- "mov $1, %%eax\n"
- "pushl %%ebx\n"
- "cpuid\n"
- "movl %%edx, %0\n"
- "popl %%ebx\n"
- : "=r" (cpuflags)
- :
- : "%eax", "%ecx", "%edx", "memory"
- );
-
-#else
-
- asm volatile (
- "pushq %%rbx\n"
- "movq $1, %%rax\n"
- "cpuid\n"
- "movq %%rdx, %0\n"
- "popq %%rbx\n"
- : "=r" (cpuflags)
- :
- : "%rax", "%rcx", "%rdx", "memory"
- );
-
-#endif /* USE_X86_64_ASM */
-
- if (cpuflags & (1<<25)) {
- _flags = Flags (_flags | (HasSSE|HasFlushToZero));
- }
-
- if (cpuflags & (1<<26)) {
- _flags = Flags (_flags | HasSSE2);
- }
-
- if (cpuflags & (1 << 24)) {
-
- char* fxbuf = 0;
-
-#ifdef NO_POSIX_MEMALIGN
- if ((fxbuf = (char *) malloc(512)) == 0)
-#else
- if (posix_memalign ((void**)&fxbuf, 16, 512))
-#endif
- {
- error << _("cannot allocate 16 byte aligned buffer for h/w feature detection") << endmsg;
- } else {
-
- asm volatile (
- "fxsave (%0)"
- :
- : "r" (fxbuf)
- : "memory"
- );
-
- uint32_t mxcsr_mask = *((uint32_t*) &fxbuf[28]);
-
- /* if the mask is zero, set its default value (from intel specs) */
-
- if (mxcsr_mask == 0) {
- mxcsr_mask = 0xffbf;
- }
-
- if (mxcsr_mask & (1<<6)) {
- _flags = Flags (_flags | HasDenormalsAreZero);
- }
-
- free (fxbuf);
- }
- }
-}
-
-FPU::~FPU ()
-{
-}