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.
Hi matic,
You can use PKHBT and PKHTB to format the registers, see § 3.8. Packing and unpacking instructions of Cortex-M4 Devices Generic User Guide Revision r0p1. Now, tabulate all the instructions in the two methods (PKHBT/PKHTB, SMUAD versus multiply, add), calculate and compare the total number of cycles incurred to accomplish the mathematical expression. I hope you can post the result; I'm also curious but I have to log out already.
Regards,
Goodwin