29 #include "../../../common/c71/FFTLIB_debug.h"
30 #include "../../FFTLIB_fft1dBatched_i32fc_c32fc_o32fc/FFTLIB_fft1dBatched_i32fc_c32fc_o32fc.h"
31 #include "../../FFTLIB_fft1d_i32fc_c32fc_o32fc/FFTLIB_fft1d_i32fc_c32fc_o32fc.h"
32 #include "../FFTLIB_fft1d_i32f_c32fc_o32fc.h"
34 #define SE_PARAM_BASE (0x0000)
35 #define SE0_PARAM_OFFSET (SE_PARAM_BASE)
36 #define SE1_PARAM_OFFSET (SE0_PARAM_OFFSET + SE_PARAM_SIZE)
37 #define SE1_PARAM_OFFSET_LAST (SE1_PARAM_OFFSET + SE_PARAM_SIZE)
38 #define SA0_PARAM_OFFSET (SE1_PARAM_OFFSET_LAST + SE_PARAM_SIZE)
39 #define SA1_PARAM_OFFSET (SA0_PARAM_OFFSET + SE_PARAM_SIZE)
41 typedef typename c7x::cfloat_vec
CV;
42 typedef typename c7x::float_vec
V;
68 __SE_TEMPLATE_v1 se0_param = __gen_SE_TEMPLATE_v1 ();
69 __SE_TEMPLATE_v1 se1_param = __gen_SE_TEMPLATE_v1 ();
70 __SA_TEMPLATE_v1 sa0_param = __gen_SA_TEMPLATE_v1 ();
71 __SA_TEMPLATE_v1 sa1_param = __gen_SA_TEMPLATE_v1 ();
74 __SE_TEMPLATE_v1 se1_param_last = __gen_SE_TEMPLATE_v1 ();
77 numPoints = bufParamsX->
dim_x;
79 bufParamsX_FFT.
dim_x = numPoints;
83 &bufParamsX_FFT, (
FFTLIB_F32 *) pXFFT, &bufParamsX_FFT,
84 (numPoints >> 1), 1, &((uint8_t *) pBlock)[5 * SE_PARAM_SIZE]);
86 uint32_t elementCount = c7x::element_count_of<CV>::value;
87 uint32_t SEBlocks = (numPoints >> 1) / elementCount;
88 uint32_t offset = (((uint64_t) pSf - (uint64_t) pXFFT)) /
sizeof (cfloat);
90 se0_param.ICNT0 = elementCount;
92 se0_param.DIM1 = offset;
93 se0_param.ICNT2 = SEBlocks;
94 se0_param.DIM2 = elementCount;
96 se0_param.ELETYPE = __SE_ELETYPE_32BIT_CMPLX_SWAP;
97 se0_param.VECLEN = c7x::se_veclen<CV>::value;
98 se0_param.DIMFMT = __SE_DIMFMT_3D;
102 se1_param.ICNT0 = elementCount;
104 se1_param.DIM1 = offset + (numPoints >> 1) - 1;
105 se1_param.ICNT2 = SEBlocks;
106 se1_param.DIM2 = -elementCount;
108 se1_param.DIR = __SE_DIR_DEC;
109 se1_param.ELETYPE = __SE_ELETYPE_32BIT_CMPLX_SWAP;
110 se1_param.VECLEN = c7x::se_veclen<CV>::value;
111 se1_param.DIMFMT = __SE_DIMFMT_3D;
116 sa0_param.ICNT0 = numPoints >> 1;
117 sa0_param.VECLEN = c7x::sa_veclen<CV>::value;
118 sa0_param.DIMFMT = __SA_DIMFMT_1D;
122 se1_param_last.ICNT0 = numPoints >> 1;
123 se1_param_last.DIR = __SE_DIR_DEC;
124 se1_param_last.ELETYPE = __SE_ELETYPE_32BIT_CMPLX_NOSWAP;
125 se1_param_last.VECLEN = c7x::se_veclen<CV>::value;
126 se1_param_last.DIMFMT = __SE_DIMFMT_1D;
130 sa1_param.ICNT0 = elementCount;
131 sa1_param.ICNT1 = (numPoints >> 1) / (elementCount);
132 sa1_param.DIM1 = -(elementCount);
133 sa1_param.VECLEN = c7x::sa_veclen<CV>::value;
134 sa1_param.DIMFMT = __SA_DIMFMT_2D;
160 numPoints = bufParamsX->
dim_x;
161 bufParamsX_FFT.
dim_x = numPoints;
168 (
FFTLIB_F32 *) pXFFT, &bufParamsX_FFT, (numPoints >> 1), 1,
169 &((uint8_t *) pBlock)[5 * SE_PARAM_SIZE]);
171 FFTLIB_asm (
" MARK 6");
173 __SE_TEMPLATE_v1 se0Params = __gen_SE_TEMPLATE_v1 ();
174 __SE_TEMPLATE_v1 se1Params = __gen_SE_TEMPLATE_v1 ();
177 __SA_TEMPLATE_v1 sa0Params = __gen_SA_TEMPLATE_v1 ();
178 __SA_TEMPLATE_v1 sa1Params = __gen_SA_TEMPLATE_v1 ();
188 __SE0_OPEN (&(pXFFT[0]), se0Params);
189 __SE1_OPEN (&(pXFFT[numPoints + 2]), se1Params);
190 __SA0_OPEN (sa0Params);
191 __SA1_OPEN (sa1Params);
196 CV regStore0, regStore1;
201 #if defined(_HOST_BUILD)
202 c7x::ulong_vec xorVec = (c7x::ulong_vec) (0x0000000080000000);
205 c7x::ulong_vec xorVec = (0x0000000080000000);
209 uint32_t elementCount = c7x::element_count_of<CV>::value;
220 FFTLIB_asm (
" MARK 8");
222 #pragma MUST_ITERATE(8, , 8)
224 for (i = 0; i < (numPoints >> 1) / (elementCount); i++) {
225 var0 = c7x::strm_eng<0, CV>::get_adv ();
226 var1 = c7x::strm_eng<1, CV>::get_adv ();
228 sFA = c7x::strm_eng<0, CV>::get_adv ();
229 sFB = c7x::strm_eng<1, CV>::get_adv ();
231 temp0 = (__complex_multiply (var0, c7x::as_cfloat_vec (sFA)));
232 temp1 = (__complex_conjugate_multiply (var1, c7x::as_cfloat_vec (sFB)));
234 regStore0 = temp0 + temp1;
235 tmp = c7x::strm_agen<0, CV>::get_vpred ();
236 addr = c7x::strm_agen<0, CV>::get_adv (&pY[0]);
237 __vstore_pred (tmp, addr, regStore0);
240 c7x::as_cfloat_vec ((c7x::as_ulong_vec (regStore0)) ^ (xorVec));
242 tmp = c7x::strm_agen<1, CV>::get_vpred ();
243 addr = c7x::strm_agen<1, CV>::get_adv (
244 &pY[2 * numPoints + 2 - (elementCount << 1)]);
245 __vstore_pred (tmp, addr, (__reverse (regStore1)));
247 FFTLIB_asm (
" MARK 9");
278 cfloat var2, temp2, temp3;
281 var2 = ((cfloat *) pXFFT)[0];
283 temp2 = __complex_multiply (var2, (((cfloat *) pSf)[0]));
285 __complex_conjugate_multiply (var2, (((cfloat *) pSf)[numPoints - 1]));
287 ((cfloat *) pY)[0] = temp2 + temp3;
291 pY[numPoints] = pXFFT[0] - pXFFT[1];
292 pY[numPoints + 1] = 0;
294 FFTLIB_asm (
" MARK 7");
316 if ((pX == NULL) || (pW == NULL) || (pY == NULL)) {
319 else if (bufParamsX->
dim_x != bufParamsW->
dim_x ||
323 else if (bufParamsX->
dim_x < 64 * 2) {
332 else if (((uint64_t) pX) & 0xFu) {
341 if (bufParamsX->
dim_x & (1u << k)) {
346 if ((1u << k) != bufParamsX->
dim_x) {
#define SE1_PARAM_OFFSET_LAST
FFTLIB_STATUS_NAME
The enumeration of all status codes.
@ FFTLIB_ERR_INVALID_TYPE
@ FFTLIB_ERR_NULL_POINTER
@ FFTLIB_ERR_INVALID_DIMENSION
@ FFTLIB_ERR_NOT_ALIGNED_PTRS_STRIDES
float FFTLIB_F32
Single precision floating point.
FFTLIB_STATUS FFTLIB_fft1dBatched_i32fc_c32fc_o32fc_init(FFTLIB_F32 *pX, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_F32 *pW, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_F32 *pY, FFTLIB_bufParams1D_t *bufParamsY, uint32_t numPoints, uint32_t numChannels, void *pBlock)
This function should be called before the FFTLIB_fft1dBatched_i32fc_c32fc_o32fc_kernel function is ca...
FFTLIB_STATUS FFTLIB_fft1dBatched_i32fc_c32fc_o32fc_kernel(FFTLIB_F32 *pX, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_F32 *pW, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_F32 *pY, FFTLIB_bufParams1D_t *bufParamsY, uint32_t numPoints, uint32_t numChannels, void *pBlock)
This function is the main kernel compute function.
FFTLIB_STATUS FFTLIB_fft1d_i32f_c32fc_o32fc_init(FFTLIB_F32 *pX, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_F32 *pW, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_F32 *pXFFT, FFTLIB_bufParams1D_t *bufParamsXFFT, FFTLIB_F32 *pSf, FFTLIB_bufParams1D_t *bufParamsSf, FFTLIB_F32 *pY, FFTLIB_bufParams1D_t *bufParamsY, void *pBlock)
This function should be called before the FFTLIB_fft1d_i32f_c32fc_o32fc_kernel function is called....
FFTLIB_STATUS FFTLIB_fft1d_i32f_c32fc_o32fc_kernel(FFTLIB_F32 *restrict pX, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_F32 *restrict pW, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_F32 *restrict pXFFT, FFTLIB_bufParams1D_t *bufParamsXFFT, FFTLIB_F32 *restrict pSf, FFTLIB_bufParams1D_t *bufParamsSf, FFTLIB_F32 *restrict pY, FFTLIB_bufParams1D_t *bufParamsY, void *pBlock)
This function is the main kernel compute function.
FFTLIB_STATUS FFTLIB_fft1d_i32f_c32fc_o32fc_checkParams(FFTLIB_F32 *pX, FFTLIB_bufParams1D_t *bufParamsX, FFTLIB_F32 *pW, FFTLIB_bufParams1D_t *bufParamsW, FFTLIB_F32 *pY, FFTLIB_bufParams1D_t *bufParamsY, void *pBlock)
This function checks the validity of the parameters passed to FFTLIB_fft1d_i32f_c32fc_o32fc_init and ...
A structure for a 1 dimensional buffer descriptor.
uint32_t data_type
Values are of type FFTLIB_data_type_e.
uint32_t dim_x
Width of buffer in X dimension in elements.