|
|
|
|
|
|
Figure 3.5
Branch target table (or buffer). |
|
|
|
|
Table 3.11 Percent of branch target references found in a branch table with two different strategies (R/M). (A branch table is a single-block I-cache with prefetch.) | Size (bytes) | | | 16 | | | 32 | | | 64 | | | 128 | | | 256 | | | 512 | | | 1024 | | | 2K | | | 4K | | | 8K | | | 16K | | | 32K | | | Unlimited | | |
|
|
|
|
|
|
instructions (dynamic). The buffer functions in two ways. First, it contains instructions sequentially ahead of the current instruction fetch address; thus, instructions fetched in sequence are available without the usual memory access time. Second, it keeps previously executed instructions and it recognizes when the target of a branch falls within its contents (backward branches). In either case, the buffers deliver those branch target instructions without accessing memory. |
|
|
|
|
|
|
|
|
How successful it is depends on the distribution of branch distances for successful branches. Figure 3.5 and Tables 3.11-3.12 illustrate this relationship, where table size defines an instruction region starting at the address of the instruction following the branch instruction (in bytes). This region extends either to addresses less than the current address (backward) or greater than this address (forward). The centered region is for a buffer that both prefetches instructions and retains previously executed instructions. |
|
|
|
|
|
|
|
|
While retaining history (previously executed branches) involves only storage, prefetching in anticipation of forward branches places an added bur- |
|
|
|
|
|