Compiler User Guide: Texas Instruments (TI) C55x intrinsics for optimizing C code http://www.keil.com/support/man/docs/armcc/armcc_babchiba.htm
Intrinsics for rounding, saturation, bitcount and extremum, such as _round and _count. For example, _round(v1) returns the value v1 rounded by adding 215 using unsaturated arithmetic, clearing the lower 16 bits.
Why adding 215 here? As to round the lower 16 bits, shouldn't it be adding 255 to value v1? Or it's something about specific arithmetic calculation?
Maybe it is 2^15, not 215.
Oh, I think that may be the case. B-) Anyway there are numerous mistakes in the manual texts...
I am curious. I know the question is definitely an ARM/Keil related question. But why? It is a TI C55x DSP. Is there any chip that C55x is integrated with ARM core?
I believe it is 2^15, not 215. Again a printing error.
No. Of course TI C55x DSP cannot be integrated into ARM core.
It talks about a header which defines intrinsics JUST LIKE a C55x. So you can implement some intrinsics of TI C55x in ARM platform, which may help code portability.
There is also a Feedback link on each page - have you used it to report these "errors"?
Keil say they're just emulating the TI behaviour - so what does the TI documentation say?
I've checked TI's C55x DSP Library. According to its implemention, it's the same as we had guessed.
_round(v1) would add (in unsaturated ways) 2^15 to v1, and then clear the lower 16 bits.