I'm using the FIR filter function from the C28 filter library (sprc082) and there's something that I don't understand.
In function _FIR16_calc, after doing the REP-DMAC instruction, the two partial products are added; this is done in line 127:
ADDL ACC,P ; Add the two sums with shift
Then, the result is saturated against bounds 0x00FFFFFF and 0xFF000000.
What I don't understand is:
1) Why does the comment in the ADDL instruction speak of a shift? The CPU manual says there's no shift, and we've verified it with the simulator.
2) Why the last saturation? are we not going to lose a lot of our dynamic range unnecessarily? do we rely on the magnitude of the filter coefs being small?
This is not an urgent issue; It's only that I'd like to fully understand this function before going on to build my own customized version.
I am sure I am missing something very obvious but I think I'll need you help to know what it is.
Thank you very much!