[12 p] Dependencies. Assume that RISC architecture ALU instructions have
three register operands and that the result is stored into the first
(left-most) register. The architecture is implemented in ordinary (not
superscalar) pipelined fashion so that, in best case, one instruction can be
completed in each cycle.
Observe the following set of instructions generated by the compiler:
Load R2, VarX ; Regs(R2) <- Mem(VarX)
Add R5, R5, R2 ; Regs(R5) <- Regs (R5) + Regs(R2)
Move R2, R6 ; Regs(R2) <- Regs (R6)
Add R3, R3, R2
Mul R3, R2, R5
Jnzer R2, Loop
Add R3, R2, R5
Many aspects in the preceding code segment may reduce the execution speed
from the maximum possible for that architecture.
- [6 p] Describe precisely the problem types defined below and mark
in a clear way all occurrences of each problem type in the
preceding code segment:
- data dependencies
- structural dependencies
- control dependencies
How can one avoid or reduce the performance problems caused by each
problem type?
- [3 p] Assume now, that the architecture is implemented as superscalar.
Describe precisely new problem types given below and mark
in a clear way all occurrences for each problem type in the preceding
code segment.
- output dependencies
- antidependencies
How can one avoid or reduce the performance problems caused by each new
problem type?
- [3 p] Assume now, that a functionally correct emulator has been
implemented for this architecture. The emulator is implemented according
to normal von Neumann architecture and it executes given machine
language code one instruction at a time. Which dependencies described in
parts (a) and (b) must be considered in the emulation and how? Why?
Make all needed assumptions and write them down.