| A. 100 ps | B. 500 ps | C. 2000 ps | D. 2500 ps | E. something else |
| A. 1 instr/100 ps | B. 1 instr/500 ps | C. 1 instr/2000ps | D. 1 instr/2500 ps |
| E. something else | |||
| A. 1 instr/100 ps | B. 1 instr/250 ps | C. 1 instr/1000ps | D. 1 instr/5000 ps |
| E. something else | |||
| step# | pipeline implementation | ISA specification |
|---|---|---|
| 1 | read r8, r9 for (1) | read r8, r9 for (1) |
| 2 | read r9, r8 for (2) | write r9 for (1) |
| 3 | write r9 for (1) | read r9, r8 for (2) |
| 4 | write r8 for (2) | write r8 ror (2) |
one solution: change the ISA
addqs take effect three instructions later make it compiler’s job
problem: recompile everytime processor changes?
addq %r8, %r9
// hardware inserts: nop
// hardware inserts: nop
addq %r9, %r8
how about hardware add nops?
called stalling
extra logic:
in subq, %r8 is _____ addq.
in xorq, %r9 is _____ addq.
in andq, %r9 is _____ addq.
in andq, %r9 is _____ xorq.
value from memory stage too late for forwarding alone
combine stalling and forwarding to resolve hazard
assumption in diagram: hazard detected in subq’s decode stage
clock cycle needs to be long enough
to go through data cache AND
to go through math circuits!
(which we were trying to avoid by putting them in separate stages)
dependency — X needs result of instruction Y?
hazard — will it not work in some pipeline?
// 4 stage // 5 stage
addq %rax, %r8 // // W
subq %rax, %r9 // W // M
xorq %rax, %r10 // EM // E
andq %r8, %r11 // D // D
in subq, %r8 is _____ addq.
in subq, %r9 is _____ addq.
in andq, %r9 is _____ subq.
in andq, %r9 is _____ addq.
if jle is correctly predicted:
in andq, %r9 is ______ addq.
in andq, %r8 is ______ subq.
A: not forwarded from [assume read while writing requires forwarding]
B-D: forwarded to decode from {execute,memory,writeback} stage of
if jle is mispredicted + resolved after jle’s execute:
in andq, %r9 is _____ addq.
in andq, %r9 is ___ subq.
A: not forwarded from [assume read while writing requires forwarding]
B-D: forwarded to decode from {execute,memory,writeback} stage of
* — ignoring data hazards