traverso-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-commit] traverso/src core/CMakeLists.txt core/core.pro ...


From: Remon Sijrier
Subject: [Traverso-commit] traverso/src core/CMakeLists.txt core/core.pro ...
Date: Wed, 07 Nov 2007 22:02:48 +0000

CVSROOT:        /sources/traverso
Module name:    traverso
Changes by:     Remon Sijrier <r_sijrier>       07/11/07 22:02:48

Modified files:
        src/core       : CMakeLists.txt core.pro 
        src/traverso   : CMakeLists.txt Traverso.cpp traverso.pro 
Added files:
        src/common     : fpu.cc fpu.h 
Removed files:
        src/core       : fpu.cc fpu.h 

Log message:
        * move fpu.h/cc to src/common 
        * add -fPIC compile flag when linking traverso in release mode (fixes 
runtime sse detection in fpu.cc)

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/common/fpu.cc?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/common/fpu.h?cvsroot=traverso&rev=1.1
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/CMakeLists.txt?cvsroot=traverso&r1=1.6&r2=1.7
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/core.pro?cvsroot=traverso&r1=1.45&r2=1.46
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/fpu.cc?cvsroot=traverso&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/traverso/src/core/fpu.h?cvsroot=traverso&r1=1.1&r2=0
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/CMakeLists.txt?cvsroot=traverso&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/Traverso.cpp?cvsroot=traverso&r1=1.51&r2=1.52
http://cvs.savannah.gnu.org/viewcvs/traverso/src/traverso/traverso.pro?cvsroot=traverso&r1=1.81&r2=1.82

Patches:
Index: core/CMakeLists.txt
===================================================================
RCS file: /sources/traverso/traverso/src/core/CMakeLists.txt,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -b -r1.6 -r1.7
--- core/CMakeLists.txt 7 Nov 2007 21:36:00 -0000       1.6
+++ core/CMakeLists.txt 7 Nov 2007 22:02:47 -0000       1.7
@@ -49,7 +49,6 @@
 Themer.cpp
 AudioFileMerger.cpp
 ProjectConverter.cpp
-fpu.cc
 )
 
 SET(TRAVERSO_CORE_MOC_CLASSES

Index: core/core.pro
===================================================================
RCS file: /sources/traverso/traverso/src/core/core.pro,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -b -r1.45 -r1.46
--- core/core.pro       5 Nov 2007 17:39:42 -0000       1.45
+++ core/core.pro       7 Nov 2007 22:02:47 -0000       1.46
@@ -58,8 +58,7 @@
        Marker.cpp \
        Themer.cpp \
        AudioFileMerger.cpp \
-       ProjectConverter.cpp \
-       fpu.cc
+       ProjectConverter.cpp
 HEADERS = precompile.h \
        ../common/Utils.h \
        ../common/Tsar.h \
@@ -105,8 +104,7 @@
        Marker.h \
        Themer.h \
        AudioFileMerger.h \
-       ProjectConverter.h \
-       fpu.h
+       ProjectConverter.h
 macx{
     QMAKE_LIBDIR += /usr/local/qt/lib
 }

Index: traverso/CMakeLists.txt
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/CMakeLists.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- traverso/CMakeLists.txt     6 Nov 2007 18:25:16 -0000       1.3
+++ traverso/CMakeLists.txt     7 Nov 2007 22:02:47 -0000       1.4
@@ -21,6 +21,7 @@
 
 
 SET(TRAVERSO_GUI_SOURCES
+${CMAKE_SOURCE_DIR}/src/common/fpu.cc
 Traverso.cpp
 BusMonitor.cpp
 ContextDialog.cpp
@@ -124,6 +125,10 @@
     ${TRAVERSO_RESOURCES}
 )
 
+SET_TARGET_PROPERTIES(traverso
+    PROPERTIES
+    CMAKE_CXX_FLAGS_RELEASE "-fPIC")
+
 TARGET_LINK_LIBRARIES(traverso
        ${QT_LIBRARIES}
        ${QT_QTXML_LIBRARY}

Index: traverso/Traverso.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/Traverso.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -b -r1.51 -r1.52
--- traverso/Traverso.cpp       7 Nov 2007 21:01:50 -0000       1.51
+++ traverso/Traverso.cpp       7 Nov 2007 22:02:47 -0000       1.52
@@ -194,7 +194,7 @@
 
 #if defined (ARCH_X86) && defined (SSE_OPTIMIZATIONS)
 
-       if (true) {
+       if (fpu.has_sse()) {
 
                printf("Using SSE optimized routines\n");
 

Index: traverso/traverso.pro
===================================================================
RCS file: /sources/traverso/traverso/src/traverso/traverso.pro,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -b -r1.81 -r1.82
--- traverso/traverso.pro       5 Nov 2007 15:33:55 -0000       1.81
+++ traverso/traverso.pro       7 Nov 2007 22:02:48 -0000       1.82
@@ -25,6 +25,7 @@
        -lfftw3
 
 HEADERS += \
+       ../common/fpu.h \
        BusMonitor.h \
        ContextDialog.h \
        FadeContextDialog.h \
@@ -57,6 +58,7 @@
        dialogs/ExportDialog.h \
        dialogs/CDWritingDialog.h
 SOURCES += \
+       ../common/fpu.cc \
        Traverso.cpp \
        BusMonitor.cpp \
        ContextDialog.cpp \

Index: common/fpu.cc
===================================================================
RCS file: common/fpu.cc
diff -N common/fpu.cc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ common/fpu.cc       7 Nov 2007 22:02:47 -0000       1.1
@@ -0,0 +1,115 @@
+/*
+Copyright (C) 2007 Remon Sijrier
+
+Copyright (C) 2000-2007 Paul Davis 
+
+This file is part of Traverso
+
+Traverso is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+
+*/
+
+#include <stdlib.h>
+#include <stdint.h>
+
+#include <fpu.h>
+
+#include "Debugger.h"
+
+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                 
+               {
+                       PERROR("cannot allocate 16 byte aligned buffer for h/w 
feature detection");
+               } 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 ()
+{
+}

Index: common/fpu.h
===================================================================
RCS file: common/fpu.h
diff -N common/fpu.h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ common/fpu.h        7 Nov 2007 22:02:47 -0000       1.1
@@ -0,0 +1,50 @@
+/*
+Copyright (C) 2007 Remon Sijrier
+
+Copyright (C) 2000-2007 Paul Davis 
+
+This file is part of Traverso
+
+Traverso is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
+
+*/
+
+#ifndef __pbd_fpu_h__
+#define __pbd_fpu_h__
+
+
+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__ */

Index: core/fpu.cc
===================================================================
RCS file: core/fpu.cc
diff -N core/fpu.cc
--- core/fpu.cc 27 Oct 2007 17:57:15 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,115 +0,0 @@
-/*
-Copyright (C) 2007 Remon Sijrier
-
-Copyright (C) 2000-2007 Paul Davis 
-
-This file is part of Traverso
-
-Traverso is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
-
-*/
-
-#include <stdlib.h>
-#include <stdint.h>
-
-#include <fpu.h>
-
-#include "Debugger.h"
-
-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                 
-               {
-                       PERROR("cannot allocate 16 byte aligned buffer for h/w 
feature detection");
-               } 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 ()
-{
-}

Index: core/fpu.h
===================================================================
RCS file: core/fpu.h
diff -N core/fpu.h
--- core/fpu.h  27 Oct 2007 17:57:15 -0000      1.1
+++ /dev/null   1 Jan 1970 00:00:00 -0000
@@ -1,50 +0,0 @@
-/*
-Copyright (C) 2007 Remon Sijrier
-
-Copyright (C) 2000-2007 Paul Davis 
-
-This file is part of Traverso
-
-Traverso is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA.
-
-*/
-
-#ifndef __pbd_fpu_h__
-#define __pbd_fpu_h__
-
-
-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__ */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]