DSP What Should I Avoid?

I'm starting with dsp programming right now, and I'm writing my first low level classes and functions. Since I want functions to be fast (or finally inefficient), I often wonder what I should use and what I should avoid in functions that are called in the sample.

I know that learning speed changes quite a bit, but I think that some of you, at least, can use the rule or just experience. :)

conditional statements

If I need to use conditions, it switchshould be faster than a block if / else if, right? Are there differences between using two if-statements or if-else? Somewhere I read what elseto avoid, but I don’t know why.

Also, compared to multiplication, is there a rough estimate of how long an if-block takes? Because in some cases, using the use of multiplication by zero can be used instead of if-statements:

//something could be an int either 1 or 0:
if(something) {
    signal += something_else;
}
// or:
signa+ += something*something_else;

functions and function pointers

Instead of using conditional statements, you can use a pointer function. Instead of using conditions in each call, the pointer can be redirected to a specific function. However, for each call, the pointer had to be interpreted in order to call the desired function. So I don’t know if that would help or not.

I also wonder if the call function affects. If so, boxing functions should be avoided, right?

Variables

, , , . ? , , .

, ? , , . , . , ? ? (*0.5 /2.0)

, soem.

+4
2

DSP for, .

, for.

DSP , SW.

, .

for.

#pragma for:

#pragma, , , , -.

, DSP .

_dotpu4 Texas Instruments C64xx, src1 src2: 8- src1 src2 8- src1 8- src2, .

DSP , .

, , for .

, , .

+1

:

( , , 32 ):

  • DSP , , .
  • , , , .

:

if/else - , if , if else , , , if.

, , , /else , .

.

+1

All Articles