summaryrefslogtreecommitdiff
path: root/libs/ardour/globals.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-05-12 21:07:09 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2015-06-29 14:18:13 -0400
commit6410aa896f974002f8539ee3ca2f70bf66c0a0af (patch)
tree7ef2a62226a6ac5927c563efe21ea6d1ecc0da72 /libs/ardour/globals.cc
parente2a76746e65c42fd10a892ffd82300f1cf776ac6 (diff)
Added optimized AVX function for sample processing
Added AVX versions of existing 5 SSE functions. Added 6th AVX function to copy vectors which is 1.5 times faster then memcpy. Data consistency and validness is fully tested after processing with new AVX functions on aligned and non aligned buffers.
Diffstat (limited to 'libs/ardour/globals.cc')
-rw-r--r--libs/ardour/globals.cc20
1 files changed, 19 insertions, 1 deletions
diff --git a/libs/ardour/globals.cc b/libs/ardour/globals.cc
index 288e69dc9e..fa6f833d94 100644
--- a/libs/ardour/globals.cc
+++ b/libs/ardour/globals.cc
@@ -131,6 +131,7 @@ find_peaks_t ARDOUR::find_peaks = 0;
apply_gain_to_buffer_t ARDOUR::apply_gain_to_buffer = 0;
mix_buffers_with_gain_t ARDOUR::mix_buffers_with_gain = 0;
mix_buffers_no_gain_t ARDOUR::mix_buffers_no_gain = 0;
+copy_vector_t ARDOUR::copy_vector = 0;
PBD::Signal1<void,std::string> ARDOUR::BootMessage;
PBD::Signal3<void,std::string,std::string,bool> ARDOUR::PluginScanMessage;
@@ -160,7 +161,21 @@ setup_hardware_optimization (bool try_optimization)
#if defined (ARCH_X86) && defined (BUILD_SSE_OPTIMIZATIONS)
- if (fpu.has_sse()) {
+ if (fpu.has_avx()) {
+
+ info << "Using AVX optimized routines" << endmsg;
+
+ // AVX SET
+ compute_peak = x86_sse_avx_compute_peak;
+ find_peaks = x86_sse_avx_find_peaks;
+ apply_gain_to_buffer = x86_sse_avx_apply_gain_to_buffer;
+ mix_buffers_with_gain = x86_sse_avx_mix_buffers_with_gain;
+ mix_buffers_no_gain = x86_sse_avx_mix_buffers_no_gain;
+ copy_vector = x86_sse_avx_copy_vector;
+
+ generic_mix_functions = false;
+
+ } else if (fpu.has_sse()) {
info << "Using SSE optimized routines" << endmsg;
@@ -170,6 +185,7 @@ setup_hardware_optimization (bool try_optimization)
apply_gain_to_buffer = x86_sse_apply_gain_to_buffer;
mix_buffers_with_gain = x86_sse_mix_buffers_with_gain;
mix_buffers_no_gain = x86_sse_mix_buffers_no_gain;
+ copy_vector = default_copy_vector;
generic_mix_functions = false;
@@ -187,6 +203,7 @@ setup_hardware_optimization (bool try_optimization)
apply_gain_to_buffer = veclib_apply_gain_to_buffer;
mix_buffers_with_gain = veclib_mix_buffers_with_gain;
mix_buffers_no_gain = veclib_mix_buffers_no_gain;
+ copy_vector = default_copy_vector;
generic_mix_functions = false;
@@ -206,6 +223,7 @@ setup_hardware_optimization (bool try_optimization)
apply_gain_to_buffer = default_apply_gain_to_buffer;
mix_buffers_with_gain = default_mix_buffers_with_gain;
mix_buffers_no_gain = default_mix_buffers_no_gain;
+ copy_vector = default_copy_vector;
info << "No H/W specific optimizations in use" << endmsg;
}