Index

Lecture 09

Exceptions

LW R1, (R2) IF ID EX  ME* WB*     //page fault, caught in ME
Invalid        IF ID* EX* ME* WB* //invalid instruction, caught in ID
* instructions to invoke OS: SWI/Trap

VLIW

1 Intro

09-01

09-01

2 Local Scheduling

Same example: for (i = 999; i >= 0; i --) x[i] += y;

instr mem1 mem2 fp1 fp2 int/br
Loop1: 1 L.D F2, 8(R1) nop nop nop nop
2 nop nop nop nop ADDI R1, R1, -8
3 nop nop ADD.D F2, F2, F0 nop nop
4 nop nop nop nop BGE R1, R2, Loop1
5 S.D F2, (R1) nop nop nop nop

slot utilization = \(\frac{5\quad slots\quad used}{5\quad instr\times 5\frac{slots}{instr}}=20\%\)

3 Loop unrolling

instr mem1 mem2 fp1 fp2 int/br
Loop2: 1 L.D F2, 0(R1) L.D F4 -8(R1)
2 L.D F6, -16(R1) L.D F8, -24(R1)
3 ADD.D F2, F2, F0 ADD.D F4, F4, F0 ADDI R1, R1, -32
4 ADD.D F6, F6, F0 ADD.D F8, F8, F0
5 S.D F2, 32(R1) S.D F4, 24(R1) BGT R1, R2, Loop2
6 S.D F6, 16(R1) S.D F8, 8(R1)

slot utilization = \(\frac{14\quad slots\quad used}{6\quad instr\times 5\frac{slots}{instr}}=47\%\)

\(S_{\frac{loop2}{loop1}}=\frac{5\times 1000}{6\times\frac{1000}{4}}=3.33\)

Index