Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 29 – CPU Design : Pipelining to Improve Performance II 2010-04-07 Cal researcher Marty.

Slides:



Advertisements
Similar presentations
Mehmet Can Vuran, Instructor University of Nebraska-Lincoln Acknowledgement: Overheads adapted from those provided by the authors of the textbook.
Advertisements

Pipeline Computer Organization II 1 Hazards Situations that prevent starting the next instruction in the next cycle Structural hazards – A required resource.
Chapter 8. Pipelining.
Review: Pipelining. Pipelining Laundry Example Ann, Brian, Cathy, Dave each have one load of clothes to wash, dry, and fold Washer takes 30 minutes Dryer.
Pipelining I (1) Fall 2005 Lecture 18: Pipelining I.
Goal: Describe Pipelining
Chapter Six 1.
Pipelining II (1) Fall 2005 Lecture 19: Pipelining II.
Chapter 8. Pipelining. Instruction Hazards Overview Whenever the stream of instructions supplied by the instruction fetch unit is interrupted, the pipeline.
CS61C L29 CPU Design : Pipelining to Improve Performance II (1) Garcia, Fall 2006 © UCB Running away with it  Our #8 football team had a great effort.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
CS61C L24 Review Pipeline © UC Regents 1 CS61C - Machine Structures Lecture 24 - Review Pipelined Execution November 29, 2000 David Patterson
Inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 29 – CPU Design : Pipelining to Improve Performance II Designed for the.
CS Computer Architecture 1 CS 430 – Computer Architecture Pipelined Execution - Review William J. Taffe using slides of David Patterson.
CS61C L22 CPU Design : Pipelining to Improve Performance II (1) Beamer, Summer 2007 © UCB Scott Beamer, Instructor inst.eecs.berkeley.edu/~cs61c CS61C.
inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 28 – CPU Design : Pipelining to Improve Performance The College Board.
CS61C L29 CPU Design : Pipelining to Improve Performance (1) Garcia, Spring 2007 © UCB Wirelessly recharge batt  Powercast & Philips have developed a.
CS61C L30 CPU Design : Pipelining to Improve Performance II (1) Garcia, Spring 2007 © UCB E-voting bill in congress!  Rep Rush Holt (D-NJ) has a bill.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania Computer Organization Pipelined Processor Design 1.
©UCB CS 162 Computer Architecture Lecture 3: Pipelining Contd. Instructor: L.N. Bhuyan
Pipelining Andreas Klappenecker CPSC321 Computer Architecture.
1 Chapter Six - 2nd Half Pipelined Processor Forwarding, Hazards, Branching EE3055 Web:
CS61C L30 Caches I (1) Garcia, Fall 2006 © UCB Shuttle can’t fly over Jan 1?  A computer bug has come up for the shuttle – its computers don’t reset to.
Computer ArchitectureFall 2007 © October 24nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
CS61C L28 CPU Design : Pipelining to Improve Performance I (1) Garcia, Fall 2006 © UCB 100 Msites!  Sometimes it’s nice to stop and reflect. The web was.
Cs 61C L25 pipeline.1 Patterson Spring 99 ©UCB CS61C Introduction to Pipelining Lecture 25 April 28, 1999 Dave Patterson (http.cs.berkeley.edu/~patterson)
CS61CL L10 CPU II: Control & Pipeline (1) Huddleston, Summer 2009 © UCB Jeremy Huddleston inst.eecs.berkeley.edu/~cs61c CS61CL : Machine Structures Lecture.
Computer ArchitectureFall 2007 © October 22nd, 2007 Majd F. Sakr CS-447– Computer Architecture.
CS61C L21 Pipeline © UC Regents 1 CS61C - Machine Structures Lecture 21 - Introduction to Pipelined Execution November 15, 2000 David Patterson
CS61C L31 Pipelined Execution, part II (1) Garcia, Fall 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS430 – Computer Architecture Introduction to Pipelined Execution
CS61C L21 Pipelining I (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #21 – Pipelining.
Scott Beamer, Instructor
CS 61C L30 Introduction to Pipelined Execution (1) Garcia, Fall 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C L18 Pipelining I (1) A Carle, Summer 2005 © UCB inst.eecs.berkeley.edu/~cs61c/su05 CS61C : Machine Structures Lecture #18: Pipelining
ENGS 116 Lecture 51 Pipelining and Hazards Vincent H. Berk September 30, 2005 Reading for today: Chapter A.1 – A.3, article: Patterson&Ditzel Reading for.
Prof. John Nestor ECE Department Lafayette College Easton, Pennsylvania ECE Computer Organization Lecture 17 - Pipelined.
CS61C L19 Introduction to Pipelined Execution (1) Garcia, Fall 2005 © UCB Lecturer PSOE, new dad Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS 61C L38 Pipelined Execution, part II (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
CS3350B Computer Architecture Winter 2015 Lecture 6.2: Instructional Level Parallelism: Hazards and Resolutions Marc Moreno Maza
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Pipelining Instructors: Krste Asanovic & Vladimir Stojanovic
CS1104: Computer Organisation School of Computing National University of Singapore.
1 Pipelining Reconsider the data path we just did Each instruction takes from 3 to 5 clock cycles However, there are parts of hardware that are idle many.
EEL5708 Lotzi Bölöni EEL 5708 High Performance Computer Architecture Pipelining.
CSE 340 Computer Architecture Summer 2014 Basic MIPS Pipelining Review.
CS.305 Computer Architecture Enhancing Performance with Pipelining Adapted from Computer Organization and Design, Patterson & Hennessy, © 2005, and from.
CMPE 421 Parallel Computer Architecture
1 Designing a Pipelined Processor In this Chapter, we will study 1. Pipelined datapath 2. Pipelined control 3. Data Hazards 4. Forwarding 5. Branch Hazards.
CS 61C: Great Ideas in Computer Architecture (Machine Structures) Lecture 32: Pipeline Parallelism 3 Instructor: Dan Garcia inst.eecs.Berkeley.edu/~cs61c.
CS 61C: Great Ideas in Computer Architecture Pipelining & Hazards 1 Instructors: John Wawrzynek & Vladimir Stojanovic
CS 1104 Help Session IV Five Issues in Pipelining Colin Tan, S
CECS 440 Pipelining.1(c) 2014 – R. W. Allison [slides adapted from D. Patterson slides with additional credits to M.J. Irwin]
Cs 152 L1 3.1 DAP Fa97,  U.CB Pipelining Lessons °Pipelining doesn’t help latency of single task, it helps throughput of entire workload °Multiple tasks.
CSIE30300 Computer Architecture Unit 04: Basic MIPS Pipelining Hsin-Chou Chi [Adapted from material by and
CS 61C L5.2.2 Pipelining I (1) K. Meinz, Summer 2004 © UCB CS61C : Machine Structures Lecture Pipelining I Kurt Meinz inst.eecs.berkeley.edu/~cs61c.
Instructor: Senior Lecturer SOE Dan Garcia CS 61C: Great Ideas in Computer Architecture Pipelining Hazards 1.
LECTURE 7 Pipelining. DATAPATH AND CONTROL We started with the single-cycle implementation, in which a single instruction is executed over a single cycle.
CDA 3101 Summer 2003 Introduction to Computer Organization Pipeline Control And Pipeline Hazards 17 July 2003.
CS61C L22 Pipelining II, Cache I (1) Chae, Summer 2008 © UCB Albert Chae, Instructor inst.eecs.berkeley.edu/~cs61c CS61C : Machine Structures Lecture #22.
Lecture 9. MIPS Processor Design – Pipelined Processor Design #1 Prof. Taeweon Suh Computer Science Education Korea University 2010 R&E Computer System.
CS 61C: Great Ideas in Computer Architecture Pipelining and Hazards 1 Instructors: Vladimir Stojanovic and Nicholas Weaver
CS 110 Computer Architecture Lecture 11: Pipelining Instructor: Sören Schwertfeger School of Information Science and Technology.
Lecture 18: Pipelining I.
CDA 3101 Spring 2016 Introduction to Computer Organization
Pipelining concepts, datapath and hazards
Instructor: Justin Hsia
Pipelining Lessons 6 PM T a s k O r d e B C D A 30
Pipelining Lessons 6 PM T a s k O r d e B C D A 30
The Processor Lecture 3.6: Control Hazards
Guest Lecturer: Justin Hsia
Presentation transcript:

inst.eecs.berkeley.edu/~cs61c UCB CS61C : Machine Structures Lecture 29 – CPU Design : Pipelining to Improve Performance II Cal researcher Marty Banks has put together a system to help with the eyestrain many viewers experience with 3D content on a small screen – the vergence / accomodation conflict. Lecturer SOE Dan Garcia

CS61C L29 CPU Design : Pipelining to Improve Performance II (2) Garcia, Spring 2010 © UCB Review  Pipelining is a BIG idea  Optimal Pipeline  Each stage is executing part of an instruction each clock cycle.  One instruction finishes during each clock cycle.  On average, execute far more quickly.  What makes this work?  Similarities between instructions allow us to use same stages for all instructions (generally).  Each stage takes about the same amount of time as all others: little wasted time.

CS61C L29 CPU Design : Pipelining to Improve Performance II (3) Garcia, Spring 2010 © UCB Problems for Pipelining CPUs  Limits to pipelining: Hazards prevent next instruction from executing during its designated clock cycle  Structural hazards: HW cannot support some combination of instructions (single person to fold and put clothes away)  Control hazards: Pipelining of branches causes later instruction fetches to wait for the result of the branch  Data hazards: Instruction depends on result of prior instruction still in the pipeline (missing sock)  These might result in pipeline stalls or “bubbles” in the pipeline.

CS61C L29 CPU Design : Pipelining to Improve Performance II (4) Garcia, Spring 2010 © UCB Read same memory twice in same clock cycle I$ Load Instr 1 Instr 2 Instr 3 Instr 4 ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU Reg D$Reg ALU I$ Reg D$Reg I n s t r. O r d e r Time (clock cycles) Structural Hazard #1: Single Memory (1/2)

CS61C L29 CPU Design : Pipelining to Improve Performance II (5) Garcia, Spring 2010 © UCB Structural Hazard #1: Single Memory (2/2)  Solution:  infeasible and inefficient to create second memory  (We’ll learn about this more friday/next week)  …so simulate this by having two Level 1 Caches  (a temporary smaller [of usually most recently used] copy of memory)  have both an L1 Instruction Cache and an L1 Data Cache  need more complex hardware to control when both caches miss

CS61C L29 CPU Design : Pipelining to Improve Performance II (6) Garcia, Spring 2010 © UCB Structural Hazard #2: Registers (1/2) Can we read and write to registers simultaneously? I$ sw Instr 1 Instr 2 Instr 3 Instr 4 ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU Reg D$Reg ALU I$ Reg D$Reg I n s t r. O r d e r Time (clock cycles)

CS61C L29 CPU Design : Pipelining to Improve Performance II (7) Garcia, Spring 2010 © UCB Structural Hazard #2: Registers (2/2)  Two different solutions have been used: 1) RegFile access is VERY fast: takes less than half the time of ALU stage  Write to Registers during first half of each clock cycle  Read from Registers during second half of each clock cycle 2) Build RegFile with independent read and write ports  Result: can perform Read and Write during same clock cycle

CS61C L29 CPU Design : Pipelining to Improve Performance II (8) Garcia, Spring 2010 © UCB Control Hazard: Branching (1/9) Where do we do the compare for the branch? I$ beq Instr 1 Instr 2 Instr 3 Instr 4 ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU Reg D$Reg ALU I$ Reg D$Reg I n s t r. O r d e r Time (clock cycles)

CS61C L29 CPU Design : Pipelining to Improve Performance II (9) Garcia, Spring 2010 © UCB Control Hazard: Branching (2/9)  We had put branch decision-making hardware in ALU stage  therefore two more instructions after the branch will always be fetched, whether or not the branch is taken  Desired functionality of a branch  if we do not take the branch, don’t waste any time and continue executing normally  if we take the branch, don’t execute any instructions after the branch, just go to the desired label

CS61C L29 CPU Design : Pipelining to Improve Performance II (10) Garcia, Spring 2010 © UCB Control Hazard: Branching (3/9)  Initial Solution: Stall until decision is made  insert “no-op” instructions (those that accomplish nothing, just take time) or hold up the fetch of the next instruction (for 2 cycles).  Drawback: branches take 3 clock cycles each (assuming comparator is put in ALU stage)

CS61C L29 CPU Design : Pipelining to Improve Performance II (11) Garcia, Spring 2010 © UCB Control Hazard: Branching (4/9)  Optimization #1:  insert special branch comparator in Stage 2  as soon as instruction is decoded (Opcode identifies it as a branch), immediately make a decision and set the new value of the PC  Benefit: since branch is complete in Stage 2, only one unnecessary instruction is fetched, so only one no-op is needed  Side Note: This means that branches are idle in Stages 3, 4 and 5.

CS61C L29 CPU Design : Pipelining to Improve Performance II (12) Garcia, Spring 2010 © UCB Control Hazard: Branching (5/9) Branch comparator moved to Decode stage. I$ beq Instr 1 Instr 2 Instr 3 Instr 4 ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU Reg D$Reg ALU I$ Reg D$Reg I n s t r. O r d e r Time (clock cycles)

CS61C L29 CPU Design : Pipelining to Improve Performance II (13) Garcia, Spring 2010 © UCB Control Hazard: Branching (6/9)  User inserting no-op instruction add beq nop ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU Reg D$Reg I$ I n s t r. O r d e r Time (clock cycles) bub ble Impact: 2 clock cycles per branch instruction  slow lw bub ble

CS61C L29 CPU Design : Pipelining to Improve Performance II (14) Garcia, Spring 2010 © UCB Control Hazard: Branching (7/9)  Controller inserting a single bubble add beq lw ALU I$ Reg D$Reg ALU I$ Reg D$Reg ALU Reg D$Reg I$ I n s t r. O r d e r Time (clock cycles) bub ble Impact: 2 clock cycles per branch instruction  slow …story about engineer, physicist, mathematician asked to build a fence around a flock of sheep using minimal fence…

CS61C L29 CPU Design : Pipelining to Improve Performance II (15) Garcia, Spring 2010 © UCB Control Hazard: Branching (8/9)  Optimization #2: Redefine branches  Old definition: if we take the branch, none of the instructions after the branch get executed by accident  New definition: whether or not we take the branch, the single instruction immediately following the branch gets executed (called the branch-delay slot)  The term “Delayed Branch” means we always execute inst after branch  This optimization is used with MIPS

CS61C L29 CPU Design : Pipelining to Improve Performance II (16) Garcia, Spring 2010 © UCB Control Hazard: Branching (9/9)  Notes on Branch-Delay Slot  Worst-Case Scenario: can always put a no-op in the branch-delay slot  Better Case: can find an instruction preceding the branch which can be placed in the branch- delay slot without affecting flow of the program  re-ordering instructions is a common method of speeding up programs  compiler must be very smart in order to find instructions to do this  usually can find such an instruction at least 50% of the time  Jumps also have a delay slot…

CS61C L29 CPU Design : Pipelining to Improve Performance II (17) Garcia, Spring 2010 © UCB Example: Nondelayed vs. Delayed Branch add $1,$2,$3 sub $4, $5,$6 beq $1, $4, Exit or $8, $9,$10 xor $10, $1,$11 Nondelayed Branch add $1,$2,$3 sub $4, $5,$6 beq $1, $4, Exit or $8, $9,$10 xor $10, $1,$11 Delayed Branch Exit:

CS61C L29 CPU Design : Pipelining to Improve Performance II (18) Garcia, Spring 2010 © UCB Data Hazards (1/2)  Consider the following sequence of instructions add $t0, $t1, $t2 sub $t4, $t0,$t3 and $t5, $t0,$t6 or $t7, $t0,$t8 xor $t9, $t0,$t10

CS61C L29 CPU Design : Pipelining to Improve Performance II (19) Garcia, Spring 2010 © UCB Data Hazards (2/2)  Data-flow backward in time are hazards sub $t4,$t0,$t3 ALU I$ Reg D$Reg and $t5,$t0,$t6 ALU I$ Reg D$Reg or $t7,$t0,$t8 I$ ALU Reg D$Reg xor $t9,$t0,$t10 ALU I$ Reg D$Reg add $t0,$t1,$t2 IFID/RFEXMEMWB ALU I$ Reg D$ Reg I n s t r. O r d e r Time (clock cycles)

CS61C L29 CPU Design : Pipelining to Improve Performance II (20) Garcia, Spring 2010 © UCB Data Hazard Solution: Forwarding  Forward result from one stage to another sub $t4,$t0,$t3 ALU I$ Reg D$Reg and $t5,$t0,$t6 ALU I$ Reg D$Reg or $t7,$t0,$t8 I$ ALU Reg D$Reg xor $t9,$t0,$t10 ALU I$ Reg D$Reg add $t0,$t1,$t2 IFID/RFEXMEMWB ALU I$ Reg D$ Reg “ or ” hazard solved by register hardware

CS61C L29 CPU Design : Pipelining to Improve Performance II (21) Garcia, Spring 2010 © UCB Data Hazard: Loads (1/4)  Dataflow backwards in time are hazards Can’t solve all cases with forwarding Must stall instruction dependent on load, then forward (more hardware) sub $t3,$t0,$t2 ALU I$ Reg D$Reg lw $t0,0($t1) IFID/RFEXMEMWB ALU I$ Reg D$ Reg

CS61C L29 CPU Design : Pipelining to Improve Performance II (22) Garcia, Spring 2010 © UCB Data Hazard: Loads (2/4) Hardware stalls pipeline Called “interlock” sub $t3,$t0,$t2 ALU I$ Reg D$Reg bub ble and $t5,$t0,$t4 ALU I$ Reg D$Reg bub ble or $t7,$t0,$t6 I$ ALU Reg D$ bub ble lw $t0, 0($t1) IFID/RFEXMEMWB ALU I$ Reg D$ Reg

CS61C L29 CPU Design : Pipelining to Improve Performance II (23) Garcia, Spring 2010 © UCB Data Hazard: Loads (3/4)  Instruction slot after a load is called “load delay slot”  If that instruction uses the result of the load, then the hardware interlock will stall it for one cycle.  If the compiler puts an unrelated instruction in that slot, then no stall  Letting the hardware stall the instruction in the delay slot is equivalent to putting a nop in the slot (except the latter uses more code space)

CS61C L29 CPU Design : Pipelining to Improve Performance II (24) Garcia, Spring 2010 © UCB Data Hazard: Loads (4/4)  Stall is equivalent to nop sub $t3,$t0,$t2 and $t5,$t0,$t4 or $t7,$t0,$t6 I$ ALU Reg D$ lw $t0, 0($t1) ALU I$ Reg D$ Reg bub ble ALU I$ Reg D$ Reg ALU I$ Reg D$ Reg nop

CS61C L29 CPU Design : Pipelining to Improve Performance II (25) Garcia, Spring 2010 © UCB 1)Thanks to pipelining, I have reduced the time it took me to wash my one shirt. 2)Longer pipelines are always a win (since less work per stage & a faster clock). Peer Instruction 12 a) FF b) FT c) TF d) TT

CS61C L29 CPU Design : Pipelining to Improve Performance II (26) Garcia, Spring 2010 © UCB “And in Conclusion..”  Pipeline challenge is hazards  Forwarding helps w/many data hazards  Delayed branch helps with control hazard in 5 stage pipeline  Load delay slot / interlock necessary  More aggressive performance:  Superscalar  Out-of-order execution

CS61C L29 CPU Design : Pipelining to Improve Performance II (27) Garcia, Spring 2010 © UCB Bonus slides  These are extra slides that used to be included in lecture notes, but have been moved to this, the “bonus” area to serve as a supplement.  The slides will appear in the order they would have in the normal presentation

CS61C L29 CPU Design : Pipelining to Improve Performance II (28) Garcia, Spring 2010 © UCB Historical Trivia  First MIPS design did not interlock and stall on load-use data hazard  Real reason for name behind MIPS: Microprocessor without Interlocked Pipeline Stages  Word Play on acronym for Millions of Instructions Per Second, also called MIPS

CS61C L29 CPU Design : Pipelining to Improve Performance II (29) Garcia, Spring 2010 © UCB Pipeline Hazard: Matching socks in later load  A depends on D; stall since folder tied up; Note this is much different from processor cases so far. We have not had a earlier instruction depend on a later one. TaskOrderTaskOrder B C D A E F bubble 12 2 AM 6 PM Time 30

CS61C L29 CPU Design : Pipelining to Improve Performance II (30) Garcia, Spring 2010 © UCB Out-of-Order Laundry: Don’t Wait  A depends on D; rest continue; need more resources to allow out-of-order TaskOrderTaskOrder 12 2 AM 6 PM Time B C D A 30 E F bubble

CS61C L29 CPU Design : Pipelining to Improve Performance II (31) Garcia, Spring 2010 © UCB Superscalar Laundry: Parallel per stage  More resources, HW to match mix of parallel tasks? TaskOrderTaskOrder 12 2 AM 6 PM Time B C D A E F (light clothing) (dark clothing) (very dirty clothing) (light clothing) (dark clothing) (very dirty clothing) 30

CS61C L29 CPU Design : Pipelining to Improve Performance II (32) Garcia, Spring 2010 © UCB Superscalar Laundry: Mismatch Mix  Task mix underutilizes extra resources TaskOrderTaskOrder 12 2 AM 6 PM Time 30 (light clothing) (dark clothing) (light clothing) A B D C

CS61C L29 CPU Design : Pipelining to Improve Performance II (33) Garcia, Spring 2010 © UCB Peer Instruction (1/2) Assume 1 instr/clock, delayed branch, 5 stage pipeline, forwarding, interlock on unresolved load hazards (after 10 3 loops, so pipeline full) Loop:lw $t0, 0($s1) addu $t0, $t0, $s2 sw $t0, 0($s1) addiu $s1, $s1, -4 bne $s1, $zero, Loop nop How many pipeline stages (clock cycles) per loop iteration to execute this code?

CS61C L29 CPU Design : Pipelining to Improve Performance II (34) Garcia, Spring 2010 © UCB Peer Instruction Answer (1/2)  Assume 1 instr/clock, delayed branch, 5 stage pipeline, forwarding, interlock on unresolved load hazards iterations, so pipeline full. Loop:lw$t0, 0($s1) addu$t0, $t0, $s2 sw$t0, 0($s1) addiu$s1, $s1, -4 bne$s1, $zero, Loop nop  How many pipeline stages (clock cycles) per loop iteration to execute this code? (data hazard so stall) (delayed branch so exec. nop)

CS61C L29 CPU Design : Pipelining to Improve Performance II (35) Garcia, Spring 2010 © UCB Peer Instruction (2/2) Assume 1 instr/clock, delayed branch, 5 stage pipeline, forwarding, interlock on unresolved load hazards (after 10 3 loops, so pipeline full). Rewrite this code to reduce pipeline stages (clock cycles) per loop to as few as possible. Loop:lw $t0, 0($s1) addu $t0, $t0, $s2 sw $t0, 0($s1) addiu $s1, $s1, -4 bne $s1, $zero, Loop nop How many pipeline stages (clock cycles) per loop iteration to execute this code?

CS61C L29 CPU Design : Pipelining to Improve Performance II (36) Garcia, Spring 2010 © UCB Peer Instruction (2/2) How long to execute?  How many pipeline stages (clock cycles) per loop iteration to execute your revised code? (assume pipeline is full) Rewrite this code to reduce clock cycles per loop to as few as possible: Loop:lw$t0, 0($s1) addiu$s1, $s1, -4 addu$t0, $t0, $s2 bne$s1, $zero, Loop sw$t0, +4($s1) (no hazard since extra cycle) (modified sw to put past addiu)