hpca/Problem Set Solutions/ILP/problem01

Given the following set of instructions, use register renaming to eliminate the false dependencies. Assume there are 7 possible locations for the registers; L1, L2, L3, L4, L5, L6, L7. The registers at the start of the instructions are assigned as: R1 → L1 R2 → L2 R3 → L3 (L4 - L7 are available for assignment),

ADD R1, R2, R3
SUB R3, R2, R1
MUL R1, R2, R3
DIV R2, R1, R3

Solution

Given the following set of instructions, use register renaming to eliminate the false dependencies. Assume there are 7 possible locations for the registers; L1, L2, L3, L4, L5, L6, L7. The registers at the start of the instructions are assigned as: R1 → L1 R2 → L2 R3 → L3 (L4 - L7 are available for assignment),

ADD R1, R2, R3 ADD L4 , L2 , L3

SUB R3, R2, R1 SUB L5 , L2 , L4

MUL R1, R2, R3 MUL L6 , L2 , L5

DIV R2, R1, R3 DIV L7 , L6 , L5

Adapted from a lecture on Tomasulo's Algorithm at Duke University.