Perfect branch prediction

147 views 8:32 am 0 Comments August 5, 2023

LOOP: LDUR X10, [X1, #0]

LDUR X11, [X1, #8]

ADD X12, X10, X11

SUBI X1, X1, #16

CBNZ X12, LOOP

Exercise A: Consider the code above:
A.1 (10 Points). Assume that perfect branch prediction is used (no stall due to controlhazard), that has full forwarding support, and that branches are resolved in ID stage. Showpipeline execution time diagram for the first two iterations of this loop.


A.2 (10 Points). Assume branches are predicted as not-taken (but actually taken) the first time and predicted taken (but actually not-taken) the second time. Assume full forwardingsupport and that branches are resolved in EX stage. Show the execution time diagram for the
first two iterations of this loop.

Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,