summaryrefslogtreecommitdiff
path: root/libs/ardour/globals.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ardour/globals.cc')
-rw-r--r--libs/ardour/globals.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 515d9e1c2f..2806ab60a8 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -197,43 +197,44 @@ setup_hardware_optimization (bool try_optimization)
{
bool generic_mix_functions = true;
+
if (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"
- "popl %%ebx\n"
- "andl $33554432, %%edx\n"
"movl %%edx, %0\n"
- : "=m" (use_sse)
+ "popl %%ebx\n"
+ : "=l" (use_sse)
:
: "%eax", "%ecx", "%edx", "memory");
+
#else
- asm volatile (
- "movq $1, %%rax\n"
+ asm (
"pushq %%rbx\n"
+ "movq $1, %%rax\n"
"cpuid\n"
- "popq %%rbx\n"
- "andq $33554432, %%rdx\n"
"movq %%rdx, %0\n"
- : "=m" (use_sse)
+ "popq %%rbx\n"
+ : "=l" (use_sse)
:
- : "%rax", "%rcx", "%rdx", "memory");
+ : "%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;