1 / 14

Lecture 22: Instruction Level Parallelism

Lecture 22: Instruction Level Parallelism. Computer Engineering 585 Fall 2001. Correlating Branches. Branch address. (2,2) predictor Then behavior of recent branches selects between, say, four predictions of next branch, updating just that prediction . 4. 2-bit per branch predictors. XX.

brenna
Download Presentation

Lecture 22: Instruction Level Parallelism

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 22: Instruction Level Parallelism Computer Engineering 585 Fall 2001

  2. Correlating Branches Branch address (2,2) predictor • Then behavior of recent branches selects between, say, four predictions of next branch, updating just that prediction 4 2-bit per branch predictors XX XX prediction 00 01 10 11 2-bit global branch history

  3. Accuracy of Different Schemes(Figure 4.21, p. 272) 18% 4096 Entries 2-bit BHT Unlimited Entries 2-bit BHT 1024 Entries (2,2) BHT Frequency of Mispredictions 0%

  4. Re-evaluating Correlation • Several of the SPEC benchmarks have less than a dozen branches responsible for 90% of taken branches: program branch%static#=90% compress 14% 236 13 eqntott 25% 494 5 gcc 15% 9531 2020 mpeg 10% 5598 532 real gcc 13% 17361 3214 • Real programs + OS more like gcc. • Small benefits beyond benchmarks for correlation? problems with branch aliases?

  5. HW support for More ILP • Avoid branch prediction by turning branches into conditionally executed instructions: if (x) then A = B op C else NOP • If false, then neither store result nor cause exception • Expanded ISA of Alpha, MIPS, PowerPC, SPARC have conditional move; PA-RISC can annul any following instr. • IA-64: 64 1-bit condition fields selected so conditional execution of any instruction • Drawbacks to conditional instructions • Still takes a clock even if “annulled” • Stall if condition evaluated late • Complex conditions reduce effectiveness; condition becomes known late in pipeline x A = B op C

  6. Dynamic Branch Prediction Summary • Branch History Table: 2 bits for loop accuracy. • Correlation: Recently executed branches correlated with next branch. • Branch Target Buffer: include branch address & prediction. • Predicated Execution can reduce number of branches, number of mispredicted branches.

  7. Branch Decoupling Loop: LD F0,0(R1) ;F0=vector element ADDD F4,F0,F2 ;add scalar from F2 SD 0(R1),F4 ;store result SUBI R1,R1,8 ;decrement pointer 8B (DW) BNEZ R1,Loop ;branch R1!=zero Say 100 iterations. Can branch be pre-computed for each loop iteration?

  8. LD F0,0(R1) ADDD F4,F0,F2 SD 0(R1),F4 SUBI R1,R1,8 BDI BNEZ R1,Loop Branch Determining Instructions (BDIs)

  9. Branch Decoupling Loop: LD F0,0(R1) ADDD F4,F0,F2 SD 0(R1),F4 SUBI R1,R1,8 BNEZ R1,Loop Program Stream PLoop: LD F0,0(R1) ADDD F4,F0,F2 SD 0(R1),F4 SUBI R1,R1,8 Branch Stream BLoop: SUBI R1,R1,8 BNEZ R1,Bloop,Ploop

  10. Target + Block size Branch Decoupled Microarchitecture B-Processor P-Processor B-Reg File I-cache P-Reg File D-cache B-PC I-cache PPC Block Counter PPC Queue

  11. PPC Control If(Block counternot = 0) Decrement Block counter & Increment PPC. else when (PPCQ not empty) Dequeue a (target, block size) entry from PPCQ. PPC  target; Block counter  block size;

  12. Hardware Support for ILP • Speculation: allow an instruction to issue that is dependent on branch predicted to be taken without any consequences (including exceptions) if branch is not actually taken (“HW undo”); called “boosting”. • Combine branch prediction with dynamic scheduling to allow execution before controlling branch resolved. • Separate speculative bypassing of results from real bypassing of results: • When instruction no longer speculative, write boosted results (instruction commit)or discard boosted results. • execute out-of-order but commit in-order to prevent irrevocable action (update state or exception) until instruction commits.

  13. Reorder Buffer FP Op Queue FP Regs Res Stations Res Stations FP Adder FP Adder HW support for More ILP • Need HW buffer for results of uncommitted instructions: reorder buffer (ROB) • 3 fields: inst, destination, value • ROB can be operand source => more registers like RS. • Use ROB number instead of RS as tag. • Bypass operands between execution complete & commit. • Once an instruction commits, result is put into register/mem. • Instructions commit in order. • Easy to undo speculated instructions on mispredicted branches or on exceptions.

  14. Head 1 2 3 4 12 Entries 12 5 Inst. Result Destination Valid Instructions 6 7 8 Tail Reorder Buffer A circular buffer.

More Related