9. Consider the following loop. LOOP: LDUR X10, [X1, #O] LDUR X11, [X1, #8] ADD X12, X10, X11 STUR X12, [X1, #-8] SUBI X

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

9. Consider the following loop. LOOP: LDUR X10, [X1, #O] LDUR X11, [X1, #8] ADD X12, X10, X11 STUR X12, [X1, #-8] SUBI X

Post by answerhappygod »

9 Consider The Following Loop Loop Ldur X10 X1 O Ldur X11 X1 8 Add X12 X10 X11 Stur X12 X1 8 Subi X 1
9 Consider The Following Loop Loop Ldur X10 X1 O Ldur X11 X1 8 Add X12 X10 X11 Stur X12 X1 8 Subi X 1 (84.06 KiB) Viewed 23 times
9 Consider The Following Loop Loop Ldur X10 X1 O Ldur X11 X1 8 Add X12 X10 X11 Stur X12 X1 8 Subi X 2
9 Consider The Following Loop Loop Ldur X10 X1 O Ldur X11 X1 8 Add X12 X10 X11 Stur X12 X1 8 Subi X 2 (371.38 KiB) Viewed 23 times
9. Consider the following loop. LOOP: LDUR X10, [X1, #O] LDUR X11, [X1, #8] ADD X12, X10, X11 STUR X12, [X1, #-8] SUBI X1, X1, #16 CBNZ X12, LOOP (a) Assume that data and control hazards are handled by simply stalling the pipeline (i.e. inserting NOP instructions where necessary). Show the pipeline timing diagram of the code execution. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 IF ID EX MEWB IF Cycle number: LOOP: LDUR X10, [X1, #0] LDUR X11, [X1, #8] ADD X12, X10, X11 STUR X12, [X1, #-8] SUBI X1, X1, #16 CBNZ X12, LOOP 2nd iteration: LDUR X10, [X1, #0]
(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. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 IF ID EX|ME WB A IF > > Cycle number: LOOP: LDUR X10, [X1, #0] LDUR X11, [X1, #8] ADD X12, X10, X11 STUR X12, [X1, #-8] SUBI X1, X1, #16 CBNZ X12, LOOP > > 2nd iteration: LDUR X10, [X1, #0] (d) What is the speedup for the execution of (c) over (a)?
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply