Docsity

Dealing with Branches - Computer Architecture and Organization | ECE 337, Study notes of Computer Architecture and Organization

Partial preview of the text

Download Dealing with Branches - Computer Architecture and Organization | ECE 337 and more Study notes Computer Architecture and Organization in PDF only on Docsity!

Dealing with Branches

• Multiple Streams• Prefetch Branch Target• Loop buffer• Branch prediction• Delayed branching

Multiple Streams

•^

Have two pipelines

•^

Prefetch each branch into a separate pipeline

•^

Use appropriate pipeline

•^

Leads to bus & register contention

•^

Multiple branches lead to further pipelines beingneeded

Loop Buffer

  • Very fast memory• Maintained by fetch stage of pipeline• Check buffer before fetching from memory• Very good for small loops or jumps• Used by CRAY-

Loop Buffer Diagram

Branch Prediction (2)

• Predict by Opcode

– Some instructions are more likely to result in a

jump than others

– Can get up to 75% success

• Taken/Not taken switch

– Based on previous history– Good for loops

Branch Prediction (3)

• Delayed Branch

– Do not take jump until you have to– Rearrange instructions

Branch Prediction State Diagram

Intel 80486 Pipelining

-^

Fetch–

From cache or external memory

-^

Put in one of two 16-byte prefetch buffers

-^

Fill buffer with new data as soon as old data consumed

-^

Average 5 instructions fetched per load

-^

Independent of other stages to keep buffers full

-^

Decode stage 1–

Opcode & address-mode info

-^

At most first 3 bytes of instruction

-^

Can direct D2 stage to get rest of instruction

-^

Decode stage 2–

Expand opcode into control signals

-^

Computation of complex address modes

-^

Execute–

ALU operations, cache access, register update

-^

Writeback–

Update registers & flags

-^

Results sent to cache & bus interface write buffers

Pentium 4Registers

EFLAGS Register

MMX Register Mapping

  • MMX uses several 64 bit data types• Use 3 bit register address fields
    • 8 registers
      • No MMX specific registers
        • Aliasing to lower 64 bits (mantissa) of existing

floating point registers

MMX Register Mapping Diagram

PowerPC User Visible Registers

PowerPC Register Formats