From 3d1e329f33b34fae6407d54c176a3c0f8c753740 Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Tue, 15 Sep 2020 07:25:48 +0200 Subject: [PATCH] CMSIS-DSP: Improved build with MDK Compilation flags to control code size can now be used with MDK build and not only with the cmake one. --- Include/arm_common_tables_f16.h | 1 + Include/arm_helium_utils.h | 2 +- .../ComplexMathFunctions.c | 16 ++++++++-- .../ControllerFunctions/ControllerFunctions.c | 9 ++++++ Source/FastMathFunctions/FastMathFunctions.c | 23 +++++++++++++ .../FilteringFunctions/FilteringFunctions.c | 6 ++++ Source/TransformFunctions/arm_cfft_init_q15.c | 18 +++++------ Source/TransformFunctions/arm_cfft_init_q31.c | 18 +++++------ .../arm_cfft_radix2_init_f16.c | 15 ++++++++- .../arm_cfft_radix2_init_f32.c | 14 +++++++- .../arm_cfft_radix2_init_q15.c | 32 +++++++++++++------ .../arm_cfft_radix2_init_q31.c | 32 +++++++++++++------ .../arm_cfft_radix4_init_f16.c | 16 ++++++++-- .../arm_cfft_radix4_init_f32.c | 16 ++++++++-- .../arm_cfft_radix4_init_q15.c | 24 ++++++++++---- .../arm_cfft_radix4_init_q31.c | 25 +++++++++++---- Source/TransformFunctions/arm_rfft_init_f32.c | 10 +++++- Source/TransformFunctions/arm_rfft_init_q15.c | 11 ++++++- Source/TransformFunctions/arm_rfft_init_q31.c | 11 ++++++- 19 files changed, 237 insertions(+), 62 deletions(-) diff --git a/Include/arm_common_tables_f16.h b/Include/arm_common_tables_f16.h index f6ef321b..c04b30cf 100755 --- a/Include/arm_common_tables_f16.h +++ b/Include/arm_common_tables_f16.h @@ -74,6 +74,7 @@ extern "C" #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F16_4096) extern const float16_t twiddleCoefF16_4096[8192]; + #define twiddleCoefF16 twiddleCoefF16_4096 #endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) */ diff --git a/Include/arm_helium_utils.h b/Include/arm_helium_utils.h index 7a6fa9c2..826ecf84 100755 --- a/Include/arm_helium_utils.h +++ b/Include/arm_helium_utils.h @@ -63,7 +63,7 @@ __STATIC_FORCEINLINE float32_t vecAddAcrossF32Mve(float32x4_t in) return acc; } -__STATIC_FORCEINLINE _Float16 vecAddAcrossF16Mve(float16x8_t in) +__STATIC_FORCEINLINE float16_t vecAddAcrossF16Mve(float16x8_t in) { float16x8_t tmpVec; _Float16 acc; diff --git a/Source/ComplexMathFunctions/ComplexMathFunctions.c b/Source/ComplexMathFunctions/ComplexMathFunctions.c index 22105333..17f58cfa 100644 --- a/Source/ComplexMathFunctions/ComplexMathFunctions.c +++ b/Source/ComplexMathFunctions/ComplexMathFunctions.c @@ -33,8 +33,20 @@ #include "arm_cmplx_dot_prod_q15.c" #include "arm_cmplx_dot_prod_q31.c" #include "arm_cmplx_mag_f32.c" -#include "arm_cmplx_mag_q15.c" -#include "arm_cmplx_mag_q31.c" + +#if defined (ARM_MATH_HELIUM) || defined(ARM_MATH_MVEI) + #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_FAST_SQRT_Q15_MVE) + #include "arm_cmplx_mag_q15.c" + #endif + + #if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_FAST_SQRT_Q31_MVE) + #include "arm_cmplx_mag_q31.c" + #endif +#else + #include "arm_cmplx_mag_q15.c" + #include "arm_cmplx_mag_q31.c" +#endif + #include "arm_cmplx_mag_squared_f32.c" #include "arm_cmplx_mag_squared_q15.c" #include "arm_cmplx_mag_squared_q31.c" diff --git a/Source/ControllerFunctions/ControllerFunctions.c b/Source/ControllerFunctions/ControllerFunctions.c index 51720bcc..e406ac2e 100644 --- a/Source/ControllerFunctions/ControllerFunctions.c +++ b/Source/ControllerFunctions/ControllerFunctions.c @@ -32,6 +32,15 @@ #include "arm_pid_reset_f32.c" #include "arm_pid_reset_q15.c" #include "arm_pid_reset_q31.c" + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FAST_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_F32) #include "arm_sin_cos_f32.c" +#endif + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_Q31) #include "arm_sin_cos_q31.c" +#endif +#endif \ No newline at end of file diff --git a/Source/FastMathFunctions/FastMathFunctions.c b/Source/FastMathFunctions/FastMathFunctions.c index 75dec1c4..de7ce9b4 100644 --- a/Source/FastMathFunctions/FastMathFunctions.c +++ b/Source/FastMathFunctions/FastMathFunctions.c @@ -26,13 +26,36 @@ * limitations under the License. */ +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FAST_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_F32) #include "arm_cos_f32.c" +#endif + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_Q15) #include "arm_cos_q15.c" +#endif + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_Q31) #include "arm_cos_q31.c" +#endif + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_F32) #include "arm_sin_f32.c" +#endif + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_Q15) #include "arm_sin_q15.c" +#endif + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_SIN_Q31) #include "arm_sin_q31.c" +#endif + +#endif + #include "arm_sqrt_q15.c" #include "arm_sqrt_q31.c" #include "arm_vexp_f32.c" #include "arm_vlog_f32.c" + diff --git a/Source/FilteringFunctions/FilteringFunctions.c b/Source/FilteringFunctions/FilteringFunctions.c index 7ce0cdbb..861e9d84 100644 --- a/Source/FilteringFunctions/FilteringFunctions.c +++ b/Source/FilteringFunctions/FilteringFunctions.c @@ -119,8 +119,14 @@ #include "arm_lms_init_q31.c" #include "arm_lms_norm_f32.c" #include "arm_lms_norm_init_f32.c" +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FAST_ALLOW_TABLES) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_RECIP_Q15) #include "arm_lms_norm_init_q15.c" +#endif +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FAST_TABLES) || defined(ARM_TABLE_RECIP_Q31) #include "arm_lms_norm_init_q31.c" +#endif +#endif #include "arm_lms_norm_q15.c" #include "arm_lms_norm_q31.c" #include "arm_lms_q15.c" diff --git a/Source/TransformFunctions/arm_cfft_init_q15.c b/Source/TransformFunctions/arm_cfft_init_q15.c index 8875a1cb..2b478f57 100755 --- a/Source/TransformFunctions/arm_cfft_init_q15.c +++ b/Source/TransformFunctions/arm_cfft_init_q15.c @@ -275,7 +275,7 @@ arm_status arm_cfft_init_q15( /* Initializations of Instance structure depending on the FFT length */ switch (S->fftLen) { -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) && defined(ARM_TABLE_BITREVIDX_FLT_4096)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) && defined(ARM_TABLE_BITREVIDX_FXT_4096)) /* Initializations of structure parameters for 4096 point FFT */ case 4096U: /* Initialise the bit reversal table modifier */ @@ -283,7 +283,7 @@ arm_status arm_cfft_init_q15( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_2048) && defined(ARM_TABLE_BITREVIDX_FLT_2048)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_2048) && defined(ARM_TABLE_BITREVIDX_FXT_2048)) /* Initializations of structure parameters for 2048 point FFT */ case 2048U: /* Initialise the bit reversal table modifier */ @@ -292,7 +292,7 @@ arm_status arm_cfft_init_q15( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_1024) && defined(ARM_TABLE_BITREVIDX_FLT_1024)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_1024) && defined(ARM_TABLE_BITREVIDX_FXT_1024)) /* Initializations of structure parameters for 1024 point FFT */ case 1024U: /* Initialise the bit reversal table modifier */ @@ -301,7 +301,7 @@ arm_status arm_cfft_init_q15( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_512) && defined(ARM_TABLE_BITREVIDX_FLT_512)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_512) && defined(ARM_TABLE_BITREVIDX_FXT_512)) /* Initializations of structure parameters for 512 point FFT */ case 512U: /* Initialise the bit reversal table modifier */ @@ -309,31 +309,31 @@ arm_status arm_cfft_init_q15( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_256) && defined(ARM_TABLE_BITREVIDX_FLT_256)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_256) && defined(ARM_TABLE_BITREVIDX_FXT_256)) case 256U: FFTINIT(q15,256); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_128) && defined(ARM_TABLE_BITREVIDX_FLT_128)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_128) && defined(ARM_TABLE_BITREVIDX_FXT_128)) case 128U: FFTINIT(q15,128); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_64) && defined(ARM_TABLE_BITREVIDX_FLT_64)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_64) && defined(ARM_TABLE_BITREVIDX_FXT_64)) case 64U: FFTINIT(q15,64); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_32) && defined(ARM_TABLE_BITREVIDX_FLT_32)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_32) && defined(ARM_TABLE_BITREVIDX_FXT_32)) case 32U: FFTINIT(q15,32); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_16) && defined(ARM_TABLE_BITREVIDX_FLT_16)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_16) && defined(ARM_TABLE_BITREVIDX_FXT_16)) case 16U: /* Initializations of structure parameters for 16 point FFT */ FFTINIT(q15,16); diff --git a/Source/TransformFunctions/arm_cfft_init_q31.c b/Source/TransformFunctions/arm_cfft_init_q31.c index da9da26f..a68ee9d6 100755 --- a/Source/TransformFunctions/arm_cfft_init_q31.c +++ b/Source/TransformFunctions/arm_cfft_init_q31.c @@ -275,7 +275,7 @@ arm_status arm_cfft_init_q31( /* Initializations of Instance structure depending on the FFT length */ switch (S->fftLen) { -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) && defined(ARM_TABLE_BITREVIDX_FLT_4096)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) && defined(ARM_TABLE_BITREVIDX_FXT_4096)) /* Initializations of structure parameters for 4096 point FFT */ case 4096U: /* Initialise the bit reversal table modifier */ @@ -283,7 +283,7 @@ arm_status arm_cfft_init_q31( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_2048) && defined(ARM_TABLE_BITREVIDX_FLT_2048)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_2048) && defined(ARM_TABLE_BITREVIDX_FXT_2048)) /* Initializations of structure parameters for 2048 point FFT */ case 2048U: /* Initialise the bit reversal table modifier */ @@ -292,7 +292,7 @@ arm_status arm_cfft_init_q31( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_1024) && defined(ARM_TABLE_BITREVIDX_FLT_1024)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_1024) && defined(ARM_TABLE_BITREVIDX_FXT_1024)) /* Initializations of structure parameters for 1024 point FFT */ case 1024U: /* Initialise the bit reversal table modifier */ @@ -301,7 +301,7 @@ arm_status arm_cfft_init_q31( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_512) && defined(ARM_TABLE_BITREVIDX_FLT_512)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_512) && defined(ARM_TABLE_BITREVIDX_FXT_512)) /* Initializations of structure parameters for 512 point FFT */ case 512U: /* Initialise the bit reversal table modifier */ @@ -309,31 +309,31 @@ arm_status arm_cfft_init_q31( break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_256) && defined(ARM_TABLE_BITREVIDX_FLT_256)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_256) && defined(ARM_TABLE_BITREVIDX_FXT_256)) case 256U: FFTINIT(q31,256); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_128) && defined(ARM_TABLE_BITREVIDX_FLT_128)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_128) && defined(ARM_TABLE_BITREVIDX_FXT_128)) case 128U: FFTINIT(q31,128); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_64) && defined(ARM_TABLE_BITREVIDX_FLT_64)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_64) && defined(ARM_TABLE_BITREVIDX_FXT_64)) case 64U: FFTINIT(q31,64); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_32) && defined(ARM_TABLE_BITREVIDX_FLT_32)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_32) && defined(ARM_TABLE_BITREVIDX_FXT_32)) case 32U: FFTINIT(q31,32); break; #endif -#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_16) && defined(ARM_TABLE_BITREVIDX_FLT_16)) +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || (defined(ARM_TABLE_TWIDDLECOEF_Q31_16) && defined(ARM_TABLE_BITREVIDX_FXT_16)) case 16U: /* Initializations of structure parameters for 16 point FFT */ FFTINIT(q31,16); diff --git a/Source/TransformFunctions/arm_cfft_radix2_init_f16.c b/Source/TransformFunctions/arm_cfft_radix2_init_f16.c index b9f9cf5b..83154900 100755 --- a/Source/TransformFunctions/arm_cfft_radix2_init_f16.c +++ b/Source/TransformFunctions/arm_cfft_radix2_init_f16.c @@ -69,8 +69,16 @@ arm_status arm_cfft_radix2_init_f16( uint8_t ifftFlag, uint8_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F16_4096) + + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; @@ -84,6 +92,8 @@ arm_status arm_cfft_radix2_init_f16( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024) + /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) { @@ -187,6 +197,9 @@ arm_status arm_cfft_radix2_init_f16( break; } +#endif +#endif +#endif return (status); } diff --git a/Source/TransformFunctions/arm_cfft_radix2_init_f32.c b/Source/TransformFunctions/arm_cfft_radix2_init_f32.c index 41fbac30..c3cecc2a 100644 --- a/Source/TransformFunctions/arm_cfft_radix2_init_f32.c +++ b/Source/TransformFunctions/arm_cfft_radix2_init_f32.c @@ -71,8 +71,15 @@ arm_status arm_cfft_radix2_init_f32( uint8_t ifftFlag, uint8_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_4096) + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; @@ -86,6 +93,8 @@ arm_status arm_cfft_radix2_init_f32( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_4096) + /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) { @@ -189,6 +198,9 @@ arm_status arm_cfft_radix2_init_f32( break; } +#endif +#endif +#endif return (status); } diff --git a/Source/TransformFunctions/arm_cfft_radix2_init_q15.c b/Source/TransformFunctions/arm_cfft_radix2_init_q15.c index 1edaef3d..5cb0dee4 100644 --- a/Source/TransformFunctions/arm_cfft_radix2_init_q15.c +++ b/Source/TransformFunctions/arm_cfft_radix2_init_q15.c @@ -72,8 +72,15 @@ arm_status arm_cfft_radix2_init_q15( uint8_t ifftFlag, uint8_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_4096) + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; @@ -85,6 +92,8 @@ arm_status arm_cfft_radix2_init_q15( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) + /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) { @@ -96,7 +105,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevTable; + S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; break; @@ -108,7 +117,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 2U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevTable[1]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[1]; break; @@ -116,7 +125,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 1024 point FFT */ S->twidCoefModifier = 4U; S->bitRevFactor = 4U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; break; @@ -124,7 +133,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 512 point FFT */ S->twidCoefModifier = 8U; S->bitRevFactor = 8U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[7]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[7]; break; @@ -132,7 +141,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; break; @@ -140,7 +149,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 128 point FFT */ S->twidCoefModifier = 32U; S->bitRevFactor = 32U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[31]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[31]; break; @@ -148,7 +157,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; break; @@ -156,7 +165,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 32 point FFT */ S->twidCoefModifier = 128U; S->bitRevFactor = 128U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[127]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[127]; break; @@ -164,7 +173,7 @@ arm_status arm_cfft_radix2_init_q15( /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; break; @@ -174,6 +183,9 @@ arm_status arm_cfft_radix2_init_q15( break; } +#endif +#endif +#endif return (status); } diff --git a/Source/TransformFunctions/arm_cfft_radix2_init_q31.c b/Source/TransformFunctions/arm_cfft_radix2_init_q31.c index 074c2c82..b9b49f73 100644 --- a/Source/TransformFunctions/arm_cfft_radix2_init_q31.c +++ b/Source/TransformFunctions/arm_cfft_radix2_init_q31.c @@ -72,7 +72,14 @@ arm_status arm_cfft_radix2_init_q31( uint8_t bitReverseFlag) { /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q31_4096) + + /* Initialise the default arm status */ + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; @@ -86,6 +93,8 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) + /* Initializations of Instance structure depending on the FFT length */ switch (S->fftLen) { @@ -96,7 +105,7 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevTable; + S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; break; /* Initializations of structure parameters for 2048 point FFT */ @@ -106,7 +115,7 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 2U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevTable[1]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[1]; break; /* Initializations of structure parameters for 1024 point FFT */ @@ -116,7 +125,7 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 4U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; break; /* Initializations of structure parameters for 512 point FFT */ @@ -126,42 +135,42 @@ arm_status arm_cfft_radix2_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 8U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevTable[7]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[7]; break; case 256U: /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; break; case 128U: /* Initializations of structure parameters for 128 point FFT */ S->twidCoefModifier = 32U; S->bitRevFactor = 32U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[31]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[31]; break; case 64U: /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; break; case 32U: /* Initializations of structure parameters for 32 point FFT */ S->twidCoefModifier = 128U; S->bitRevFactor = 128U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[127]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[127]; break; case 16U: /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; break; @@ -171,6 +180,9 @@ arm_status arm_cfft_radix2_init_q31( break; } +#endif +#endif +#endif return (status); } diff --git a/Source/TransformFunctions/arm_cfft_radix4_init_f16.c b/Source/TransformFunctions/arm_cfft_radix4_init_f16.c index 2e1317ae..c7aa0fce 100755 --- a/Source/TransformFunctions/arm_cfft_radix4_init_f16.c +++ b/Source/TransformFunctions/arm_cfft_radix4_init_f16.c @@ -72,14 +72,21 @@ arm_status arm_cfft_radix4_init_f16( uint8_t ifftFlag, uint8_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F16_4096) + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; /* Initialise the Twiddle coefficient pointer */ - S->pTwiddle = (float16_t *) twiddleCoef; + S->pTwiddle = (float16_t *) twiddleCoefF16; /* Initialise the Flag for selection of CFFT or CIFFT */ S->ifftFlag = ifftFlag; @@ -87,6 +94,8 @@ arm_status arm_cfft_radix4_init_f16( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREV_1024) + /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) { @@ -149,6 +158,9 @@ arm_status arm_cfft_radix4_init_f16( break; } +#endif +#endif +#endif return (status); } diff --git a/Source/TransformFunctions/arm_cfft_radix4_init_f32.c b/Source/TransformFunctions/arm_cfft_radix4_init_f32.c index e4e3d299..d51f4c13 100644 --- a/Source/TransformFunctions/arm_cfft_radix4_init_f32.c +++ b/Source/TransformFunctions/arm_cfft_radix4_init_f32.c @@ -71,8 +71,15 @@ arm_status arm_cfft_radix4_init_f32( uint8_t ifftFlag, uint8_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_4096) + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; @@ -86,6 +93,8 @@ arm_status arm_cfft_radix4_init_f32( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_F32_4096) + /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) { @@ -147,7 +156,10 @@ arm_status arm_cfft_radix4_init_f32( status = ARM_MATH_ARGUMENT_ERROR; break; } - +#endif +#endif +#endif + return (status); } diff --git a/Source/TransformFunctions/arm_cfft_radix4_init_q15.c b/Source/TransformFunctions/arm_cfft_radix4_init_q15.c index 1b584843..bd7b1aa5 100644 --- a/Source/TransformFunctions/arm_cfft_radix4_init_q15.c +++ b/Source/TransformFunctions/arm_cfft_radix4_init_q15.c @@ -74,7 +74,14 @@ arm_status arm_cfft_radix4_init_q15( uint8_t bitReverseFlag) { /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_4096) + + /* Initialise the default arm status */ + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; /* Initialise the Twiddle coefficient pointer */ @@ -84,6 +91,8 @@ arm_status arm_cfft_radix4_init_q15( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) + /* Initializations of structure parameters depending on the FFT length */ switch (S->fftLen) { @@ -95,7 +104,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevTable; + S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; break; @@ -103,7 +112,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 1024 point FFT */ S->twidCoefModifier = 4U; S->bitRevFactor = 4U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; break; @@ -111,7 +120,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; break; @@ -119,7 +128,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; break; @@ -127,7 +136,7 @@ arm_status arm_cfft_radix4_init_q15( /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; break; @@ -137,6 +146,9 @@ arm_status arm_cfft_radix4_init_q15( break; } +#endif +#endif +#endif return (status); } diff --git a/Source/TransformFunctions/arm_cfft_radix4_init_q31.c b/Source/TransformFunctions/arm_cfft_radix4_init_q31.c index c18e4fee..a7ed1b66 100644 --- a/Source/TransformFunctions/arm_cfft_radix4_init_q31.c +++ b/Source/TransformFunctions/arm_cfft_radix4_init_q31.c @@ -72,8 +72,16 @@ arm_status arm_cfft_radix4_init_q31( uint8_t ifftFlag, uint8_t bitReverseFlag) { + + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_TWIDDLECOEF_Q15_4096) + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialise the FFT length */ S->fftLen = fftLen; /* Initialise the Twiddle coefficient pointer */ @@ -83,6 +91,8 @@ arm_status arm_cfft_radix4_init_q31( /* Initialise the Flag for calculation Bit reversal or not */ S->bitReverseFlag = bitReverseFlag; +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_BITREVIDX_FXT_4096) + /* Initializations of Instance structure depending on the FFT length */ switch (S->fftLen) { @@ -93,7 +103,7 @@ arm_status arm_cfft_radix4_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 1U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) armBitRevTable; + S->pBitRevTable = (uint16_t *) armBitRevIndexTable_fixed_4096; break; /* Initializations of structure parameters for 1024 point FFT */ @@ -103,28 +113,28 @@ arm_status arm_cfft_radix4_init_q31( /* Initialise the bit reversal table modifier */ S->bitRevFactor = 4U; /* Initialise the bit reversal table pointer */ - S->pBitRevTable = (uint16_t *) & armBitRevTable[3]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[3]; break; case 256U: /* Initializations of structure parameters for 256 point FFT */ S->twidCoefModifier = 16U; S->bitRevFactor = 16U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[15]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[15]; break; case 64U: /* Initializations of structure parameters for 64 point FFT */ S->twidCoefModifier = 64U; S->bitRevFactor = 64U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[63]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[63]; break; case 16U: /* Initializations of structure parameters for 16 point FFT */ S->twidCoefModifier = 256U; S->bitRevFactor = 256U; - S->pBitRevTable = (uint16_t *) & armBitRevTable[255]; + S->pBitRevTable = (uint16_t *) & armBitRevIndexTable_fixed_4096[255]; break; default: @@ -133,6 +143,9 @@ arm_status arm_cfft_radix4_init_q31( break; } +#endif +#endif +#endif return (status); } diff --git a/Source/TransformFunctions/arm_rfft_init_f32.c b/Source/TransformFunctions/arm_rfft_init_f32.c index 2191cca8..cb294c65 100644 --- a/Source/TransformFunctions/arm_rfft_init_f32.c +++ b/Source/TransformFunctions/arm_rfft_init_f32.c @@ -71,9 +71,15 @@ arm_status arm_rfft_init_f32( uint32_t ifftFlagR, uint32_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_REALCOEF_F32) /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialize the Real FFT length */ S->fftLenReal = (uint16_t) fftLenReal; @@ -129,6 +135,8 @@ arm_status arm_rfft_init_f32( arm_cfft_radix4_init_f32(S->pCfft, S->fftLenBy2, 0U, 0U); } +#endif +#endif /* return the status of RFFT Init function */ return (status); diff --git a/Source/TransformFunctions/arm_rfft_init_q15.c b/Source/TransformFunctions/arm_rfft_init_q15.c index 7fffce90..e84fc6bf 100644 --- a/Source/TransformFunctions/arm_rfft_init_q15.c +++ b/Source/TransformFunctions/arm_rfft_init_q15.c @@ -68,8 +68,15 @@ arm_status arm_rfft_init_q15( uint32_t ifftFlagR, uint32_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_REALCOEF_Q15) + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialize the Real FFT length */ S->fftLenReal = (uint16_t) fftLenReal; @@ -230,6 +237,8 @@ arm_status arm_rfft_init_q15( break; } +#endif +#endif /* return the status of RFFT Init function */ return (status); } diff --git a/Source/TransformFunctions/arm_rfft_init_q31.c b/Source/TransformFunctions/arm_rfft_init_q31.c index a7dcbf5c..1325c1d8 100644 --- a/Source/TransformFunctions/arm_rfft_init_q31.c +++ b/Source/TransformFunctions/arm_rfft_init_q31.c @@ -70,8 +70,15 @@ arm_status arm_rfft_init_q31( uint32_t ifftFlagR, uint32_t bitReverseFlag) { + /* Initialise the default arm status */ + arm_status status = ARM_MATH_ARGUMENT_ERROR; + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) + +#if !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_ALL_FFT_TABLES) || defined(ARM_TABLE_REALCOEF_Q31) + /* Initialise the default arm status */ - arm_status status = ARM_MATH_SUCCESS; + status = ARM_MATH_SUCCESS; /* Initialize the Real FFT length */ S->fftLenReal = (uint16_t) fftLenReal; @@ -228,6 +235,8 @@ arm_status arm_rfft_init_q31( break; } +#endif +#endif /* return the status of RFFT Init function */ return (status); }