Hopefully last in line of assembler fixes
authorSampo Savolainen <v2@iki.fi>
Tue, 9 Jan 2007 18:05:50 +0000 (18:05 +0000)
committerSampo Savolainen <v2@iki.fi>
Tue, 9 Jan 2007 18:05:50 +0000 (18:05 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1291 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/globals.cc

index e9d5a01c5061432bd34d588fb3d47ffd73c5c8f8..3f47b30c1f8ca1333205648557be4b8e0df2dec8 100644 (file)
@@ -200,39 +200,39 @@ setup_hardware_optimization (bool try_optimization)
 
 #if defined (ARCH_X86) && defined (BUILD_SSE_OPTIMIZATIONS)
        
-               unsigned int use_sse = 0;
+               unsigned long use_sse = 0;
 
 #ifndef USE_X86_64_ASM
-               asm volatile (
+               asm (
                                 "mov $1, %%eax\n"
                                 "pushl %%ebx\n"
                                 "cpuid\n"
-                                "andl $33554432, %%edx\n"
                                 "movl %%edx, %0\n"
                                 "popl %%ebx\n"
-                            : "=m" (use_sse)
+                            : "=l" (use_sse)
                             : 
                         : "%eax", "%ecx", "%edx", "memory");
+
 #else
 
-               asm volatile (
+               asm (
                                 "movq $1, %%rax\n"
                                 "pushq %%rbx\n"
                                 "cpuid\n"
-                                "andq $33554432, %%rdx\n"
                                 "movq %%rdx, %0\n"
                                 "popq %%rbx\n"
-                            : "=m" (use_sse)
+                            : "=l" (use_sse)
                             : 
                         : "%rax", "%rcx", "%rdx", "memory");
 
 #endif /* USE_X86_64_ASM */
+               use_sse &= (1 << 25); // bit 25 = SSE support
                
                if (use_sse) {
                        info << "Using SSE optimized routines" << endmsg;
        
                        // SSE SET
-                       Session::compute_peak                   = x86_sse_compute_peak;
+                       Session::compute_peak           = x86_sse_compute_peak;
                        Session::apply_gain_to_buffer   = x86_sse_apply_gain_to_buffer;
                        Session::mix_buffers_with_gain  = x86_sse_mix_buffers_with_gain;
                        Session::mix_buffers_no_gain    = x86_sse_mix_buffers_no_gain;