11.07.2015 Views

Chapter 4 Introduction

Chapter 4 Introduction

Chapter 4 Introduction

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Morgan Kaufmann Publishers 31 January 2013Load-Use Data Hazardn Can’t always avoid stalls by forwardingn If value not computed when neededn Can’t forward backward in time!CSE 420 <strong>Chapter</strong> 4 — The Processor — 41Code Scheduling to Avoid Stallsn Reorder code to avoid use of load resultin the next instructionn C code for A = B + E; C = B + F;stallstalllw $t1, 0($t0)lw $t2, 4($t0)add $t3, $t1, $t2sw $t3, 12($t0)lw $t4, 8($t0)add $t5, $t1, $t4sw $t5, 16($t0)lw $t1, 0($t0)lw $t2, 4($t0)lw $t4, 8($t0)add $t3, $t1, $t2sw $t3, 12($t0)add $t5, $t1, $t4sw $t5, 16($t0)Eliminates 2 stall cyclesCSE 420 <strong>Chapter</strong> 4 — The Processor — 42

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!