Game Development Reference
In-Depth Information
Figure 16. Loop fusion and unrolling.
size changes. The conditional operations, such as absolute value calculation and
threshold inside loop, block the increase of basic block size.
In the second step, we sought two methods to reduce the branches, which limit
the basic block size in loops. A solution for this is to use conditional execution
instructions, which requires hardware support. The TriMedia processors offer
such instructions, such as IABS, that calculate the absolute value in a single
instruction. This optimization provides a significant performance improvement.
Another technique we used is to convert control flow dependency to data
dependency by using look-up tables. In our algorithm, contour following, the
instruction level parallelism is limited by the control flow dependency. The
critical control flow structure is shown on the left-hand side of Figure 17.
Although if-conversion is a general method to remove branches caused by if-else
statements, the if-conversion does not help much for such a control flow
dependency. To increase the available parallelism, we convert the control
Figure 17. Branch reduction.
Search WWH ::




Custom Search