2016-05-02 10:45 AM
Hello!
I would like to ask, if anyone knows, if there is a DSP instruction for Cortex-M4, which would calculate x*x + y*y. I saw that there are some quite complex instruction which are intended for similar calculations, but didn't find one for exactly that calculation.
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) as fast as possible.
Thanks in advance.
2016-05-02 12:25 PM
SMUAD
JW [EDIT] Even if it's a single instruction, it won't necessarily help - it's a SIMD instruction and there might be no effective way to get the operands as SIMD. You might be better off having halfword-in-a-word operands, and use SMULBB then SMLABB.2016-05-03 02:01 PM