|
|
|
|
|
|
|
|
#else |
|
|
#else |
|
|
|
|
|
|
|
|
/* acc += A1 * x[n-1] + A2 * x[n-2] */ |
|
|
/* acc += A1 * x[n-1] + A2 * x[n-2] */ |
|
|
acc = __SMLALD(S->A1, (q31_t) __SIMD32(S->state), acc); |
|
|
|
|
|
|
|
|
// TODO: this single-instruction version causes a gcc strict-aliasing warning |
|
|
|
|
|
//acc = __SMLALD(S->A1, (q31_t) __SIMD32(S->state), acc); |
|
|
|
|
|
uint32_t state = (uint32_t)S->state[0] | ((uint32_t)S->state[1] << 16); |
|
|
|
|
|
acc = __SMLALD(S->A1, state, acc); |
|
|
|
|
|
|
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Iniatilize output for below specified range as least output value of table */ |
|
|
/* Iniatilize output for below specified range as least output value of table */ |
|
|
y = pYData[0]; |
|
|
y = pYData[0]; |
|
|
} |
|
|
} |
|
|
else if(i >= S->nValues) |
|
|
|
|
|
|
|
|
else if((uint32_t)i >= S->nValues) |
|
|
{ |
|
|
{ |
|
|
/* Iniatilize output for above specified range as last output value of table */ |
|
|
/* Iniatilize output for above specified range as last output value of table */ |
|
|
y = pYData[S->nValues - 1]; |
|
|
y = pYData[S->nValues - 1]; |
|
|
|
|
|
|
|
|
/* Index value calculation */ |
|
|
/* Index value calculation */ |
|
|
index = ((x & 0xFFF00000) >> 20); |
|
|
index = ((x & 0xFFF00000) >> 20); |
|
|
|
|
|
|
|
|
if(index >= (nValues - 1)) |
|
|
|
|
|
|
|
|
if(index < 0) |
|
|
{ |
|
|
{ |
|
|
return (pYData[nValues - 1]); |
|
|
|
|
|
|
|
|
return (pYData[0]); |
|
|
} |
|
|
} |
|
|
else if(index < 0) |
|
|
|
|
|
|
|
|
else if((uint32_t)index >= (nValues - 1)) |
|
|
{ |
|
|
{ |
|
|
return (pYData[0]); |
|
|
|
|
|
|
|
|
return (pYData[nValues - 1]); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
/* Index value calculation */ |
|
|
/* Index value calculation */ |
|
|
index = ((x & 0xFFF00000) >> 20u); |
|
|
index = ((x & 0xFFF00000) >> 20u); |
|
|
|
|
|
|
|
|
if(index >= (nValues - 1)) |
|
|
|
|
|
|
|
|
if(index < 0) |
|
|
{ |
|
|
{ |
|
|
return (pYData[nValues - 1]); |
|
|
|
|
|
|
|
|
return (pYData[0]); |
|
|
} |
|
|
} |
|
|
else if(index < 0) |
|
|
|
|
|
|
|
|
else if((uint32_t)index >= (nValues - 1)) |
|
|
{ |
|
|
{ |
|
|
return (pYData[0]); |
|
|
|
|
|
|
|
|
return (pYData[nValues - 1]); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |
|
|
|
|
|
|
|
|
index = ((x & 0xFFF00000) >> 20u); |
|
|
index = ((x & 0xFFF00000) >> 20u); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(index >= (nValues - 1)) |
|
|
|
|
|
|
|
|
if(index < 0) |
|
|
{ |
|
|
{ |
|
|
return (pYData[nValues - 1]); |
|
|
|
|
|
|
|
|
return (pYData[0]); |
|
|
} |
|
|
} |
|
|
else if(index < 0) |
|
|
|
|
|
|
|
|
else if((uint32_t)index >= (nValues - 1)) |
|
|
{ |
|
|
{ |
|
|
return (pYData[0]); |
|
|
|
|
|
|
|
|
return (pYData[nValues - 1]); |
|
|
} |
|
|
} |
|
|
else |
|
|
else |
|
|
{ |
|
|
{ |