fix crash when copy'ing latent plugins
[ardour.git] / libs / ardour / sse_functions_xmm.cc
index b3e3342cb8951dc5da6bc49cef479178ef034bc0..6eac488a253a3af89df5f7044a1e60d07ed126b2 100644 (file)
@@ -22,7 +22,7 @@
 #include "ardour/types.h"
 
 void
-x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::nframes_t nframes, float *min, float *max)
+x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::pframes_t nframes, float *min, float *max)
 {
        __m128 current_max, current_min, work;
 
@@ -45,8 +45,11 @@ x86_sse_find_peaks(const ARDOUR::Sample* buf, ARDOUR::nframes_t nframes, float *
 
         // use 64 byte prefetch for quadruple quads
         while (nframes >= 16) {
+#ifdef COMPILER_MSVC
+                               _mm_prefetch(((char*)buf+64), 0);  // A total guess! Assumed to be eqivalent to
+#else                                              // the line below but waiting to be tested !!
                 __builtin_prefetch(buf+64,0,0);
-
+#endif
                 work = _mm_load_ps(buf);
                 current_min = _mm_min_ps(current_min, work);
                 current_max = _mm_max_ps(current_max, work);