AI Engine Intrinsics User Guide (AIE) v2024.2
Loading...
Searching...
No Matches

Overview

FFT addressing intrinsics .

Data pointer increment functions

v2cint32 * fft_data_incr (v2cint32 *ptr, int range, v2cint32 *&target, umod_t &cntwrap)
 Increment the FFT data pointer.
 
v8cint16 * fft_data_incr (v8cint16 *ptr, int range, v8cint16 *&target, umod_t &cntwrap)
 Increment the FFT data pointer.
 
v4cint16 * fft_data_incr (v4cint16 *ptr, int range, v4cint16 *&target, umod_t &cntwrap)
 Increment the FFT data pointer.
 
v4cfloat * fft_data_incr (v4cfloat *ptr, int range, v4cfloat *&target, umod_t &cntwrap)
 Increment the FFT data pointer.
 
v2cfloat * fft_data_incr (v2cfloat *ptr, int range, v2cfloat *&target, umod_t &cntwrap)
 Increment the FFT data pointer.
 

Data pointer increment functions without cntwrap return value

v4cint32 * fft_data_incr (v4cint32 *ptr, int range, v4cint32 *&target)
 Iterate over the FFT input values.
 
v2cint32 * fft_data_incr (v2cint32 *ptr, int range, v2cint32 *&target)
 Iterate over the FFT input values.
 
v8cint16 * fft_data_incr (v8cint16 *ptr, int range, v8cint16 *&target)
 Iterate over the FFT input values.
 
v4cint16 * fft_data_incr (v4cint16 *ptr, int range, v4cint16 *&target)
 Iterate over the FFT input values.
 
v4cfloat * fft_data_incr (v4cfloat *ptr, int range, v4cfloat *&target)
 Iterate over the FFT input values.
 
v2cfloat * fft_data_incr (v2cfloat *ptr, int range, v2cfloat *&target)
 Iterate over the FFT input values.
 

Twiddle factor increment functions

void * fft_twiddle_incr_inl (void *ptr, int bytes, umod_t cntwrap, int step)
 Increment the twiddle factor pointer.
 
#define fft_twiddle_incr(ptr, cntwrap, step)   fft_twiddle_incr_inl((ptr), 1, (cntwrap), (step))
 Increment the twiddle factor pointer.
 

Macro Definition Documentation

◆ fft_twiddle_incr

#define fft_twiddle_incr (   ptr,
  cntwrap,
  step 
)    fft_twiddle_incr_inl((ptr), 1, (cntwrap), (step))

Increment the twiddle factor pointer.

Parameters
cntwrapContains the block wrap (cntwrap[19]) and the count of previous wraps (cntwrap[2:0])
ptrPointer to the current twiddle vector.
stepBinary logarithm of the number of wraps per pointer increment. Must be a compile-time constant.

This function is called within every stage of the Stockham FFT algorithm in order to get a new set of twiddle values.

The internal logic of this function can be thought of as the following:

bool wrap = cntwrap >> 19;
bool cntzero = (cntwrap & ((1 << step) - 1)) == 0;
if(wrap && cntzero)
++ptw;

Function Documentation

◆ fft_data_incr() [1/11]

v2cfloat * fft_data_incr ( v2cfloat *  ptr,
int  range,
v2cfloat *&  target 
)

Iterate over the FFT input values.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
}
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.
See also
fft_data_incr()

◆ fft_data_incr() [2/11]

v2cfloat * fft_data_incr ( v2cfloat *  ptr,
int  range,
v2cfloat *&  target,
umod_t &  cntwrap 
)

Increment the FFT data pointer.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block
cntwrapWrap bit (cntwrap[19]) and wrap counter (cntwrap[2:0])

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

cnt = cntwrap & 0x7;
if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
wrap = 1;
cnt = (cnt+1) & 0x7;
}
else
wrap = 0;
cntwrap = (wrap << 19) | cnt;
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.

◆ fft_data_incr() [3/11]

v2cint32 * fft_data_incr ( v2cint32 *  ptr,
int  range,
v2cint32 *&  target 
)

Iterate over the FFT input values.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
}
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.
See also
fft_data_incr()

◆ fft_data_incr() [4/11]

v2cint32 * fft_data_incr ( v2cint32 *  ptr,
int  range,
v2cint32 *&  target,
umod_t &  cntwrap 
)

Increment the FFT data pointer.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block
cntwrapWrap bit (cntwrap[19]) and wrap counter (cntwrap[2:0])

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

cnt = cntwrap & 0x7;
if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
wrap = 1;
cnt = (cnt+1) & 0x7;
}
else
wrap = 0;
cntwrap = (wrap << 19) | cnt;
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.

◆ fft_data_incr() [5/11]

v4cfloat * fft_data_incr ( v4cfloat *  ptr,
int  range,
v4cfloat *&  target 
)

Iterate over the FFT input values.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
}
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.
See also
fft_data_incr()

◆ fft_data_incr() [6/11]

v4cfloat * fft_data_incr ( v4cfloat *  ptr,
int  range,
v4cfloat *&  target,
umod_t &  cntwrap 
)

Increment the FFT data pointer.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block
cntwrapWrap bit (cntwrap[19]) and wrap counter (cntwrap[2:0])

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

cnt = cntwrap & 0x7;
if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
wrap = 1;
cnt = (cnt+1) & 0x7;
}
else
wrap = 0;
cntwrap = (wrap << 19) | cnt;
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.

◆ fft_data_incr() [7/11]

v4cint16 * fft_data_incr ( v4cint16 *  ptr,
int  range,
v4cint16 *&  target 
)

Iterate over the FFT input values.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
}
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.
See also
fft_data_incr()

◆ fft_data_incr() [8/11]

v4cint16 * fft_data_incr ( v4cint16 *  ptr,
int  range,
v4cint16 *&  target,
umod_t &  cntwrap 
)

Increment the FFT data pointer.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block
cntwrapWrap bit (cntwrap[19]) and wrap counter (cntwrap[2:0])

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

cnt = cntwrap & 0x7;
if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
wrap = 1;
cnt = (cnt+1) & 0x7;
}
else
wrap = 0;
cntwrap = (wrap << 19) | cnt;
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.

◆ fft_data_incr() [9/11]

v4cint32 * fft_data_incr ( v4cint32 *  ptr,
int  range,
v4cint32 *&  target 
)

Iterate over the FFT input values.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
}
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.
See also
fft_data_incr()

◆ fft_data_incr() [10/11]

v8cint16 * fft_data_incr ( v8cint16 *  ptr,
int  range,
v8cint16 *&  target 
)

Iterate over the FFT input values.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
}
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.
See also
fft_data_incr()

◆ fft_data_incr() [11/11]

v8cint16 * fft_data_incr ( v8cint16 *  ptr,
int  range,
v8cint16 *&  target,
umod_t &  cntwrap 
)

Increment the FFT data pointer.

Parameters
ptrPointer to the input vector
rangeSize of the block of vectors to iterate over between jumps
targetPointer to the end of the consecutive block
cntwrapWrap bit (cntwrap[19]) and wrap counter (cntwrap[2:0])

This function enables the iteration of the pointer that is the current target of the butterfly operation. If this pointer becomes equal to the target i.e. reaches the end of the wrap, it skips the appropriate distance (the range) and begins to iterate towards a newly assigned target. The pseudocode showing this logic can be seen below:

cnt = cntwrap & 0x7;
if(++ptr == target)
{
ptr += (radix-1) * range;
target += radix * range;
wrap = 1;
cnt = (cnt+1) & 0x7;
}
else
wrap = 0;
cntwrap = (wrap << 19) | cnt;
Note
The radix value must be set statically with set_rdx(). Allowed values for the radix are 2,3,4,5 and 7.

◆ fft_twiddle_incr_inl()

void * fft_twiddle_incr_inl ( void *  ptr,
int  bytes,
umod_t  cntwrap,
int  step 
)

Increment the twiddle factor pointer.

Parameters
cntwrapContains the block wrap (cntwrap[19]) and the count of previous wraps (cntwrap[2:0])
ptrPointer to the current twiddle vector.
stepBinary logarithm of the number of wraps per pointer increment. Must be a compile-time constant.

This function is called within every stage of the Stockham FFT algorithm in order to get a new set of twiddle values.

The internal logic of this function can be thought of as the following:

bool wrap = cntwrap >> 19;
bool cntzero = (cntwrap & ((1 << step) - 1)) == 0;
if(wrap && cntzero)
++ptw;