diff options
author | Jean-Marc Valin <jmvalin@amazon.com> | 2023-11-21 10:13:06 +0300 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@amazon.com> | 2023-11-21 10:13:06 +0300 |
commit | b93e4a149c1bb77e65f4e2c66249553d2a9c4428 (patch) | |
tree | 3307383a7d278d5b57e57c530710827ee295d80f /silk | |
parent | ed9006038966d8ab059964e9bd4918e8d5180512 (diff) |
Start enabling AVX2 silk_inner_product_FLP()
Not yet with rtcd
Diffstat (limited to 'silk')
-rw-r--r-- | silk/float/SigProc_FLP.h | 8 | ||||
-rw-r--r-- | silk/float/inner_product_FLP.c | 2 | ||||
-rw-r--r-- | silk/float/x86/inner_product_FLP_avx2.c | 2 | ||||
-rw-r--r-- | silk/x86/main_sse.h | 17 |
4 files changed, 26 insertions, 3 deletions
diff --git a/silk/float/SigProc_FLP.h b/silk/float/SigProc_FLP.h index 953de8b0..f70ddc3e 100644 --- a/silk/float/SigProc_FLP.h +++ b/silk/float/SigProc_FLP.h @@ -30,6 +30,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FIX.h" #include "float_cast.h" +#include "main.h" #include <math.h> #ifdef __cplusplus @@ -124,12 +125,17 @@ void silk_scale_copy_vector_FLP( ); /* inner product of two silk_float arrays, with result as double */ -double silk_inner_product_FLP( +double silk_inner_product_FLP_c( const silk_float *data1, const silk_float *data2, opus_int dataSize ); +#ifndef OVERRIDE_inner_product_FLP +#define silk_inner_product_FLP(data1, data2, dataSize) silk_inner_product_FLP_c(data1, data2, dataSize) +#endif + + /* sum of squares of a silk_float array, with result as double */ double silk_energy_FLP( const silk_float *data, diff --git a/silk/float/inner_product_FLP.c b/silk/float/inner_product_FLP.c index cdd39d24..88b160ab 100644 --- a/silk/float/inner_product_FLP.c +++ b/silk/float/inner_product_FLP.c @@ -32,7 +32,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "SigProc_FLP.h" /* inner product of two silk_float arrays, with result as double */ -double silk_inner_product_FLP( +double silk_inner_product_FLP_c( const silk_float *data1, const silk_float *data2, opus_int dataSize diff --git a/silk/float/x86/inner_product_FLP_avx2.c b/silk/float/x86/inner_product_FLP_avx2.c index b27b5910..4a2daaf5 100644 --- a/silk/float/x86/inner_product_FLP_avx2.c +++ b/silk/float/x86/inner_product_FLP_avx2.c @@ -35,7 +35,7 @@ POSSIBILITY OF SUCH DAMAGE. /* inner product of two silk_float arrays, with result as double */ -double silk_inner_product_FLP( +double silk_inner_product_FLP_avx2( const silk_float *data1, const silk_float *data2, opus_int dataSize diff --git a/silk/x86/main_sse.h b/silk/x86/main_sse.h index 2e4386bf..81cd684c 100644 --- a/silk/x86/main_sse.h +++ b/silk/x86/main_sse.h @@ -269,5 +269,22 @@ extern opus_int (*const SILK_VAD_GETSA_Q8_IMPL[OPUS_ARCHMASK + 1])( # endif +double silk_inner_product_FLP_avx2( + const silk_float *data1, + const silk_float *data2, + opus_int dataSize +); + +#if defined (OPUS_X86_PRESUME_AVX2) + +#define OVERRIDE_inner_product_FLP +#define silk_inner_product_FLP(data1, data2, dataSize) silk_inner_product_FLP_avx2(data1, data2, dataSize) + +#elif defined(OPUS_HAVE_RTCD) && defined(OPUS_X86_MAY_HAVE_AVX2) + +/*#define OVERRIDE_inner_product_FLP*/ + +#endif + # endif #endif |