Question: Consider the following loop. LOOP: LDUR X 1 0 , [ X 1 , # 0 ] LDUR x 1 1 , [ x 1
Consider the following loop.
LOOP: LDUR XX #
LDUR #
ADD
STUR #
SUBI X X #
CBNZ X LOOP
a Assume that data and control hazards are handled by simply stalling the pipeline ie inserting NOP instructions where necessary Show the pipeline timing diagram of the code execution.
tableCycle number:,LOOP: LDUR XX #IFIDEXMEWBLDUR XX #IFADD X X XSTUR X#SUBI X X #CBNZ X LOOP,,,,,,,,,,,,,,,,,,,, iteration: LDUR XX #
b Can you reorder the code to reduce the number of stalls? If yes, show the reordered code.
c Show the pipeline timing diagram of the code execution with data forwarding and assume that the branch is handled by predicting it as taken and the branch target address is calculated at the ID stage.
tableCycle number:,LOOP: LDUR XX #IFIDEXME WWLDUR XX #IFADD X X XSTUR XX #SUBI X X #CBNZ X LOOP,,,,,,,,,,,,,,,,,,,, iteration: LDUR XX #
d What is the speedup for the execution of c over a
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
