Commit 576d4688 authored by Laurent THOMAS's avatar Laurent THOMAS Committed by Robert Schmidt

Clean up intermediate DFT macros, remove non-existing DFTs

DFT for 9216 and 73728 don't exist and/or assert, so remove them from
the list.
parent ffa3260a
...@@ -44,6 +44,8 @@ ...@@ -44,6 +44,8 @@
/* function description array, to be used when loading the dfts/idfts lib */ /* function description array, to be used when loading the dfts/idfts lib */
static loader_shlibfunc_t shlib_fdesc[2]; static loader_shlibfunc_t shlib_fdesc[2];
static char *arg[64] = {"phytest", "-O", "cmdlineonly::dbgl0"}; static char *arg[64] = {"phytest", "-O", "cmdlineonly::dbgl0"};
dftfunc_t dft;
idftfunc_t idft;
int load_dftslib(void) int load_dftslib(void)
{ {
char *ptr = (char *)config_get_if(); char *ptr = (char *)config_get_if();
...@@ -51,8 +53,8 @@ int load_dftslib(void) ...@@ -51,8 +53,8 @@ int load_dftslib(void)
uniqCfg = load_configmodule(3, (char **)arg, CONFIG_ENABLECMDLINEONLY); uniqCfg = load_configmodule(3, (char **)arg, CONFIG_ENABLECMDLINEONLY);
logInit(); logInit();
} }
shlib_fdesc[0].fname = "dft"; shlib_fdesc[0].fname = "dft_implementation";
shlib_fdesc[1].fname = "idft"; shlib_fdesc[1].fname = "idft_implementation";
int ret = load_module_shlib("dfts", shlib_fdesc, sizeof(shlib_fdesc) / sizeof(loader_shlibfunc_t), NULL); int ret = load_module_shlib("dfts", shlib_fdesc, sizeof(shlib_fdesc) / sizeof(loader_shlibfunc_t), NULL);
AssertFatal((ret >= 0), "Error loading dftsc decoder"); AssertFatal((ret >= 0), "Error loading dftsc decoder");
dft = (dftfunc_t)shlib_fdesc[0].fptr; dft = (dftfunc_t)shlib_fdesc[0].fptr;
......
...@@ -3594,19 +3594,6 @@ void dft6144(int16_t *input, int16_t *output,unsigned char scale) ...@@ -3594,19 +3594,6 @@ void dft6144(int16_t *input, int16_t *output,unsigned char scale)
simde_m_empty(); simde_m_empty();
} }
int16_t twa9216[6144] __attribute__((aligned(32)));
int16_t twb9216[6144] __attribute__((aligned(32)));
// 3072 x 3
void dft9216(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
void idft9216(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
int16_t twa12288[8192] __attribute__((aligned(32))); int16_t twa12288[8192] __attribute__((aligned(32)));
int16_t twb12288[8192] __attribute__((aligned(32))); int16_t twb12288[8192] __attribute__((aligned(32)));
// 4096 x 3 // 4096 x 3
...@@ -4233,20 +4220,6 @@ void idft65536(int16_t *x,int16_t *y,unsigned char scale) ...@@ -4233,20 +4220,6 @@ void idft65536(int16_t *x,int16_t *y,unsigned char scale)
simde_m_empty(); simde_m_empty();
} }
int16_t twa73728[49152] __attribute__((aligned(32)));
int16_t twb73728[49152] __attribute__((aligned(32)));
// 24576 x 3
void dft73728(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
void idft73728(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
int16_t twa98304[65536] __attribute__((aligned(32))); int16_t twa98304[65536] __attribute__((aligned(32)));
int16_t twb98304[65536] __attribute__((aligned(32))); int16_t twb98304[65536] __attribute__((aligned(32)));
// 32768 x 3 // 32768 x 3
...@@ -7905,8 +7878,9 @@ int dfts_autoinit(void) ...@@ -7905,8 +7878,9 @@ int dfts_autoinit(void)
#ifndef MR_MAIN #ifndef MR_MAIN
void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){ void dft_implementation(uint8_t sizeidx, int16_t *input, int16_t *output, unsigned char scale_flag)
AssertFatal((sizeidx >= 0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx); {
AssertFatal((sizeidx >= 0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx);
int algn=0xF; int algn=0xF;
if ( (dft_ftab[sizeidx].size%3) != 0 ) // there is no AVX2 implementation for multiples of 3 DFTs if ( (dft_ftab[sizeidx].size%3) != 0 ) // there is no AVX2 implementation for multiples of 3 DFTs
algn=0x1F; algn=0x1F;
...@@ -7923,8 +7897,9 @@ void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_fla ...@@ -7923,8 +7897,9 @@ void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_fla
dft_ftab[sizeidx].func(input,output,scale_flag); dft_ftab[sizeidx].func(input,output,scale_flag);
}; };
void idft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){ void idft_implementation(uint8_t sizeidx, int16_t *input, int16_t *output, unsigned char scale_flag)
AssertFatal((sizeidx>=0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid idft size index %i\n",sizeidx); {
AssertFatal((sizeidx>=0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid idft size index %i\n",sizeidx);
int algn=0xF; int algn=0xF;
algn=0x1F; algn=0x1F;
AssertFatal( ((intptr_t)output&algn)==0,"Buffers should be 16 bytes aligned %p",output); AssertFatal( ((intptr_t)output&algn)==0,"Buffers should be 16 bytes aligned %p",output);
......
...@@ -3029,19 +3029,6 @@ void dft6144(int16_t *input, int16_t *output,unsigned char scale) ...@@ -3029,19 +3029,6 @@ void dft6144(int16_t *input, int16_t *output,unsigned char scale)
} }
} }
int16_t twa9216[6144] __attribute__((aligned(32)));
int16_t twb9216[6144] __attribute__((aligned(32)));
// 3072 x 3
void dft9216(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
void idft9216(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
int16_t twa12288[8192] __attribute__((aligned(32))); int16_t twa12288[8192] __attribute__((aligned(32)));
int16_t twb12288[8192] __attribute__((aligned(32))); int16_t twb12288[8192] __attribute__((aligned(32)));
// 4096 x 3 // 4096 x 3
...@@ -3649,19 +3636,6 @@ void idft65536(int16_t *x,int16_t *y,unsigned char scale) ...@@ -3649,19 +3636,6 @@ void idft65536(int16_t *x,int16_t *y,unsigned char scale)
simde_mm_empty(); simde_mm_empty();
simde_m_empty(); simde_m_empty();
} }
int16_t twa73728[49152] __attribute__((aligned(32)));
int16_t twb73728[49152] __attribute__((aligned(32)));
// 24576 x 3
void dft73728(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
void idft73728(int16_t *input, int16_t *output,uint8_t scale) {
AssertFatal(1==0,"Need to do this ..\n");
}
int16_t twa98304[65536] __attribute__((aligned(32))); int16_t twa98304[65536] __attribute__((aligned(32)));
int16_t twb98304[65536] __attribute__((aligned(32))); int16_t twb98304[65536] __attribute__((aligned(32)));
...@@ -7125,8 +7099,9 @@ int dfts_autoinit(void) ...@@ -7125,8 +7099,9 @@ int dfts_autoinit(void)
#ifndef MR_MAIN #ifndef MR_MAIN
void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){ void dft_implementation(uint8_t sizeidx, int16_t *input, int16_t *output, unsigned char scale_flag)
AssertFatal((sizeidx >= 0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx); {
AssertFatal((sizeidx >= 0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid dft size index %i\n",sizeidx);
int algn=0xF; int algn=0xF;
AssertFatal(((intptr_t)output&algn)==0,"Buffers should be aligned %p",output); AssertFatal(((intptr_t)output&algn)==0,"Buffers should be aligned %p",output);
if (((intptr_t)input)&algn) { if (((intptr_t)input)&algn) {
...@@ -7141,8 +7116,9 @@ void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_fla ...@@ -7141,8 +7116,9 @@ void dft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_fla
dft_ftab[sizeidx].func(input,output,scale_flag); dft_ftab[sizeidx].func(input,output,scale_flag);
}; };
void idft(uint8_t sizeidx, int16_t *input,int16_t *output,unsigned char scale_flag){ void idft_implementation(uint8_t sizeidx, int16_t *input, int16_t *output, unsigned char scale_flag)
AssertFatal((sizeidx>=0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid idft size index %i\n",sizeidx); {
AssertFatal((sizeidx>=0 && sizeidx<DFT_SIZE_IDXTABLESIZE),"Invalid idft size index %i\n",sizeidx);
int algn=0xF; int algn=0xF;
AssertFatal( ((intptr_t)output&algn)==0,"Buffers should be 16 bytes aligned %p",output); AssertFatal( ((intptr_t)output&algn)==0,"Buffers should be 16 bytes aligned %p",output);
if (((intptr_t)input)&algn ) { if (((intptr_t)input)&algn ) {
......
...@@ -431,136 +431,110 @@ void init_fft(uint16_t size, ...@@ -431,136 +431,110 @@ void init_fft(uint16_t size,
uint16_t *rev); uint16_t *rev);
#define FOREACH_DFTSZ(SZ_DEF) \ #define FOREACH_DFTSZ(SZ_DEF) \
SZ_DEF(12) \ SZ_DEF(12) \
SZ_DEF(24) \ SZ_DEF(24) \
SZ_DEF(36) \ SZ_DEF(36) \
SZ_DEF(48) \ SZ_DEF(48) \
SZ_DEF(60) \ SZ_DEF(60) \
SZ_DEF(64) \ SZ_DEF(64) \
SZ_DEF(72) \ SZ_DEF(72) \
SZ_DEF(96) \ SZ_DEF(96) \
SZ_DEF(108) \ SZ_DEF(108) \
SZ_DEF(120) \ SZ_DEF(120) \
SZ_DEF(128) \ SZ_DEF(128) \
SZ_DEF(144) \ SZ_DEF(144) \
SZ_DEF(180) \ SZ_DEF(180) \
SZ_DEF(192) \ SZ_DEF(192) \
SZ_DEF(216) \ SZ_DEF(216) \
SZ_DEF(240) \ SZ_DEF(240) \
SZ_DEF(256) \ SZ_DEF(256) \
SZ_DEF(288) \ SZ_DEF(288) \
SZ_DEF(300) \ SZ_DEF(300) \
SZ_DEF(324) \ SZ_DEF(324) \
SZ_DEF(360) \ SZ_DEF(360) \
SZ_DEF(384) \ SZ_DEF(384) \
SZ_DEF(432) \ SZ_DEF(432) \
SZ_DEF(480) \ SZ_DEF(480) \
SZ_DEF(512) \ SZ_DEF(512) \
SZ_DEF(540) \ SZ_DEF(540) \
SZ_DEF(576) \ SZ_DEF(576) \
SZ_DEF(600) \ SZ_DEF(600) \
SZ_DEF(648) \ SZ_DEF(648) \
SZ_DEF(720) \ SZ_DEF(720) \
SZ_DEF(768) \ SZ_DEF(768) \
SZ_DEF(864) \ SZ_DEF(864) \
SZ_DEF(900) \ SZ_DEF(900) \
SZ_DEF(960) \ SZ_DEF(960) \
SZ_DEF(972) \ SZ_DEF(972) \
SZ_DEF(1024) \ SZ_DEF(1024) \
SZ_DEF(1080) \ SZ_DEF(1080) \
SZ_DEF(1152) \ SZ_DEF(1152) \
SZ_DEF(1200) \ SZ_DEF(1200) \
SZ_DEF(1296) \ SZ_DEF(1296) \
SZ_DEF(1440) \ SZ_DEF(1440) \
SZ_DEF(1500) \ SZ_DEF(1500) \
SZ_DEF(1536) \ SZ_DEF(1536) \
SZ_DEF(1620) \ SZ_DEF(1620) \
SZ_DEF(1728) \ SZ_DEF(1728) \
SZ_DEF(1800) \ SZ_DEF(1800) \
SZ_DEF(1920) \ SZ_DEF(1920) \
SZ_DEF(1944) \ SZ_DEF(1944) \
SZ_DEF(2048) \ SZ_DEF(2048) \
SZ_DEF(2160) \ SZ_DEF(2160) \
SZ_DEF(2304) \ SZ_DEF(2304) \
SZ_DEF(2400) \ SZ_DEF(2400) \
SZ_DEF(2592) \ SZ_DEF(2592) \
SZ_DEF(2700) \ SZ_DEF(2700) \
SZ_DEF(2880) \ SZ_DEF(2880) \
SZ_DEF(2916) \ SZ_DEF(2916) \
SZ_DEF(3000) \ SZ_DEF(3000) \
SZ_DEF(3072) \ SZ_DEF(3072) \
SZ_DEF(3240) \ SZ_DEF(3240) \
SZ_DEF(4096) \ SZ_DEF(4096) \
SZ_DEF(6144) \ SZ_DEF(6144) \
SZ_DEF(8192) \ SZ_DEF(8192) \
SZ_DEF(9216) \ SZ_DEF(12288) \
SZ_DEF(12288) \ SZ_DEF(18432) \
SZ_DEF(18432) \ SZ_DEF(24576) \
SZ_DEF(24576) \ SZ_DEF(36864) \
SZ_DEF(36864) \ SZ_DEF(49152) \
SZ_DEF(49152) \
SZ_DEF(73728) \
SZ_DEF(98304) SZ_DEF(98304)
#define FOREACH_IDFTSZ(SZ_DEF)\ #define FOREACH_IDFTSZ(SZ_DEF) \
SZ_DEF(64) \ SZ_DEF(64) \
SZ_DEF(128) \ SZ_DEF(128) \
SZ_DEF(256) \ SZ_DEF(256) \
SZ_DEF(512) \ SZ_DEF(512) \
SZ_DEF(768) \ SZ_DEF(768) \
SZ_DEF(1024) \ SZ_DEF(1024) \
SZ_DEF(1536) \ SZ_DEF(1536) \
SZ_DEF(2048) \ SZ_DEF(2048) \
SZ_DEF(3072) \ SZ_DEF(3072) \
SZ_DEF(4096) \ SZ_DEF(4096) \
SZ_DEF(6144) \ SZ_DEF(6144) \
SZ_DEF(8192) \ SZ_DEF(8192) \
SZ_DEF(9216) \ SZ_DEF(12288) \
SZ_DEF(12288) \ SZ_DEF(16384) \
SZ_DEF(16384) \ SZ_DEF(18432) \
SZ_DEF(18432) \ SZ_DEF(24576) \
SZ_DEF(24576) \ SZ_DEF(32768) \
SZ_DEF(32768) \ SZ_DEF(36864) \
SZ_DEF(36864) \ SZ_DEF(49152) \
SZ_DEF(49152) \ SZ_DEF(65536) \
SZ_DEF(65536) \
SZ_DEF(73728) \
SZ_DEF(98304) SZ_DEF(98304)
#ifdef OAIDFTS_MAIN
typedef void(*adftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
typedef void(*aidftfunc_t)(int16_t *sigF,int16_t *sig,unsigned char scale_flag);
#define SZ_FUNC(Sz) void dft ## Sz(int16_t *x,int16_t *y,uint8_t scale_flag);
FOREACH_DFTSZ(SZ_FUNC)
#define SZ_iFUNC(Sz) void idft ## Sz(int16_t *x,int16_t *y,uint8_t scale_flag);
FOREACH_IDFTSZ(SZ_iFUNC)
#else
typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); typedef void(*dftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag);
typedef void(*idftfunc_t)(uint8_t sizeidx,int16_t *sigF,int16_t *sig,unsigned char scale_flag); typedef void (*idftfunc_t)(uint8_t sizeidx, int16_t *sigF, int16_t *sig, unsigned char scale_flag);
# ifdef OAIDFTS_LOADER
dftfunc_t dft;
idftfunc_t idft;
# else
extern dftfunc_t dft; extern dftfunc_t dft;
extern idftfunc_t idft; extern idftfunc_t idft;
extern int load_dftslib(void); int load_dftslib(void);
# endif
#endif
#define SZ_ENUM(Sz) DFT_ ## Sz,
#define SZ_ENUM(Sz) DFT_##Sz,
typedef enum dft_size_idx { typedef enum dft_size_idx {
FOREACH_DFTSZ(SZ_ENUM) FOREACH_DFTSZ(SZ_ENUM)
DFT_SIZE_IDXTABLESIZE DFT_SIZE_IDXTABLESIZE
} dft_size_idx_t; } dft_size_idx_t;
#define SZ_iENUM(Sz) IDFT_ ## Sz,
/******************************************************************* /*******************************************************************
* *
* NAME : get_dft * NAME : get_dft
...@@ -589,13 +563,23 @@ dft_size_idx_t get_dft(int ofdm_symbol_size) ...@@ -589,13 +563,23 @@ dft_size_idx_t get_dft(int ofdm_symbol_size)
return DFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function; return DFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function;
} }
#define SZ_iENUM(Sz) IDFT_##Sz,
typedef enum idft_size_idx { typedef enum idft_size_idx {
FOREACH_IDFTSZ(SZ_iENUM) FOREACH_IDFTSZ(SZ_iENUM)
IDFT_SIZE_IDXTABLESIZE IDFT_SIZE_IDXTABLESIZE
} idft_size_idx_t; } idft_size_idx_t;
#ifdef OAIDFTS_MAIN #ifdef OAIDFTS_MAIN
typedef void (*adftfunc_t)(int16_t *sigF, int16_t *sig, unsigned char scale_flag);
typedef void (*aidftfunc_t)(int16_t *sigF, int16_t *sig, unsigned char scale_flag);
#define SZ_FUNC(Sz) void dft##Sz(int16_t *x, int16_t *y, uint8_t scale_flag);
FOREACH_DFTSZ(SZ_FUNC)
#define SZ_iFUNC(Sz) void idft##Sz(int16_t *x, int16_t *y, uint8_t scale_flag);
FOREACH_IDFTSZ(SZ_iFUNC)
#define SZ_PTR(Sz) {dft ## Sz,Sz}, #define SZ_PTR(Sz) {dft ## Sz,Sz},
struct { struct {
adftfunc_t func; adftfunc_t func;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment