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,
you can use "SMLALD{X}<c> <RdLo>,<RdHi>,<Rn>,<Rm>".
Best regards,
Yasuhiko Koumoto.
Hi.
Thank you a lot. I played a little bit with that and other similar instructions and it works quite well. I noticed that SMLALD has an "accumulate" feature, which I don't need. Actually, it is a drawback in my case, because I would have to clear that accumulator back to zero before each use of the instruction.
Maybe SMLAD should be better, where I could multiply topHW * topHW + bottomHW * bottomHW, then add zero and write this to destination variable.
Hi,
I'm sorry.
You are right.
Why don't you use SMUAD{X} instruction? It performs bottom x bottom + top x top. Additionally it can support bottom x top + top x bottom as well.
Regards, Prasad
Great. I did't see this one.
Thank you.
Matic