
5-38
SC100 C Compiler
Optimization Techniques and Hints
Although computing a single sample with multiple ALUs is theoretically possible, limitations in the DSP
hardware may not allow this style of algorithm to be implemented. In particular, most processors typically
require operands to be aligned in memory and multiple operand load/stores to be aligned.
For example, a double operand load requires an even address and a quad operand load requires a double
even address. These types of restrictions are typical to reduce the complexity of the address generation
hardware (particularly for modulo addressing).
Restricting the boundaries of the load makes implementing some algorithms very difficult or impossible.
This is easiest to explain by way of example. Consider a series of (aligned) quad operand loads from
memory, as shown in Figure 5-10.
Figure 5-10. Quad Coefficient Loading from Memory
The loads in Figure 5-10 do not have a problem with alignment because loads occur from double even
addresses.
Alignment problems typically occur with algorithms implementing delay lines in memory. These
algorithms delete the oldest delay and replace it with the newest sample. This is typically done by using
modulo addressing and
“
backing up
”
the pointer after the sample is processed. This leads to an addressing
alignment problem as shown in Figure 5-11.
Figure 5-11. Misalignment when Loading Quad Operands
On the first iteration of the kernel, quad data values are loaded starting from a double even address. This
does not create an alignment problem. However, at the end of the first iteration, the pointer is backed up by
one to delete the oldest sample. On the next iteration, the pointer is not at a double even address and the
quad data load is not aligned.
A solution to the alignment problem is to reduce the number of operands moved on each data bus. This
relaxes the alignment issue. However, in order to maintain the same operand bandwidth, each loaded
operand must be used multiple times. This is a situation where multisample processing is useful.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Load
Load
Load
Load
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Load
Load
Load
Load
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Load
Load
Load
Load
First
Iteration
Second
Iteration
Pointer
Pointer