Hello all!
I am new to ARM community and this is my first question here. I work on embedded systems where we use Cortex-M4 based MCUs (concretely STM32F3 series). I would like to ask, if there is a DSP instruction which would calculate x*x + y*y.
x and y represent sine and cosine values (signed integers, 16-bit variables are sufficient). I would like to calculate a square of amplitude (x*x + y*y).
Thanks in advance.
Hello Matic,
These instructions are kind of SIMD extensions possible with existing ARM register files.
Consider the scenario where you have a lot of x and y co-ordinates in memory where it is already in the packed form. In that case you just need to load them as 32 bit values and perform these computations.
Even in scenarios where x and y values are calculated and then performed (x*x + y*y), other SIMD instructions can be used to get the x and y results in packed format.
Or if you localize the problem, then yes we do have the packing overhead and it can be huge such that there is no advantage in using those special instructions.
Regards, Prasad