< previous page page_160 next page >

Page 160
0160-01.gif
Figure 3.4
Distribution of basic blocks (number of instructions between
branches), from MacDougall [189] (R/M architecture). Note that
while the mean distance between branches is 7.5 instructions, about
66% of the basic blocks are shorter than this. A few very large
basic blocks significantly affect the mean sequence length.
Procedure call is less frequent in Fortran-based scientific code, and much more frequent in commercial and systems type applications. Many architectures allow the target address to be either available in a register (BCR) or computed by an address generation (AG) action (BC). Architectures that allow 2-byte register-to-register operations would include BCR as a 2-byte instruction, while BC occupies four bytes (Table 3.10b).
Within the branch-on-condition category, about 20% of the BC instructions are expected to be unconditional, and of the true conditional branch instructions, we expect 54% to go to the target and 46% to go in-line. This latter statistic is highly sensitive to both the application and the compiler. Available data in the commercial environment indicates a much higher frequency of unconditional branches and also a higher frequency of branches that go to the in-line path. Most loop-type branches go to the target as expected (Table 3.10d), and (statistically) almost all call and return instructions also go to target (Table 3.10e). As we shall see, knowledge concerning the direction selected by a branch is important in selecting a branch strategy to improve the performance of pipelined systems.
In interpreting Table 3.10, recall that the conditional branch instruction includes a mask field (Chapter 1) which specifies the condition code state that is being tested. An all-1's mask field implies that the branch must be taken, since the machine must be in one of the tested states. We designate these as BR instructions. Similarly, all 0's implies a no-op instruction. The remaining branch instructions are "true" conditional branches and are designated as BC.
Table 3.13 shows the results of the BC test on the condition code established by an earlier instruction of various types. (For most architectures, not all instructions set the CC.)

 
< previous page page_160 next page >