CMSIS-DSP: Added new f16 tests
diff --git a/CMSIS/DSP/Source/CommonTables/CMakeLists.txt b/CMSIS/DSP/Source/CommonTables/CMakeLists.txt
index d58780a..b6e0ed4 100644
--- a/CMSIS/DSP/Source/CommonTables/CMakeLists.txt
+++ b/CMSIS/DSP/Source/CommonTables/CMakeLists.txt
@@ -41,3 +41,12 @@
endif()
+if (WRAPPER)
+ target_compile_definitions(CMSISDSPCommon PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(CMSISDSPCommon PUBLIC ARM_TABLE_TWIDDLECOEF_F32_4096)
+ target_compile_definitions(CMSISDSPCommon PUBLIC ARM_TABLE_TWIDDLECOEF_Q31_4096)
+ target_compile_definitions(CMSISDSPCommon PUBLIC ARM_TABLE_TWIDDLECOEF_Q15_4096)
+ if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
+ target_compile_definitions(CMSISDSPCommon PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+ endif()
+endif()
\ No newline at end of file
diff --git a/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c b/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c
index 5b8ddc1..efdfecb 100755
--- a/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c
+++ b/CMSIS/DSP/Source/CommonTables/arm_mve_tables.c
@@ -3763,7 +3763,6 @@
#endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */
#endif /* defined(ARM_MATH_MVEF) && !defined(ARM_MATH_AUTOVECTORIZE) */
-#include "arm_math.h"
#if defined(ARM_MATH_MVEI)
@@ -5429,7 +5428,6 @@
#endif /* !defined(ARM_DSP_CONFIG_TABLES) || defined(ARM_FFT_ALLOW_TABLES) */
#endif /* defined(ARM_MATH_MVEI) */
-#include "arm_math.h"
#if defined(ARM_MATH_MVEI)
diff --git a/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c b/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c
index fa6479b..9ebc1f4 100755
--- a/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c
+++ b/CMSIS/DSP/Source/DistanceFunctions/arm_minkowski_distance_f32.c
@@ -35,6 +35,25 @@
@{
*/
+/* 6.14 bug */
+#if defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) && (__ARMCC_VERSION < 6150001)
+
+__attribute__((weak)) float __powisf2(float a, int b)
+{
+ const int recip = b < 0;
+ float r = 1;
+ while (1)
+ {
+ if (b & 1)
+ r *= a;
+ b /= 2;
+ if (b == 0)
+ break;
+ a *= a;
+ }
+ return recip ? 1/r : r;
+}
+#endif
/**
* @brief Minkowski distance between two vectors
diff --git a/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c b/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c
index d396d08..234d33f 100644
--- a/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c
+++ b/CMSIS/DSP/Source/InterpolationFunctions/arm_spline_interp_init_f32.c
@@ -26,7 +26,7 @@
* limitations under the License.
*/
-#include "arm_math.h"
+#include "dsp/interpolation_functions.h"
/**
@ingroup groupInterpolation
diff --git a/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c b/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c
index 7c2fa24..6e7e350 100644
--- a/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c
+++ b/CMSIS/DSP/Source/SupportFunctions/arm_quick_sort_f32.c
@@ -26,7 +26,7 @@
* limitations under the License.
*/
-#include "arm_math.h"
+#include "dsp/support_functions_f16.h"
#include "arm_sorting.h"
static uint32_t arm_quick_sort_partition_f32(float32_t *pSrc, int32_t first, int32_t last, uint8_t dir)
diff --git a/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c b/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c
index 9819570..1a02568 100644
--- a/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c
+++ b/CMSIS/DSP/Source/SupportFunctions/arm_selection_sort_f32.c
@@ -26,7 +26,7 @@
* limitations under the License.
*/
-#include "arm_math.h"
+#include "dsp/support_functions_f16.h"
#include "arm_sorting.h"
/**
diff --git a/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c b/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c
index 1e73f5a..2546861 100644
--- a/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c
+++ b/CMSIS/DSP/Source/SupportFunctions/arm_sort_f32.c
@@ -26,7 +26,7 @@
* limitations under the License.
*/
-#include "arm_math.h"
+#include "dsp/support_functions_f16.h"
#include "arm_sorting.h"
/**
diff --git a/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c b/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c
index 264b5c3..6f6e3a6 100644
--- a/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c
+++ b/CMSIS/DSP/Source/SupportFunctions/arm_sort_init_f32.c
@@ -26,7 +26,7 @@
* limitations under the License.
*/
-#include "arm_math.h"
+#include "dsp/support_functions_f16.h"
#include "arm_sorting.h"
/**
diff --git a/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c b/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c
index 1d2c6ef..5de3143 100755
--- a/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c
+++ b/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f16.c
@@ -24,7 +24,6 @@
* limitations under the License.
*/
-#include "arm_math.h"
#include <limits.h>
#include <math.h>
diff --git a/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c b/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c
index fd8d535..4ada805 100755
--- a/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c
+++ b/CMSIS/DSP/Source/SupportFunctions/arm_weighted_sum_f32.c
@@ -24,7 +24,6 @@
* limitations under the License.
*/
-#include "arm_math.h"
#include <limits.h>
#include <math.h>
diff --git a/CMSIS/DSP/Source/TransformFunctions/CMakeLists.txt b/CMSIS/DSP/Source/TransformFunctions/CMakeLists.txt
index a0139b4..494d9fc 100644
--- a/CMSIS/DSP/Source/TransformFunctions/CMakeLists.txt
+++ b/CMSIS/DSP/Source/TransformFunctions/CMakeLists.txt
@@ -38,6 +38,13 @@
endif()
endif()
+if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
+if (NOT CONFIGTABLE OR ALLFFT OR RFFT_F16_128 OR RFFT_F16_512 OR RFFT_F16_2048 OR RFFT_F16_8192)
+target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_init_f16.c)
+target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix4_f16.c)
+endif()
+endif()
+
if (NOT CONFIGTABLE OR ALLFFT OR CFFT_F64_16 OR CFFT_F64_32 OR CFFT_F64_64 OR CFFT_F64_128 OR CFFT_F64_256 OR CFFT_F64_512
OR CFFT_F64_1024 OR CFFT_F64_2048 OR CFFT_F64_4096)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_f64.c)
@@ -112,9 +119,9 @@
target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_init_f64.c)
endif()
-if (NOT CONFIGTABLE OR ALLFFT OR RFFT_FAST_F32_32 OR RFFT_FAST_F32_64 OR RFFT_FAST_F32_128
- OR RFFT_FAST_F32_256 OR RFFT_FAST_F32_512 OR RFFT_FAST_F32_1024 OR RFFT_FAST_F32_2048
- OR RFFT_FAST_F32_4096 )
+if (NOT CONFIGTABLE OR ALLFFT OR RFFT_FAST_F16_32 OR RFFT_FAST_F16_64 OR RFFT_FAST_F16_128
+ OR RFFT_FAST_F16_256 OR RFFT_FAST_F16_512 OR RFFT_FAST_F16_1024 OR RFFT_FAST_F16_2048
+ OR RFFT_FAST_F16_4096 )
target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_f16.c)
target_sources(CMSISDSPTransform PRIVATE arm_rfft_fast_init_f16.c)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_f16.c)
@@ -152,6 +159,17 @@
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_f32.c)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q31.c)
target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_q15.c)
+if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
+target_sources(CMSISDSPTransform PRIVATE arm_cfft_radix2_init_f16.c)
+endif()
+
+ target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_F32_4096)
+ target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_Q31_4096)
+ target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_Q15_4096)
+if ((NOT ARMAC5) AND (NOT DISABLEFLOAT16))
+ target_compile_definitions(CMSISDSPTransform PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
endif()
### Includes
diff --git a/CMSIS/DSP/Source/TransformFunctions/TransformFunctionsF16.c b/CMSIS/DSP/Source/TransformFunctions/TransformFunctionsF16.c
index f0ff26e..816e5bb 100755
--- a/CMSIS/DSP/Source/TransformFunctions/TransformFunctionsF16.c
+++ b/CMSIS/DSP/Source/TransformFunctions/TransformFunctionsF16.c
@@ -32,4 +32,8 @@
#include "arm_cfft_radix4_f16.c"
#include "arm_rfft_fast_init_f16.c"
#include "arm_rfft_fast_f16.c"
-#include "arm_cfft_radix8_f16.c"
\ No newline at end of file
+#include "arm_cfft_radix8_f16.c"
+
+/* Deprecated */
+#include "arm_cfft_radix2_init_f16.c"
+#include "arm_cfft_radix4_init_f16.c"
diff --git a/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f16.c b/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f16.c
new file mode 100755
index 0000000..b9f9cf5
--- /dev/null
+++ b/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix2_init_f16.c
@@ -0,0 +1,195 @@
+/* ----------------------------------------------------------------------
+ * Project: CMSIS DSP Library
+ * Title: arm_cfft_radix2_init_f16.c
+ * Description: Radix-2 Decimation in Frequency Floating-point CFFT & CIFFT Initialization function
+ *
+ * Target Processor: Cortex-M cores
+ * -------------------------------------------------------------------- */
+/*
+ * Copyright (C) 2010-2020 ARM Limited or its affiliates. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dsp/transform_functions_f16.h"
+#include "arm_common_tables.h"
+#include "arm_common_tables_f16.h"
+
+/**
+ @ingroup groupTransforms
+ */
+
+/**
+ @addtogroup ComplexFFT
+ @{
+ */
+
+/**
+ @brief Initialization function for the floating-point CFFT/CIFFT.
+ @deprecated Do not use this function. It has been superseded by \ref arm_cfft_f16 and will be removed in the future.
+ @param[in,out] S points to an instance of the floating-point CFFT/CIFFT structure
+ @param[in] fftLen length of the FFT
+ @param[in] ifftFlag flag that selects transform direction
+ - value = 0: forward transform
+ - value = 1: inverse transform
+ @param[in] bitReverseFlag flag that enables / disables bit reversal of output
+ - value = 0: disables bit reversal of output
+ - value = 1: enables bit reversal of output
+ @return execution status
+ - \ref ARM_MATH_SUCCESS : Operation successful
+ - \ref ARM_MATH_ARGUMENT_ERROR : <code>fftLen</code> is not a supported length
+
+ @par Details
+ The parameter <code>ifftFlag</code> controls whether a forward or inverse transform is computed.
+ Set(=1) ifftFlag for calculation of CIFFT otherwise CFFT is calculated
+ @par
+ The parameter <code>bitReverseFlag</code> controls whether output is in normal order or bit reversed order.
+ Set(=1) bitReverseFlag for output to be in normal order otherwise output is in bit reversed order.
+ @par
+ The parameter <code>fftLen</code> Specifies length of CFFT/CIFFT process. Supported FFT Lengths are 16, 64, 256, 1024.
+ @par
+ This Function also initializes Twiddle factor table pointer and Bit reversal table pointer.
+*/
+
+arm_status arm_cfft_radix2_init_f16(
+ arm_cfft_radix2_instance_f16 * S,
+ uint16_t fftLen,
+ uint8_t ifftFlag,
+ uint8_t bitReverseFlag)
+{
+ /* Initialise the default arm status */
+ arm_status status = ARM_MATH_SUCCESS;
+
+ /* Initialise the FFT length */
+ S->fftLen = fftLen;
+
+ /* Initialise the Twiddle coefficient pointer */
+ S->pTwiddle = (float16_t *) twiddleCoefF16_4096;
+
+ /* Initialise the Flag for selection of CFFT or CIFFT */
+ S->ifftFlag = ifftFlag;
+
+ /* Initialise the Flag for calculation Bit reversal or not */
+ S->bitReverseFlag = bitReverseFlag;
+
+ /* Initializations of structure parameters depending on the FFT length */
+ switch (S->fftLen)
+ {
+
+ case 4096U:
+ /* Initializations of structure parameters for 4096 point FFT */
+
+ /* Initialise the twiddle coef modifier value */
+ S->twidCoefModifier = 1U;
+ /* Initialise the bit reversal table modifier */
+ S->bitRevFactor = 1U;
+ /* Initialise the bit reversal table pointer */
+ S->pBitRevTable = (uint16_t *) armBitRevTable;
+ /* Initialise the 1/fftLen Value */
+ S->onebyfftLen = 0.000244140625;
+ break;
+
+ case 2048U:
+ /* Initializations of structure parameters for 2048 point FFT */
+
+ /* Initialise the twiddle coef modifier value */
+ S->twidCoefModifier = 2U;
+ /* Initialise the bit reversal table modifier */
+ S->bitRevFactor = 2U;
+ /* Initialise the bit reversal table pointer */
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[1];
+ /* Initialise the 1/fftLen Value */
+ S->onebyfftLen = 0.00048828125;
+ break;
+
+ case 1024U:
+ /* Initializations of structure parameters for 1024 point FFT */
+
+ /* Initialise the twiddle coef modifier value */
+ S->twidCoefModifier = 4U;
+ /* Initialise the bit reversal table modifier */
+ S->bitRevFactor = 4U;
+ /* Initialise the bit reversal table pointer */
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[3];
+ /* Initialise the 1/fftLen Value */
+ S->onebyfftLen = 0.0009765625f;
+ break;
+
+ case 512U:
+ /* Initializations of structure parameters for 512 point FFT */
+
+ /* Initialise the twiddle coef modifier value */
+ S->twidCoefModifier = 8U;
+ /* Initialise the bit reversal table modifier */
+ S->bitRevFactor = 8U;
+ /* Initialise the bit reversal table pointer */
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[7];
+ /* Initialise the 1/fftLen Value */
+ S->onebyfftLen = 0.001953125;
+ break;
+
+ case 256U:
+ /* Initializations of structure parameters for 256 point FFT */
+ S->twidCoefModifier = 16U;
+ S->bitRevFactor = 16U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[15];
+ S->onebyfftLen = 0.00390625f;
+ break;
+
+ case 128U:
+ /* Initializations of structure parameters for 128 point FFT */
+ S->twidCoefModifier = 32U;
+ S->bitRevFactor = 32U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[31];
+ S->onebyfftLen = 0.0078125;
+ break;
+
+ case 64U:
+ /* Initializations of structure parameters for 64 point FFT */
+ S->twidCoefModifier = 64U;
+ S->bitRevFactor = 64U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[63];
+ S->onebyfftLen = 0.015625f;
+ break;
+
+ case 32U:
+ /* Initializations of structure parameters for 64 point FFT */
+ S->twidCoefModifier = 128U;
+ S->bitRevFactor = 128U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[127];
+ S->onebyfftLen = 0.03125;
+ break;
+
+ case 16U:
+ /* Initializations of structure parameters for 16 point FFT */
+ S->twidCoefModifier = 256U;
+ S->bitRevFactor = 256U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[255];
+ S->onebyfftLen = 0.0625f;
+ break;
+
+
+ default:
+ /* Reporting argument error if fftSize is not valid value */
+ status = ARM_MATH_ARGUMENT_ERROR;
+ break;
+ }
+
+ return (status);
+}
+
+/**
+ @} end of ComplexFFT group
+ */
diff --git a/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f16.c b/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f16.c
new file mode 100755
index 0000000..2e1317a
--- /dev/null
+++ b/CMSIS/DSP/Source/TransformFunctions/arm_cfft_radix4_init_f16.c
@@ -0,0 +1,157 @@
+/* ----------------------------------------------------------------------
+ * Project: CMSIS DSP Library
+ * Title: arm_cfft_radix4_init_f16.c
+ * Description: Radix-4 Decimation in Frequency Floating-point CFFT & CIFFT Initialization function
+ *
+ * $Date: 18. March 2019
+ * $Revision: V1.6.0
+ *
+ * Target Processor: Cortex-M cores
+ * -------------------------------------------------------------------- */
+/*
+ * Copyright (C) 2010-2019 ARM Limited or its affiliates. All rights reserved.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ *
+ * Licensed under the Apache License, Version 2.0 (the License); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "dsp/transform_functions_f16.h"
+#include "arm_common_tables.h"
+#include "arm_common_tables_f16.h"
+
+/**
+ @ingroup groupTransforms
+ */
+
+/**
+ @addtogroup ComplexFFT
+ @{
+ */
+
+/**
+ @brief Initialization function for the floating-point CFFT/CIFFT.
+ @deprecated Do not use this function. It has been superceded by \ref arm_cfft_f16 and will be removed in the future.
+ @param[in,out] S points to an instance of the floating-point CFFT/CIFFT structure
+ @param[in] fftLen length of the FFT
+ @param[in] ifftFlag flag that selects transform direction
+ - value = 0: forward transform
+ - value = 1: inverse transform
+ @param[in] bitReverseFlag flag that enables / disables bit reversal of output
+ - value = 0: disables bit reversal of output
+ - value = 1: enables bit reversal of output
+ @return execution status
+ - \ref ARM_MATH_SUCCESS : Operation successful
+ - \ref ARM_MATH_ARGUMENT_ERROR : <code>fftLen</code> is not a supported length
+
+ @par Details
+ The parameter <code>ifftFlag</code> controls whether a forward or inverse transform is computed.
+ Set(=1) ifftFlag for calculation of CIFFT otherwise CFFT is calculated
+ @par
+ The parameter <code>bitReverseFlag</code> controls whether output is in normal order or bit reversed order.
+ Set(=1) bitReverseFlag for output to be in normal order otherwise output is in bit reversed order.
+ @par
+ The parameter <code>fftLen</code> Specifies length of CFFT/CIFFT process. Supported FFT Lengths are 16, 64, 256, 1024.
+ @par
+ This Function also initializes Twiddle factor table pointer and Bit reversal table pointer.
+ */
+
+arm_status arm_cfft_radix4_init_f16(
+ arm_cfft_radix4_instance_f16 * S,
+ uint16_t fftLen,
+ uint8_t ifftFlag,
+ uint8_t bitReverseFlag)
+{
+ /* Initialise the default arm status */
+ arm_status status = ARM_MATH_SUCCESS;
+
+ /* Initialise the FFT length */
+ S->fftLen = fftLen;
+
+ /* Initialise the Twiddle coefficient pointer */
+ S->pTwiddle = (float16_t *) twiddleCoef;
+
+ /* Initialise the Flag for selection of CFFT or CIFFT */
+ S->ifftFlag = ifftFlag;
+
+ /* Initialise the Flag for calculation Bit reversal or not */
+ S->bitReverseFlag = bitReverseFlag;
+
+ /* Initializations of structure parameters depending on the FFT length */
+ switch (S->fftLen)
+ {
+
+ case 4096U:
+ /* Initializations of structure parameters for 4096 point FFT */
+
+ /* Initialise the twiddle coef modifier value */
+ S->twidCoefModifier = 1U;
+ /* Initialise the bit reversal table modifier */
+ S->bitRevFactor = 1U;
+ /* Initialise the bit reversal table pointer */
+ S->pBitRevTable = (uint16_t *) armBitRevTable;
+ /* Initialise the 1/fftLen Value */
+ S->onebyfftLen = 0.000244140625;
+ break;
+
+ case 1024U:
+ /* Initializations of structure parameters for 1024 point FFT */
+
+ /* Initialise the twiddle coef modifier value */
+ S->twidCoefModifier = 4U;
+ /* Initialise the bit reversal table modifier */
+ S->bitRevFactor = 4U;
+ /* Initialise the bit reversal table pointer */
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[3];
+ /* Initialise the 1/fftLen Value */
+ S->onebyfftLen = 0.0009765625f;
+ break;
+
+
+ case 256U:
+ /* Initializations of structure parameters for 256 point FFT */
+ S->twidCoefModifier = 16U;
+ S->bitRevFactor = 16U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[15];
+ S->onebyfftLen = 0.00390625f;
+ break;
+
+ case 64U:
+ /* Initializations of structure parameters for 64 point FFT */
+ S->twidCoefModifier = 64U;
+ S->bitRevFactor = 64U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[63];
+ S->onebyfftLen = 0.015625f;
+ break;
+
+ case 16U:
+ /* Initializations of structure parameters for 16 point FFT */
+ S->twidCoefModifier = 256U;
+ S->bitRevFactor = 256U;
+ S->pBitRevTable = (uint16_t *) & armBitRevTable[255];
+ S->onebyfftLen = 0.0625f;
+ break;
+
+
+ default:
+ /* Reporting argument error if fftSize is not valid value */
+ status = ARM_MATH_ARGUMENT_ERROR;
+ break;
+ }
+
+ return (status);
+}
+
+/**
+ @} end of ComplexFFT group
+ */
diff --git a/CMSIS/DSP/Source/fft.cmake b/CMSIS/DSP/Source/fft.cmake
index 1abd724..9615dd4 100644
--- a/CMSIS/DSP/Source/fft.cmake
+++ b/CMSIS/DSP/Source/fft.cmake
@@ -94,83 +94,47 @@
if (CONFIGTABLE AND CFFT_F16_16)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_16)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_16)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_16)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_32)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_32)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_32)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_32)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_64)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_64)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_64)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_64)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_128)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_128)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_128)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_128)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_256)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_256)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_256)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_256)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_512)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_512)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_512)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_512)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_1024)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_1024)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_1024)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_1024)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_2048)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_2048)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_2048)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_2048)
-endif()
endif()
if (CONFIGTABLE AND CFFT_F16_4096)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
-if (HELIUM OR MVEF)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_4096)
-else()
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_4096)
-endif()
endif()
#######################################
@@ -445,49 +409,49 @@
if (CONFIGTABLE AND RFFT_FAST_F16_32)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_16)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_16)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_16)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_32)
endif()
if (CONFIGTABLE AND RFFT_FAST_F16_64)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_32)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_32)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_32)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_64)
endif()
if (CONFIGTABLE AND RFFT_FAST_F16_128)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_64)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_64)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_64)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_128)
endif()
if (CONFIGTABLE AND RFFT_FAST_F16_256)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_128)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_128)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_128)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_256)
endif()
if (CONFIGTABLE AND RFFT_FAST_F16_512)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_256)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_256)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_256)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_512)
endif()
if (CONFIGTABLE AND RFFT_FAST_F16_1024)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_512)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_512)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_512)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_1024)
endif()
if (CONFIGTABLE AND RFFT_FAST_F16_2048)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_1024)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_1024)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_2048)
endif()
if (CONFIGTABLE AND RFFT_FAST_F16_4096)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_2048)
- target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FLT_2048)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREVIDX_FXT_2048)
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_RFFT_F16_4096)
endif()
@@ -559,6 +523,66 @@
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F32_4096)
endif()
+
+#######################################
+#
+# RFFT F16 (for radix4 and radix2)
+#
+
+if (CONFIGTABLE AND RFFT_F16_32)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_64)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_128)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_256)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_512)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_1024)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_2048)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_4096)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
+if (CONFIGTABLE AND RFFT_F16_8192)
+ # For cfft_radix4_init
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_BITREV_1024)
+ target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_F16_4096)
+endif()
+
#######################################
#
# RFFT Q31
@@ -800,4 +824,6 @@
target_compile_definitions(${PROJECT} PUBLIC ARM_TABLE_TWIDDLECOEF_Q15_4096)
endif()
+
+
endfunction()
\ No newline at end of file