AVX/SSE compatibility

This fixes symbol mangle for window builds, and offers backwards
compatibility with older systems where the inline _mm256_cvtss_f32
is not defined in avxintrin.h
This commit is contained in:
Robin Gareus 2020-08-11 15:12:50 +02:00
parent b0707b812d
commit 01dbbb86c3
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 7 additions and 2 deletions

View file

@ -40,10 +40,15 @@ extern "C" {
LIBARDOUR_API void x86_sse_avx_mix_buffers_with_gain(float * dst, const float * src, uint32_t nframes, float gain);
LIBARDOUR_API void x86_sse_avx_mix_buffers_no_gain (float * dst, const float * src, uint32_t nframes);
LIBARDOUR_API void x86_sse_avx_copy_vector (float * dst, const float * src, uint32_t nframes);
#ifndef PLATFORM_WINDOWS
LIBARDOUR_API void x86_sse_avx_find_peaks (const float * buf, uint32_t nsamples, float *min, float *max);
#endif
}
LIBARDOUR_API void x86_sse_find_peaks (const float * buf, uint32_t nsamples, float *min, float *max);
LIBARDOUR_API void x86_sse_find_peaks (const float * buf, uint32_t nsamples, float *min, float *max);
#ifdef PLATFORM_WINDOWS
LIBARDOUR_API void x86_sse_avx_find_peaks (const float * buf, uint32_t nsamples, float *min, float *max);
#endif
/* debug wrappers for SSE functions */

View file

@ -137,7 +137,7 @@ x86_sse_avx_compute_peak(const float *src, uint32_t nframes, float current)
// zero upper 128 bit of 256 bit ymm register to avoid penalties using non-AVX instructions
_mm256_zeroupper();
return _mm256_cvtss_f32(vcurrent);
return vcurrent[0]; // _mm256_cvtss_f32
}
/**