Delayed Branch All problems solved NO what will
Delayed Branch All problems solved? NO, what will happen if. . . b loop add $4 $6 $1. . . Datorteknik Delayed. Branch bild 1
Zero ext. = = Branch logic 0 A ALU 4 B + = Sgn/Ze extend 31 = + Datorteknik Delayed. Branch bild 2
Zero ext. = = Branch logic 0 A ALU 4 B + = Sgn/Ze extend 31 = + Datorteknik Delayed. Branch bild 3
Delayed Branch - Throughput might decrease, (nop). - Assembler/Compiler dependent. + Keep critical path short Datorteknik Delayed. Branch bild 4
All problems solved now? NO, what will happen if. . . . jalr loop add $4 $6 $1. . loop: . . j $ra Datorteknik Delayed. Branch bild 5
Zero ext. = = Branch logic 0 A ALU 4 B + = Sgn/Ze extend 31 = + ADDR 0 x 00400004 Datorteknik Delayed. Branch bild 6
Zero ext. = = Branch logic ADDR 0 x 00400004 0 A ADDR 0 x 00400004 ALU 4 B + = Sgn/Ze extend 31 = + Datorteknik Delayed. Branch bild 7
jr $ra ADDR 0 x 00400004 Zero ext. = = Branch logic 0 A ALU 4 B + = Sgn/Ze extend 31 = + Datorteknik Delayed. Branch bild 8
Zero ext. = = Branch logic 0 A ALU 4 B + = Sgn/Ze extend 31 = + ADDR 0 x 00400004 Datorteknik Delayed. Branch bild 9
Continue at 0 x 00400008 Zero ext. = = Branch logic ADDR 0 x 00400004 4 A ADDR 0 x 00400008 ALU 4 B + = Sgn/Ze extend 31 = + Datorteknik Delayed. Branch bild 10
All Hazards Fixed but: One “delayed branch” slot Datorteknik Delayed. Branch bild 11
What about “delayed Branch” Can we avoid it? How? Datorteknik Delayed. Branch bild 12
Delayed Branch IM Reg DM Reg Branch Logic IM Direct Branch Reg DM Reg Datorteknik Delayed. Branch bild 13
Delayed Branch Zero ext. = = Branch logic 0 A ALU 4 B + = Sgn/Ze extend 31 = + Datorteknik Delayed. Branch bild 14
Direct Branch Zero ext. = = Branch logic 0 A ALU 4 B + = Sgn/Ze extend 31 = + Datorteknik Delayed. Branch bild 15
What about the instruction set? beq $t 0 label? jr $ra? NO, DE is not in path! b label? OK, but the new branch logic needs an ALU to compute the address Datorteknik Delayed. Branch bild 16
Different branch logic? Can both branch types coexist? Yes, no problem, but: Old type still uses “delay slot” Datorteknik Delayed. Branch bild 17
- Slides: 17