Investigative Feedback
A-12
Larger Outer Loop Overhead in Nested Loop
Description
In cases where the inner loop count of a nested loop is relatively small, the time
to execute the outer loop can start to become a large percentage of the total
execution time. For cases where this significantly degrades overall loop per-
formance, unrolling the inner loop may be desired.
Solution
Unroll the inner loop.
Make one loop with the outer loop instructions conditional on an inner loop
counter
For More Information
See Chapter 6,
Loop Unrolling (In C) (In Assembly), on page 6-118.
See section 6.14,
Outer Loop Conditionally Executed With Inner Loop, on
page 6-136.
There are Memory Bank Conflicts
Description
In cases where the compiler generates 2 memory accesses in one cycle and
those accesses are either 8 bytes apart on a ’C620x device, 16 bytes apart
on a ’C670x device, or 32 bytes apart on a ’C640x device, AND both accesses
reside within the same memory block, a memory bank stall will occur. To avoid
this degradation, memory bank conflicts can be completely avoided by either
placing the two accesses in different memory blocks or by writing linear as-
sembly and using the .mptr directive to control memory banks.
Solution
Write linear assembly and use the .mptr directive
Link different arrays in separate memory blocks
For More Information
See section 6.2.4,
The .mptr Directive, on page 6-5.
See section 6.9,
Loop Unrolling (in Assembly), on page 6-94.
See section 3.4.3.4,
Loop Unrolling (in C), on page 3-44.
See section 6.12,
Memory Banks, on page 6-118