Cortex-M4 DSP instruction
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-02 10:45 AM
Posted on May 02, 2016 at 19:45
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.
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-02 12:25 PM
Posted on May 02, 2016 at 21:25
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.Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-03 2:01 PM
Posted on May 03, 2016 at 23:01Thanks Jan.I tried with instruction SMLALD and it works quite well. Except that it has ''accumulate'' feature, which I don't need. I put my 2 16-bit variables into one 32-bit variable, yes.I will try your suggestions, too.
